mm/khugepaged: fix comment for default scan sleep duration
Subsystems (2)
PATCH v2 1/1 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.
--- mm/khugepaged.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/khugepaged.c +1 -1
@@ -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;
Signature · 1 line
2.50.1 (Apple Git-155)
Quoted 7 lines · wang lian
The comment for
khugepaged_scan_sleep_millisecsincorrectly 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'."
Quoted 2 lines
Fixes ba76149f47d8 ("thp: khugepaged")
I prefer to not have fixes for comments. It tricks people into thinking that this might warrant a backport.
Likely no need to resend and Andrew can fix it up when applying.
Signature · 3 lines
Cheers David / dhildenb
Ok, I get it, thanks.
Quoted 9 lines · David Hildenbrand
"While at it, replace the magic value 512 by
HPAGE_PMD_NRand use 'ptes'."Quoted 1 line
Fixes ba76149f47d8 ("thp: khugepaged")I prefer to not have fixes for comments. It tricks people into thinking that this might warrant a backport.
Likely no need to resend and Andrew can fix it up when applying.
--
Best Regards,
wang lian
Quoted 8 lines · On Wed, 15 Oct 2025 17:29:57 +0800 wang lian <[email protected]> wrote:
The comment for
khugepaged_scan_sleep_millisecsincorrectly 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.
Quoted 7 lines
Fixes ba76149f47d8 ("thp: khugepaged")Signed-off-by wang lian <[email protected]>Suggested-by David Hildenbrand <[email protected]>Reviewed-by Dev Jain <[email protected]>Reviewed-by Wei Yang <[email protected]>Reviewed-by Lance Yang <[email protected]>
Thanks,
SJ
[...]
Quoted 8 lines · wang lian
The comment for
khugepaged_scan_sleep_millisecsincorrectly 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.
Quoted 8 lines
Fixes ba76149f47d8 ("thp: khugepaged")Signed-off-by wang lian <[email protected]>Suggested-by David Hildenbrand <[email protected]>Reviewed-by Dev Jain <[email protected]>Reviewed-by Wei Yang <[email protected]>Reviewed-by Lance Yang <[email protected]>---
Quoted 8 lines
The comment for
khugepaged_scan_sleep_millisecsincorrectly 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.
Quoted 7 lines
Fixes ba76149f47d8 ("thp: khugepaged")Signed-off-by wang lian <[email protected]>Suggested-by David Hildenbrand <[email protected]>Reviewed-by Dev Jain <[email protected]>Reviewed-by Wei Yang <[email protected]>Reviewed-by Lance Yang <[email protected]>
Nice cleanup for the comments!
Quoted 17 lines
--- mm/khugepaged.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/khugepaged.c +1
-1@@ -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;