* [PATCH 0/2] ext4: fix two minor mistakes in ext4_es_scan()
@ 2021-05-22 10:30 Zhang Yi
2021-05-22 10:30 ` [PATCH 1/2] ext4: remove check for zero nr_to_scan " Zhang Yi
2021-05-22 10:30 ` [PATCH 2/2] ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit Zhang Yi
0 siblings, 2 replies; 7+ messages in thread
From: Zhang Yi @ 2021-05-22 10:30 UTC (permalink / raw)
To: linux-ext4; +Cc: tytso, adilger.kernel, jack, yi.zhang, yukuai3
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(-)
--
2.25.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] ext4: remove check for zero nr_to_scan in ext4_es_scan()
2021-05-22 10:30 [PATCH 0/2] ext4: fix two minor mistakes in ext4_es_scan() Zhang Yi
@ 2021-05-22 10:30 ` Zhang Yi
2021-05-24 9:51 ` Jan Kara
2021-06-17 20:16 ` Theodore Ts'o
2021-05-22 10:30 ` [PATCH 2/2] ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit Zhang Yi
1 sibling, 2 replies; 7+ messages in thread
From: Zhang Yi @ 2021-05-22 10:30 UTC (permalink / raw)
To: linux-ext4; +Cc: tytso, adilger.kernel, jack, yi.zhang, yukuai3
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.
Fixes: 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API")
Cc: stable@vger.kernel.org # 3.12+
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
---
fs/ext4/extents_status.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index 0a729027322d..db3cd70a72e4 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -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);
--
2.25.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit
2021-05-22 10:30 [PATCH 0/2] ext4: fix two minor mistakes in ext4_es_scan() Zhang Yi
2021-05-22 10:30 ` [PATCH 1/2] ext4: remove check for zero nr_to_scan " Zhang Yi
@ 2021-05-22 10:30 ` Zhang Yi
2021-05-24 9:54 ` Jan Kara
2021-06-17 20:17 ` Theodore Ts'o
1 sibling, 2 replies; 7+ messages in thread
From: Zhang Yi @ 2021-05-22 10:30 UTC (permalink / raw)
To: linux-ext4; +Cc: tytso, adilger.kernel, jack, yi.zhang, yukuai3
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: 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API")
Cc: stable@vger.kernel.org # 3.12+
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
---
fs/ext4/extents_status.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index db3cd70a72e4..9a3a8996aacf 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -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;
}
--
2.25.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] ext4: remove check for zero nr_to_scan in ext4_es_scan()
2021-05-22 10:30 ` [PATCH 1/2] ext4: remove check for zero nr_to_scan " Zhang Yi
@ 2021-05-24 9:51 ` Jan Kara
2021-06-17 20:16 ` Theodore Ts'o
1 sibling, 0 replies; 7+ messages in thread
From: Jan Kara @ 2021-05-24 9:51 UTC (permalink / raw)
To: Zhang Yi; +Cc: linux-ext4, tytso, adilger.kernel, jack, yukuai3
On Sat 22-05-21 18:30:44, Zhang Yi wrote:
> 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.
>
> Fixes: 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API")
> Cc: stable@vger.kernel.org # 3.12+
> Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Looks good. Thanks for the patch. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext4/extents_status.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
> index 0a729027322d..db3cd70a72e4 100644
> --- a/fs/ext4/extents_status.c
> +++ b/fs/ext4/extents_status.c
> @@ -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);
> --
> 2.25.4
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit
2021-05-22 10:30 ` [PATCH 2/2] ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit Zhang Yi
@ 2021-05-24 9:54 ` Jan Kara
2021-06-17 20:17 ` Theodore Ts'o
1 sibling, 0 replies; 7+ messages in thread
From: Jan Kara @ 2021-05-24 9:54 UTC (permalink / raw)
To: Zhang Yi; +Cc: linux-ext4, tytso, adilger.kernel, jack, yukuai3
On Sat 22-05-21 18:30:45, Zhang Yi wrote:
> 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: 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API")
> Cc: stable@vger.kernel.org # 3.12+
> Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Yeah, probably it is better this way. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext4/extents_status.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
> index db3cd70a72e4..9a3a8996aacf 100644
> --- a/fs/ext4/extents_status.c
> +++ b/fs/ext4/extents_status.c
> @@ -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;
> }
> --
> 2.25.4
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] ext4: remove check for zero nr_to_scan in ext4_es_scan()
2021-05-22 10:30 ` [PATCH 1/2] ext4: remove check for zero nr_to_scan " Zhang Yi
2021-05-24 9:51 ` Jan Kara
@ 2021-06-17 20:16 ` Theodore Ts'o
1 sibling, 0 replies; 7+ messages in thread
From: Theodore Ts'o @ 2021-06-17 20:16 UTC (permalink / raw)
To: Zhang Yi; +Cc: linux-ext4, adilger.kernel, jack, yukuai3
On Sat, May 22, 2021 at 06:30:44PM +0800, Zhang Yi wrote:
> 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.
>
> Fixes: 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API")
> Cc: stable@vger.kernel.org # 3.12+
> Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit
2021-05-22 10:30 ` [PATCH 2/2] ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit Zhang Yi
2021-05-24 9:54 ` Jan Kara
@ 2021-06-17 20:17 ` Theodore Ts'o
1 sibling, 0 replies; 7+ messages in thread
From: Theodore Ts'o @ 2021-06-17 20:17 UTC (permalink / raw)
To: Zhang Yi; +Cc: linux-ext4, adilger.kernel, jack, yukuai3
On Sat, May 22, 2021 at 06:30:45PM +0800, Zhang Yi wrote:
> 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: 1ab6c4997e04 ("fs: convert fs shrinkers to new scan/count API")
> Cc: stable@vger.kernel.org # 3.12+
> Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-06-17 20:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-22 10:30 [PATCH 0/2] ext4: fix two minor mistakes in ext4_es_scan() Zhang Yi
2021-05-22 10:30 ` [PATCH 1/2] ext4: remove check for zero nr_to_scan " Zhang Yi
2021-05-24 9:51 ` Jan Kara
2021-06-17 20:16 ` Theodore Ts'o
2021-05-22 10:30 ` [PATCH 2/2] ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit Zhang Yi
2021-05-24 9:54 ` Jan Kara
2021-06-17 20:17 ` Theodore Ts'o
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.