Re: [PATCH v3 2/3] mm/kmemleak: stop the task stack scan early when interrupted

From: Oleg Nesterov

Date: Tue Jun 16 2026 - 05:54:43 EST


On 06/15, Breno Leitao wrote:
>
> scan_block() already checks scan_should_stop() for every pointer and
> bails out of the current block, but the task stack walk cannot tell and
> keeps issuing a separate scan_should_stop() between every task.
>
> Return that status from scan_block() and use it as the task stack loop
> condition, so the walk stops as soon as a scan is interrupted.
>
> Suggested-by: Catalin Marinas <catalin.marinas@xxxxxxx>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>

Reviewed-by: Oleg Nesterov <oleg@xxxxxxxxxx>