On 07/09/2009 01:32 PM, Wolfgang Steinwender wrote:
[..] When I'm trying the hardware latency test (hwlatdetect.py) I'm getting the following messages: hwlat_detector: version 1.0.0 BUG: using smp_processor_id() in preemptible [00000000] code: hwlatdetect/3755 caller is debug_sample_fread+0x138/0x1ea [hwlat_detector] [..]
Does the attached patch help? Carsten.
Index: linux-2.6.29.5-rt22/drivers/misc/hwlat_detector.c =================================================================== --- linux-2.6.29.5-rt22.orig/drivers/misc/hwlat_detector.c +++ linux-2.6.29.5-rt22/drivers/misc/hwlat_detector.c @@ -191,17 +191,11 @@ static struct sample *buffer_get_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) {