WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Re: [PATCH] xen: always handle VIRQ_TIMER first.

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [PATCH] xen: always handle VIRQ_TIMER first.
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Mon, 18 Oct 2010 09:52:05 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Keir Fraser <keir@xxxxxxx>, Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Mon, 18 Oct 2010 09:53:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4CBC65AE020000780001DBC0@xxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C8DF0F4F.262B3%keir@xxxxxxx> <4CBA937C.6060301@xxxxxxxx> <4CBC65AE020000780001DBC0@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Lightning/1.0b3pre Thunderbird/3.1.4
 On 10/18/2010 06:20 AM, Jan Beulich wrote:
>>>> On 17.10.10 at 08:11, Jeremy Fitzhardinge <jeremy@xxxxxxxx> 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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel