public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: john stultz <johnstul@us.ibm.com>, Pavel Machek <pavel@ucw.cz>,
	Mikael Pettersson <mikpe@it.uu.se>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: [BUG] APM resume breakage from 2.6.18-rc1 clocksource changes
Date: Tue, 11 Jul 2006 13:07:05 +0200	[thread overview]
Message-ID: <1152616025.32107.151.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.64.0607111120310.12900@scrub.home>

Roman,

On Tue, 2006-07-11 at 11:29 +0200, Roman Zippel wrote:
> > It is not illusionary at all and we have to find a way to handle this.
> > 
> > Forcing time keeping to be bound on some interrupt handling is the wrong
> > design and in the way of tickless systems.
> 
> So what is the correct design?
> Especially for tickless system it's vital for precise timekeeping that the 
> timekeeping code knows what the timer interrupt code does.

Err. Why needs the time keeping code to know what the next timer event
will be ? The time keeping code must not care at all about it. And there
is nothing vital at all.

Time keeping code reads from a given source and does the necessary
adjustments when NTP is active. There is no relation to an interrupt
event at all. At the very end it boils down to a linear equation which
is recalculated at the synchronization points.

The timer interrupt itself is not a synchronization point.

At any synchronization point you store the current time as seen by the
time keeping code for reference and calculate the deviation from the
reference time line. Until the next synchronization point you apply the
recalculated correction to the readout and it does not matter at all
whether there are 0, 10 or 1000 timer interrupts between those points
and whether the delta between those interrupts is constant or not.

> > When there is a system where the time source is bound to an interrupt
> > event then the handling code for that time source has to cope with the
> > problem instead of enforcing this not generally valid scenario on
> > everything. We can of course add helpers into the generic part of the
> > time keeping code to make this easier.
> 
> I'm not sure I'm following, could you please illustrate with an example?

An example is time keeping via a periodic interrupt which does not allow
to readout intermediate values. Thats the only case where you want that
the increment of the internal time is as close as possible to the point
where the event happens. This is a property of this particular time
source not of the general time keeping code. If its necessary to have
some infrastructure for such cases in the generic code, I'm not
opposing. 

I'm just opposing the general tight coupling of the time keeping to
timer interrupts.

Vs. the original problem of resume ordering. It simply has to be
structured in a way that the essential fixups are done _before_ anything
uses the values. If this is not the case then we have to fix this
problem instead of proposing that time keeping has to be coupled to
timer interrupts.

> > The majority of machines has stand alone time sources and there is no
> > need to enforce artificial interrupt relations on them.
> 
> What do you mean with "artificial interrupt relations"?

Binding the time source to an interrupt event. There is no need to do so
at all when you have a continous clock source like TSC, pm_timer, PPC
incrementer, ... 

Why should the time keeping code care when the next interrupt goes off ?

> > Please accept that the "tick" is not the holy grail of Linux. We have
> > already way too much historic tick ballast all over the place, so we
> > really want to avoid that when we design replacement functionality.
> 
> What do you mean with the "holy grail" of "tick"?

Well, I have the feeling - maybe I misunderstand you - that your idea of
time keeping is affixed around the tight coupling of time keeping and
timer interrupt which is the tick in the current implementation.

	tglx



  reply	other threads:[~2006-07-11 11:04 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-09 23:52 [BUG] APM resume breakage from 2.6.18-rc1 clocksource changes Mikael Pettersson
2006-07-10  7:55 ` Pavel Machek
2006-07-10 17:58 ` john stultz
2006-07-10 18:08   ` Pavel Machek
2006-07-10 18:19     ` john stultz
2006-07-10 22:37     ` Roman Zippel
2006-07-10 22:50       ` john stultz
2006-07-10 22:59         ` Roman Zippel
2006-07-11  8:07           ` Thomas Gleixner
2006-07-11  9:29             ` Roman Zippel
2006-07-11 11:07               ` Thomas Gleixner [this message]
2006-07-11 23:31                 ` Roman Zippel
2006-07-12  0:42                   ` john stultz
2006-07-13 20:27                     ` Thomas Gleixner
2006-07-13 22:05                       ` john stultz
2006-07-14  6:56                         ` Thomas Gleixner
2006-07-16 15:52                         ` Roman Zippel
2006-07-16 15:50                       ` Roman Zippel
2006-07-16 16:09                         ` Thomas Gleixner
2006-07-16 16:15                           ` Roman Zippel
2006-07-10 23:17       ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2006-07-10 23:36 Mikael Pettersson
2006-07-09 23:53 Mikael Pettersson
2006-07-09 20:58 Mikael Pettersson
2006-07-09 21:20 ` john stultz
2006-07-09 21:31 ` Valdis.Kletnieks
2006-07-09 21:44 ` Pavel Machek
2006-07-09 22:51   ` Alan Cox

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=1152616025.32107.151.camel@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@it.uu.se \
    --cc=mingo@elte.hu \
    --cc=pavel@ucw.cz \
    --cc=zippel@linux-m68k.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