lkml.org 
[lkml]   [2009]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:tracing/hw-branch-tracing] tracing/hw-branch-tracing: convert bts-tracer mutex to a spinlock

* Metzger, Markus T <markus.t.metzger@intel.com> wrote:

> >-----Original Message-----
> >From: Ingo Molnar [mailto:mingo@elte.hu]
> >Sent: Wednesday, February 25, 2009 10:58 AM
> >To: Metzger, Markus T
>
>
> >* Metzger, Markus T <markus.t.metzger@intel.com> wrote:
> >
> >> > static void trace_bts_prepare(struct trace_iterator *iter)
> >> > {
> >> >- mutex_lock(&bts_tracer_mutex);
> >> >+ spin_lock(&bts_tracer_lock);
> >> >
> >> > on_each_cpu(trace_bts_cpu, iter->tr, 1);
> >> >
> >> >- mutex_unlock(&bts_tracer_mutex);
> >> >+ spin_unlock(&bts_tracer_lock);
> >> > }
> >>
> >> Whereas start/stop are relatively fast, the above operation is
> >> rather expensive. Would it make sense to use
> >> schedule_on_each_cpu() instead of on_each_cpu()?
> >
> >it's perfectly fine to do that on_each_cpu() under the spinlock.
> >schedule_on_each_cpu() would likely be more expensive - and for
> >no good reason.
>
> OK.
>
> And I assume you like the spinlock better than the
> get/put_online_cpus(), as well.

yeah - and get/put_online_cpus is sleepable too, so it doesnt
really help unless i'm missing something ...

Ingo


\
 
 \ /
  Last update: 2009-02-25 12:13    [W:0.089 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site