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/
Home Products Support Community News


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

To: Keir Fraser <keir@xxxxxxx>
Subject: Re: [Xen-devel] Re: [PATCH] xen: always handle VIRQ_TIMER first.
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Sat, 16 Oct 2010 23:11:08 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Sat, 16 Oct 2010 23:12:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C8DF0F4F.262B3%keir@xxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100921 Fedora/3.1.4-1.fc13 Lightning/1.0b3pre Thunderbird/3.1.4
 On 10/16/2010 12:14 AM, Keir Fraser wrote:
> On 15/10/2010 22:11, "Jeremy Fitzhardinge" <jeremy@xxxxxxxx> wrote:
>>> When guest resumes execution after a long period blocked, the unblocking
>>> interrupt may be handled before the inevitable timer interrupt which
>> Why "inevitable"?  What if the next timer event is still some time in
>> the future?  Or are you assuming the timer is driven by the default Xen
>> 100Hz timer?
> Do you sometimes disable, or indeed never use, VCPUOP_set_periodic_timer?

I disable it ASAP at boot and always use VCPUOP_set_singleshot_timer
from then on.

> Hmmm... Perhaps as you suggest this would be a generic issue with any
> tickless kernel, and the correct upstream fix for issues such as USB kbd
> repeat -- if indeed such issues still exist -- is to fix such hardirq
> handlers to not depend on jiffies.
> We fixed it the way we did in 'classic Xen' patched kernels since it seemed
> arhitecturally neatest. I can accept that in the tickless kernel world that
> may not actually be true.

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)


Xen-devel mailing list