RE: [tip:tracing/hw-branch-tracing] tracing/hw-branch-tracing: convert bts-tracer mutex to a spinlock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>-----Original Message-----
>From: Ingo Molnar [mailto:mingo@xxxxxxx]
>Sent: Wednesday, February 25, 2009 10:58 AM
>To: Metzger, Markus T


>* Metzger, Markus T <markus.t.metzger@xxxxxxxxx> 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.

regards,
markus.

---------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen Germany
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456 Ust.-IdNr.
VAT Registration No.: DE129385895
Citibank Frankfurt (BLZ 502 109 00) 600119052

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux