diff options
author | Brian Behlendorf <[email protected]> | 2015-05-30 09:57:53 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-06-11 10:27:25 -0700 |
commit | f6046738365571bd647f804958dfdff8a32fbde4 (patch) | |
tree | a3018bea5c47c04a0c109c84793a8f21e26814ce /include/sys | |
parent | c5528b9ba622421a213e128704de4090fa0db773 (diff) |
Make arc_prune() asynchronous
As described in the comment above arc_adapt_thread() it is critical
that the arc_adapt_thread() function never sleep while holding a hash
lock. This behavior was possible in the Linux implementation because
the arc_prune() logic was implemented to be synchronous. Under
illumos the analogous dnlc_reduce_cache() function is asynchronous.
To address this the arc_do_user_prune() function is has been reworked
in to two new functions as follows:
* arc_prune_async() is an asynchronous implementation which dispatches
the prune callback to be run by the system taskq. This makes it
suitable to use in the context of the arc_adapt_thread().
* arc_prune() is a synchronous implementation which depends on the
arc_prune_async() implementation but blocks until the outstanding
callbacks complete. This is used in arc_kmem_reap_now() where it
is safe, and expected, that memory will be freed.
This patch additionally adds the zfs_arc_meta_strategy module option
while allows the meta reclaim strategy to be configured. It defaults
to a balanced strategy which has been proved to work well under Linux
but the illumos meta-only strategy can be enabled.
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'include/sys')
-rw-r--r-- | include/sys/arc.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sys/arc.h b/include/sys/arc.h index 38f9f27fe..0961d4b4d 100644 --- a/include/sys/arc.h +++ b/include/sys/arc.h @@ -59,10 +59,16 @@ arc_done_func_t arc_getbuf_func; struct arc_prune { arc_prune_func_t *p_pfunc; void *p_private; + uint64_t p_adjust; list_node_t p_node; refcount_t p_refcnt; }; +typedef enum arc_strategy { + ARC_STRATEGY_META_ONLY = 0, /* Evict only meta data buffers */ + ARC_STRATEGY_META_BALANCED = 1, /* Evict data buffers if needed */ +} arc_strategy_t; + typedef enum arc_flags { /* |