All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: Does dom0 see all physical processors? (RE: [Xen-ia64-devel] SAL INFO virtualization)
@ 2006-04-04 19:27 Magenheimer, Dan (HP Labs Fort Collins)
  2006-04-07 15:42 ` Ryan Harper
  0 siblings, 1 reply; 9+ messages in thread
From: Magenheimer, Dan (HP Labs Fort Collins) @ 2006-04-04 19:27 UTC (permalink / raw)
  To: Keir Fraser, Tian, Kevin; +Cc: Tristan Gingold, xen-devel, xen-ia64-devel

I understand and sympathize with the need for dom0 to
sometimes get and use information from each processor
that is only available if dom0 is running on each processor.

However, AFAIK, SMP guests are always gang-scheduled, correct?
(If not, aren't there some very knotty research issues related
to locking and forward progress?)

So on a 16-processor system, every time dom0 needs to
run (e.g. to handle backend I/O for any one of perhaps hundreds
of domains), *every* domain gets descheduled so that dom0
can be (gang-)scheduled on all 16 processors?

If true, this sounds like a _horrible_ performance hit, so
I hope I'm misunderstanding something...

Dan

> -----Original Message-----
> From: Keir Fraser [mailto:Keir.Fraser@cl.cam.ac.uk] 
> Sent: Tuesday, April 04, 2006 1:26 AM
> To: Tian, Kevin
> Cc: xen-devel; xen-ia64-devel@lists.xensource.com; 
> Magenheimer, Dan (HP Labs Fort Collins); Tristan Gingold
> Subject: Re: [Xen-devel] Does dom0 see all physical 
> processors? (RE: [Xen-ia64-devel] SAL INFO virtualization)
> 
> 
> On 4 Apr 2006, at 03:17, Tian, Kevin wrote:
> 
> >
> > Then consider your question about a large box with many processors.
> > How about the real environment? Is it the case to provide a 
> 16-way SMP
> > box, or a 16-way NUMA box? I prefer to the latter. If it's 
> a NUMA box,
> > dom0 sees physical ACPI table and can be configured as NUMA aware.
> 
> This is a model we must support if we are to have domain0 
> handle other 
> processor-related ACPI activities (e.g., power management). The power 
> information and available settings won't make much sense to the user 
> unless there's an equivalence between VCPUs and PCPUs for domain0.
> 
>   -- Keir
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: Does dom0 see all physical processors? (RE:[Xen-ia64-devel] SAL INFO virtualization)
@ 2006-04-05 14:32 Ian Pratt
  0 siblings, 0 replies; 9+ messages in thread
From: Ian Pratt @ 2006-04-05 14:32 UTC (permalink / raw)
  To: Magenheimer, Dan (HP Labs Fort Collins), Keir Fraser, Tian, Kevin
  Cc: Jimi Xenidis, xen-devel, okrieg, Tristan Gingold, xen-ia64-devel


> I believe ppc has "paravirtualized spinlocks" in their Linux 
> kernel, though even this won't necessarily help with a poorly 
> written SMP application.

We have an equivalent of this ("bad pre-emption mitigation"), along with
an alternative ("bad pre-emption avoidance"). Both have various pros and
cons, and can be shown to offer significant benefits in various
contrived benchmarks.

We have benchmark code that records when these bad pre-emptions happen,
and the workloads we've looked at we haven't been moved to check either
scheme in.

That's not to say that we won't have to at some point in the future, but
the limits to scalability are currently elsewhere. 

> > > So on a 16-processor system, every time dom0 needs to run 
> (e.g. to 
> > > handle backend I/O for any one of perhaps hundreds of domains), 
> > > *every* domain gets descheduled so that dom0 can be 
> (gang-)scheduled 
> > > on all 16 processors?
> > > 
> > > If true, this sounds like a _horrible_ performance hit, so I hope 
> > > I'm misunderstanding something...
> > 
> > This isn't an issue.
> > 
> > After booting you probably want dom0 to give up all but 1 
> vCPU anyway.
> 
> Unless of course the PCPU's have data that change over time, 
> such as variable cycle rate (for power management) or 
> hot-plug memory...

Such events don't happen very often -- dom0 is still free to run
something on a given CPU whenever it wants to.

Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: Does dom0 see all physical processors? (RE:[Xen-ia64-devel] SAL INFO virtualization)
@ 2006-04-05 14:07 Magenheimer, Dan (HP Labs Fort Collins)
  2006-04-05 14:20 ` Keir Fraser
  2006-04-07 13:55 ` Stephen C. Tweedie
  0 siblings, 2 replies; 9+ messages in thread
From: Magenheimer, Dan (HP Labs Fort Collins) @ 2006-04-05 14:07 UTC (permalink / raw)
  To: Ian Pratt, Keir Fraser, Tian, Kevin
  Cc: Jimi Xenidis, xen-devel, okrieg, Tristan Gingold, xen-ia64-devel

(Orran/Jimi cc'ed, see question below...)

> > I understand and sympathize with the need for dom0 to 
> > sometimes get and use information from each processor that is 
> > only available if dom0 is running on each processor.
> > 
> > However, AFAIK, SMP guests are always gang-scheduled, correct?
> 
> No, there's no need to strictly gang schedule, and the 
> current scheduler makes no attempt to do so. It may generally 
> be a decent thing to do, though.
> 
> > (If not, aren't there some very knotty research issues 
> > related to locking and forward progress?)
> 
> You could end up preempting a vCPU holding a lock which could 
> lead to daft behaviour of naïve spin locks. A number of 
> possible workarounds have been prototyped, but since it 
> doesn't seem to be much of a problem in practice nothing has 
> been checked in.

I wonder if "not a problem in practice" is more of an indication
of lack of practice than lack of problem.  I can see that the
problem would be unlikely to occur with small numbers of
processors and one SMP guests running a highly scalable SMP app
(such as a web server), but I'll bet a real enterprise load
of home-grown SMP apps running in a IT shop that's had big SMP
boxes for years would see the problem more quickly, especially
after multiple SMP guests are consolidated onto a single box.

I believe ppc has "paravirtualized spinlocks" in their Linux
kernel, though even this won't necessarily help with a poorly
written SMP application.

No data, admittedly, but perhaps our good buddies at
Watson could comment?

> > So on a 16-processor system, every time dom0 needs to run 
> > (e.g. to handle backend I/O for any one of perhaps hundreds 
> > of domains), *every* domain gets descheduled so that dom0 can 
> > be (gang-)scheduled on all 16 processors?
> > 
> > If true, this sounds like a _horrible_ performance hit, so I 
> > hope I'm misunderstanding something...
> 
> This isn't an issue.
> 
> After booting you probably want dom0 to give up all but 1 vCPU anyway.

Unless of course the PCPU's have data that change over time, such
as variable cycle rate (for power management) or hot-plug memory...
 
> Ian
>

Dan

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: Does dom0 see all physical processors? (RE:[Xen-ia64-devel] SAL INFO virtualization)
@ 2006-04-04 20:06 Ian Pratt
  0 siblings, 0 replies; 9+ messages in thread
From: Ian Pratt @ 2006-04-04 20:06 UTC (permalink / raw)
  To: Magenheimer, Dan (HP Labs Fort Collins), Keir Fraser, Tian, Kevin
  Cc: xen-ia64-devel, xen-devel, Tristan Gingold

> I understand and sympathize with the need for dom0 to 
> sometimes get and use information from each processor that is 
> only available if dom0 is running on each processor.
> 
> However, AFAIK, SMP guests are always gang-scheduled, correct?

No, there's no need to strictly gang schedule, and the current scheduler makes no attempt to do so. It may generally be a decent thing to do, though.

> (If not, aren't there some very knotty research issues 
> related to locking and forward progress?)

You could end up preempting a vCPU holding a lock which could lead to daft behaviour of naïve spin locks. A number of possible workarounds have been prototyped, but since it doesn't seem to be much of a problem in practice nothing has been checked in.

> So on a 16-processor system, every time dom0 needs to run 
> (e.g. to handle backend I/O for any one of perhaps hundreds 
> of domains), *every* domain gets descheduled so that dom0 can 
> be (gang-)scheduled on all 16 processors?
> 
> If true, this sounds like a _horrible_ performance hit, so I 
> hope I'm misunderstanding something...

This isn't an issue.

After booting you probably want dom0 to give up all but 1 vCPU anyway.

Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: Does dom0 see all physical processors? (RE: [Xen-ia64-devel] SAL INFO virtualization)
@ 2006-04-04  7:40 Tian, Kevin
  0 siblings, 0 replies; 9+ messages in thread
From: Tian, Kevin @ 2006-04-04  7:40 UTC (permalink / raw)
  To: Keir Fraser
  Cc: Magenheimer, Dan (HP Labs Fort Collins), Tristan Gingold,
	xen-devel, xen-ia64-devel

>From: Keir Fraser [mailto:Keir.Fraser@cl.cam.ac.uk]
>Sent: 2006年4月4日 15:26
>
>
>On 4 Apr 2006, at 03:17, Tian, Kevin wrote:
>
>>
>> Then consider your question about a large box with many processors.
>> How about the real environment? Is it the case to provide a 16-way
>SMP
>> box, or a 16-way NUMA box? I prefer to the latter. If it's a NUMA box,
>> dom0 sees physical ACPI table and can be configured as NUMA
>aware.
>
>This is a model we must support if we are to have domain0 handle other
>processor-related ACPI activities (e.g., power management). The power
>information and available settings won't make much sense to the user
>unless there's an equivalence between VCPUs and PCPUs for domain0.
>
>  -- Keir

Yes, and thanks for making it clearer. (Originally I only came up
performance reason for this model.)

Thanks,
Kevin

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Does dom0 see all physical processors? (RE: SAL INFO virtualization)
@ 2006-04-04  2:17 Tian, Kevin
  2006-04-04  7:26 ` Does dom0 see all physical processors? (RE: [Xen-ia64-devel] " Keir Fraser
  0 siblings, 1 reply; 9+ messages in thread
From: Tian, Kevin @ 2006-04-04  2:17 UTC (permalink / raw)
  To: Magenheimer, Dan (HP Labs Fort Collins), Tristan Gingold,
	xen-ia64-devel
  Cc: xen-devel

>From: Magenheimer, Dan (HP Labs Fort Collins)
>[mailto:dan.magenheimer@hp.com]
>Sent: 2006年4月3日 23:55
>>
>> Just an unrelated comment, Dom0 should always run on every
>physical
>> processor, which is the base requirement for performance
>> reason. It's not
>> "therefore" result of this specific issue and instead you can
>> take it as the
>> basic assumption for your thought. :-)
>>
>> Thanks,
>> Kevin
>
>Hmmm... are you saying that on a 16-processor Xen system,
>domain0 will run as a 16-way SMP guest?

OK, seems that I didn't describe the case clearly. :-) For current xen
model, dom0 default runs on all physical cpus which is however 
configurable.:

    if ( opt_dom0_max_vcpus == 0 )
        opt_dom0_max_vcpus = num_online_cpus();
    if ( opt_dom0_max_vcpus > MAX_VIRT_CPUS )
        opt_dom0_max_vcpus = MAX_VIRT_CPUS;
    printk("Dom0 has maximum %u VCPUs\n", opt_dom0_max_vcpus);

    for ( i = 1; i < opt_dom0_max_vcpus; i++ )
        (void)alloc_vcpu(d, i, i); /* vcpu N runs on physical cpu N */

In this case, max vcpus of dom0 is configurable but each vcpu is running 
at different physical processor once allocated. For a typical SMP box, 
such model can provide better performance or else dom0 will become the 
bottle neck if only owning one physical processor.

Then consider your question about a large box with many processors. 
How about the real environment? Is it the case to provide a 16-way SMP 
box, or a 16-way NUMA box? I prefer to the latter. If it's a NUMA box, 
dom0 sees physical ACPI table and can be configured as NUMA aware.

Yes, such binding model may change later but it's always bad to have 
dom0 only running on single physical processor.

CC to a wider list for comments. :-)

Thanks,
Kevin

>
>This isn't the case today with Xen (x86 or ia64) and I
>don't expect that it will work this way in the future
>either.
>
>Dan

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-04-07 15:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-04 19:27 Does dom0 see all physical processors? (RE: [Xen-ia64-devel] SAL INFO virtualization) Magenheimer, Dan (HP Labs Fort Collins)
2006-04-07 15:42 ` Ryan Harper
  -- strict thread matches above, loose matches on Subject: below --
2006-04-05 14:32 Does dom0 see all physical processors? (RE:[Xen-ia64-devel] " Ian Pratt
2006-04-05 14:07 Magenheimer, Dan (HP Labs Fort Collins)
2006-04-05 14:20 ` Keir Fraser
2006-04-07 13:55 ` Stephen C. Tweedie
2006-04-04 20:06 Ian Pratt
2006-04-04  7:40 Does dom0 see all physical processors? (RE: [Xen-ia64-devel] " Tian, Kevin
2006-04-04  2:17 Does dom0 see all physical processors? (RE: " Tian, Kevin
2006-04-04  7:26 ` Does dom0 see all physical processors? (RE: [Xen-ia64-devel] " Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.