Skip to contentSkip to conversation

mm/khugepaged: fix comment for default scan sleep duration

PATCH Superseded wang lian 5 participants 6 messages Oct 15, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

wang lian

author
#0 lore raw

PATCH 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..449f983b8891 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*512 pte (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)
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 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).

Quoted 8 lines

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")

---

reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to wang lian
Quoted 11 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.

Fixes ba76149f47d8 ("thp: khugepaged")

---

Thanks!

Quoted 16 lines
  mm/khugepaged.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/khugepaged.c +1 -1
index e947b96e1443..449f983b8891 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*512 pte (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;
Reviewed-by on v1 1/1
#3 lore raw
In reply to wang lian
Quoted 10 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.

Fixes ba76149f47d8 ("thp: khugepaged")
Signature · 2 lines
Wei Yang
Help you, Help me
#4 lore raw
In reply to wang lian
Quoted 19 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.

Fixes ba76149f47d8 ("thp: khugepaged")
---
  mm/khugepaged.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/khugepaged.c +0 -0
index e947b96e1443..449f983b8891 100644

mm/khugepaged.c enum scan_result { · line 70

Quoted 5 lines
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*512 pte (or vmas) every 10 second */

We should improve the 512 part while at it (e.g., on arm64 with 64k page size it's 2048, on s390x it's 256).

And s/pte/ptes/.

/* default scan 8*HPAGE_PMD_NR ptes (or vmas) every 10 second */

Signature · 3 lines
Cheers

David / dhildenb
author
#5 lore raw

Hi David,
Thanks for the great suggestions!
That indeed makes the comment much better.
I will send out a v2 shortly.

Quoted 7 lines · David Hildenbrand

We should improve the 512 part while at it (e.g., on arm64 with 64k page size it's 2048, on s390x it's 256).

And s/pte/ptes/.

/* default scan 8*HPAGE_PMD_NR ptes (or vmas) every 10 second */

Best Regards,
Wang Lian