Re: [PATCH 13/32] mm/khugepaged: stop MADV_COLLAPSE on a fatal signal
From: Gregory Price (Meta)
Date: Wed Dec 02 2026 - 00:38:06 EST
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.
before: 4.5 seconds to exit
after: 86 microseconds
Tested-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
Reviewed-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
--
~Gregory