Re: [PATCH v3 1/1] khugepaged: fix readahead lock inversion in collapse_file()

From: Lance Yang

Date: Mon Oct 26 2026 - 08:38:29 EST




On 2026/10/26 19:26, David Hildenbrand (Arm) wrote:
On 10/18/26 04:47, Baolin Wang wrote:


On 10/17/26 3:41 PM, Lance Yang wrote:


On 2026/10/17 13:43, Baolin Wang wrote:



OK.


Sounds good.


But why not add RA logic in collapse_pmd(), as we do for
SCAN_PAGE_DIRTY_OR_WRITEBACK? There's already retry logic there, and this
would also simplify the long collapse_file().

That would be cleaner, yeah. Some older stable trees don't have that
outer retry loop, though ... I'd prefer to get the fix backported first,
then move the RA/retry logic out in a follow-up, wdyt?

IIRC, the approach to bug fixes is to fix bugs properly and cleanly for
upstream, without being constrained by backporting requirements.

Anyway, I don't have a strong opinion on this. Let's also see what David prefers.

Let's get this fixed in a acceptable way in a reasonable timeframe; it's been
broken for too long. ... and follow up with bigger cleanups later.

@Lance is this version good to review for that purpose or are you planning a resend?

Right, as for the bigger cleanup, that can come later. Will resend the current version as-is :)