diff options
author | Carsten Emde <C.Emde@osadl.org> | 2010-01-16 11:14:04 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-02-21 14:20:12 -0500 |
commit | b635a77f9aadc5ed3fc5a949e3f219c24cdd254c (patch) | |
tree | 41624bc93087ed7308930dc13329d75889d5581f /drivers/misc/hwlat_detector.c | |
parent | 1954630a0637ad1ec2dcfe0324a36cd243f018ee (diff) |
hwlat_detector-avoid-smp_processor_id.patch
Avoid smp_processor_id() in preemptible code.
Signed-off-by: Carsten Emde <C.Emde@osadl.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/misc/hwlat_detector.c')
-rw-r--r-- | 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 d9549e9b58f4..953783c983dd 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) | |||
191 | if (!sample) | 191 | if (!sample) |
192 | return NULL; | 192 | return NULL; |
193 | 193 | ||
194 | /* ring_buffers are per-cpu but we just want any value */ | ||
195 | /* so we'll start with this cpu and try others if not */ | ||
196 | /* Steven is planning to add a generic mechanism */ | ||
197 | mutex_lock(&ring_buffer_mutex); | 194 | mutex_lock(&ring_buffer_mutex); |
198 | e = ring_buffer_consume(ring_buffer, smp_processor_id(), NULL); | 195 | for_each_online_cpu(cpu) { |
199 | if (!e) { | 196 | e = ring_buffer_consume(ring_buffer, cpu, NULL); |
200 | for_each_online_cpu(cpu) { | 197 | if (e) |
201 | e = ring_buffer_consume(ring_buffer, cpu, NULL); | 198 | break; |
202 | if (e) | ||
203 | break; | ||
204 | } | ||
205 | } | 199 | } |
206 | 200 | ||
207 | if (e) { | 201 | if (e) { |