lkml.org 
[lkml]   [2008]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: enable preemption in delay


On Sun, 25 May 2008, Pavel Machek wrote:
> > + if (unlikely(cpu != smp_processor_id())) {
> > + if (loops <= TSC_MIGRATE_COUNT)
> > + break;
> > + cpu = smp_processor_id();
> > + rdtscl(bclock);
> > + loops -= TSC_MIGRATE_COUNT;
> > + } else {
> > + rdtscl(now);
> > + if ((now - bclock) >= loops)
> > + break;
> > + loops -= (now - bclock);
> > + bclock = now;
>
> What happens with different cpus running on different frequencies...?
> Cpufreq?

It's not even protected with the old code.

inline void __const_udelay(unsigned long xloops)
{
__delay(((xloops * HZ *
cpu_data(raw_smp_processor_id()).loops_per_jiffy) >> 32) + 1);
}

Here it calculates the loops_per_jiffy for the CPU and calls into __delay.
But it can easily be preempted here and the delay could run on another
CPU.

-- Steve



\
 
 \ /
  Last update: 2008-05-28 15:05    [W:0.700 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site