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>] [day] [month] [year] [list]
Message-Id: <20240920122030.159751-1-gxxa03070307@gmail.com>
Date: Fri, 20 Sep 2024 20:20:30 +0800
From: Xiang Gao <gxxa03070307@...il.com>
To: akpm@...ux-foundation.org
Cc: linux-mm@...ck.org,
	linux-kernel@...r.kernel.org,
	gaoxiang17 <gaoxiang17@...omi.com>
Subject: [PATCH] mm/page_alloc: Add some detailed comments in can_steal_fallback

From: gaoxiang17 <gaoxiang17@...omi.com>

Signed-off-by: gaoxiang17 <gaoxiang17@...omi.com>
---
 mm/page_alloc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 0aefae4a26b2..8b0634d1728b 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1818,6 +1818,13 @@ static bool can_steal_fallback(unsigned int order, int start_mt)
 	if (order >= pageblock_order)
 		return true;
 
+	/*
+	 * movable pages won't cause permanent fragmentation, so when you alloc small pages,
+	 * you just need to temporarily steal unmovable or reclaimable pages that are closest
+	 * to the request size. After a while, memory compact may occur to form large contiguous
+	 * pages, and the next movable allocation may not need to steal. Unmovable and reclaimable
+	 * allocation need to actually steal pages.
+	 */
 	if (order >= pageblock_order / 2 ||
 		start_mt == MIGRATE_RECLAIMABLE ||
 		start_mt == MIGRATE_UNMOVABLE ||
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ