public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: Frank Sorenson <frank@tuxrocks.com>
Cc: Andrew Morton <akpm@osdl.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Tim Schmielau <tim@physik3.uni-rostock.de>,
	George Anzinger <george@mvista.com>,
	albert@users.sourceforge.net,
	Ulrich Windl <ulrich.windl@rz.uni-regensburg.de>,
	Christoph Lameter <clameter@sgi.com>,
	Dominik Brodowski <linux@dominikbrodowski.de>,
	David Mosberger <davidm@hpl.hp.com>, Andi Kleen <ak@suse.de>,
	paulus@samba.org, schwidefsky@de.ibm.com,
	keith maanthey <kmannth@us.ibm.com>,
	Chris McDermott <lcm@us.ibm.com>, Max Asbock <masbock@us.ibm.com>,
	mahuja@us.ibm.com, Nishanth Aravamudan <nacc@us.ibm.com>,
	Darren Hart <darren@dvhart.com>,
	"Darrick J. Wong" <djwong@us.ibm.com>,
	Anton Blanchard <anton@samba.org>,
	donf@us.ibm.com, mpm@selenic.com, benh@kernel.crashing.org
Subject: Re: [PATCH 1/4] new timeofday core subsystem (v. B1)
Date: Tue, 07 Jun 2005 11:28:33 -0700	[thread overview]
Message-ID: <1118168914.3661.12.camel@leatherman> (raw)
In-Reply-To: <42A006E8.9000601@tuxrocks.com>

On Fri, 2005-06-03 at 01:29 -0600, Frank Sorenson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> john stultz wrote:
> > Andrew, All,
> > 	I'm just re-spinning this to resolve a conflict w/ the CPUFREQ changes
> > Linus accepted last night.
> <snip>
> 
> I have found an issue with these TOD subsystem patches, and I
> think it's only an issue on systems that use CPUFREQ.  Whenever
> the frequency changes, at least some portions of the kernel
> get confused about their notion of time.  Here are some
> example entries from my syslog:
> 
> Jun  3 00:33:40 moebius kernel: [  145.023201] cpufreq-core: target for CPU 0: 800000 kHz, relation 0
> Jun  3 00:33:47 moebius kernel: [  114.838909] cpufreq-core: target for CPU 0: 1000000 kHz, relation 0
> Jun  3 00:33:47 moebius kernel: [  114.838977] freq-table: request for target 1000000 kHz (relation: 0) for cpu 0
> Jun  3 00:33:47 moebius kernel: [   92.161872] codec_semaphore: semaphore is not ready [0x1][0x700300]
> Jun  3 00:33:52 moebius kernel: [   97.433279] cpufreq-core: target for CPU 0: 1200000 kHz, relation 0
> Jun  3 00:33:58 moebius kernel: [   66.352233] cpufreq-core: target for CPU 0: 1400000 kHz, relation 0
> Jun  3 00:34:08 moebius kernel: [   85.547260] cpufreq-core: target for CPU 0: 1200000 kHz, relation 0
> Jun  3 00:34:16 moebius kernel: [  211.791738] cpufreq-core: target for CPU 0: 800000 kHz, relation 0
> Jun  3 00:34:27 moebius kernel: [  112.941898] cpufreq-core: target for CPU 0: 1000000 kHz, relation 0
> Jun  3 00:34:31 moebius kernel: [  231.793121] cpufreq-core: target for CPU 0: 800000 kHz, relation 0
> Jun  3 00:34:41 moebius kernel: [  147.122593] cpufreq-core: target for CPU 0: 1200000 kHz, relation 0
> Jun  3 00:34:42 moebius kernel: [  123.906802] cpufreq-core: target for CPU 0: 1000000 kHz, relation 0
> Jun  3 00:34:46 moebius kernel: [  251.342116] cpufreq-core: target for CPU 0: 800000 kHz, relation 0
> Jun  3 00:34:51 moebius kernel: [  192.985214] cpufreq-core: target for CPU 0: 1000000 kHz, relation 0
> 
> The printk times are taken from sched_clock(), which now
> varies depending on the cpu frequency.  Without these patches,
> the printk times appear to consistently increase at the right rate.
> I'm not sure what other portions of the kernel are affected by
> this (watchdogs firing, or other issues?).

Hrm. So, I've been looking into this and I'm a bit stumped, as I'm not
really changing the behavior of sched_clock().

sched_clock() is a pretty bad interface as it just takes the current TSC
value (relative to zero) and scales it using the current cpukhz value
(well, indirectly using cycles_2_ns). Since it doesn't ever accumulate
the past time, frequency changes affect the full interval (since the TSC
was reset) which can cause large errors. The rational for this was that
sched_clock() was supposed to be as fast as possible just to give a
quick guide to the scheduler and occasional incorrect values are
acceptable. 

I'm looking further into it, but could you send me privately the dmesg
output for both with and without the TOD patch?

thanks
-john



      parent reply	other threads:[~2005-06-07 18:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-01 23:09 [PATCH 1/4] new timeofday core subsystem (v. B1) john stultz
2005-06-01 23:12 ` [PATCH 2/4] new timeofday i386 arch specific changes " john stultz
2005-06-01 23:13   ` [PATCH 3/4] new timeofday x86-64 " john stultz
2005-06-01 23:16     ` [PATCH 4/4] new timeofday i386 and x86-64 timesources " john stultz
2005-06-02  0:37     ` [PATCH 3/4] new timeofday x86-64 arch specific changes " Parag Warudkar
2005-06-02 17:34       ` john stultz
2005-06-02  1:08 ` [PATCH 1/4] new timeofday core subsystem " Frank Sorenson
2005-06-02 18:00   ` john stultz
2005-06-03  7:29 ` Frank Sorenson
2005-06-03 16:13   ` john stultz
2005-06-07 18:28   ` john stultz [this message]

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=1118168914.3661.12.camel@leatherman \
    --to=johnstul@us.ibm.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=albert@users.sourceforge.net \
    --cc=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=clameter@sgi.com \
    --cc=darren@dvhart.com \
    --cc=davidm@hpl.hp.com \
    --cc=djwong@us.ibm.com \
    --cc=donf@us.ibm.com \
    --cc=frank@tuxrocks.com \
    --cc=george@mvista.com \
    --cc=kmannth@us.ibm.com \
    --cc=lcm@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.de \
    --cc=mahuja@us.ibm.com \
    --cc=masbock@us.ibm.com \
    --cc=mpm@selenic.com \
    --cc=nacc@us.ibm.com \
    --cc=paulus@samba.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=tim@physik3.uni-rostock.de \
    --cc=ulrich.windl@rz.uni-regensburg.de \
    /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