netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Andy Gospodarek <andy@greyhouse.net>
Cc: fubar@us.ibm.com, netdev@vger.kernel.org
Subject: Re: [PATCH 1/1] bonding: eliminate RTNL assertion spew
Date: Tue, 9 Jan 2007 15:09:35 -0800	[thread overview]
Message-ID: <20070109150935.6ec3ce69@localhost> (raw)
In-Reply-To: <20070109225900.GA11755@gospo.rdu.redhat.com>

On Tue, 9 Jan 2007 17:59:01 -0500
Andy Gospodarek <andy@greyhouse.net> wrote:

> 
> These changes eliminate the messages indicating that the rtnetlink lock
> isn't held when bonding tries to change the MAC address of an interface.
> These calls generally come from timer-pops, but also from sysfs events
> since neither hold the rtnl lock.  
> 
> The spew generally looks something like this:
> 
> RTNL: assertion failed at net/core/fib_rules.c (391)
>  [<c028d12e>] fib_rules_event+0x3a/0xeb
>  [<c02da576>] notifier_call_chain+0x19/0x29
>  [<c0280ce6>] dev_set_mac_address+0x46/0x4b
>  [<f8a2a686>] alb_set_slave_mac_addr+0x5d/0x88 [bonding]
>  [<f8a2aa7e>] alb_swap_mac_addr+0x88/0x134 [bonding]
>  [<f8a25ed9>] bond_change_active_slave+0x1a1/0x2c5 [bonding]
>  [<f8a262e8>] bond_select_active_slave+0xa8/0xe1 [bonding]
>  [<f8a27ecb>] bond_mii_monitor+0x3af/0x3fd [bonding]
>  [<c0121896>] run_workqueue+0x85/0xc5
>  [<f8a27b1c>] bond_mii_monitor+0x0/0x3fd [bonding]
>  [<c0121d83>] worker_thread+0xe8/0x119
>  [<c0111179>] default_wake_function+0x0/0xc
>  [<c0121c9b>] worker_thread+0x0/0x119
>  [<c0124099>] kthread+0xad/0xd8
>  [<c0123fec>] kthread+0x0/0xd8
>  .....
> 
> This patch was mostly inspired from parts of some potential bonding
> updates Jay Vosburgh <fubar@us.ibm.com> and I discussed in December, so
> he deserves most of the credit for the idea.
> 
> I've tested it on several systems and it works as I expect.  Deadlocks
> between the rtnl and global bond lock are avoided since we drop the
> global bond lock before taking the rtnl lock.
> 


This seems like the ugly way to do it. Couldn't you just change figure out
how to acquire RTNL first. It wouldn't hurt to acquire it in the monitor
routine even if you don't need it.

Conditional locking is a bad road to start down.

  reply	other threads:[~2007-01-09 23:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-09 22:59 [PATCH 1/1] bonding: eliminate RTNL assertion spew Andy Gospodarek
2007-01-09 23:09 ` Stephen Hemminger [this message]
2007-01-10 19:33   ` Andy Gospodarek
2007-01-10 19:53     ` Stephen Hemminger
2007-08-15  3:14     ` Mike Snitzer
2007-08-15  3:27       ` Andy Gospodarek
2007-08-15 18:36         ` Mike Snitzer
2007-08-15 19:15           ` Jay Vosburgh
2007-01-09 23:13 ` Jeff Garzik
2007-01-09 23:34   ` Andy Gospodarek

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=20070109150935.6ec3ce69@localhost \
    --to=shemminger@osdl.org \
    --cc=andy@greyhouse.net \
    --cc=fubar@us.ibm.com \
    --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 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).