aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-03-30 17:44:35 -0700
committerBrian Behlendorf <[email protected]>2011-04-06 20:06:03 -0700
commite76f4bf11d54479fe767d9647a10e8b98d7ffc4f (patch)
tree213970e408e6c9b808184abd7fb7e3920cee0c52 /config
parent83150861e610701d44510816e2062bcf407f51ab (diff)
Add dnlc_reduce_cache() support
Provide the dnlc_reduce_cache() function which attempts to prune cached entries from the dcache and icache. After the entries are pruned any slabs which they may have been using are reaped. Note the API takes a reclaim percentage but we don't have easy access to the total number of cache entries to calculate the reclaim count. However, in practice this doesn't need to be exactly correct. We simply need to reclaim some useful fraction (but not all) of the cache. The caller can determine if more needs to be done.
Diffstat (limited to 'config')
-rw-r--r--config/spl-build.m432
1 files changed, 32 insertions, 0 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4
index 72bb3258e..94c7f3e74 100644
--- a/config/spl-build.m4
+++ b/config/spl-build.m4
@@ -76,6 +76,8 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
SPL_AC_3ARGS_FILE_FSYNC
SPL_AC_EXPORTED_RWSEM_IS_LOCKED
SPL_AC_KERNEL_INVALIDATE_INODES
+ SPL_AC_SHRINK_DCACHE_MEMORY
+ SPL_AC_SHRINK_ICACHE_MEMORY
])
AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
@@ -1717,3 +1719,33 @@ AC_DEFUN([SPL_AC_KERNEL_INVALIDATE_INODES], [
[invalidate_inodes() is available])],
[])
])
+
+dnl #
+dnl # 2.6.xx API compat,
+dnl # There currently exists no exposed API to partially shrink the dcache.
+dnl # The expected mechanism to shrink the cache is a registered shrinker
+dnl # which is called during memory pressure.
+dnl #
+AC_DEFUN([SPL_AC_SHRINK_DCACHE_MEMORY], [
+ SPL_CHECK_SYMBOL_EXPORT(
+ [shrink_dcache_memory],
+ [fs/dcache.c],
+ [AC_DEFINE(HAVE_SHRINK_DCACHE_MEMORY, 1,
+ [shrink_dcache_memory() is available])],
+ [])
+])
+
+dnl #
+dnl # 2.6.xx API compat,
+dnl # There currently exists no exposed API to partially shrink the icache.
+dnl # The expected mechanism to shrink the cache is a registered shrinker
+dnl # which is called during memory pressure.
+dnl #
+AC_DEFUN([SPL_AC_SHRINK_ICACHE_MEMORY], [
+ SPL_CHECK_SYMBOL_EXPORT(
+ [shrink_icache_memory],
+ [fs/inode.c],
+ [AC_DEFINE(HAVE_SHRINK_ICACHE_MEMORY, 1,
+ [shrink_icache_memory() is available])],
+ [])
+])