Skip to contentSkip to conversation

mm/khugepaged: fix comment for default scan sleep duration

PATCH Applied wang lian 5 participants 6 messages Oct 15, 2025 – Oct 17, 2025

Subsystems (2)
lore
Share & tools
lore

wang lian

author
#0 lore raw

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.

Fixes ba76149f47d8 ("thp: khugepaged")
---
 mm/khugepaged.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/khugepaged.c +1 -1
index e947b96e1443..d635d821f611 100644
@@ -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)
Acked-by on v2 1/1
#1 lore raw
Quoted 7 lines · wang lian

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'."

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
author
#2 lore raw

Ok, I get it, thanks.

Quoted 9 lines · David Hildenbrand

"While at it, replace the magic value 512 by HPAGE_PMD_NR and 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

Reviewed-by on v2 1/1
#3 lore raw
In reply to 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_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.

Quoted 7 lines
Fixes ba76149f47d8 ("thp: khugepaged")

Thanks,
SJ

[...]

Reviewed-by on v2 1/1
#4 lore raw
In reply to wang lian
Quoted 8 lines · wang lian

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.

Quoted 8 lines
Fixes ba76149f47d8 ("thp: khugepaged")

---

Acked-by on v2 1/1
#5 lore raw
In reply to wang lian
Quoted 8 lines

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.

Quoted 7 lines
Fixes ba76149f47d8 ("thp: khugepaged")

Nice cleanup for the comments!

Quoted 17 lines
---
 mm/khugepaged.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/khugepaged.c +1 -1
index e947b96e1443..d635d821f611 100644
@@ -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;