[PATCH 4/5] mm: remove redundant check in wb_min_max_ratio

From: Kemeng Shi
Date: Tue Jan 23 2024 - 05:36:48 EST


We initialize bdi->max_ratio with a valid value (100 * BDI_RATIO_SCALE)
in bdi_init and we always set bdi->max_ratio with a valid value (< 100 *
BDI_RATIO_SCALE) in __bdi_set_max_ratio. So the validation of max_ratio
in wb_min_max_ratio is redundant. Just remove it.

Signed-off-by: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx>
---
mm/page-writeback.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 5c19ebffe5be..f25393034c76 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -198,10 +198,8 @@ static void wb_min_max_ratio(struct bdi_writeback *wb,
min *= this_bw;
min = div64_ul(min, tot_bw);
}
- if (max < 100 * BDI_RATIO_SCALE) {
- max *= this_bw;
- max = div64_ul(max, tot_bw);
- }
+ max *= this_bw;
+ max = div64_ul(max, tot_bw);
}

*minp = min;
--
2.30.0