[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 4/4] [Net] Support accelerated network plugin modules


  • To: "Kieran Mansley" <kmansley@xxxxxxxxxxxxxx>
  • From: "Zhu Han" <schumi.han@xxxxxxxxx>
  • Date: Fri, 15 Jun 2007 14:03:05 -0400
  • Cc: netdev@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, herbert@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 15 Jun 2007 11:01:05 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=h94vU8zCdX26o+U4bXcUcPvb5M+Z/kEMNQ+IRMBIY9e3KnwxQ738krg2+bXfX1TVoL32/V/LYXPqAqN9wCT1Qq1g4Obt3/ZEi76TlNpiFtjl6i/d4UXw2D8S0NY693g+FOdEDF/K9n7p5Hn7ECCgyUPq8GHWmtq3M1dDyjg4R+A=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

On 6/15/07, Kieran Mansley <kmansley@xxxxxxxxxxxxxx> wrote:

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.


If the hook routine blocks on the other code path instead of tx/rx
path,  why not use a simple atomic reference count. When the reference
count reachs zero, free it. Considering you can synchronzie on tx/rx
path, the free will not happen under the critical code path. So the
uninitialize work could be done inside the free routine even if it
blocks.

I think that RCU would only work in this situation if the hook functions
didn't block,.

I agree.


Kieran








--
best regards,
hanzhu

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.