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]
Date:   Wed, 30 Nov 2022 16:51:46 +0800 (CST)
From:   <ye.xingchen@....com.cn>
To:     <akpm@...ux-foundation.org>
Cc:     <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] mm/huge_memory: add TRANSPARENT_HUGEPAGE_NEVER for THP

From: ye xingchen <ye.xingchen@....com.cn>

Sometimes we may need the /sys/kernel/mm/transparent_hugepage/enabled to
default as [never] at the first time.

Signed-off-by: ye xingchen <ye.xingchen@....com.cn>
---
 mm/Kconfig       | 5 +++++
 mm/huge_memory.c | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/mm/Kconfig b/mm/Kconfig
index ff7b209dec05..ded8c1da6267 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -797,6 +797,11 @@ choice
 	  madvise(MADV_HUGEPAGE) but it won't risk to increase the
 	  memory footprint of applications without a guaranteed
 	  benefit.
+
+	config TRANSPARENT_HUGEPAGE_NEVER
+		bool "never"
+	help
+	  Disabling Transparent Hugepage.
 endchoice

 config THP_SWAP
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index c0c57828110d..3571417aa70a 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -60,6 +60,8 @@ unsigned long transparent_hugepage_flags __read_mostly =
 #endif
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE_MADVISE
 	(1<<TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG)|
+#endif
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE_NEVER
 #endif
 	(1<<TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG)|
 	(1<<TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG)|
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ