Re: [PATCH v3 3/3] mm/kmemleak: stop the per-cpu and struct page scans early too

From: Catalin Marinas

Date: Mon Jun 15 2026 - 14:27:59 EST


On Mon, Jun 15, 2026 at 10:49:08AM -0700, Breno Leitao wrote:
> The per-cpu and struct page scan loops have no reschedule-stop check of
> their own: once a scan is interrupted they keep calling scan_block() for
> every remaining block, which scans nothing useful.
>
> Propagate scan_block()'s interrupted status through scan_large_block()
> and break both loops as soon as it is set.
>
> Suggested-by: Catalin Marinas <catalin.marinas@xxxxxxx>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>

Reviewed-by: Catalin Marinas <catalin.marinas@xxxxxxx>