mm/huge_memory: add TRANSPARENT_HUGEPAGE_NEVER for THP
Subsystems (3)
PATCH 1/1 mm/huge_memory: add TRANSPARENT_HUGEPAGE_NEVER for THP
From: ye xingchen <[email protected]>
Sometimes we may need the /sys/kernel/mm/transparent_hugepage/enabled to default as [never] at the first time.
--- mm/Kconfig | 5 +++++ mm/huge_memory.c | 2 ++ 2 files changed, 7 insertions(+)
mm/Kconfig +5 -0
@@ -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
mm/huge_memory.c +2 -0
@@ -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)|
Signature · 1 line
2.25.1
Quoted 4 lines · On Wed, Nov 30, 2022 at 04:51:46PM +0800, [email protected] wrote:
From: ye xingchen <[email protected]>
Sometimes we may need the
/sys/kernel/mm/transparent_hugepage/enabledto default as [never] at the first time.
What is going wrong with THP enabled that you need to disable it?
Quoted 8 lines · Matthew Wilcox
Quoted 4 lines · On Wed, Nov 30, 2022 at 04:51:46PM +0800, [email protected] wrote:
From: ye xingchen <[email protected]>
Sometimes we may need the
/sys/kernel/mm/transparent_hugepage/enabledto 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.
Quoted 4 lines · David Rientjes
Quoted 3 lines · Matthew Wilcox
Quoted 2 lines · On Wed, Nov 30, 2022 at 04:51:46PM +0800, [email protected] wrote:
From: ye xingchen <[email protected]>
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Sometimes we may need the
/sys/kernel/mm/transparent_hugepage/enabledto 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