mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
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 <tim@chase2k.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
@@ -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
|
||||
{
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user