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: <20240726082818.260008-1-21cnbao@gmail.com>
Date: Fri, 26 Jul 2024 20:28:18 +1200
From: Barry Song <21cnbao@...il.com>
To: akpm@...ux-foundation.org,
	linux-mm@...ck.org
Cc: linux-kernel@...r.kernel.org,
	Barry Song <v-songbaohua@...o.com>,
	Lance Yang <ioworker0@...il.com>,
	Ryan Roberts <ryan.roberts@....com>,
	Baolin Wang <baolin.wang@...ux.alibaba.com>,
	David Hildenbrand <david@...hat.com>,
	Yang Shi <shy828301@...il.com>,
	Zi Yan <ziy@...dia.com>
Subject: [PATCH] mm: huge_memory: don't start_stop_khugepaged for non-PMD THP

From: Barry Song <v-songbaohua@...o.com>

khugepaged will be automatically started when PMD-sized THP is enabled
(either of the per-size anon control or the top-level control are set
to "always" or "madvise"), and it'll be automatically shutdown when
PMD-sized THP is disabled (when both the per-size anon control and the
top-level control are "never").

It seems unnecessary to call start_stop_khugepaged() for non-PMD THP,
as it would only waste CPU time.

Cc: Lance Yang <ioworker0@...il.com>
Cc: Ryan Roberts <ryan.roberts@....com>
Cc: Baolin Wang <baolin.wang@...ux.alibaba.com>
Cc: David Hildenbrand <david@...hat.com>
Cc: Yang Shi <shy828301@...il.com>
Cc: Zi Yan <ziy@...dia.com>
Signed-off-by: Barry Song <v-songbaohua@...o.com>
---
 mm/huge_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 41460847988c..bd365e35acf7 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -514,7 +514,7 @@ static ssize_t thpsize_enabled_store(struct kobject *kobj,
 	} else
 		ret = -EINVAL;
 
-	if (ret > 0) {
+	if (ret > 0 && order == HPAGE_PMD_ORDER) {
 		int err;
 
 		err = start_stop_khugepaged();
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ