public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: tglx@timesys.com, LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>, john stultz <johnstul@us.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCHSET] Announce: High-res timers, tickless/dyntick and dynamic  HZ
Date: Tue, 20 Jun 2006 00:03:25 +1000	[thread overview]
Message-ID: <200606200003.26008.kernel@kolivas.org> (raw)
In-Reply-To: <20060619122606.GA19451@elte.hu>

On Monday 19 June 2006 22:26, Ingo Molnar wrote:
> * Con Kolivas <kernel@kolivas.org> wrote:
> > One of the problems we enountered with dynticks was that using the
> > higher resolution timers such as TSC and HPET to adjust for timer
> > ticks over longer periods when skipping ticks made the overall clock
> > drift when run for many days and only the PM Timer was not prone to
> > this happening. ie the timers were very accurate for short periods but
> > over days it would drift. It could well have been a design flaw in the
> > dynticks I was maintaining rather than the timers themselves but have
> > you checked that this isn't a problem?
>
> not yet. If it's a real problem we could introduce a 'make clock events
> more reliable' framework by doing something like always programming
> clock event sources into periodic mode and reading their current time
> offset [if possible] when the event is processesed (thus compensating
> for most of the drift caused by irq processing latency). But if it's not
> needed it would be nice to avoid that complexity. I'm also wondering why
> the PM timer was the most accurate in that regard - it's almost as slow
> to program as the PIT, so i'd have expected it to to show the biggest
> drift.
>
> (another technique to reduce drift: we could increase the APIC-priority
> of the lapic timer, making it less suspect to drift when there are lots
> of other IRQs going on.)

Better to wait and see if it was an artefact of my dodgy code for recover 
walltime and if this code doesn't have that issue.

> can you think of any other similar 'weird cases' that you saw happen
> with dynticks? For example there's the 'APIC stops timer irqs when
> entering C3 mode' bug - any similar weirdness we should be careful
> about? [right now the patch doesnt handle the C3 mode bug, but it should
> be relatively straightforward to blacklist lapic events in that case]

The hardware that also did C4 was more troublesome but for the same reasons 
since it's a subset of C3. See Dominik's patches mentioned below which 
address these high state transitions. There isn't anything else offhand I can 
think of that I actually managed to track down :|

> i'm looking at dynticks-060227.patch right now, and there seem to be a
> fair amount of dyntick specific changes to ACPI's processor_idle.c code.
> Do you remember what those changes were about and should we pick them up
> in one way or another?

Dominik donated a lot of code to use the dynticks infrastructure to actually 
implement the power savings. Just skipping ticks seemed to make very little 
power difference unless we also used the knowledge from next timer interrupt 
to know how long we are going to be idle and choose C state transitions 
accordingly. Each patch is documented at length in the split out

C-States-1_bm_activity_improvements.patch
C-States-2_bm_activity_handling_improvement.patch
C-States-3_accounting_of_sleep_times.patch
C-States-4_dyn-ticks_tweaks.patch

http://ck.kolivas.org/patches/dyn-ticks/split-out/

> > The other thing I note is that there is a reasonable amount of
> > indirection in fairly hot paths. It looks like there is scope for more
> > local variable storage of these indirect calls. [...]
>
> which function(s) were you looking at when coming to this conclusion?
> clockevents_init_next_event() perhaps? [we could certainly put
> 'sources->nextevent' into a local variable there]

>From what I could see

hrtimer_restart_sched_tick() could use
struct hrtimer *sched_timer = &cpu_base->sched_timer;

clockevents_init_next_event() and clockevents_set_next_event() could use
struct clock_event *nextevt = sources->nextevt;

> > [...] Also if set_next_event is separated from struct clock_event, the
> > whole struct looks like a suitable candidate for __read_mostly.
>
> You mean ->event_handler()? We can make all clockevent instantiations
> __read_mostly right now - all of the fields of clock_event are static,
> even ->event_handler() will change at most once per bootup [when we
> switch from low-res into high-res mode].

Great, thanks!

-- 
-ck

  reply	other threads:[~2006-06-19 14:05 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-18 15:10 [PATCHSET] Announce: High-res timers, tickless/dyntick and dynamic HZ Thomas Gleixner
2006-06-18 16:35 ` Michal Piotrowski
2006-06-18 18:28   ` Ingo Molnar
2006-06-19 16:35     ` Michal Piotrowski
2006-06-19 19:51       ` Thomas Gleixner
2006-06-25 13:06         ` Steven Rostedt
2006-06-25 14:26           ` Thomas Gleixner
2006-06-18 19:50   ` Thomas Gleixner
2006-06-19 12:09     ` Con Kolivas
2006-06-19 12:31       ` Thomas Gleixner
2006-06-19 13:05         ` Con Kolivas
2006-06-19 13:10           ` Thomas Gleixner
2006-06-19 21:58         ` mark gross
2006-06-19 22:19           ` Thomas Gleixner
2006-06-21 12:54             ` Felix Oxley
2006-06-21 13:07               ` Thomas Gleixner
2006-06-18 23:47 ` Roman Zippel
2006-06-19 12:50   ` Ingo Molnar
2006-06-19 13:47     ` Roman Zippel
2006-06-19  5:21 ` Con Kolivas
2006-06-19  5:24   ` Con Kolivas
2006-06-19 12:26   ` Ingo Molnar
2006-06-19 14:03     ` Con Kolivas [this message]
2006-06-19 20:06       ` Thomas Gleixner
2006-06-19 20:57         ` ACPI C-States algorithm updates for dyn-tick Dominik Brodowski
2006-06-19 21:28           ` [1/4] ACPI C-States: accounting of sleep states Dominik Brodowski
2006-06-19 21:29             ` [2/4] ACPI C-States: bm_activity improvements Dominik Brodowski
2006-06-19 21:31               ` [3/4] ACPI C-States: only demote on current bus mastering activity Dominik Brodowski
2006-06-19 21:33                 ` [4/4 -- only for discussion] ACPI C-States: dyn-ticks-improvements (for -ck implementation) Dominik Brodowski

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=200606200003.26008.kernel@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=akpm@osdl.org \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=tglx@timesys.com \
    /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