Re: [PATCH] Module : call synchronize_sched() between module exit() and free.

From: Rusty Russell
Date: Wed Jul 30 2008 - 20:54:51 EST


On Thursday 31 July 2008 00:09:38 Mathieu Desnoyers wrote:
> * Frank Ch. Eigler (fche@xxxxxxxxxx) 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/