All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier@cisco.com>
To: "aluno3\@poczta.onet.pl" <aluno3@poczta.onet.pl>
Cc: general@lists.openfabrics.org, netdev@vger.kernel.org
Subject: Re: [ofa-general] NetEffect, iw_nes and kernel warning
Date: Tue, 27 Jan 2009 15:53:16 -0800	[thread overview]
Message-ID: <adawscgwbkj.fsf@cisco.com> (raw)
In-Reply-To: <497EF9AC.70104@poczta.onet.pl> (aluno3@poczta.onet.pl's message of "Tue, 27 Jan 2009 13:10:20 +0100")

Interesting... looks like an unfortunate interaction with unclear
locking rules.  See below for full explanation.

BTW, what workload are you running to hit this?

I assume you have CONFIG_HIGHMEM set?

 > WARNING: at kernel/softirq.c:136 local_bh_enable+0x9b/0xa0()

I assume this is

	WARN_ON_ONCE(in_irq() || irqs_disabled());

The interesting parts of the stack trace seem to be (reversing the order
so the story makes sense):

 [<e8e3f815>] nes_netdev_start_xmit+0x815/0x8a0 [iw_nes]

nes_netdev_start_xmit() calls skb_linearize() for nonlinear skbs it
can't handle, which calls __pskb_pull_tail():

 [<c048982c>] __pskb_pull_tail+0x5c/0x2e0

__pskb_pull_tail() calls skb_copy_bits():

 [<c0489c05>] skb_copy_bits+0x155/0x290

At least in some cases, skb_copy_bits() calls kmap_skb_frag() and more
to the point kunmap_skb_frag(), which looks like:

	static inline void kunmap_skb_frag(void *vaddr)
	{
		kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
	#ifdef CONFIG_HIGHMEM
		local_bh_enable();
	#endif
	}

which leads to:

 [<c012a79b>] local_bh_enable+0x9b/0xa0

which hits the irqs_disabled() warning because iw_nes is using LLTX, and
nes_netdev_start_xmit() does:

	local_irq_save(flags);
	if (!spin_trylock(&nesnic->sq_lock)) {

at the very beginning.

The best solution is probably for iw_nes to stop using LLTX and use the
main netdev lock... but actually I still don't see how it's safe for a
net driver to call skb_linearize() from its transmit routine, since
there's a chance that that will unconditionally enable BHs?

 - R.

       reply	other threads:[~2009-01-27 23:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <497EF9AC.70104@poczta.onet.pl>
2009-01-27 23:53 ` Roland Dreier [this message]
2009-01-28  0:07   ` [ofa-general] NetEffect, iw_nes and kernel warning David Miller
2009-01-28  0:17     ` Stephen Hemminger
2009-01-28 16:36       ` Tung, Chien Tin
2009-01-28 18:05     ` Roland Dreier
2009-01-28 19:05       ` Stephen Hemminger
2009-01-28 21:52         ` Roland Dreier
2009-01-30  6:57       ` Herbert Xu
2009-01-30  8:22         ` Eilon Greenstein
2009-01-30 16:25         ` Stephen Hemminger
2009-01-30 17:35         ` Roland Dreier
2009-01-30 21:51           ` David Miller
2009-01-31  3:54             ` Roland Dreier
2009-04-21  9:09               ` Lennert Buytenhek
2009-04-21 12:49                 ` Herbert Xu
2009-04-21 12:50                   ` Herbert Xu

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=adawscgwbkj.fsf@cisco.com \
    --to=rdreier@cisco.com \
    --cc=aluno3@poczta.onet.pl \
    --cc=general@lists.openfabrics.org \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.