netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <amwang@redhat.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org,
	John Fastabend <john.r.fastabend@intel.com>,
	Greg Rose <gregory.v.rose@intel.com>, Thomas Graf <tgraf@suug.ch>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH net] ipv6: addrconf: Avoid calling netdevice notifiers with RCU read-side lock
Date: Wed, 15 Aug 2012 11:10:23 +0800	[thread overview]
Message-ID: <1345000223.29572.2.camel@cr0> (raw)
In-Reply-To: <1344970491.2690.8.camel@bwh-desktop.uk.solarflarecom.com>

On Tue, 2012-08-14 at 19:54 +0100, Ben Hutchings wrote:
> Cong Wang reports that lockdep detected suspicious RCU usage while
> enabling IPV6 forwarding:
> 
>  [ 1123.310275] ===============================
>  [ 1123.442202] [ INFO: suspicious RCU usage. ]
>  [ 1123.558207] 3.6.0-rc1+ #109 Not tainted
>  [ 1123.665204] -------------------------------
>  [ 1123.768254] include/linux/rcupdate.h:430 Illegal context switch in RCU read-side critical section!
>  [ 1123.992320]
>  [ 1123.992320] other info that might help us debug this:
>  [ 1123.992320]
>  [ 1124.307382]
>  [ 1124.307382] rcu_scheduler_active = 1, debug_locks = 0
>  [ 1124.522220] 2 locks held by sysctl/5710:
>  [ 1124.648364]  #0:  (rtnl_mutex){+.+.+.}, at: [<ffffffff81768498>] rtnl_trylock+0x15/0x17
>  [ 1124.882211]  #1:  (rcu_read_lock){.+.+.+}, at: [<ffffffff81871df8>] rcu_lock_acquire+0x0/0x29
>  [ 1125.085209]
>  [ 1125.085209] stack backtrace:
>  [ 1125.332213] Pid: 5710, comm: sysctl Not tainted 3.6.0-rc1+ #109
>  [ 1125.441291] Call Trace:
>  [ 1125.545281]  [<ffffffff8109d915>] lockdep_rcu_suspicious+0x109/0x112
>  [ 1125.667212]  [<ffffffff8107c240>] rcu_preempt_sleep_check+0x45/0x47
>  [ 1125.781838]  [<ffffffff8107c260>] __might_sleep+0x1e/0x19b
> [...]
>  [ 1127.445223]  [<ffffffff81757ac5>] call_netdevice_notifiers+0x4a/0x4f
> [...]
>  [ 1127.772188]  [<ffffffff8175e125>] dev_disable_lro+0x32/0x6b
>  [ 1127.885174]  [<ffffffff81872d26>] dev_forward_change+0x30/0xcb
>  [ 1128.013214]  [<ffffffff818738c4>] addrconf_forward_change+0x85/0xc5
> [...]
> 
> addrconf_forward_change() uses RCU iteration over the netdev list,
> which is unnecessary since it already holds the RTNL lock.  We also
> cannot reasonably require netdevice notifier functions not to sleep.
> 
> Reported-by: Cong Wang <amwang@redhat.com>
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>

Thanks for your patch, Ben!

      parent reply	other threads:[~2012-08-15  3:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14 10:28 [Patch] net: allow calling rtmsg_ifinfo() in atomic Cong Wang
2012-08-14 18:40 ` Ben Hutchings
2012-08-14 18:54 ` [PATCH net] ipv6: addrconf: Avoid calling netdevice notifiers with RCU read-side lock Ben Hutchings
2012-08-15  0:02   ` David Miller
2012-08-15  3:10   ` Cong Wang [this message]

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=1345000223.29572.2.camel@cr0 \
    --to=amwang@redhat.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gregory.v.rose@intel.com \
    --cc=john.r.fastabend@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /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).