mirror_zfs/module
Mark Roper 1e9231ada8
Prevent deadlock in arc_read in Linux memory reclaim callback
Using zfs with Lustre, an arc_read can trigger kernel memory allocation
that in turn leads to a memory reclaim callback and a deadlock within a
single zfs process. This change uses spl_fstrans_mark and
spl_trans_unmark to prevent the reclaim attempt and the deadlock
(https://zfsonlinux.topicbox.com/groups/zfs-devel/T4db2c705ec1804ba).
The stack trace observed is:

    __schedule at ffffffff81610f2e
    schedule at ffffffff81611558
    schedule_preempt_disabled at ffffffff8161184a
    __mutex_lock at ffffffff816131e8
    arc_buf_destroy at ffffffffa0bf37d7 [zfs]
    dbuf_destroy at ffffffffa0bfa6fe [zfs]
    dbuf_evict_one at ffffffffa0bfaa96 [zfs]
    dbuf_rele_and_unlock at ffffffffa0bfa561 [zfs]
    dbuf_rele_and_unlock at ffffffffa0bfa32b [zfs]
    osd_object_delete at ffffffffa0b64ecc [osd_zfs]
    lu_object_free at ffffffffa06d6a74 [obdclass]
    lu_site_purge_objects at ffffffffa06d7fc1 [obdclass]
    lu_cache_shrink_scan at ffffffffa06d81b8 [obdclass]
    shrink_slab at ffffffff811ca9d8
    shrink_node at ffffffff811cfd94
    do_try_to_free_pages at ffffffff811cfe63
    try_to_free_pages at ffffffff811d01c4
    __alloc_pages_slowpath at ffffffff811be7f2
    __alloc_pages_nodemask at ffffffff811bf3ed
    new_slab at ffffffff81226304
    ___slab_alloc at ffffffff812272ab
    __slab_alloc at ffffffff8122740c
    kmem_cache_alloc at ffffffff81227578
    spl_kmem_cache_alloc at ffffffffa048a1fd [spl]
    arc_buf_alloc_impl at ffffffffa0befba2 [zfs]
    arc_read at ffffffffa0bf0924 [zfs]
    dbuf_read at ffffffffa0bf9083 [zfs]
    dmu_buf_hold_by_dnode at ffffffffa0c04869 [zfs]

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mark Roper <markroper@gmail.com>
Closes #9987
2020-03-12 10:24:43 -07:00
..
avl Wrap Linux module macros 2019-11-01 10:41:03 -07:00
icp Fix icp include directories for in-tree build 2020-02-20 08:10:47 -08:00
lua cppcheck: (error) Address of local auto-variable assigned 2019-12-18 17:25:42 -08:00
nvpair cppcheck: (warning) Possible null pointer dereference: nvh 2019-12-18 17:25:57 -08:00
os Improve performance of zio_taskq_member 2020-03-03 10:29:38 -08:00
spl OpenZFS restructuring - move platform specific sources 2019-09-06 11:26:26 -07:00
unicode Wrap Linux module macros 2019-11-01 10:41:03 -07:00
zcommon Change default to overlay=on 2020-03-06 09:28:19 -08:00
zfs Prevent deadlock in arc_read in Linux memory reclaim callback 2020-03-12 10:24:43 -07:00
.gitignore Adapt gitignore for modules 2019-12-02 13:23:47 -08:00
Makefile.in module/Makefile.in: don't run xargs if empty 2019-10-08 10:10:23 -07:00