All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Cc: Con Kolivas <kernel@kolivas.org>,
	Russell King <rmk+lkml@arm.linux.org.uk>,
	linux-kernel@vger.kernel.org, akpm@osdl.org,
	ck list <ck@vds.kolivas.org>,
	johnstul@us.ibm.com
Subject: Re: [PATCH 1/3] dynticks - implement no idle hz for x86
Date: Mon, 5 Sep 2005 09:57:30 -0700	[thread overview]
Message-ID: <20050905165730.GI25856@us.ibm.com> (raw)
In-Reply-To: <20050905070053.GA7329@in.ibm.com>

On 05.09.2005 [12:30:53 +0530], Srivatsa Vaddagiri wrote:
> On Sun, Sep 04, 2005 at 01:10:54PM -0700, Nishanth Aravamudan wrote:
> > First of all, and maybe this is just me, I think it would be good to
> > make the dyn_tick_timer per-interrupt source, as opposed to each arch?
> 
> Nish, may be a good idea as it may make the code more cleaner (it will
> remove the 'if (cpu_has_local_apic())' kind of code that is there
> currently in x86).

Yes, exactly. I think those kind of interrupt-source specific code can
be handled by the interrupt-source :)

> However note that ARM currently has 'handler' member also part of it,
> which is used to recover time and that has nothing to do with
> interrupt source. Unless there is something like John's TOD, we still
> need to recover time in a arch-dependent fashion ..Where do you
> propose to have that 'handler' member?

I think it's ok where it is. Currently, with x86, at least, you can have
an independent interrupt source and time source (not true for all archs,
of course, ppc64 being a good example, I think?) Perhaps "handler"
should be called arch_recover_time() and may point to a timesource
function (currently PIT/TSC/ACPI_PM/HPET on x86, right?) which does the
appropriate catch-up for the time-related variables. In any case, since
most of the timesource code is lost-tick aware, I think it is possible.

> > Thus, for x86, we would have a dyn_tick_timer structure for the PIT,
> > APIC, ACPI PM-timer and the HPET. These structures could be put in
> 
> Does the ACPI PM-timer support generating interrupts also? Same question
> I have for HPET.

I think, as you figured out, the HPET can, but the ACPI_PM can not. John
might know for sure (I always end up asking him), have added him to the
Cc.

> 
> > arch-specific timer.c files (there currently is not one for x86, I
> > believe). Then, at compilation time, the appropriate structure would be
> > linked to the arch-generic code. That should make the arch-independent
> 
> I think this binding has to be done at run-time, instead of
> compile-time?  (since we may build in support for local APIC but not
> find one at run-time, in which case we have to fall back on PIT as
> interrupt source).

What may be useful is something similar to what John Stultz does in his
rework, attaching priorities to the various interrupt sources. For
example, on x86, if we have an HPET, then we should use it, if not, then
use APIC and PIT, but if the APIC doesn't exist in h/w, or is buggy
(perhaps determined via a calibration loop), then only use the PIT.

> > code simple to implement (I do have some patches in the works, but it's
> > slow going, right now, sorry). I think ARM and s390 could perhaps use
> > this infrastructure as well?
> > 
> > Also, I am a bit confused by the use of "dynamic-tick" to describe these
> > changes. To me, these are all NO_IDLE_HZ implementations, as they are
> > only invoked from cpu_idle() (or their equivalent) routines. I know this
> > is true of s390 and the x86 code, and I believe it is true of the ARM
> > code? If it were dynamic-tick, I would think we would be adjusting the
> > timer interrupt frequency continuously (e.g., at the end of
> > __run_timers() and at every call to {add,mod,del}_timer()). I was
> > working on a patch which did some renaming to no_idle_hz_timer, etc.,
> > but it's mostly code churn :)
> 
> Yes, the name 'dynamic-tick' is misleading!

Especially, to me, as the .config option is NO_IDLE_HZ. I prefer
referring to everything as interrupt_source or something similar, I
think (after looking more at the code), then it doesn't matter whether
it is being used for (what is technically) NO_IDLE_HZ or dynamic-tick.

> > Con, wrt to the x86 implementation, I think the max_skip field should be
> > a member of the interrupt source (dyn_tick_timer) structure, as opposed
> > to the state. This would require dyn_tick_reprogram_timer() to change
> 
> max_skip is dictated by two things - interrupt and the backing time source.
> In case of Local APIC, it may allow for ticks to be skipped upto few tens of
> seconds, but if we are using ACPI PM timer to recover time, then we can
> really skip not more than what the 24-bit PM timer allows for recovering time.
> (few seconds if I remember correctly). Do you agree?

I agree. I guess max_skip, to me, is what the kernel thinks the
interrupt source should maximally skip by, not what the interrupt source
thinks it can do. So, I think it fits in fine with what you are saying
and with the code you have in the current patch.

> > Also, what exactly the purpose of conditional_run_local_timers()? It
> > seems identical to run_local_timers(), except you check for
> > inequality before potentially raising the softirq. It seems like the
> > conditional check in run_timer_softirq() [the TIMER_SOFTIRQ
> > callback] will achieve the same thing? And, in fact, I think that
> > conditional is always true?
> 
> Nish, that was just an optimization for not raising the softirq at all
> if the CPU was woken up w/o having skipped any ticks (becasue of some
> external interrupt).

I was just wondering; I guess it makes sense, but did you check to see
if it ever *doesn't* get called? Like I said, __run_timers() [from how I
understand it], will always increment base->timer_jiffies to one more
than jiffies. So if we disable interrupts and come right back, that
conditional is still true, but time_after_eq(jiffies,
base->timer_jiffies) [the condition in run_timer_softirq()] is not. How
much does it cost to raise the softirq, if it is going to return
immediately from the callback?

Thanks,
Nish

  parent reply	other threads:[~2005-09-05 16:59 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-31 16:58 Updated dynamic tick patches Srivatsa Vaddagiri
2005-08-31 17:12 ` [PATCH 1/3] Updated dynamic tick patches - Fix lost tick calculation in timer_pm.c Srivatsa Vaddagiri
2005-08-31 22:36   ` Zachary Amsden
2005-08-31 22:47     ` john stultz
2005-09-02 15:43   ` [PATCH 1/3] dynticks - implement no idle hz for x86 Con Kolivas
2005-09-02 15:45     ` [PATCH 2/3] dyntick - Fix lost tick calculation in timer pm.c Con Kolivas
2005-09-02 15:46       ` [PATCH 3/3] dyntick - Recover walltime upon wakeup Con Kolivas
2005-09-02 17:25       ` [PATCH 2/3] dyntick - Fix lost tick calculation in timer pm.c Srivatsa Vaddagiri
2005-09-02 20:18         ` Thomas Schlichter
2005-09-02 21:21           ` john stultz
2005-09-02 16:56     ` [PATCH 1/3] dynticks - implement no idle hz for x86 Russell King
2005-09-02 17:12       ` Srivatsa Vaddagiri
2005-09-03  6:13       ` Con Kolivas
2005-09-03  7:58         ` Russell King
2005-09-03  8:01           ` Con Kolivas
2005-09-03  8:06             ` Russell King
2005-09-03  8:14               ` Con Kolivas
2005-09-04 20:10                 ` Nishanth Aravamudan
2005-09-04 20:26                   ` Russell King
2005-09-04 20:37                     ` Nishanth Aravamudan
2005-09-04 21:17                       ` Russell King
2005-09-05  3:08                       ` Con Kolivas
2005-09-05 16:28                         ` Nishanth Aravamudan
2005-09-05  6:58                       ` Tony Lindgren
2005-09-05 16:30                         ` Nishanth Aravamudan
2005-09-04 20:41                     ` Nishanth Aravamudan
2005-09-05  5:32                     ` Srivatsa Vaddagiri
2005-09-05  5:48                       ` Nishanth Aravamudan
2005-09-05  6:32                         ` Srivatsa Vaddagiri
2005-09-05  6:44                           ` Nishanth Aravamudan
2005-09-06 20:51                             ` Nishanth Aravamudan
2005-09-07  8:13                               ` Tony Lindgren
2005-09-07 15:00                                 ` Nishanth Aravamudan
2005-09-07 15:53                                 ` Nishanth Aravamudan
2005-09-07 17:07                                   ` Srivatsa Vaddagiri
2005-09-07 17:23                                     ` Nishanth Aravamudan
2005-09-07 18:14                                       ` Srivatsa Vaddagiri
2005-09-07 18:22                                         ` Nishanth Aravamudan
2005-09-07 16:14                           ` Bill Davidsen
2005-09-07 16:42                             ` Nish Aravamudan
2005-09-07 17:17                               ` Srivatsa Vaddagiri
2005-09-07 17:27                                 ` Nish Aravamudan
2005-09-07 18:18                                   ` Srivatsa Vaddagiri
2005-09-07 18:33                                     ` Nish Aravamudan
2005-09-09 16:27                                 ` Bill Davidsen
2005-09-05  7:37                       ` Russell King
2005-09-05  7:49                         ` Srivatsa Vaddagiri
2005-09-05  8:00                           ` Russell King
2005-09-05 16:33                             ` Nishanth Aravamudan
2005-09-05  7:00                   ` Srivatsa Vaddagiri
2005-09-05  7:27                     ` Tony Lindgren
2005-09-05 17:02                       ` Nishanth Aravamudan
2005-09-07  7:37                         ` Tony Lindgren
2005-09-07 15:05                           ` Nishanth Aravamudan
2005-09-08 10:00                             ` Tony Lindgren
2005-09-08 21:22                               ` Nishanth Aravamudan
2005-09-08 22:08                                 ` Nishanth Aravamudan
2005-09-09 22:30                                   ` Nishanth Aravamudan
2005-09-20 11:06                                   ` Srivatsa Vaddagiri
2005-09-20 14:58                                     ` Nishanth Aravamudan
2005-09-22 13:38                                       ` Martin Schwidefsky
2005-09-22 14:52                                         ` Nishanth Aravamudan
2005-09-22 18:32                                           ` Srivatsa Vaddagiri
2005-09-26 15:08                                             ` Srivatsa Vaddagiri
2005-09-23  6:55                                         ` Srivatsa Vaddagiri
2005-09-05  7:44                     ` Russell King
2005-09-05  8:19                       ` Srivatsa Vaddagiri
2005-09-05  8:32                         ` Russell King
2005-09-05  9:24                           ` Srivatsa Vaddagiri
2005-09-05 17:06                           ` Nishanth Aravamudan
2005-09-05 17:04                       ` Nishanth Aravamudan
2005-09-05 17:27                         ` Srivatsa Vaddagiri
2005-09-05 18:06                           ` Nishanth Aravamudan
2005-09-05 13:19                     ` Srivatsa Vaddagiri
2005-09-05 16:57                     ` Nishanth Aravamudan [this message]
2005-09-05 17:25                       ` Srivatsa Vaddagiri
2005-09-05 18:11                         ` Nishanth Aravamudan
2005-09-03  4:05   ` [PATCH 1/3] Updated dynamic tick patches - Fix lost tick calculation in timer_pm.c Lee Revell
2005-09-03  4:18     ` Peter Williams
2005-09-03  4:34       ` Lee Revell
2005-09-03  4:48         ` Peter Williams
2005-09-03  5:15     ` Parag Warudkar
2005-09-03  5:30       ` Lee Revell
2005-09-03  5:20     ` Srivatsa Vaddagiri
2005-09-06 10:32     ` Pavel Machek
2005-09-06 10:46       ` Srivatsa Vaddagiri
2005-09-06 18:04     ` john stultz
2005-08-31 17:26 ` [PATCH 2/3] Updated dynamic tick patches - Cleanup Srivatsa Vaddagiri
2005-08-31 17:27 ` [PATCH 3/3] Updated dynamic tick patches - Recover walltime upon wakeup Srivatsa Vaddagiri
2005-09-01  5:23 ` Updated dynamic tick patches Con Kolivas
2005-09-01 13:07   ` Tony Lindgren
2005-09-01 13:19     ` David Weinehall
2005-09-01 13:46       ` Tony Lindgren
2005-09-01 14:11     ` Srivatsa Vaddagiri
2005-09-02 17:34     ` Srivatsa Vaddagiri
2005-09-03 10:16       ` Tony Lindgren

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=20050905165730.GI25856@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=ck@vds.kolivas.org \
    --cc=johnstul@us.ibm.com \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=vatsa@in.ibm.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 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.