From: Juergen Gross Subject: Re: late lapic timer interrupts for hvm guest Date: Tue, 28 Oct 2008 09:56:10 +0100 Message-ID: <4906D3AA.5000004@fujitsu-siemens.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070903030603000600080101" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------070903030603000600080101 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Keir Fraser wrote: > On 28/10/08 07:45, "Juergen Gross" > 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: www.fujitsu-siemens.com D-81739 Muenchen Company details: www.fujitsu-siemens.com/imprint.html --------------070903030603000600080101 Content-Type: text/x-patch; name="lapic.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="lapic.patch" When using lapic timer in one shot mode there is no need to delay timer interrupts. Signed-off-by: juergen.gross@fujitsu-siemens.com # HG changeset patch # User juergen.gross@fujitsu-siemens.com # Date 1225183655 -3600 # Node ID 7640fba355fac233773d183077d7d01c8fd591f3 # Parent 874d0d673ecb55749cdc836942222ba684b365cb don't delay lapic timer if one shot mode diff -r 874d0d673ecb -r 7640fba355fa xen/arch/x86/hvm/vpt.c --- a/xen/arch/x86/hvm/vpt.c Thu Oct 23 15:38:52 2008 +0100 +++ b/xen/arch/x86/hvm/vpt.c Tue Oct 28 09:47:35 2008 +0100 @@ -388,8 +388,9 @@ * 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. + * In one shot mode we assume this is no problem. */ - if ( pt->source == PTSRC_lapic ) + if ( period && (pt->source == PTSRC_lapic) ) pt->scheduled += delta >> 1; pt->cb = cb; pt->priv = data; --------------070903030603000600080101 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------070903030603000600080101--