mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
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.
This commit is contained in:
@@ -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])],
|
||||
[])
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user