linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: Saravana Kannan <skannan@codeaurora.org>
Cc: cpufreq <cpufreq@vger.kernel.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>
Subject: Re: CPUfreq - udelay() interaction issues
Date: Fri, 23 Apr 2010 01:18:31 +0200	[thread overview]
Message-ID: <201004230118.32147.trenn@suse.de> (raw)
In-Reply-To: <4BD0BE0C.3010709@codeaurora.org>

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

  reply	other threads:[~2010-04-22 23:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-22  3:34 CPUfreq - udelay() interaction issues Saravana Kannan
2010-04-22 21:22 ` Saravana Kannan
2010-04-22 23:18   ` Thomas Renninger [this message]
2010-04-22 23:37     ` Saravana Kannan
2010-04-22 23:21 ` Saravana Kannan
2010-04-23 18:40   ` Mathieu Desnoyers
2010-04-23 19:22     ` Arjan van de Ven
2010-04-23 19:55       ` Mathieu Desnoyers
2010-04-24 18:56         ` Arjan van de Ven
2010-04-24 21:00           ` Mathieu Desnoyers
2010-04-24 23:20             ` Arjan van de Ven
2010-04-24  2:57       ` Saravana Kannan
2010-04-24  2:49     ` Saravana Kannan
2010-04-24  5:56       ` Pavel Machek
2010-04-24 13:58       ` Mathieu Desnoyers
2010-04-27 23:41         ` Saravana Kannan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201004230118.32147.trenn@suse.de \
    --to=trenn@suse.de \
    --cc=cpufreq@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=skannan@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).