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

From: Catalin Marinas

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


On Mon, Jun 15, 2026 at 10:49:07AM -0700, 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: Catalin Marinas <catalin.marinas@xxxxxxx>