Skip to content

Commit

Permalink
arc: Improve the evict thread count auto-scaling formula
Browse files Browse the repository at this point in the history
- Use a simple division instead of a bit shift for better readability.
- Make sure that systems with less than 6 CPUs auto-scale to 1 eviction
  thread.
  • Loading branch information
0mp committed Nov 12, 2024
1 parent 6ac4dd5 commit 92a786b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -7876,8 +7876,8 @@ arc_init(void)
buf_init();

if (zfs_arc_evict_threads == 0)
zfs_arc_evict_threads_live = MIN(MAX(max_ncpus > 6 ? 2 : 1,
(highbit64(max_ncpus) - 1) + (max_ncpus >> 6)), 16);
zfs_arc_evict_threads_live = max_ncpus < 6 ? 1 :
MIN((highbit64(max_ncpus) - 1) + max_ncpus / 64, 16);
else
zfs_arc_evict_threads_live = zfs_arc_evict_threads;

Expand Down

0 comments on commit 92a786b

Please sign in to comment.