netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: Jay Vosburgh <fubar@us.ibm.com>
Cc: Laurent Chavey <chavey@google.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Mikhail Markine <markine@google.com>,
	netdev@vger.kernel.org, bonding-devel@lists.sourceforge.net,
	Petri Gynther <pgynther@google.com>,
	David Miller <davem@davemloft.net>
Subject: Re: [Bonding-devel] [PATCH] bonding: cancel_delayed_work() -> cancel_delayed_work_sync()
Date: Thu, 17 Dec 2009 23:33:00 +0100	[thread overview]
Message-ID: <20091217223300.GB3491@ami.dom.local> (raw)
In-Reply-To: <20091217215823.GA3491@ami.dom.local>

On Thu, Dec 17, 2009 at 10:58:23PM +0100, Jarek Poplawski wrote:
> On Thu, Dec 17, 2009 at 01:40:29PM -0800, Jay Vosburgh wrote:
> > 	A less evil alternative would be to punt and reschedule the work
> > if the rtnl_trylock failed, e.g.,
> > 
> > 	if (bond_miimon_inspect(bond)) {
> > 		read_unlock(&bond->lock);
> > 		if (!rtnl_trylock()) {
> > 			queue_work(...);
> > 			return;
> > 		}
> > 
> > 		read_lock(&bond->lock);
> > 
> > 		bond_miimon_commit(bond);
> > 		[...]
> > 
> > 	I'm not sure what the usual contention level on rtnl is (and,
> > therefore, how often this will punt for the normal case that's not the
> > race we're trying to avoid here).
> 
> Even if there is not much contention there is usually a lot of work
> inside, so this looks most reasonable to me.

On the other hand, there could be considered other alternatives yet,
like separating these works with rtnl_lock, and killing them reliably
from some better place (after dev close).

Jarek P.

  reply	other threads:[~2009-12-17 22:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-17  0:28 [PATCH] bonding: cancel_delayed_work() -> cancel_delayed_work_sync() Mikhail Markine
2009-12-17  7:49 ` Jarek Poplawski
2009-12-17 13:36   ` Jarek Poplawski
2009-12-17 14:30     ` Johannes Berg
2009-12-17 16:12       ` [Bonding-devel] " Jay Vosburgh
2009-12-17 18:40         ` Jarek Poplawski
2009-12-17 18:49           ` Laurent Chavey
2009-12-17 19:37             ` Jay Vosburgh
2009-12-17 20:56               ` Jarek Poplawski
2009-12-17 21:16                 ` Jarek Poplawski
2009-12-17 21:40                 ` Jay Vosburgh
2009-12-17 21:58                   ` Jarek Poplawski
2009-12-17 22:33                     ` Jarek Poplawski [this message]
2009-12-17 21:25               ` Laurent Chavey
2009-12-17 21:31         ` Mikhail Markine

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=20091217223300.GB3491@ami.dom.local \
    --to=jarkao2@gmail.com \
    --cc=bonding-devel@lists.sourceforge.net \
    --cc=chavey@google.com \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=johannes@sipsolutions.net \
    --cc=markine@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pgynther@google.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 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).