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] How to increase timer resolution?

To: <kaiser@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] How to increase timer resolution?
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Sun, 14 Sep 2008 17:41:05 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 14 Sep 2008 09:41:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <48CD2C5A.1080208@xxxxxxxxxxxxxxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AckWiK4o7JjcUYJ7Ed2w4AAWy6hiGQ==
Thread-topic: [Xen-devel] How to increase timer resolution?
User-agent: Microsoft-Entourage/
On 14/9/08 16:23, "Robert Kaiser (FH)" <kaiser@xxxxxxxxxxxxxxxxxxxxxxxxxx>

> Keir Fraser schrieb:
>> set_timer() and friends are already high-resolution, so long as your system
>> has a local APIC. This is undoubtedly the case if running a multi-processor
>> system. On a uni-processor system you might need to forcibly enable use of
>> the APIC with 'lapic' as a Xen boot parameter.
>> Either way, early during boot you should find a message saying local APIC is
>> found and enabled, or not found, or whatever.
> Quote:
> (XEN) Local APIC disabled by BIOS -- reenabling.
> (XEN) Could not enable APIC!
> Seems like I have to switch to a different testing machine then, the old
> notebook I was using doesn't seem to have an APIC :-(
> Do you know what resolution I can expect to get on an APIC-enabled machine?

The set_timer() infrastructure is not actually tick-based. With an APIC
you'll get timer accuracy of around 100us (this figure because we service
timer handlers up to 100us before the deadline specified to set_timer(),
just to avoid multiple timer interrupts for close-together events). Without
this extra fudge factor you'd get accuracy down to microsecond resolution.

 -- Keir

Xen-devel mailing list