diff options
author | Alexander Motin <[email protected]> | 2021-12-22 20:07:13 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2021-12-22 17:07:13 -0800 |
commit | 462217d1c24a0769ec32b6f6e378868c311b2448 (patch) | |
tree | 636027568cf52a30fa1f8fec11bdb48c7933d7cb /module/zfs/arc.c | |
parent | d2f374c3f29c2e2c8d6b1bb7c9a18fbb4e0d5542 (diff) |
Reduce number of arc_prune threads
On FreeBSD vnode reclamation is single-threaded, protected by single
global lock. Linux seems to be able to use a thread per mount point,
but at this time it creates more harm than good.
Reduce number of threads to 1, adding tunable in case somebody wants
to try more.
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Chris Dunlop <[email protected]>
Reviewed-by: Ahelenia ZiemiaĆska <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Closes #12896
Issue #9966
Diffstat (limited to 'module/zfs/arc.c')
-rw-r--r-- | module/zfs/arc.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 5427f2a71..abd5ba50c 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -463,6 +463,11 @@ int zfs_arc_meta_strategy = ARC_STRATEGY_META_BALANCED; int zfs_arc_meta_adjust_restarts = 4096; int zfs_arc_lotsfree_percent = 10; +/* + * Number of arc_prune threads + */ +static int zfs_arc_prune_task_threads = 1; + /* The 6 states: */ arc_state_t ARC_anon; arc_state_t ARC_mru; @@ -7983,9 +7988,8 @@ arc_init(void) offsetof(arc_prune_t, p_node)); mutex_init(&arc_prune_mtx, NULL, MUTEX_DEFAULT, NULL); - arc_prune_taskq = taskq_create("arc_prune", 100, defclsyspri, - boot_ncpus, INT_MAX, TASKQ_PREPOPULATE | TASKQ_DYNAMIC | - TASKQ_THREADS_CPU_PCT); + arc_prune_taskq = taskq_create("arc_prune", zfs_arc_prune_task_threads, + defclsyspri, 100, INT_MAX, TASKQ_PREPOPULATE | TASKQ_DYNAMIC); arc_ksp = kstat_create("zfs", 0, "arcstats", "misc", KSTAT_TYPE_NAMED, sizeof (arc_stats) / sizeof (kstat_named_t), KSTAT_FLAG_VIRTUAL); @@ -11132,4 +11136,7 @@ ZFS_MODULE_PARAM(zfs_arc, zfs_arc_, eviction_pct, INT, ZMOD_RW, ZFS_MODULE_PARAM(zfs_arc, zfs_arc_, evict_batch_limit, INT, ZMOD_RW, "The number of headers to evict per sublist before moving to the next"); + +ZFS_MODULE_PARAM(zfs_arc, zfs_arc_, prune_task_threads, INT, ZMOD_RW, + "Number of arc_prune threads"); /* END CSTYLED */ |