All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Jan Beulich <JBeulich@novell.com>
Cc: xen-devel@lists.xensource.com, Keir Fraser <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: Re: Re: [PATCH] xen: always handle VIRQ_TIMER	 first.
Date: Mon, 18 Oct 2010 09:52:05 -0700	[thread overview]
Message-ID: <4CBC7B35.3000004@goop.org> (raw)
In-Reply-To: <4CBC65AE020000780001DBC0@vpn.id2.novell.com>

 On 10/18/2010 06:20 AM, Jan Beulich wrote:
>>>> On 17.10.10 at 08:11, Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>> I think (but I haven't spelunked into that code lately) that after a
>> tickless idle period it will update jiffies N ticks based on the
>> clocksource, and then run any other interrupt handler code, so jiffies
>> will always appear to be up to date.
>>
>> Ah, yes, here it is:
>>
>> /**
>>  * tick_nohz_update_jiffies - update jiffies when idle was interrupted
>>  *
>>  * Called from interrupt entry when the CPU was idle
>>  *
>>  * In case the sched_tick was stopped on this CPU, we have to check if 
>> jiffies
>>  * must be updated. Otherwise an interrupt handler could use a stale jiffy
>>  * value. We do this unconditionally on any cpu, as we don't know whether 
>> the
>>  * cpu, which has the update task assigned is in a long sleep.
>>  */
>> static void tick_nohz_update_jiffies(ktime_t now)
>> {
>> 	...
>> }
> But this is available only with CONFIG_NO_HZ, which is a freely
> selectable option. So perhaps the code should still be added
> inside an #ifndef CONFIG_NO_HZ?

Non-NO_HZ is a pretty pessimal configuration for a VM, or indeed any
system which cares about power.  Are there any use cases for which its a
good idea?

However, you could change it to always update jiffies on any interrupt
entrypoint, regardless of whether its coming from an idle state.  Or
even just change "jiffies" into a macro which calls a function to just
compute the current value without needing to rely on interrupts at all.

    J

      reply	other threads:[~2010-10-18 16:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-15 10:52 [PATCH] xen: always handle VIRQ_TIMER first Ian Campbell
2010-10-15 17:18 ` Jeremy Fitzhardinge
2010-10-15 18:30   ` Keir Fraser
2010-10-15 21:11     ` Jeremy Fitzhardinge
2010-10-16  6:48       ` Ian Campbell
2010-10-16  7:14       ` Keir Fraser
2010-10-17  6:11         ` Jeremy Fitzhardinge
2010-10-17  7:38           ` Keir Fraser
2010-10-18 13:20           ` Jan Beulich
2010-10-18 16:52             ` Jeremy Fitzhardinge [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=4CBC7B35.3000004@goop.org \
    --to=jeremy@goop.org \
    --cc=JBeulich@novell.com \
    --cc=ian.campbell@citrix.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xensource.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.