-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For kernels which do not implement a per-suberblock shrinker, those older than Linux 3.1, the shrink_dcache_parent() function was used to attempt to reclaim dentries. This was found not be entirely reliable and could lead to performance issues on older kernels running meta-data heavy workloads. To address this issue a zfs_sb_prune_aliases() function has been added to implement this functionality. It relies on traversing the list of znodes for a filesystem and adding them to a private list with a reference held. The private list can then be safely walked outside the z_znodes_lock to prune dentires and drop the last reference so the inode can be freed. This provides the same synchronous behavior as the per-filesystem shrinker and has the advantage of depending on only long standing interfaces. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Tim Chase <[email protected]> Closes #3501
- Loading branch information
1 parent
4c6a700
commit 218b4e0
Showing
3 changed files
with
84 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
dnl # | ||
dnl # 2.6.12 API change | ||
dnl # d_prune_aliases() helper function available. | ||
dnl # | ||
AC_DEFUN([ZFS_AC_KERNEL_D_PRUNE_ALIASES], | ||
[AC_MSG_CHECKING([whether d_prune_aliases() is available]) | ||
ZFS_LINUX_TRY_COMPILE_SYMBOL([ | ||
#include <linux/dcache.h> | ||
], [ | ||
struct inode *ip = NULL; | ||
d_prune_aliases(ip); | ||
], [d_prune_aliases], [fs/dcache.c], [ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_D_PRUNE_ALIASES, 1, | ||
[d_prune_aliases() is available]) | ||
], [ | ||
AC_MSG_RESULT(no) | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters