* Re: [PATCH] mm/khugepaged: fix comment for default scan sleep duration
2025-10-15 6:43 [PATCH] mm/khugepaged: fix comment for default scan sleep duration wang lian
@ 2025-10-15 6:52 ` Dev Jain
2025-10-15 6:54 ` Lance Yang
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Dev Jain @ 2025-10-15 6:52 UTC (permalink / raw)
To: wang lian, Andrew Morton
Cc: David Hildenbrand, Lorenzo Stoakes, Zi Yan, Baolin Wang,
Liam R. Howlett, Nico Pache, Ryan Roberts, Barry Song,
Lance Yang, Andrea Arcangeli, Rik van Riel, Wei Yang, linux-mm,
linux-kernel
On 15/10/25 12:13 pm, wang lian 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.
>
> Fixes: ba76149f47d8 ("thp: khugepaged")
> Signed-off-by: wang lian <lianux.mm@gmail.com>
> ---
>
Reviewed-by: Dev Jain <dev.jain@arm.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] mm/khugepaged: fix comment for default scan sleep duration
2025-10-15 6:43 [PATCH] mm/khugepaged: fix comment for default scan sleep duration wang lian
2025-10-15 6:52 ` Dev Jain
@ 2025-10-15 6:54 ` Lance Yang
2025-10-15 7:32 ` Wei Yang
2025-10-15 9:08 ` David Hildenbrand
3 siblings, 0 replies; 6+ messages in thread
From: Lance Yang @ 2025-10-15 6:54 UTC (permalink / raw)
To: wang lian
Cc: David Hildenbrand, Lorenzo Stoakes, Zi Yan, Baolin Wang,
Liam R. Howlett, Andrew Morton, Nico Pache, Ryan Roberts,
Dev Jain, Barry Song, Andrea Arcangeli, Rik van Riel, Wei Yang,
linux-mm, linux-kernel
On 2025/10/15 14:43, wang lian 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.
>
> Fixes: ba76149f47d8 ("thp: khugepaged")
> Signed-off-by: wang lian <lianux.mm@gmail.com>
> ---
Thanks!
Reviewed-by: Lance Yang <lance.yang@linux.dev>
> mm/khugepaged.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index e947b96e1443..449f983b8891 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*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;
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] mm/khugepaged: fix comment for default scan sleep duration
2025-10-15 6:43 [PATCH] mm/khugepaged: fix comment for default scan sleep duration wang lian
2025-10-15 6:52 ` Dev Jain
2025-10-15 6:54 ` Lance Yang
@ 2025-10-15 7:32 ` Wei Yang
2025-10-15 9:08 ` David Hildenbrand
3 siblings, 0 replies; 6+ messages in thread
From: Wei Yang @ 2025-10-15 7:32 UTC (permalink / raw)
To: wang lian
Cc: Andrew Morton, David Hildenbrand, Lorenzo Stoakes, Zi Yan,
Baolin Wang, Liam R. Howlett, Nico Pache, Ryan Roberts, Dev Jain,
Barry Song, Lance Yang, Andrea Arcangeli, Rik van Riel, Wei Yang,
linux-mm, linux-kernel
On Wed, Oct 15, 2025 at 02:43:33PM +0800, wang lian 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.
>
>Fixes: ba76149f47d8 ("thp: khugepaged")
>Signed-off-by: wang lian <lianux.mm@gmail.com>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
--
Wei Yang
Help you, Help me
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] mm/khugepaged: fix comment for default scan sleep duration
2025-10-15 6:43 [PATCH] mm/khugepaged: fix comment for default scan sleep duration wang lian
` (2 preceding siblings ...)
2025-10-15 7:32 ` Wei Yang
@ 2025-10-15 9:08 ` David Hildenbrand
2025-10-15 9:13 ` wang lian
3 siblings, 1 reply; 6+ messages in thread
From: David Hildenbrand @ 2025-10-15 9:08 UTC (permalink / raw)
To: wang lian, Andrew Morton
Cc: Lorenzo Stoakes, Zi Yan, Baolin Wang, Liam R. Howlett,
Nico Pache, Ryan Roberts, Dev Jain, Barry Song, Lance Yang,
Andrea Arcangeli, Rik van Riel, Wei Yang, linux-mm, linux-kernel
On 15.10.25 08:43, wang lian 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.
>
> Fixes: ba76149f47d8 ("thp: khugepaged")
> Signed-off-by: wang lian <lianux.mm@gmail.com>
> ---
> mm/khugepaged.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index e947b96e1443..449f983b8891 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*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 */
--
Cheers
David / dhildenb
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] mm/khugepaged: fix comment for default scan sleep duration
2025-10-15 9:08 ` David Hildenbrand
@ 2025-10-15 9:13 ` wang lian
0 siblings, 0 replies; 6+ messages in thread
From: wang lian @ 2025-10-15 9:13 UTC (permalink / raw)
To: David Hildenbrand
Cc: Andrew Morton, Lorenzo Stoakes, Zi Yan, Baolin Wang,
Liam R. Howlett, Nico Pache, Ryan Roberts, Dev Jain, Barry Song,
Lance Yang, Andrea Arcangeli, Rik van Riel, Wei Yang, linux-mm,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 436 bytes --]
Hi David,
Thanks for the great suggestions!
That indeed makes the comment much better.
I will send out a v2 shortly.
> On Oct 15, 2025, at 17:08, David Hildenbrand <david@redhat.com> wrote:
>
> 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
[-- Attachment #2: Type: text/html, Size: 3236 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread