Re: [PATCH 13/32] mm/khugepaged: stop MADV_COLLAPSE on a fatal signal
From: David Hildenbrand (Arm)
Date: Wed Dec 02 2026 - 10:31:25 EST
On 12/2/26 06:37, Gregory Price (Meta) wrote:
> On 2026-11-29 11:06 +0100, David Hildenbrand (Arm) wrote:
>> A task that gets a fatal signal during MADV_COLLAPSE keeps collapsing
>> the rest of the range. Consequently, the exit of the task can be delayed
>> for a while for a large range.
>>
>> Let's fix it by checking for a fatal signal before each PMD, simply
>> breaking out of the loop. User space will never see the return value,
>> so no need to return -EINTR.
>>
>> This has low urgency, as it only delays the exit of the task. No need to
>> CC stable.
>>
>> Fixes: 7d8faaf15545 ("mm/madvise: introduce MADV_COLLAPSE sync hugepage collapse")
>> Reported-by: Chris Mason <mason@xxxxxxxxxx>
>> Signed-off-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
>
> I enjoyed this test. mapped 16TB sparse and the collapsed it.
:D
>
> before: 4.5 seconds to exit
4.5s, still surprising fast. Did you populate a lot of page tables such that not
that much can actually be skipped easily?
--
Cheers,
David