From: Lance Yang <lance.yang@linux.dev>
To: Zhiheng Tao <junchuan.tzh@antgroup.com>
Cc: ziy@nvidia.com, baolin.wang@linux.alibaba.com,
Liam.Howlett@oracle.com, npache@redhat.com, ryan.roberts@arm.com,
dev.jain@arm.com, baohua@kernel.org, shy828301@gmail.com,
zokeefe@google.com, peterx@redhat.com, akpm@linux-foundation.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
lorenzo.stoakes@oracle.com,
"David Hildenbrand (Red Hat)" <david@kernel.org>
Subject: Re: [PATCH] mm/khugepaged: Fix skipping of alloc sleep after second failure
Date: Mon, 24 Nov 2025 17:27:23 +0800 [thread overview]
Message-ID: <0f292735-4b13-417f-bc65-82cebd2040a3@linux.dev> (raw)
In-Reply-To: <dfe192a8-4a88-407a-83c2-976d953a2227@kernel.org>
On 2025/11/24 17:14, David Hildenbrand (Red Hat) wrote:
> On 11/24/25 07:19, Zhiheng Tao wrote:
>> In khugepaged_do_scan(), two consecutive allocation failures cause
>> the logic to skip the dedicated 60s throttling sleep
>> (khugepaged_alloc_sleep_millisecs), forcing a fallback to the
>> shorter 10s scanning interval via the outer loop
>>
>> Since fragmentation is unlikely to resolve in 10s, this results in
>> wasted CPU cycles on immediate retries.
>
> Why shouldn't memory comapction be able to compact a single THP in 10s?
>
> Why should it resolve in 60s?
>
>>
>> Reorder the failure logic to ensure khugepaged_alloc_sleep() is
>> always called on each allocation failure.
>>
>> Fixes: c6a7f445a272 ("mm: khugepaged: don't carry huge page to the
>> next loop for !CONFIG_NUMA")
>
> What are we fixing here? This sounds like a change that might be better
> on some systems, but worse on others?
Seems like we're not honoring khugepaged_alloc_sleep_millisecs on the
second allocation failure... but is that actually a problem?
>
> We really need more information on when/how an issue was hit, and how
> this patch here really moves the needle in any way.
+1
next prev parent reply other threads:[~2025-11-24 9:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 6:19 Zhiheng Tao
2025-11-24 9:14 ` David Hildenbrand (Red Hat)
2025-11-24 9:27 ` Lance Yang [this message]
2025-11-25 4:26 ` Zhiheng Tao
2025-11-25 4:15 ` Zhiheng Tao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0f292735-4b13-417f-bc65-82cebd2040a3@linux.dev \
--to=lance.yang@linux.dev \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=junchuan.tzh@antgroup.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=npache@redhat.com \
--cc=peterx@redhat.com \
--cc=ryan.roberts@arm.com \
--cc=shy828301@gmail.com \
--cc=ziy@nvidia.com \
--cc=zokeefe@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox