Skip to contentSkip to conversation

boot_cpu_data vs current_cpu_data in voluntary-preempt-2.6.9-rc2-mm1-S1

DISCUSSION Dominik Brodowski 2 participants 2 messages Sep 19, 2004

lore
Share & tools
lore
#0 lore raw

Ingo,

Your voluntary-preempt-2.6.9-rc2-mm1-S1 patch contains this change

@@ -34,7 +34,7 @@ inline void __const_udelay(unsigned long
xloops *= 4;
__asm__("mull %0"
:"=d" (xloops), "=&a" (d0)
- :"1" (xloops),"0" (current_cpu_data.loops_per_jiffy *
(HZ/4)));

+		:"1" (xloops),"0" (boot_cpu_data.loops_per_jiffy * (HZ/4)));
         __delay(++xloops);

}

for both x86 and x86_64. And it's wrong. It assumes loops_per_jiffy being consistent on all CPUs. There _are_ asymetric multiprocessor systems out there, and some SMP systems can become asymetric as soon as frequency scaling is enabled. Using boot_cpu_data's loops_per_jiffy instead of current_cpu_data's loops_per_jiffy causes delays being too short or too long. So please drop this change.

Thanks,
Dominik

#1 lore raw

Review inline void __const_udelay(unsigned long · line 38

Quoted 9 lines · Dominik Brodowski

Your voluntary-preempt-2.6.9-rc2-mm1-S1 patch contains this change

(quoted diff) +1 -1
@@ -34,7 +34,7 @@ inline void __const_udelay(unsigned long
 	xloops *= 4;
 	__asm__("mull %0"
 		:"=d" (xloops), "=&a" (d0)
-		:"1" (xloops),"0" (current_cpu_data.loops_per_jiffy *
 (HZ/4)));
+		:"1" (xloops),"0" (boot_cpu_data.loops_per_jiffy * (HZ/4)));

this comes from the BKL patch - this is done to avoid false positives in the smp_processor_id() debugger.

Ingo