From 7e657d348dacd4e7588a7a3daaffe3d509546d96 Mon Sep 17 00:00:00 2001 From: wang lian Date: Wed, 15 Oct 2025 17:29:57 +0800 Subject: [PATCH] mm/khugepaged: fix comment for default scan sleep duration The comment for khugepaged_scan_sleep_millisecs incorrectly states the default scan period is 30 seconds. The actual default value in the code is 10000ms (10 seconds). This patch corrects the comment to match the code, preventing potential confusion. The incorrect comment has existed since the feature was first introduced. While at it, replace the magic value 512 by HPAGE_PMD_NR and use 'ptes'. Link: https://lkml.kernel.org/r/20251015092957.37432-1-lianux.mm@gmail.com Signed-off-by: wang lian Suggested-by: David Hildenbrand Reviewed-by: Dev Jain Reviewed-by: Wei Yang Reviewed-by: Lance Yang Acked-by: David Hildenbrand Reviewed-by: SeongJae Park Reviewed-by: Vishal Moola (Oracle) Acked-by: Nico Pache Cc: Andrea Arcangeli Cc: Baolin Wang Cc: Barry Song Cc: Liam Howlett Cc: Lorenzo Stoakes Cc: Rik van Riel Cc: Ryan Roberts Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/khugepaged.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index e947b96e1443..d635d821f611 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -67,7 +67,7 @@ enum scan_result { static struct task_struct *khugepaged_thread __read_mostly; static DEFINE_MUTEX(khugepaged_mutex); -/* default scan 8*512 pte (or vmas) every 30 second */ +/* default scan 8*HPAGE_PMD_NR ptes (or vmas) every 10 second */ static unsigned int khugepaged_pages_to_scan __read_mostly; static unsigned int khugepaged_pages_collapsed; static unsigned int khugepaged_full_scans; -- 2.51.0