lkml.org 
[lkml]   [2008]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 1/3] performance counters: core code

* Paul Mackerras <paulus@samba.org> wrote:

> Thomas Gleixner writes:
>
> > +static void
> > +perf_install_in_context(struct perf_counter_context *ctx,
> > + struct perf_counter *counter,
> > + int cpu)
> > +{
> > + struct task_struct *task = ctx->task;
> > +
>
> [...]
>
> > + if (task) {
> > + task_oncpu_function_call(task, __perf_install_in_context,
> > + counter);
> > + } else {
> > + smp_call_function_single(cpu, __perf_install_in_context,
> > + counter, 1);
> > + }
>
> What happens if we send an IPI to the cpu where the task is running,
> but by the time the IPI arrives, the task has been migrated to another
> cpu and is now running there? Do you chase after it and send another
> IPI to its new cpu, or is there some reason why it can't migrate? If
> it's the former, where is that code? I haven't seen it so far (at
> least, task_oncpu_function_call doesn't seem to do it).

in that case the schedule-in method will install the perf counter
automatically. No need to chase after it. The smp call is only for the
case where the task does not schedule at all.

Ingo


\
 
 \ /
  Last update: 2008-12-05 12:23    [W:0.106 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site