From: "David Hildenbrand (Red Hat)" <david@kernel.org>
To: Zhiheng Tao <junchuan.tzh@antgroup.com>,
akpm@linux-foundation.org, lorenzo.stoakes@oracle.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, lance.yang@linux.dev,
shy828301@gmail.com, zokeefe@google.com, peterx@redhat.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/khugepaged: Fix skipping of alloc sleep after second failure
Date: Mon, 24 Nov 2025 10:14:20 +0100 [thread overview]
Message-ID: <dfe192a8-4a88-407a-83c2-976d953a2227@kernel.org> (raw)
In-Reply-To: <1763965157-58413-1-git-send-email-junchuan.tzh@antgroup.com>
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?
We really need more information on when/how an issue was hit, and how
this patch here really moves the needle in any way.
--
Cheers
David
next prev parent reply other threads:[~2025-11-24 9:14 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) [this message]
2025-11-24 9:27 ` Lance Yang
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=dfe192a8-4a88-407a-83c2-976d953a2227@kernel.org \
--to=david@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=dev.jain@arm.com \
--cc=junchuan.tzh@antgroup.com \
--cc=lance.yang@linux.dev \
--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