[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4e777ed10706151103w35ae4acv149d82aba0b59775@mail.gmail.com>
Date: Fri, 15 Jun 2007 14:03:05 -0400
From: "Zhu Han" <schumi.han@...il.com>
To: "Kieran Mansley" <kmansley@...arflare.com>
Cc: xen-devel@...ts.xensource.com, netdev@...r.kernel.org,
herbert@...dor.apana.org.au
Subject: Re: [Xen-devel] [PATCH 4/4] [Net] Support accelerated network plugin modules
On 6/15/07, Kieran Mansley <kmansley@...arflare.com> 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
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists