]> git.proxmox.com Git - mirror_spl.git/commit
Add spl_kmem_cache_reclaim module option
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 16 May 2014 16:29:21 +0000 (09:29 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 22 May 2014 17:30:12 +0000 (10:30 -0700)
commit376dc35e228498da7703e7ca4c2b75d16763c23b
tree76f8b0faab10f9a77d8df49d56819771ea4e9816
parenta073aeb0604b7d410be58135fb9d5c43671af263
Add spl_kmem_cache_reclaim module option

The correct behavior for all registered shrinkers is to return the
number of objects in their cache.  In theory this allows the Linux
VM to balance memory reclaim across all registered caches.

In commit b9b3715 this behavior was disabled in favor of returning
-1 which notifies the VM that no additional objects are available
for reclaim.  This was done as a workaround to resolve thrashing
in shrink_slabs() which could occur when memory was low and numerous
core where in reclaim.  Unfortunately, this has been observed to
increase the likelihood of OOM events when SPL slab consumers are
responsible for consuming the majority of memory.

Therefore, this patch makes this behavior tunable.  Setting the
spl_kmem_cache_reclaim module option to 0x1 will result in the
shrinker only being called once.  This is the default behavior.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Prakash Surya <surya1@llnl.gov>
Closes #358
include/sys/kmem.h
module/spl/spl-kmem.c