Re: [PATCH 13/32] mm/khugepaged: stop MADV_COLLAPSE on a fatal signal

From: Baolin Wang

Date: Wed Dec 02 2026 - 04:22:27 EST




On 11/29/26 6:06 PM, 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>
---

LGTM.
Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>