All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <andi@firstfloor.org>,
	Karsten Wiese <fzu@wemgehoertderstaat.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: set_cyc2ns_scale() remove tsc_now and ns_now
Date: Fri, 11 Apr 2008 10:06:17 +0200	[thread overview]
Message-ID: <20080411080617.GP10019@one.firstfloor.org> (raw)
In-Reply-To: <20080411075554.GA6834@elte.hu>

On Fri, Apr 11, 2008 at 09:55:54AM +0200, Ingo Molnar wrote:
> 
> * Andi Kleen <andi@firstfloor.org> wrote:
> 
> > (actually it is still the wrong time -- really needs a grace period 
> > during which the TSC is not used 
> > ftp://firstfloor.org/pub/ak/quilt/patches/sched-clock implemented some 
> > of these ideas against an older kernel)
> 
> recent CPUs have constant-freq TSCs so it's mostly a legacy issue, but 

Actually there millions of non constant freq TSC CPUs shipped each
quarter ... 

> we dont really have to worry about complications like grace periods - 
> higher layers in the scheduler protect against temporary sched_clock() 
> outliers.

But you still get scheduling hickups even with the sanity check. If the 
scheduler depends on a smooth time that is not good and my (admittedly much less 
than yours) understanding of CFS is that it relies on that. Especially ondemand 
can cause quite a lot of cpufreq changes on some workloads.

> So i think this can all be done much simpler. Just get rid of 
> the global cpu_khz notion, sched_clock() should simply follow the ->freq 
> value - and that's it.

At some point you have to generate an offset to something and that
offset must be different for different frequencies, otherwise
you get large systematic errors

(<imagine complicated mathematical proof why this is so, but it should
be fairly obvious>)

-Andi


  reply	other threads:[~2008-04-11  8:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-10 21:31 [PATCH] x86: set_cyc2ns_scale() remove tsc_now and ns_now Karsten Wiese
2008-04-11  7:42 ` Andi Kleen
2008-04-11  7:55   ` Ingo Molnar
2008-04-11  8:06     ` Andi Kleen [this message]
2008-04-11  8:25       ` Guillaume Chazarain
2008-04-11  8:40         ` Andi Kleen

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=20080411080617.GP10019@one.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=fzu@wemgehoertderstaat.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.