From: Jay Vosburgh <fubar@us.ibm.com>
To: Cong Wang <cwang@twopensource.com>
Cc: "Thomas Glanzmann" <thomas@glanzmann.de>,
"Eric Dumazet" <eric.dumazet@gmail.com>,
netdev <netdev@vger.kernel.org>,
"Veaceslav Falico" <vfalico@redhat.com>,
andy@greyhouse.net, "Jiří Pírko" <jiri@resnulli.us>,
"sfeldma@cumulusnetworks.com" <sfeldma@cumulusnetworks.com>
Subject: Re: RTNL: assertion failed at net/core/dev.c (4494) and RTNL: assertion failed at net/core/rtnetlink.c (940)
Date: Thu, 06 Feb 2014 14:33:03 -0800 [thread overview]
Message-ID: <31653.1391725983@death.nxdomain> (raw)
In-Reply-To: <CAHA+R7McuqYDshugsWcaeBbBsEg3QY59LiovYthcq6bH1fLTNg@mail.gmail.com>
Cong Wang <cwang@twopensource.com> wrote:
>On Thu, Feb 6, 2014 at 2:07 PM, Jay Vosburgh <fubar@us.ibm.com> wrote:
>> Jay Vosburgh <fubar@us.ibm.com> wrote:
>>
>>>Cong Wang <cwang@twopensource.com> wrote:
>>>
>>>
>>> That would eliminate the warning, but is suboptimal. Acquiring
>>>RTNL is not necessary on the vast majority of state machine runs
>>>(because no state changes take place, i.e., no ports are disabled or
>>>enabled). The above change would add 10 round trips per second to RTNL,
>>>which seems excessive.
>>>
>>> Also, we cannot unconditionally acquire RTNL in this function,
>>>as it would race with the call to cancel_delayed_work_sync from
>>>bond_close (via bond_work_cancel_all).
>
>OK.
>
>>
>> Thought of one more problem: we can't hold a regular lock while
>> calling rtmsg_ifinfo, as it may sleep in alloc_skb. The rtmsg_ifinfo
>> call has to be RTNL and nothing else.
>>
>
>s/GFP_KERNEL/GFP_ATOMIC/
Yah, that would help with extra locks, but not totally solve
things. I'm looking around, and seeing a number of other places that
will end up at one of these rtmsg_ifinfo calls with incorrect locking:
bond_ab_arp_probe calls via bond_set_slave_active_flags and
bond_set_slave_inactive_flags without RTNL.
bond_change_active_slave calls via bond_set_slave_inactive_flags
and bond_set_slave_active_flags with other locks held, and maybe without
RTNL; I'm not sure if bond_option_active_slave_set holds RTNL when it
calls bond_select_active_slave.
bond_open calls via bond_set_slave_active_flags and
bond_set_slave_inactive_flags with RTNL, but also with other locks held.
bond_loadbalance_arp_mon calls bond_set_active_slave and
bond_set_backup_slave without RTNL.
This is in addition to the cases in the 802.3ad code from
__enable_port and __disable_port calls.
-J
---
-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
next prev parent reply other threads:[~2014-02-06 22:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 20:51 RTNL: assertion failed at net/core/dev.c (4494) and RTNL: assertion failed at net/core/rtnetlink.c (940) Thomas Glanzmann
2014-02-06 21:40 ` Cong Wang
2014-02-06 21:48 ` Jay Vosburgh
2014-02-06 22:07 ` Jay Vosburgh
2014-02-06 22:12 ` Cong Wang
2014-02-06 22:33 ` Jay Vosburgh [this message]
2014-02-08 1:21 ` Jay Vosburgh
2014-02-08 1:43 ` Ding Tianhong
2014-02-06 21:45 ` Jay Vosburgh
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=31653.1391725983@death.nxdomain \
--to=fubar@us.ibm.com \
--cc=andy@greyhouse.net \
--cc=cwang@twopensource.com \
--cc=eric.dumazet@gmail.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=sfeldma@cumulusnetworks.com \
--cc=thomas@glanzmann.de \
--cc=vfalico@redhat.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 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.