]> git.proxmox.com Git - mirror_zfs.git/commit
assertion failed in arc_wait_for_eviction()
authorMatthew Ahrens <matthew.ahrens@delphix.com>
Fri, 8 Jan 2021 04:06:32 +0000 (20:06 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 23 Jan 2021 23:47:06 +0000 (15:47 -0800)
commit4e1d1b4b927711db71e93d64f052aba6a0dbe6e4
treeafc208619f490780bea2fcc985e7d6897df65652
parentc32c475363cfff4cb9ae2d38be4b1347a9cb856f
assertion failed in arc_wait_for_eviction()

If the system is very low on memory (specifically,
`arc_free_memory() < arc_sys_free/2`, i.e. less than 1/16th of RAM
free), `arc_evict_state_impl()` will defer wakups.  In this case, the
arc_evict_waiter_t's remain on the list, even though `arc_evict_count`
has been incremented past their `aew_count`.

The problem is that `arc_wait_for_eviction()` assumes that if there are
waiters on the list, the count they are waiting for has not yet been
reached.  However, the deferred wakeups may violate this, causing
`ASSERT(last->aew_count > arc_evict_count)` to fail.

This commit resolves the issue by having new waiters use the greater of
`arc_evict_count` and the last `aew_count`.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <gwilson@delphix.com>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #11285
Closes #11397
module/zfs/arc.c