Re: [PATCH] ipc: don't allocate with GFP_KERNEL inside rcu read lock

From: Davidlohr Bueso
Date: Mon Jun 10 2013 - 13:23:55 EST

On Mon, 2013-06-10 at 12:14 -0400, Sasha Levin wrote:
> ipc_addid() is protected by a rcu read lock, which means we can't allocate
> using GFP_KERNEL inside it.
> Signed-off-by: Sasha Levin <sasha.levin@xxxxxxxxxx>
> ---
> Another option would be to call idr_preload from outside the read lock,
> but that complicates the code much more than this fix. If that's the
> preferred method to fix it I can resend that solution instead.

This issue was reported last week by Fengguang

Your fix looks the simplest approach, but I'm not sure if doing the
atomic allocation would trigger some other problem, as a side effect.

A third option would be to simply revert the offending commit, leaving
the rcu locking as it originally was.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at