linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/huge_memory: add TRANSPARENT_HUGEPAGE_NEVER for THP
@ 2022-11-30  8:51 ye.xingchen
  2022-12-01 20:26 ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: ye.xingchen @ 2022-11-30  8:51 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/huge_memory: add TRANSPARENT_HUGEPAGE_NEVER for THP
  2022-11-30  8:51 [PATCH] mm/huge_memory: add TRANSPARENT_HUGEPAGE_NEVER for THP ye.xingchen
@ 2022-12-01 20:26 ` Matthew Wilcox
  2022-12-02 17:57   ` David Rientjes
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2022-12-01 20:26 UTC (permalink / raw)
  To: ye.xingchen; +Cc: akpm, linux-mm, linux-kernel

On Wed, Nov 30, 2022 at 04:51:46PM +0800, ye.xingchen@zte.com.cn wrote:
> 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.

What is going wrong with THP enabled that you need to disable it?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/huge_memory: add TRANSPARENT_HUGEPAGE_NEVER for THP
  2022-12-01 20:26 ` Matthew Wilcox
@ 2022-12-02 17:57   ` David Rientjes
  2022-12-02 19:27     ` Hugh Dickins
  0 siblings, 1 reply; 4+ messages in thread
From: David Rientjes @ 2022-12-02 17:57 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: ye.xingchen, akpm, linux-mm, linux-kernel

On Thu, 1 Dec 2022, Matthew Wilcox wrote:

> On Wed, Nov 30, 2022 at 04:51:46PM +0800, ye.xingchen@zte.com.cn wrote:
> > 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.
> 
> What is going wrong with THP enabled that you need to disable it?
> 

That would be useful to know in addition to why this needs to be part of 
.config and not simply using the kernel command line option.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/huge_memory: add TRANSPARENT_HUGEPAGE_NEVER for THP
  2022-12-02 17:57   ` David Rientjes
@ 2022-12-02 19:27     ` Hugh Dickins
  0 siblings, 0 replies; 4+ messages in thread
From: Hugh Dickins @ 2022-12-02 19:27 UTC (permalink / raw)
  To: David Rientjes; +Cc: Matthew Wilcox, ye.xingchen, akpm, linux-mm, linux-kernel

On Fri, 2 Dec 2022, David Rientjes wrote:
> On Thu, 1 Dec 2022, Matthew Wilcox wrote:
> > On Wed, Nov 30, 2022 at 04:51:46PM +0800, ye.xingchen@zte.com.cn wrote:
> > > 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.
> > 
> > What is going wrong with THP enabled that you need to disable it?
> > 
> 
> That would be useful to know in addition to why this needs to be part of 
> .config and not simply using the kernel command line option.

There is also the puzzle of what new feature gets added by

#ifdef CONFIG_TRANSPARENT_HUGEPAGE_NEVER
#endif

Hugh

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-02 19:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30  8:51 [PATCH] mm/huge_memory: add TRANSPARENT_HUGEPAGE_NEVER for THP ye.xingchen
2022-12-01 20:26 ` Matthew Wilcox
2022-12-02 17:57   ` David Rientjes
2022-12-02 19:27     ` Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).