Skip to content

Commit

Permalink
ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit
Browse files Browse the repository at this point in the history
The cache_cnt parameter of tracepoint ext4_es_shrink_exit means the
remaining cache count after shrink, but now it is the cache count before
shrink, fix it by read sbi->s_extent_cache_cnt again.

Fixes: 1ab6c49 ("fs: convert fs shrinkers to new scan/count API")
Cc: [email protected] # 3.12+
Signed-off-by: Zhang Yi <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
  • Loading branch information
zhangyi089 authored and tytso committed Jun 23, 2021
1 parent e5e7010 commit 4fb7c70
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ext4/extents_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,7 @@ static unsigned long ext4_es_scan(struct shrinker *shrink,

nr_shrunk = __es_shrink(sbi, nr_to_scan, NULL);

ret = percpu_counter_read_positive(&sbi->s_es_stats.es_stats_shk_cnt);
trace_ext4_es_shrink_scan_exit(sbi->s_sb, nr_shrunk, ret);
return nr_shrunk;
}
Expand Down

0 comments on commit 4fb7c70

Please sign in to comment.