Messages in this thread | | | From | Rusty Russell <> | Subject | Re: [PATCH] Module : call synchronize_sched() between module exit() and free. | Date | Thu, 31 Jul 2008 10:54:33 +1000 |
| |
On Thursday 31 July 2008 00:09:38 Mathieu Desnoyers wrote: > * Frank Ch. Eigler (fche@redhat.com) wrote: > >(Would it not be desirable for an active marker to cause > > module-foo's refcount to increase, so as to prevent unloading at this > > time?) > > No, because I want to be able to unload the marked module and I don't > want the fact that a probe is connected to it to change that.
Also you might want to put a marker in the module's exit code.
> Actually there is a detail missing here. Your teardown should be : > teardown() { ... marker_probe_unregister ("foo" , ..., &foo_handler ); > synchronize_sched(); /* Before returning from exit */ } > > This makes sure that every live marker call are finished and that it is > safe to unload module-bar (the probe).
Perhaps create a synchronize_marker_unregister() wrapper for such uses; it's better documentation and the caller doesn't have to know exactly how it works...
Cheers, Rusty.
| |