Hi, When using lapic as timer source the hypervisor delivers timer interrupts late. In the source xen/arch/x86/hvm/vpt.c function create_periodic_time creates a timer element with a "bonus" of 50% of the desired time until the interrupt: pt->scheduled = NOW() + period; /* * Offset LAPIC ticks from other timer ticks. Otherwise guests which use * LAPIC ticks for process accounting can see long sequences of process * ticks incorrectly accounted to interrupt processing. */ if ( pt->source == PTSRC_lapic ) pt->scheduled += period >> 1; We have ported our mainframe OS BS2000 to x86_64/XEN and we are using the lapic timer as the main timer interrupt source (one shot mode). Finally I''ve found the above coding which seems to be the root cause of late interrupts. I think the problem mentioned in the comment won''t occur if the guest uses the lapic timer in one shot mode with varying timer values (like BS2000). Or am I wrong here? Juergen -- Juergen Gross Principal Developer IP SW OS6 Telephone: +49 (0) 89 636 47950 Fujitsu Siemens Computers e-mail: juergen.gross@fujitsu-siemens.com Otto-Hahn-Ring 6 Internet: fujitsu-siemens.com D-81739 Muenchen Company details: fujitsu-siemens.com/imprint.html _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com lists.xensource.com/xen-devel
Keir Fraser
2008-Oct-28 08:10 UTC
Re: [Xen-devel] late lapic timer interrupts for hvm guest
On 28/10/08 07:45, "Juergen Gross" <juergen.gross@fujitsu-siemens.com> wrote:> pt->scheduled = NOW() + period; > /* > * Offset LAPIC ticks from other timer ticks. Otherwise guests which use > * LAPIC ticks for process accounting can see long sequences of process > * ticks incorrectly accounted to interrupt processing. > */ > if ( pt->source == PTSRC_lapic ) > pt->scheduled += period >> 1; > > We have ported our mainframe OS BS2000 to x86_64/XEN and we are using the > lapic timer as the main timer interrupt source (one shot mode). Finally I''ve > found the above coding which seems to be the root cause of late interrupts. > > I think the problem mentioned in the comment won''t occur if the guest uses > the lapic timer in one shot mode with varying timer values (like BS2000). Or > am I wrong here?Right. That extra code could be conditional on setting up a periodic LAPIC timer. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com lists.xensource.com/xen-devel
Juergen Gross
2008-Oct-28 08:56 UTC
Re: [Xen-devel] late lapic timer interrupts for hvm guest
Keir Fraser wrote:> On 28/10/08 07:45, "Juergen Gross" <juergen.gross@fujitsu-siemens.com> > wrote: > >> pt->scheduled = NOW() + period; >> /* >> * Offset LAPIC ticks from other timer ticks. Otherwise guests which use >> * LAPIC ticks for process accounting can see long sequences of process >> * ticks incorrectly accounted to interrupt processing. >> */ >> if ( pt->source == PTSRC_lapic ) >> pt->scheduled += period >> 1; >> >> We have ported our mainframe OS BS2000 to x86_64/XEN and we are using the >> lapic timer as the main timer interrupt source (one shot mode). Finally I''ve >> found the above coding which seems to be the root cause of late interrupts. >> >> I think the problem mentioned in the comment won''t occur if the guest uses >> the lapic timer in one shot mode with varying timer values (like BS2000). Or >> am I wrong here? > > Right. That extra code could be conditional on setting up a periodic LAPIC > timer.Okay, here is the patch. Juergen -- Juergen Gross Principal Developer IP SW OS6 Telephone: +49 (0) 89 636 47950 Fujitsu Siemens Computers e-mail: juergen.gross@fujitsu-siemens.com Otto-Hahn-Ring 6 Internet: fujitsu-siemens.com D-81739 Muenchen Company details: fujitsu-siemens.com/imprint.html _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com lists.xensource.com/xen-devel
Possibly Parallel Threads
- Align periodic vpts to reduce timer interrupts and save power
- [Patch 2 of 2]: PV-domain SMP performance Linux-part
- [PATCH 2/4] CPUIDLE: Avoid remnant LAPIC timer intr while force hpetbroadcast
- Live Migration of BS2000 DomU
- [PATCH 2/2] CPUIDLE: Handle C2 LAPIC timer & TSC stop