lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bdb25331-4273-4bf8-b095-d052e5124003@redhat.com>
Date: Wed, 24 Sep 2025 12:40:49 +0200
From: David Hildenbrand <david@...hat.com>
To: Kiryl Shutsemau <kirill@...temov.name>
Cc: Lance Yang <lance.yang@...ux.dev>, akpm@...ux-foundation.org,
 lorenzo.stoakes@...cle.com, Liam.Howlett@...cle.com, baohua@...nel.org,
 baolin.wang@...ux.alibaba.com, dev.jain@....com, hughd@...gle.com,
 ioworker0@...il.com, linux-kernel@...r.kernel.org, linux-mm@...ck.org,
 mpenttil@...hat.com, npache@...hat.com, ryan.roberts@....com,
 ziy@...dia.com, richard.weiyang@...il.com
Subject: Re: [PATCH mm-new 1/1] mm/khugepaged: abort collapse scan on non-swap
 entries

On 24.09.25 12:17, Kiryl Shutsemau wrote:
> On Wed, Sep 24, 2025 at 12:10:47PM +0200, David Hildenbrand wrote:
>> On 24.09.25 12:02, Lance Yang wrote:
>>> From: Lance Yang <lance.yang@...ux.dev>
>>>
>>> The existing check in hpage_collapse_scan_pmd() is specific to uffd-wp
>>> markers. Other special markers (e.g., GUARD, POISONED) would not be caught
>>> early, leading to failures deeper in the swap-in logic.
>>>
>>> hpage_collapse_scan_pmd()
>>>    `- collapse_huge_page()
>>>        `- __collapse_huge_page_swapin() -> fails!
>>>
>>> As David suggested[1], this patch skips any such non-swap entries early.
>>> If a special marker is found, the scan is aborted immediately with the
>>> SCAN_PTE_NON_PRESENT result, as Lorenzo suggested[2], avoiding wasted
>>> work.
>>
>> Note that I suggested to skip all non-present entries except swap entries,
>> which includes migration entries, hwpoisoned entries etc.
> 
> Hm. So swap in is fine, but wait for migration to complete is not?

If so we'd have to add the logic to actually wait for migration entries, 
and not count them towards max swap entries.

But that's a different discussion and could be added on top of cleanly 
handling all non-swap entries.

-- 
Cheers

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ