Re: [PATCH v2 3/4] oom_kill: has_intersects_mems_allowed() needsrcu_read_lock()

From: David Rientjes
Date: Wed Dec 04 2013 - 19:41:48 EST


On Wed, 4 Dec 2013, Oleg Nesterov wrote:

> At least out_of_memory() calls has_intersects_mems_allowed()
> without even rcu_read_lock(), this is obviously buggy.
>
> Add the necessary rcu_read_lock(). This means that we can not
> simply return from the loop, we need "bool ret" and "break".
>
> While at it, swap the names of task_struct's (the argument and
> the local). This cleanups the code a little bit and avoids the
> unnecessary initialization.
>
> 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/