Skip to content

Commit

Permalink
fix dnode eviction typo in arc_evict_state()
Browse files Browse the repository at this point in the history
In addition decrease arc_prune_taskq max thread count to avoid
consuming all the cores when the system is under memory pressure and
is trying to reclaim memory from the dentry/inode caches.
closes openzfs#7559

Signed-off-by: Alek Pinchuk <apinchuk@axcient.com>
  • Loading branch information
alek-p committed May 23, 2020
1 parent fb82226 commit dbab131
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions module/zfs/arc.c
Expand Up @@ -4043,14 +4043,17 @@ arc_evict_state(arc_state_t *state, uint64_t spa, int64_t bytes,

/*
* Try to reduce pinned dnodes with a floor of arc_dnode_limit.
* Request that 10% of the LRUs be scanned by the superblock
* shrinker.
* Request that zfs_arc_dnode_reduce_percent of the LRUs be
* scanned by the superblock shrinker.
*/
if (type == ARC_BUFC_DATA && aggsum_compare(&astat_dnode_size,
if (aggsum_compare(&astat_dnode_size,
arc_dnode_size_limit) > 0) {
ASSERT(type == ARC_BUFC_DATA ||
type == ARC_BUFC_METADATA);
arc_prune_async((aggsum_upper_bound(&astat_dnode_size) -
arc_dnode_size_limit) / sizeof (dnode_t) /
zfs_arc_dnode_reduce_percent);
taskq_wait(arc_prune_taskq);
}

/*
Expand Down Expand Up @@ -7348,8 +7351,7 @@ 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", boot_ncpus, defclsyspri,
boot_ncpus, INT_MAX, TASKQ_PREPOPULATE | TASKQ_DYNAMIC);
arc_prune_taskq = taskq_create("arc_prune", 1, defclsyspri, 0, 0, 0);

arc_ksp = kstat_create("zfs", 0, "arcstats", "misc", KSTAT_TYPE_NAMED,
sizeof (arc_stats) / sizeof (kstat_named_t), KSTAT_FLAG_VIRTUAL);
Expand Down

0 comments on commit dbab131

Please sign in to comment.