lkml.org 
[lkml]   [2011]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: Q: perf_install_in_context/perf_event_enable are racy?
    From
    Date
    On Wed, 2011-01-26 at 20:33 +0100, Peter Zijlstra wrote:

    > Wouldn't something like the below cure things too?

    > +struct task_function_call {
    > + struct task_struct *p;
    > + void (*func)(void *info);
    > + void *info;
    > +};
    > +
    > +void task_function_trampoline(void *data)
    > +{
    > + struct task_function_call *tfc = data;
    > +
    > + if (this_rq()->curr != tfc->p)
    > + return;
    > +
    > + tfc->func(tfc->data);
    > +}

    tfc->info of course ;-)


    \
     
     \ /
      Last update: 2011-01-26 20:39    [W:2.358 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site