2024-04-25 13:27:36

by Kemeng Shi

[permalink] [raw]
Subject: [PATCH v2 3/4] mm: call __wb_calc_thresh instead of wb_calc_thresh in wb_over_bg_thresh

Call __wb_calc_thresh to calculate wb bg_thresh of gdtc in
wb_over_bg_thresh to remove unnecessary wrap in wb_calc_thresh.

Signed-off-by: Kemeng Shi <[email protected]>
---
mm/page-writeback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 14893b20d38c..22e1acec899e 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -2117,7 +2117,7 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb)
if (gdtc->dirty > gdtc->bg_thresh)
return true;

- thresh = wb_calc_thresh(gdtc->wb, gdtc->bg_thresh);
+ thresh = __wb_calc_thresh(gdtc, gdtc->bg_thresh);
if (thresh < 2 * wb_stat_error())
reclaimable = wb_stat_sum(wb, WB_RECLAIMABLE);
else
--
2.30.0



2024-05-03 09:31:44

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH v2 3/4] mm: call __wb_calc_thresh instead of wb_calc_thresh in wb_over_bg_thresh

On Thu 25-04-24 21:17:23, Kemeng Shi wrote:
> Call __wb_calc_thresh to calculate wb bg_thresh of gdtc in
> wb_over_bg_thresh to remove unnecessary wrap in wb_calc_thresh.
>
> Signed-off-by: Kemeng Shi <[email protected]>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <[email protected]>

Honza

> ---
> mm/page-writeback.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> index 14893b20d38c..22e1acec899e 100644
> --- a/mm/page-writeback.c
> +++ b/mm/page-writeback.c
> @@ -2117,7 +2117,7 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb)
> if (gdtc->dirty > gdtc->bg_thresh)
> return true;
>
> - thresh = wb_calc_thresh(gdtc->wb, gdtc->bg_thresh);
> + thresh = __wb_calc_thresh(gdtc, gdtc->bg_thresh);
> if (thresh < 2 * wb_stat_error())
> reclaimable = wb_stat_sum(wb, WB_RECLAIMABLE);
> else
> --
> 2.30.0
>
--
Jan Kara <[email protected]>
SUSE Labs, CR