Mailing List Archive

SMP and CPU hyperthreading
Hi list

I have a server with SMP and the CPUs support HyperThreading. I can start domU
on cpu = 0, cpu = 1, cpu = 2 and cpu =3.

I read that there's basic support for HyperThreading, what does this mean?

And how is performance on 0,1,2 and 3 with HyperThreading compared to
non-HyperThreading CPUs 0 and 1? Is 2 weaker than a non-HyperThreading 0?

Would it better to disable HyperThreading with noht as boot option?

--
Med venlig hilsen / Best regards
Lars E. D. Jensen
ledj@dcmedia.biz - http://dcmedia.biz

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: SMP and CPU hyperthreading [ In reply to ]
> I have a server with SMP and the CPUs support HyperThreading. I can start
> domU on cpu = 0, cpu = 1, cpu = 2 and cpu =3.
>
> I read that there's basic support for HyperThreading, what does this mean?

In this case, it means Xen will enumerate hyperthreads and allow you to start
domains on them. It's "basic" because it's probably sub-optimal for many
uses to run two different guests on one CPU. More intelligent treatment of
hyperthreads (e.g. allowing guests to be HT aware) might appear some time in
the future...

> And how is performance on 0,1,2 and 3 with HyperThreading compared to
> non-HyperThreading CPUs 0 and 1? Is 2 weaker than a non-HyperThreading 0?
> Would it better to disable HyperThreading with noht as boot option?

Using hyperthreads may improve IO performance by allowing dom0's IO routines
to run concurrently with the domU, reducing context switching overhead. For
some workloads it might increase performance, for others it may make no
difference (or harm performance). YMMV.

There's not much point using the noht flag. Just pin the domains to the
logical processors you want to use. If you don't want to use both threads on
a core then just assign domains to one of them.

Cheers,
Mark


_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: SMP and CPU hyperthreading [ In reply to ]
> Ok, how should the syntax be for using both threads on a cpu.
>
> cpu = 0,1 ?

If you're in the testing tree, you can only use one thread per domain.

If you're on the unstable tree, you may give multiple hyperthreads to a domain
but I can't remember how - there were some patches floating around recently
to make it simpler to do, however.

Cheers,
Mark

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: SMP and CPU hyperthreading [ In reply to ]
> There's not much point using the noht flag. Just pin the domains to the
> logical processors you want to use. If you don't want to use both threads
> on a core then just assign domains to one of them.

Ok, how should the syntax be for using both threads on a cpu.

cpu = 0,1 ?

--
Med venlig hilsen / Best regards
Lars E. D. Jensen
ledj@dcmedia.biz - http://dcmedia.biz

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: SMP and CPU hyperthreading [ In reply to ]
Tirsdag den 19. april 2005 20:04 skrev Mark Williamson:
> > Ok, how should the syntax be for using both threads on a cpu.
> >
> > cpu = 0,1 ?
>
> If you're in the testing tree, you can only use one thread per domain.
>
> If you're on the unstable tree, you may give multiple hyperthreads to a
> domain but I can't remember how - there were some patches floating around
> recently to make it simpler to do, however.

Ok thanks.

I'm using 2.0.5 stable release, so I'll just assign domains to 1 of the four
0,1,2 or 3 until further notice.

--
Med venlig hilsen / Best regards
Lars E. D. Jensen - DCmedia - TYPO3 Business Solutions
+45 3695 9177
ledj@dcmedia.biz - http://dcmedia.biz

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: SMP and CPU hyperthreading [ In reply to ]
> Ok thanks.
>
> I'm using 2.0.5 stable release, so I'll just assign domains to 1 of the
> four 0,1,2 or 3 until further notice.

IIRC, on a two CPU system the numbering is as follows:
0 : 1st hyperthread, 1st CPU
1 : 2nd hyperthread, 1st CPU
2 : 1st hyperthread, 2nd CPU
3 : 2nd hyperthread, 2nd CPU

If you don't want to use HT, just assign to 0 and 2 (for instance) and then
you'll only have one domain running on a physical CPU at any time.

HTH,
Mark

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: SMP and CPU hyperthreading [ In reply to ]
> IIRC, on a two CPU system the numbering is as follows:
> 0 : 1st hyperthread, 1st CPU
> 1 : 2nd hyperthread, 1st CPU
> 2 : 1st hyperthread, 2nd CPU
> 3 : 2nd hyperthread, 2nd CPU
>
> If you don't want to use HT, just assign to 0 and 2 (for instance) and then
> you'll only have one domain running on a physical CPU at any time.

Ok, will this syntax do it in the configuration?

cpu = 0,2

And does it work in 2.0.5 stable too?

--
Med venlig hilsen / Best regards
Lars E. D. Jensen
ledj@dcmedia.biz - http://dcmedia.biz

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: SMP and CPU hyperthreading [ In reply to ]
On Tuesday 19 April 2005 21:19, Lars E. D. Jensen | DCmedia wrote:
> > IIRC, on a two CPU system the numbering is as follows:
> > 0 : 1st hyperthread, 1st CPU
> > 1 : 2nd hyperthread, 1st CPU
> > 2 : 1st hyperthread, 2nd CPU
> > 3 : 2nd hyperthread, 2nd CPU
> >
> > If you don't want to use HT, just assign to 0 and 2 (for instance) and
> > then you'll only have one domain running on a physical CPU at any time.
>
> Ok, will this syntax do it in the configuration?
>
> cpu = 0,2
>
> And does it work in 2.0.5 stable too?

Sorry, I didn't express that clearly. Let me put it another way: in -stable
you can't give more than one hyperthread to a domain but you *can* have more
than one domain per hyperthread.

The configuration you suggest above won't work because you can only give one
logical processor to a domain.

If you want to run two domains on hyperthreads on the same CPU, you can assign
one of them cpu = 0 and the other one to cpu = 1. The two domains will run
simultaneously in threads on that physical CPU. If you only want one domain
at a time to run on the CPU, you should specify cpu = 0 in both config files.
The same applies for the hyperthreads on your second CPU (but with cpu = 2
instead of 0 and cpu = 3 instead of 1).

HTH,
Mark

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: SMP and CPU hyperthreading [ In reply to ]
> Sorry, I didn't express that clearly. Let me put it another way: in
> -stable you can't give more than one hyperthread to a domain but you *can*
> have more than one domain per hyperthread.
>
> The configuration you suggest above won't work because you can only give
> one logical processor to a domain.
>
> If you want to run two domains on hyperthreads on the same CPU, you can
> assign one of them cpu = 0 and the other one to cpu = 1. The two domains
> will run simultaneously in threads on that physical CPU. If you only want
> one domain at a time to run on the CPU, you should specify cpu = 0 in both
> config files. The same applies for the hyperthreads on your second CPU (but
> with cpu = 2 instead of 0 and cpu = 3 instead of 1).

Ok, thanks for a thorough explanation :)

--
Med venlig hilsen / Best regards
Lars E. D. Jensen
ledj@dcmedia.biz - http://dcmedia.biz

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
RE: SMP and CPU hyperthreading [ In reply to ]
> > There's not much point using the noht flag. Just pin the
> domains to
> > the logical processors you want to use. If you don't want
> to use both
> > threads on a core then just assign domains to one of them.
>
> Ok, how should the syntax be for using both threads on a cpu.
>
> cpu = 0,1 ?

The CPU enumeration order is: hyperthreads, cores, sockets, nodes
(though not all levels are currently implementes). i.e. on a 2 socket,
single core, Xeon box:

cpu 0 : socket 0, [core 0], hyperthread 0
cpu 1 : socket 0, [core 0], hyperthread 1
cpu 2 : socket 1, [core 0], hyperthread 0
cpu 3 : socket 1, [core 0], hyperthread 1

It's sensible to reserve cpu 0 for domain 0, and then put all your other
domains on CPUs 1 and 3 (leave CPU 2 empty, unless you know that you're
not going to thrash the chip's cache).

Ian

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users
Re: SMP and CPU hyperthreading [ In reply to ]
> cpu 0 : socket 0, [core 0], hyperthread 0
> cpu 1 : socket 0, [core 0], hyperthread 1
> cpu 2 : socket 1, [core 0], hyperthread 0
> cpu 3 : socket 1, [core 0], hyperthread 1
>
> It's sensible to reserve cpu 0 for domain 0, and then put all your other
> domains on CPUs 1 and 3 (leave CPU 2 empty, unless you know that you're
> not going to thrash the chip's cache).

How can I know if I'm trashing the chip cache?

--
Med venlig hilsen / Best regards
Lars E. D. Jensen
ledj@dcmedia.biz - http://dcmedia.biz

_______________________________________________
Xen-users mailing list
Xen-users@lists.xensource.com
http://lists.xensource.com/xen-users