lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240123183332.876854-5-shikemeng@huaweicloud.com>
Date: Wed, 24 Jan 2024 02:33:31 +0800
From: Kemeng Shi <shikemeng@...weicloud.com>
To: willy@...radead.org,
	akpm@...ux-foundation.org
Cc: tj@...nel.org,
	hcochran@...nelspring.com,
	mszeredi@...hat.com,
	axboe@...nel.dk,
	linux-fsdevel@...r.kernel.org,
	linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 4/5] mm: remove redundant check in wb_min_max_ratio

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@...weicloud.com>
---
 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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ