Subject: Re: packet_sendmsg_spkt sleeping from invalid context

From: Frederic Weisbecker <[email-masked]>
Date: Mon, 14 Dec 2009 22:30:04 +0100

On Mon, Dec 14, 2009 at 10:25:57PM +0100, Eric Dumazet wrote:
> Le 14/12/2009 21:52, Frederic Weisbecker a écrit :
> > 
> > I also wonder. Are you using PREEMPT_RCU ?
> 
> Not at all :)
> 
> But yes, this is illegal to do the memcpy_fromiovec() in rcu_read_lock() context.

I've just tested, and with rcu preempt it is mute, no warning :)

> > That may explain why you haven't seen this issue because
> > might_sleep() doesn't see you are in a rcu read locked
> > section as preemption is not disabled, but it is illegal to
> > voluntarily sleep in such area (although it's fine with
> > preempt rcu) as doing so with non-prempt RCU config would barf.
> > 
> > I'm trying a patch to handle that.
> 
> As you want, I also have a patch testing right now :)

But mine is to teach might_sleep() to handle rcu preempt case,
not to fix this net dev thing.

But I'll happily test the fix you have :)

Thanks.