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-next>] [day] [month] [year] [list]
Message-Id: <1632831797-32192-1-git-send-email-liangcaifan19@gmail.com>
Date:   Tue, 28 Sep 2021 20:23:17 +0800
From:   Liangcai Fan <liangcaifan19@...il.com>
To:     liangcai.fan@...soc.com, akpm@...ux-foundation.org
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        zhang.lyra@...il.com, Liangcai Fan <liangcaifan19@...il.com>
Subject: [PATCH] mm: Set min_free_kbytes with user_min_free_kbytes when user_min_free_kbytes is preferred

The 'min_free_kbytes' and 'user_min_free_kbytes' maybe inconsistent
after a few times of memory hotplug.
When 'new_min_free_kbytes' is not larger than 'user_min_free_kbytes',
set 'min_free_kbytes' with 'user_min_free_kbytes' rather than leave
it as the 'new_min_free_kbytes' calculated for the last time.

Signed-off-by: Liangcai Fan <liangcaifan19@...il.com>
Cc: Chunyan Zhang <zhang.lyra@...il.com>
---
 mm/page_alloc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index b37435c..ddf9dc1 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -8467,6 +8467,12 @@ int __meminit init_per_zone_wmark_min(void)
 		if (min_free_kbytes > 262144)
 			min_free_kbytes = 262144;
 	} else {
+		/*
+		 * Set 'min_free_kbytes' with 'user_min_free_kbytes' rather than
+		 * leave it as the 'new_min_free_kbytes' calculated for the last
+		 * time.
+		 */
+		min_free_kbytes = user_min_free_kbytes;
 		pr_warn("min_free_kbytes is not updated to %d because user defined value %d is preferred\n",
 				new_min_free_kbytes, user_min_free_kbytes);
 	}
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ