Re: [PATCH] mm/compaction: do not skip the free scanner's periodic lock drop
From: Zi Yan
Date: Tue Nov 17 2026 - 12:30:11 EST
On 16 Nov 2026, at 7:57, Kiryl Shutsemau (Meta) wrote:
> isolate_freepages_block() drops zone->lock, checks for a fatal signal
> and calls cond_resched() at every pfn that is a multiple of
> COMPACT_CLUSTER_MAX.
>
> With a stride above one, the scan steps over a compound page, or over a
> high-order free page it has just isolated, to a pfn that is not a
> multiple of the stride. From there it never reaches a multiple of
> COMPACT_CLUSTER_MAX, so the rest of the pageblock is scanned without the
> check, possibly with zone->lock held and interrupts off.
>
> Count probes instead, and check every COMPACT_CLUSTER_MAX of them.
Makes sense. The loop is working on one page (regardless of its order)
at a time.
>
> Fixes: 4fca9730c51d ("mm, compaction: sample pageblocks for free pages")
> Signed-off-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
> ---
> mm/compaction.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
Best Regards,
Yan, Zi