From: Ryan Harper <ryanh@us.ibm.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: Kip Macy <kip.macy@gmail.com>, xen-devel@lists.xensource.com
Subject: Re: [PATCH] patches: workaround for br_del_if race
Date: Fri, 19 Aug 2005 11:46:29 -0500 [thread overview]
Message-ID: <20050819164629.GA5523@us.ibm.com> (raw)
In-Reply-To: <444f954bea7fae40ba1d737b7f488bb2@cl.cam.ac.uk>
* Keir Fraser <Keir.Fraser@cl.cam.ac.uk> [2005-08-19 07:37]:
>
> On 18 Aug 2005, at 22:01, Ryan Harper wrote:
>
> >This patch provides a workaround for bugzilla #90 which shows up far
> >too
> >often when creating and then destroying lots of domUs and dom0 is SMP.
> >Details are in the [1]bug. With this patch, I now can create/destroy
> >domains in a tight loop for hours where previously every 3 to 10 cycles
> >would blow up.
>
> Please also submit this to the Ethernet bridge maintainer. Details are
> in the Linux MAINTAINERS file.
I've had a little discussion on [1]netdev about this but since this
isn't the proper fix I'm doing some more digging.
The real race is between when a call_rcu() callback runs and when the
netif_destroy() calls unregister_netdev().
When we get an oops, the brctl delif IOCTL has run, and br_del_if() has
been called setting the port state to DISABLED, and then queues up an
rcu callback, destroy_npb(), which will set dev->br_port = NULL.
add_del_if() // IOCTL handler from brctl delif
// xen-br0 $VIF
br_del_if()
del_nbp()
br_stp_disable_port() // Set port->state = BR_STATE_DISABLED
call_rcu(destroy_nbp_rcu) // setup rcu callback to run
// destory_nbp() which will set
// dev->br_port = NULL
After the xen scripts have called the brctl command, xend sends the
disconnect and destroy control messages, which trigger:
netif_destroy()
unregister_netdev()
unregister_netdevice()
notify_call_chain(NETDEV_UNREGISTER)
br_device_event() // The first thing done here is to check
// the device's br_port to see if it is
// NULL
If the destory_nbp_rcu() callback isn't fired before br_device_event()
checks dev->br_port, then the NULL check fails and a second call to
br_del_if() is invoked and we blow up in sysfs/kobject BUG_ON() for ref
counts of dentrys. [2]
Before I go back to netdev, I wanted to check if there is anything we
should be doing to be more defensive or does this seem to be something
the bridge code should handle (error out, whatever)?
1. http://oss.sgi.com/archives/netdev/2005-08/msg00097.html
2. Routines are in linux/net/bridge/{br_if.c, br_ioctl.c, br_notify.c}
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253 T/L: 678-9253
ryanh@us.ibm.com
next prev parent reply other threads:[~2005-08-19 16:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-18 21:01 [PATCH] patches: workaround for br_del_if race Ryan Harper
2005-08-19 8:34 ` Keir Fraser
2005-08-19 16:46 ` Ryan Harper [this message]
2005-08-19 18:54 ` [PATCH] scripts, patches: remove workaround, skip brtcl delif Ryan Harper
2005-08-20 9:34 ` Keir Fraser
2005-08-20 9:21 ` [PATCH] patches: workaround for br_del_if race Keir Fraser
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=20050819164629.GA5523@us.ibm.com \
--to=ryanh@us.ibm.com \
--cc=Keir.Fraser@cl.cam.ac.uk \
--cc=kip.macy@gmail.com \
--cc=xen-devel@lists.xensource.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.