]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/arc.c
Avoid blocking in arc_reclaim_thread()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 23 Sep 2015 22:59:04 +0000 (15:59 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 25 Sep 2015 19:45:47 +0000 (12:45 -0700)
commitef5b2e1048eeeb7a81d932d38e52d897b33fca54
tree054c798af341be4b1c2028f46571d196877847a7
parent04870568e6dae66d79ca144b0dcfa001324c562d
Avoid blocking in arc_reclaim_thread()

As described in the comment above arc_reclaim_thread() it's critical
that the reclaim thread be careful about blocking.  Just like it must
never wait on a hash lock, it must never wait on a task which can in
turn wait on the CV in arc_get_data_buf().  This will deadlock, see
issue #3822 for full backtraces showing the problem.

To resolve this issue arc_kmem_reap_now() has been updated to use the
asynchronous arc prune function.  This means that arc_prune_async()
may now be called while there are still outstanding arc_prune_tasks.
However, this isn't a problem because arc_prune_async() already
keeps a reference count preventing multiple outstanding tasks per
registered consumer.  Functionally, this behavior is the same as
the counterpart illumos function dnlc_reduce_cache().

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Issue #3808
Issue #3834
Issue #3822
module/zfs/arc.c