Re: [PATCH v2 2/4] oom_kill: change oom_kill.c to usefor_each_thread()

From: David Rientjes
Date: Wed Dec 04 2013 - 19:39:16 EST


On Wed, 4 Dec 2013, Oleg Nesterov wrote:

> Change oom_kill.c to use for_each_thread() rather than the racy
> while_each_thread() which can loop forever if we race with exit.
>
> Note also that most users were buggy even if while_each_thread()
> was fine, the task can exit even _before_ rcu_read_lock().
>
> Fortunately the new for_each_thread() only requires the stable
> task_struct, so this change fixes both problems.
>
> Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
> Reviewed-and-Tested-by: Sergey Dyasly <dserrg@xxxxxxxxx>
> Reviewed-by: Sameer Nanda <snanda@xxxxxxxxxxxx>

Acked-by: David Rientjes <rientjes@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/