diff options
author | Brian Behlendorf <[email protected]> | 2011-12-22 12:20:43 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2012-01-11 11:46:02 -0800 |
commit | ab26409db753bb087842ab6f1af943f3386c764f (patch) | |
tree | 7baa51b121ef9a866371bd750b9949688f0c29e8 /lib | |
parent | 8eaa020b46e80b09cc5f924b90809e219ce08e75 (diff) |
Linux 3.1 compat, super_block->s_shrink
The Linux 3.1 kernel has introduced the concept of per-filesystem
shrinkers which are directly assoicated with a super block. Prior
to this change there was one shared global shrinker.
The zfs code relied on being able to call the global shrinker when
the arc_meta_limit was exceeded. This would cause the VFS to drop
references on a fraction of the dentries in the dcache. The ARC
could then safely reclaim the memory used by these entries and
honor the arc_meta_limit. Unfortunately, when per-filesystem
shrinkers were added the old interfaces were made unavailable.
This change adds support to use the new per-filesystem shrinker
interface so we can continue to honor the arc_meta_limit. The
major benefit of the new interface is that we can now target
only the zfs filesystem for dentry and inode pruning. Thus we
can minimize any impact on the caching of other filesystems.
In the context of making this change several other important
issues related to managing the ARC were addressed, they include:
* The dnlc_reduce_cache() function which was called by the ARC
to drop dentries for the Posix layer was replaced with a generic
zfs_prune_t callback. The ZPL layer now registers a callback to
drop these dentries removing a layering violation which dates
back to the Solaris code. This callback can also be used by
other ARC consumers such as Lustre.
arc_add_prune_callback()
arc_remove_prune_callback()
* The arc_reduce_dnlc_percent module option has been changed to
arc_meta_prune for clarity. The dnlc functions are specific to
Solaris's VFS and have already been largely eliminated already.
The replacement tunable now represents the number of bytes the
prune callback will request when invoked.
* Less aggressively invoke the prune callback. We used to call
this whenever we exceeded the arc_meta_limit however that's not
strictly correct since it results in over zeleous reclaim of
dentries and inodes. It is now only called once the arc_meta_limit
is exceeded and every effort has been made to evict other data from
the ARC cache.
* More promptly manage exceeding the arc_meta_limit. When reading
meta data in to the cache if a buffer was unable to be recycled
notify the arc_reclaim thread to invoke the required prune.
* Added arcstat_prune kstat which is incremented when the ARC
is forced to request that a consumer prune its cache. Remember
this will only occur when the ARC has no other choice. If it
can evict buffers safely without invoking the prune callback
it will.
* This change is also expected to resolve the unexpect collapses
of the ARC cache. This would occur because when exceeded just the
arc_meta_limit reclaim presure would be excerted on the arc_c
value via arc_shrink(). This effectively shrunk the entire cache
when really we just needed to reclaim meta data.
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #466
Closes #292
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libavl/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libefi/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libnvpair/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libshare/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/asm-generic/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/asm-i386/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/asm-x86_64/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/ia32/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/ia32/sys/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/rpc/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/sys/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/sys/dktp/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/sys/sysevent/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libspl/include/util/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libunicode/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libuutil/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libzfs/Makefile.in | 1 | ||||
-rw-r--r-- | lib/libzpool/Makefile.in | 1 |
21 files changed, 21 insertions, 0 deletions
diff --git a/lib/Makefile.in b/lib/Makefile.in index 17f84a548..5929cc468 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -69,6 +69,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libavl/Makefile.in b/lib/libavl/Makefile.in index 55bb04d9f..9a6ea3a75 100644 --- a/lib/libavl/Makefile.in +++ b/lib/libavl/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libefi/Makefile.in b/lib/libefi/Makefile.in index 6e4a83b3c..7abee8cab 100644 --- a/lib/libefi/Makefile.in +++ b/lib/libefi/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libnvpair/Makefile.in b/lib/libnvpair/Makefile.in index 60439aece..33d3f3b1d 100644 --- a/lib/libnvpair/Makefile.in +++ b/lib/libnvpair/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libshare/Makefile.in b/lib/libshare/Makefile.in index 94ea82e90..67d23d279 100644 --- a/lib/libshare/Makefile.in +++ b/lib/libshare/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libspl/Makefile.in b/lib/libspl/Makefile.in index 194679a93..db3499a6d 100644 --- a/lib/libspl/Makefile.in +++ b/lib/libspl/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libspl/asm-generic/Makefile.in b/lib/libspl/asm-generic/Makefile.in index a9ffb578c..cae5d5678 100644 --- a/lib/libspl/asm-generic/Makefile.in +++ b/lib/libspl/asm-generic/Makefile.in @@ -70,6 +70,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libspl/asm-i386/Makefile.in b/lib/libspl/asm-i386/Makefile.in index ca6573040..652782e66 100644 --- a/lib/libspl/asm-i386/Makefile.in +++ b/lib/libspl/asm-i386/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libspl/asm-x86_64/Makefile.in b/lib/libspl/asm-x86_64/Makefile.in index 2db49b35a..ad6c870dc 100644 --- a/lib/libspl/asm-x86_64/Makefile.in +++ b/lib/libspl/asm-x86_64/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libspl/include/Makefile.in b/lib/libspl/include/Makefile.in index d7a8f52fc..419041afa 100644 --- a/lib/libspl/include/Makefile.in +++ b/lib/libspl/include/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libspl/include/ia32/Makefile.in b/lib/libspl/include/ia32/Makefile.in index b60892865..c0418ee60 100644 --- a/lib/libspl/include/ia32/Makefile.in +++ b/lib/libspl/include/ia32/Makefile.in @@ -69,6 +69,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libspl/include/ia32/sys/Makefile.in b/lib/libspl/include/ia32/sys/Makefile.in index 36629967e..86b08fd79 100644 --- a/lib/libspl/include/ia32/sys/Makefile.in +++ b/lib/libspl/include/ia32/sys/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libspl/include/rpc/Makefile.in b/lib/libspl/include/rpc/Makefile.in index 68e3c2f12..92529aecf 100644 --- a/lib/libspl/include/rpc/Makefile.in +++ b/lib/libspl/include/rpc/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libspl/include/sys/Makefile.in b/lib/libspl/include/sys/Makefile.in index 6851505dd..09e1ec957 100644 --- a/lib/libspl/include/sys/Makefile.in +++ b/lib/libspl/include/sys/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libspl/include/sys/dktp/Makefile.in b/lib/libspl/include/sys/dktp/Makefile.in index 89c3285e1..84961afae 100644 --- a/lib/libspl/include/sys/dktp/Makefile.in +++ b/lib/libspl/include/sys/dktp/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libspl/include/sys/sysevent/Makefile.in b/lib/libspl/include/sys/sysevent/Makefile.in index de9db421b..5d6a93dbe 100644 --- a/lib/libspl/include/sys/sysevent/Makefile.in +++ b/lib/libspl/include/sys/sysevent/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libspl/include/util/Makefile.in b/lib/libspl/include/util/Makefile.in index d7cd17c15..068a2f560 100644 --- a/lib/libspl/include/util/Makefile.in +++ b/lib/libspl/include/util/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libunicode/Makefile.in b/lib/libunicode/Makefile.in index f6c8690cd..fbcb32b99 100644 --- a/lib/libunicode/Makefile.in +++ b/lib/libunicode/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libuutil/Makefile.in b/lib/libuutil/Makefile.in index d44bba2d6..6507a7ead 100644 --- a/lib/libuutil/Makefile.in +++ b/lib/libuutil/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libzfs/Makefile.in b/lib/libzfs/Makefile.in index 29642b1ac..a975a193f 100644 --- a/lib/libzfs/Makefile.in +++ b/lib/libzfs/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ diff --git a/lib/libzpool/Makefile.in b/lib/libzpool/Makefile.in index 0e46c1516..5e1fded91 100644 --- a/lib/libzpool/Makefile.in +++ b/lib/libzpool/Makefile.in @@ -71,6 +71,7 @@ am__aclocal_m4_deps = \ $(top_srcdir)/config/kernel-rq-is_sync.m4 \ $(top_srcdir)/config/kernel-security-inode-init.m4 \ $(top_srcdir)/config/kernel-set-nlink.m4 \ + $(top_srcdir)/config/kernel-shrink.m4 \ $(top_srcdir)/config/kernel-truncate-setsize.m4 \ $(top_srcdir)/config/kernel-xattr-handler.m4 \ $(top_srcdir)/config/kernel.m4 \ |