linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: huge_memory: don't start_stop_khugepaged for non-PMD THP
@ 2024-07-26  8:28 Barry Song
  2024-07-26  9:43 ` Ryan Roberts
  0 siblings, 1 reply; 8+ messages in thread
From: Barry Song @ 2024-07-26  8:28 UTC (permalink / raw)
  To: akpm, linux-mm
  Cc: linux-kernel, Barry Song, Lance Yang, Ryan Roberts, Baolin Wang,
	David Hildenbrand, Yang Shi, Zi Yan

From: Barry Song <v-songbaohua@oppo.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@gmail.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Barry Song <v-songbaohua@oppo.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



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

end of thread, other threads:[~2024-07-26 11:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-26  8:28 [PATCH] mm: huge_memory: don't start_stop_khugepaged for non-PMD THP Barry Song
2024-07-26  9:43 ` Ryan Roberts
2024-07-26  9:48   ` David Hildenbrand
2024-07-26 10:04     ` Barry Song
2024-07-26 10:45       ` Ryan Roberts
2024-07-26 11:00         ` Barry Song
2024-07-26 11:06           ` Ryan Roberts
2024-07-26 10:11   ` Barry Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox