lkml.org 
[lkml]   [2009]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tracing/profile: Fix profile_disable vs module_unload

On Mon, 24 Aug 2009, Peter Zijlstra wrote:
> > > > >
> > > > >
> > > > > Hrmm, feel fragile, why don't we check if all a modules tracepoints are
> > > > > unused on unload?
> > > > >
> > > >
> > > > I don't think it's fragile. We are profiling via a module's
> > > > tracepoint, so we should pin the module, via module_get().
> > > > If event->profile_enable() has been calld, we should make
> > > > sure it's profile_disable() will be called.
> > >
> > > What I call fragile is that everyone registering a tracepoint
> > > callback will now apparently need to worry about modules, _that_
> > > is fragile.
> > >
> > > Either make module unload look at tracepoint users, or place the
> > > try_get_module() in the registration hooks so that regular users
> > > don't need to worry about it.
> >
> > The bug found by Li needs to be fixed obviously.
> >
> > I tend to agree with you that this does not appear to be the best
> > place to do it: so you suggest to implicitly increase the module
> > refcount on callback registr instead? (and releasing it when
> > unregistering)
> >
> > Same end result, slightly cleaner place to bump the refcount.
>
> Yes, because the user of tracepoints should never need to care about
> modules.

I also agree with Peter on this.

-- Steve



\
 
 \ /
  Last update: 2009-08-24 18:17    [W:0.090 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site