blob: bf4129807fae3d7c311936128c4e030581560748 [file] [log] [blame]
From b635a77f9aadc5ed3fc5a949e3f219c24cdd254c Mon Sep 17 00:00:00 2001
From: Carsten Emde <C.Emde@osadl.org>
Date: Sat, 16 Jan 2010 17:14:04 +0100
Subject: [PATCH] hwlat_detector-avoid-smp_processor_id.patch
commit b635a77f9aadc5ed3fc5a949e3f219c24cdd254c in tip.
Avoid smp_processor_id() in preemptible code.
Signed-off-by: Carsten Emde <C.Emde@osadl.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
diff --git a/drivers/misc/hwlat_detector.c b/drivers/misc/hwlat_detector.c
index d9549e9..953783c 100644
--- a/drivers/misc/hwlat_detector.c
+++ b/drivers/misc/hwlat_detector.c
@@ -191,17 +191,11 @@ static struct sample *buffer_get_sample(struct sample *sample)
if (!sample)
return NULL;
- /* ring_buffers are per-cpu but we just want any value */
- /* so we'll start with this cpu and try others if not */
- /* Steven is planning to add a generic mechanism */
mutex_lock(&ring_buffer_mutex);
- e = ring_buffer_consume(ring_buffer, smp_processor_id(), NULL);
- if (!e) {
- for_each_online_cpu(cpu) {
- e = ring_buffer_consume(ring_buffer, cpu, NULL);
- if (e)
- break;
- }
+ for_each_online_cpu(cpu) {
+ e = ring_buffer_consume(ring_buffer, cpu, NULL);
+ if (e)
+ break;
}
if (e) {
--
1.7.1.1