ext4: fix two minor mistakes in ext4_es_scan()
Zhang Yi
reviewercover ext4: fix two minor mistakes in ext4_es_scan()
Fix two minor mistakes introduced by 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API") in ext4_es_scan().
Zhang Yi (2):
ext4: remove check for zero nr_to_scan in ext4_es_scan()
ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit
fs/ext4/extents_status.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Signature · 1 line
2.25.4
Zhang Yi
reviewerPATCH 1/2 ext4: remove check for zero nr_to_scan in ext4_es_scan()
After converting fs shrinkers to new scan/count API, we are no longer pass zero nr_to_scan parameter to detect the number of objects to free, just remove this check.
--- fs/ext4/extents_status.c | 3 --- 1 file changed, 3 deletions(-)
fs/ext4/extents_status.c +0 -3
@@ -1574,9 +1574,6 @@ static unsigned long ext4_es_scan(struct shrinker *shrink, ret =percpu_counter_read_positive (&sbi->s_es_stats.es_stats_shk_cnt);trace_ext4_es_shrink_scan_enter (sbi->s_sb, nr_to_scan, ret); -if (!nr_to_scan) -return ret; - nr_shrunk =__es_shrink (sbi, nr_to_scan,NULL );trace_ext4_es_shrink_scan_exit (sbi->s_sb, nr_shrunk, ret);
Signature · 1 line
2.25.4
Re: [PATCH 1/2] ext4: remove check for zero nr_to_scan in ext4_es_scan()
Quoted 7 lines · Zhang Yi
After converting fs shrinkers to new scan/count API, we are no longer pass zero
nr_to_scanparameter to detect the number of objects to free, just remove this check.Fixes 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API")Cc [email protected] # 3.12+Signed-off-by Zhang Yi <[email protected]>
Looks good. Thanks for the patch. Feel free to add:
Honza
Quoted 21 lines
--- fs/ext4/extents_status.c | 3 --- 1 file changed, 3 deletions(-)fs/ext4/extents_status.c +0
-3@@ -1574,9 +1574,6 @@ static unsigned long ext4_es_scan(struct shrinker *shrink, ret =percpu_counter_read_positive (&sbi->s_es_stats.es_stats_shk_cnt);trace_ext4_es_shrink_scan_enter (sbi->s_sb, nr_to_scan, ret); -if (!nr_to_scan) -return ret; - nr_shrunk =__es_shrink (sbi, nr_to_scan,NULL );trace_ext4_es_shrink_scan_exit (sbi->s_sb, nr_shrunk, ret);Signature · 1 line
2.25.4
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Re: [PATCH 1/2] ext4: remove check for zero nr_to_scan in ext4_es_scan()
In reply to Zhang YiQuoted 7 lines · Zhang Yi
After converting fs shrinkers to new scan/count API, we are no longer pass zero
nr_to_scanparameter to detect the number of objects to free, just remove this check.Fixes 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API")Cc [email protected] # 3.12+Signed-off-by Zhang Yi <[email protected]>
Thanks, applied.
- Ted
Zhang Yi
reviewerPATCH 2/2 ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit
In reply to Zhang YiThe 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.
--- fs/ext4/extents_status.c | 1 + 1 file changed, 1 insertion(+)
fs/ext4/extents_status.c +1 -0
@@ -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; }
Signature · 1 line
2.25.4
Re: [PATCH 2/2] ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit
Quoted 7 lines · Zhang Yi
The
cache_cntparameter of tracepointext4_es_shrink_exitmeans the remaining cache count after shrink, but now it is the cache count before shrink, fix it by readsbi->s_extent_cache_cntagain.Fixes 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API")Cc [email protected] # 3.12+Signed-off-by Zhang Yi <[email protected]>
Yeah, probably it is better this way. Feel free to add:
Honza
Quoted 19 lines
--- fs/ext4/extents_status.c | 1 + 1 file changed, 1 insertion(+)fs/ext4/extents_status.c +1
-0@@ -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; }Signature · 1 line
2.25.4
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Re: [PATCH 2/2] ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit
In reply to Zhang YiQuoted 7 lines · Zhang Yi
The
cache_cntparameter of tracepointext4_es_shrink_exitmeans the remaining cache count after shrink, but now it is the cache count before shrink, fix it by readsbi->s_extent_cache_cntagain.Fixes 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API")Cc [email protected] # 3.12+Signed-off-by Zhang Yi <[email protected]>
Thanks, applied.
- Ted