|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] [PATCH 4/4] [Net] Support accelerated network plugin mod
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
|
|
|
|
|