Jan Beulich
2006-May-29 14:35 UTC
[Xen-devel] [PATCH] x86 linux: prevent halted VCPUs from eating up CPU bandwidth
Since there was no reply to an earlier inquiry regarding this, here''s a patch. Signed-off-by: Jan Beulich <jbeulich@novell.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-May-29 14:59 UTC
Re: [Xen-devel] [PATCH] x86 linux: prevent halted VCPUs from eating up CPU bandwidth
On 29 May 2006, at 15:35, Jan Beulich wrote:> Since there was no reply to an earlier inquiry regarding this, here''s > a patch. > > Signed-off-by: Jan Beulich <jbeulich@novell.com>safe_halt() should simply be HYPERVISOR_block() -- the hypercall implicitly reenables interrupt delivery for the calling VCPU, so no need to call __sti() explicitly. halt() is a bit trickier -- given that it is executed (as far as I can tell) only in contexts where the CPU has reached "end of life" (it''s crashed, or offlined, or shut down for some other reason) it might make sense to define halt() as VCPUOP_down. Or, just in case it is used in places with interrupts still enabled, where the CPU may have a future: #define halt() (irqs_disabled() ? HYPERVISOR_vcpu_op(VCPUOP_down) : HYPERVISOR_block()) -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jan Beulich
2006-May-30 08:11 UTC
Re: [Xen-devel] [PATCH] x86 linux: prevent halted VCPUs from eating up CPU bandwidth
>>> Keir Fraser <Keir.Fraser@cl.cam.ac.uk> 29.05.06 16:59 >>> > >On 29 May 2006, at 15:35, Jan Beulich wrote: > >> Since there was no reply to an earlier inquiry regarding this, here''s >> a patch. >> >> Signed-off-by: Jan Beulich <jbeulich@novell.com> > >safe_halt() should simply be HYPERVISOR_block() -- the hypercall >implicitly reenables interrupt delivery for the calling VCPU, so no >need to call __sti() explicitly. > >halt() is a bit trickier -- given that it is executed (as far as I can >tell) only in contexts where the CPU has reached "end of life" (it''s >crashed, or offlined, or shut down for some other reason) it might make >sense to define halt() as VCPUOP_down. Or, just in case it is used in >places with interrupts still enabled, where the CPU may have a future: >#define halt() (irqs_disabled() ? HYPERVISOR_vcpu_op(VCPUOP_down) : >HYPERVISOR_block())Indeed, this was the behavior I intended, but somehow I failed to find the VCPUOP_down operation that I was looking for. Here''s an updated patch. Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-May-30 08:49 UTC
Re: [Xen-devel] [PATCH] x86 linux: prevent halted VCPUs from eating up CPU bandwidth
On 30 May 2006, at 09:11, Jan Beulich wrote:> Indeed, this was the behavior I intended, but somehow I failed to find > the VCPUOP_down operation that I was looking > for. Here''s an updated patch.Given that you went for the more complicated definition of halt() that calls block when event delivery is enabled, is it actually necessary to not compile the halt-checking routine? If event delivery is enabled in that function, shouldn''t we return from each invocation of halt() on (at least) each timer interrupt? If not, I wonder why our behaviour there differs from native? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jan Beulich
2006-May-30 09:21 UTC
Re: [Xen-devel] [PATCH] x86 linux: prevent halted VCPUs from eating up CPU bandwidth
>>> Keir Fraser <Keir.Fraser@cl.cam.ac.uk> 30.05.06 10:49 >>> > >On 30 May 2006, at 09:11, Jan Beulich wrote: > >> Indeed, this was the behavior I intended, but somehow I failed to find >> the VCPUOP_down operation that I was looking >> for. Here''s an updated patch. > >Given that you went for the more complicated definition of halt() that >calls block when event delivery is enabled, is it actually necessary to >not compile the halt-checking routine? If event delivery is enabled inWhat halt-checking routine do you mean here?>that function, shouldn''t we return from each invocation of halt() on >(at least) each timer interrupt? If not, I wonder why our behaviour >there differs from native?Yes, I think the net effect should be similar behavior to native. Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-May-30 09:30 UTC
Re: [Xen-devel] [PATCH] x86 linux: prevent halted VCPUs from eating up CPU bandwidth
On 30 May 2006, at 10:21, Jan Beulich wrote:>> Given that you went for the more complicated definition of halt() that >> calls block when event delivery is enabled, is it actually necessary >> to >> not compile the halt-checking routine? If event delivery is enabled in > > What halt-checking routine do you mean here?The one called check_hlt() that you modify in your patch to not build on Xen! I don''t see why that part of the patch is necessary. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel