From d43c416df42cc3f93f75e897559de06040b81144 Mon Sep 17 00:00:00 2001 From: Carsten Emde 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 Signed-off-by: Thomas Gleixner Signed-off-by: Paul Gortmaker --- drivers/misc/hwlat_detector.c | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-) 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.0.4