netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kieran Mansley <kmansley@solarflare.com>
To: Zhu Han <schumi.han@gmail.com>
Cc: netdev@vger.kernel.org, xen-devel@lists.xensource.com,
	herbert@gondor.apana.org.au
Subject: Re: [PATCH 4/4] [Net] Support accelerated network plugin modules
Date: Fri, 15 Jun 2007 17:22:43 +0100	[thread overview]
Message-ID: <1181924563.4121.94.camel@moonstone.uk.level5networks.com> (raw)
In-Reply-To: <4e777ed10706150859r3b6e1617o3b31e5e24a30e6c9@mail.gmail.com>

On Fri, 2007-06-15 at 11:59 -0400, Zhu Han wrote:
> Hi, Kieran,
> 
> I'm just wonder why you try to acquire the lock and increase the
> hooks_usecount each time when you use the hook routine. Is there any
> generic ways to synchronze the code path using hook routines and
> netfront_accelerator_unloaded, considering you can synchronize the
> tx/rx data path easily.

The lock protects the use_count variable.  The use_count variable
prevents the plugin module unloading while it is being used.  I couldn't
just use the lock to prevent the module unloading as the hook function
(i) might block (and holding a spin_lock would be rather antisocial)
(ii) might call back into netfront and try to take the lock again, which
would deadlock.

The data path hooks do not block, and are already protected by locks, so
these are also taken when trying to unload the plugin module.  For this
reason it's not necessary to use the hooks_usecount on the data path.

I think that RCU would only work in this situation if the hook functions
didn't block, and wouldn't affect the data path locking overhead as it
wouldn't be necessary there.  

Kieran

  parent reply	other threads:[~2007-06-15 16:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-15 10:46 [PATCH 4/4] [Net] Support accelerated network plugin modules Kieran Mansley
2007-06-15 15:59 ` Zhu Han
2007-06-15 16:06   ` [Xen-devel] " Stephen Hemminger
2007-06-15 16:22   ` Kieran Mansley [this message]
2007-06-15 16:31     ` Keir Fraser
2007-06-15 18:03     ` Zhu Han
2007-06-18 15:31       ` [Xen-devel] " Kieran Mansley
  -- strict thread matches above, loose matches on Subject: below --
2007-06-21 13:17 Kieran Mansley

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=1181924563.4121.94.camel@moonstone.uk.level5networks.com \
    --to=kmansley@solarflare.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=schumi.han@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 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).