From: <ye.xingchen@zte.com.cn>
To: <akpm@linux-foundation.org>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] mm/huge_memory: add TRANSPARENT_HUGEPAGE_NEVER for THP
Date: Wed, 30 Nov 2022 16:51:46 +0800 (CST) [thread overview]
Message-ID: <202211301651462590168@zte.com.cn> (raw)
From: ye xingchen <ye.xingchen@zte.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@zte.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
next reply other threads:[~2022-11-30 8:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 8:51 ye.xingchen [this message]
2022-12-01 20:26 ` Matthew Wilcox
2022-12-02 17:57 ` David Rientjes
2022-12-02 19:27 ` Hugh Dickins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202211301651462590168@zte.com.cn \
--to=ye.xingchen@zte.com.cn \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox