netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Neil Horman <nhorman@tuxdriver.com>,
	Netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: packet_sendmsg_spkt sleeping from invalid context
Date: Mon, 14 Dec 2009 21:52:33 +0100	[thread overview]
Message-ID: <20091214205231.GB5037@nowhere> (raw)
In-Reply-To: <4B2690E7.4030303@gmail.com>

On Mon, Dec 14, 2009 at 08:24:23PM +0100, Eric Dumazet wrote:
> Le 14/12/2009 18:52, Frederic Weisbecker a écrit :
> > Hi,
> > 
> > I don't know if it has been reported already.
> > I get the following warning on boot, with latest upstream tree:
> > 
> > [   32.776502] sched: BUG: sleeping function called from invalid context at mm/slab.c:3032
> > [   32.802173] sched: in_atomic(): 1, irqs_disabled(): 0, pid: 3555, name: dhclient3
> > [   32.821141] 1 lock held by dhclient3/3555:
> > [   32.821147]  #0:  (rcu_read_lock){.+.+.+}, at: [<ffffffff815d177d>] packet_sendmsg_spkt+0x7d/0x2c0
> > [   32.821174] Pid: 3555, comm: dhclient3 Tainted: G        W  2.6.32-tip+ #134
> > [   32.821181] Call Trace:
> > [   32.821194]  [<ffffffff810811c3>] ? __debug_show_held_locks+0x13/0x30
> > [   32.821207]  [<ffffffff8103d6b8>] __might_sleep+0x118/0x140
> > [   32.821219]  [<ffffffff81110c23>] kmem_cache_alloc+0x173/0x190
> > [   32.821231]  [<ffffffff815483d9>] __alloc_skb+0x49/0x170
> > [   32.821241]  [<ffffffff81542238>] sock_wmalloc+0x38/0x80
> > [   32.821250]  [<ffffffff815d182b>] packet_sendmsg_spkt+0x12b/0x2c0
> > [   32.821260]  [<ffffffff815d177d>] ? packet_sendmsg_spkt+0x7d/0x2c0
> > [   32.821272]  [<ffffffff8153ded7>] sock_sendmsg+0x127/0x140
> > [   32.821285]  [<ffffffff8106f4a0>] ? autoremove_wake_function+0x0/0x40
> > [   32.821297]  [<ffffffff810f467b>] ? might_fault+0x7b/0xd0
> > [   32.821306]  [<ffffffff810f467b>] ? might_fault+0x7b/0xd0
> > [   32.821318]  [<ffffffff815401aa>] ? move_addr_to_kernel+0x6a/0x70
> > [   32.821328]  [<ffffffff8154029f>] sys_sendto+0xef/0x120
> > [   32.821340]  [<ffffffff81131479>] ? mntput_no_expire+0x29/0x110
> > [   32.821355]  [<ffffffff810027db>] system_call_fastpath+0x16/0x1b
> > 
> 
> Thanks for the report Frederic.
> 
> We could partly revert the original commit, but as we wanted to avoid touching 
> device refcount, and af_packet might be the only real abuser, we could
> try following patch instead.
> 
> Thanks



I also wonder. Are you using PREEMPT_RCU ?
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.

  parent reply	other threads:[~2009-12-14 20:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-14 17:52 packet_sendmsg_spkt sleeping from invalid context Frederic Weisbecker
2009-12-14 19:24 ` Eric Dumazet
2009-12-14 20:11   ` Frederic Weisbecker
2009-12-14 20:52   ` Frederic Weisbecker [this message]
2009-12-14 21:25     ` Eric Dumazet
2009-12-14 21:30       ` Frederic Weisbecker
2009-12-14 21:39         ` Eric Dumazet
2009-12-15 15:13           ` Frederic Weisbecker
2009-12-15 15:47             ` Eric Dumazet
2009-12-16  5:14               ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091214205231.GB5037@nowhere \
    --to=fweisbec@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).