Re: CPUfreq - udelay() interaction issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 22 April 2010 11:22:20 pm Saravana Kannan wrote:
> Dave, Venkatesh and other maintainers,
>
> Any comments?
>From adjust_jiffies in cpufreq.c:
 * adjust_jiffies - adjust the system "loops_per_jiffy"
 *
 * This function alters the system "loops_per_jiffy" for the clock
 * speed change. Note that loops_per_jiffy cannot be updated on SMP
 * systems as each CPU might be scaled differently. So, use the arch
 * per-CPU loops_per_jiffy value wherever possible.
For SMP case adjust_jiffies is just empty.

udelay on x86 uses the per cpu loops_per_jiffy:
cpu_data(raw_smp_processor_id()).loops_per_jiffy

which does not get adjusted via adjust_jiffies()

For me it looks as udelay is always wrong and sleeps too long
on lower frequencies, but I may oversee something.

It shouldn't be that hard to test this with a tiny test module
which is measuring real udelay sleep times via tsc reads on a x86 machine
with stable tsc. Doing that in a loop, print out the diff to how long
it should have slept and doing that under lowered freq or whatever bad
circumstances, should show worst cases after some time.

   Thomas
--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Devel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Forum]     [Linux SCSI]

  Powered by Linux