udelay() broken for SMP cores?

Russell King - ARM Linux linux at arm.linux.org.uk
Wed Apr 21 03:22:43 EDT 2010


On Tue, Apr 20, 2010 at 11:43:23PM -0700, Saravana Kannan wrote:
>
>>> I looked at arch/arm/lib/delay.S and it looks like __udelay and
>>> __const_udelay won't work correctly for SMP cores. The code just uses
>>> the loops_per_jiffy variable instead of the per-CPU loops per jiffy data.
>>>
>>> Is anyone already working on a fix for that? If not, I can fix it up in
>>> a way that's hopefully palatable to the community.
>>
>
>> If you have case where individual CPUs are running at different speed and different
>> Tick rate then only this can make difference.
>
> Yes. I was talking about the case where the CPUs could be running at  
> different speeds.

We don't support that; if we did, we'd have to disable preempt for every
call to mdelay/udelay to ensure that the thread is locked to a particular
CPU.  I suspect that will (a) destroy RT scheduling preformance (b)
increase preempt latency to an undesirable extent.



More information about the linux-arm-kernel mailing list