Re: [PATCH v3 1/3] mm/kmemleak: avoid soft lockup when scanning task stacks
From: Oleg Nesterov
Date: Tue Jun 16 2026 - 05:52:15 EST
On 06/15, Breno Leitao wrote:
>
> Walk the tasks one PID at a time with find_ge_pid(), taking the RCU read
> lock only to look up and pin each task. The stack is then scanned with no
> lock held, so cond_resched() runs between tasks and the scan stops early
> on scan_should_stop(). This follows the next_tgid()/task_seq_get_next()
> iteration pattern and keeps each RCU critical section short.
Reviewed-by: Oleg Nesterov <oleg@xxxxxxxxxx>