mm: call __wb_calc_thresh instead of wb_calc_thresh in wb_over_bg_thresh
authorKemeng Shi <shikemeng@huaweicloud.com>
Thu, 25 Apr 2024 13:17:23 +0000 (21:17 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 6 May 2024 00:53:52 +0000 (17:53 -0700)
Call __wb_calc_thresh to calculate wb bg_thresh of gdtc in
wb_over_bg_thresh to remove unnecessary wrap in wb_calc_thresh.

Link: https://lkml.kernel.org/r/20240425131724.36778-4-shikemeng@huaweicloud.com
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Howard Cochran <hcochran@kernelspring.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Miklos Szeredi <mszeredi@redhat.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page-writeback.c

index 14893b20d38cc0fbdcec9e6cc617795d17ede991..22e1acec899eac884259f033fc7ff9f1b3dfa7c4 100644 (file)
@@ -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