All of lore.kernel.org
 help / color / mirror / Atom feed
* QEMU cpu socket allocation
@ 2022-05-17 10:50 Rajesh A
  2022-05-17 20:03 ` Peter Zay
  2022-05-18  8:33 ` Daniel P. Berrangé
  0 siblings, 2 replies; 5+ messages in thread
From: Rajesh A @ 2022-05-17 10:50 UTC (permalink / raw)
  To: qemu-discuss, qemu-devel; +Cc: Ramya R (GIMEC), V G ASHWINI .


[-- Attachment #1.1: Type: text/plain, Size: 964 bytes --]

Hi QEMU dev

Virt Manager is able to configure a QEMU VM with more CPU sockets than the physical host has.
For example, in the below VM, when I request 16 vCPU cores,  by default it takes as 16 Sockets with 1 core each. The host itself has only 2 Sockets.

  1.  How does QEMU allow this and how the VM works?
  2.  What is the recommended configuration of Sockets/Cores/Threads for best VM performance of a 16 core VM running on a 2 sockets host ?

[cid:image004.png@01D86A09.7CC42970]

regards,

Rajesh A
Engineering Media Movement
Media Services

Direct +91 44 66674575   |  Mobile +91 9043011101   |  IP 564575
rajesh.a@tatacommunications.com<mailto:rajesh.a@tatacommunications.com>
[cid:image002.jpg@01D86A08.A4FDF8E0]
<http://tatacommunications.com/>
www.tatacommunications.com<http://www.tatacommunications.com/>
[cid:image003.jpg@01D86A08.A4FDF8E0]<https://twitter.com/#!/tata_comm>
 @tata_comm<https://twitter.com/#!/tata_comm>



[-- Attachment #1.2: Type: text/html, Size: 9107 bytes --]

[-- Attachment #2: image002.jpg --]
[-- Type: image/jpeg, Size: 2710 bytes --]

[-- Attachment #3: image003.jpg --]
[-- Type: image/jpeg, Size: 691 bytes --]

[-- Attachment #4: image004.png --]
[-- Type: image/png, Size: 76850 bytes --]

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

* Re: QEMU cpu socket allocation
  2022-05-17 10:50 QEMU cpu socket allocation Rajesh A
@ 2022-05-17 20:03 ` Peter Zay
  2022-05-18  6:23   ` Rajesh A
  2022-05-18  8:33 ` Daniel P. Berrangé
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Zay @ 2022-05-17 20:03 UTC (permalink / raw)
  To: Rajesh A; +Cc: qemu-discuss, qemu-devel, Ramya R (GIMEC), V G ASHWINI .


[-- Attachment #1.1: Type: text/plain, Size: 1040 bytes --]

Hi Rajesh,

Would the more intuitive CPU setting of (Sockets,Cores,Threads) = (1,16,1)
be ok?

Thanks.


On Tue, May 17, 2022 at 10:03 AM Rajesh A <rajesh.a@tatacommunications.com>
wrote:

> Hi QEMU dev
>
>
>
> Virt Manager is able to configure a QEMU VM with more CPU sockets than the
> physical host has.
>
> For example, in the below VM, when I request 16 vCPU cores,  by default it
> takes as 16 Sockets with 1 core each. The host itself has only 2 Sockets.
>
>    1. How does QEMU allow this and how the VM works?
>    2. What is the recommended configuration of Sockets/Cores/Threads for
>    best VM performance of a 16 core VM running on a 2 sockets host ?
>
>
>
>
>
> regards,
>
>
>
> *Rajesh A*
> Engineering Media Movement
> Media Services
>
>
>
> Direct +91 44 66674575   |  Mobile +91 9043011101   |  IP 564575
> rajesh.a@tatacommunications.com
>
>
> <http://tatacommunications.com/>
>
> www.tatacommunications.com
>
> <https://twitter.com/#!/tata_comm>
>
>  @tata_comm <https://twitter.com/#!/tata_comm>
>
>
>
>
>


-- 
Peter

[-- Attachment #1.2: Type: text/html, Size: 5948 bytes --]

[-- Attachment #2: image002.jpg --]
[-- Type: image/jpeg, Size: 2710 bytes --]

[-- Attachment #3: image003.jpg --]
[-- Type: image/jpeg, Size: 691 bytes --]

[-- Attachment #4: image004.png --]
[-- Type: image/png, Size: 76850 bytes --]

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

* RE: QEMU cpu socket allocation
  2022-05-17 20:03 ` Peter Zay
@ 2022-05-18  6:23   ` Rajesh A
  2022-05-18 14:09     ` Peter Zay
  0 siblings, 1 reply; 5+ messages in thread
From: Rajesh A @ 2022-05-18  6:23 UTC (permalink / raw)
  To: Peter Zay; +Cc: qemu-discuss, qemu-devel, Ramya R (GIMEC), V G ASHWINI .


[-- Attachment #1.1: Type: text/plain, Size: 3993 bytes --]

Hi Peter

Thanks. Yes, I believe (Sockets,Cores,Threads) = (1,16,1) should be the best performance, as the VM does not need to access the memory of another NUMA node.

So, is it a bug that Virt Manager uses more Sockets by default, when i choose "Copy host CPU Configuration" ?

regards,

Rajesh A
Engineering Media Movement
Media Services

Direct +91 44 66674575   |  Mobile +91 9043011101   |  IP 564575
rajesh.a@tatacommunications.com<mailto:rajesh.a@tatacommunications.com>
[cid:image001.jpg@01D86AAD.F02877A0]
<http://tatacommunications.com/>
www.tatacommunications.com<http://www.tatacommunications.com/>
[cid:image002.jpg@01D86AAD.F02877A0]<https://twitter.com/#!/tata_comm>
 @tata_comm<https://twitter.com/#!/tata_comm>


From: Peter Zay <peterzay1@gmail.com>
Sent: 18 May 2022 01:33 AM
To: Rajesh A <rajesh.a@tatacommunications.com>
Cc: qemu-discuss@nongnu.org; qemu-devel@nongnu.org; Ramya R (GIMEC) <ramya.r@tatacommunications.com>; V G ASHWINI . <Ashwini.VG@contractor.tatacommunications.com>
Subject: Re: QEMU cpu socket allocation


CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
Hi Rajesh,

Would the more intuitive CPU setting of (Sockets,Cores,Threads) = (1,16,1) be ok?

Thanks.


On Tue, May 17, 2022 at 10:03 AM Rajesh A <rajesh.a@tatacommunications.com<mailto:rajesh.a@tatacommunications.com>> wrote:
Hi QEMU dev

Virt Manager is able to configure a QEMU VM with more CPU sockets than the physical host has.
For example, in the below VM, when I request 16 vCPU cores,  by default it takes as 16 Sockets with 1 core each. The host itself has only 2 Sockets.

  1.  How does QEMU allow this and how the VM works?
  2.  What is the recommended configuration of Sockets/Cores/Threads for best VM performance of a 16 core VM running on a 2 sockets host ?

[cid:image003.png@01D86AAD.F02877A0]

regards,

Rajesh A
Engineering Media Movement
Media Services

Direct +91 44 66674575   |  Mobile +91 9043011101   |  IP 564575
rajesh.a@tatacommunications.com<mailto:rajesh.a@tatacommunications.com>
[cid:image001.jpg@01D86AAD.F02877A0]
<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftatacommunications.com%2F&data=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=RwEq2mM%2FD6EPV3weUzP1i87N7n%2Fxe619qWQzJjSYpVg%3D&reserved=0>
www.tatacommunications.com<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.tatacommunications.com%2F&data=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=CeVSNB1CC9Dn%2BRvtUdQAH13eTvPhjyYhk%2FVaW66yy3o%3D&reserved=0>
[cid:image002.jpg@01D86AAD.F02877A0]<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2F%23!%2Ftata_comm&data=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=Kqv3RAl3ZhDXSkPJeSJV2IRwewLPsoOf5fdVE%2BPm8iw%3D&reserved=0>
 @tata_comm<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2F%23!%2Ftata_comm&data=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=Kqv3RAl3ZhDXSkPJeSJV2IRwewLPsoOf5fdVE%2BPm8iw%3D&reserved=0>




--
Peter

[-- Attachment #1.2: Type: text/html, Size: 17852 bytes --]

[-- Attachment #2: image001.jpg --]
[-- Type: image/jpeg, Size: 2710 bytes --]

[-- Attachment #3: image002.jpg --]
[-- Type: image/jpeg, Size: 691 bytes --]

[-- Attachment #4: image003.png --]
[-- Type: image/png, Size: 76850 bytes --]

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

* Re: QEMU cpu socket allocation
  2022-05-17 10:50 QEMU cpu socket allocation Rajesh A
  2022-05-17 20:03 ` Peter Zay
@ 2022-05-18  8:33 ` Daniel P. Berrangé
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel P. Berrangé @ 2022-05-18  8:33 UTC (permalink / raw)
  To: Rajesh A; +Cc: qemu-discuss, qemu-devel, Ramya R (GIMEC), V G ASHWINI .

On Tue, May 17, 2022 at 10:50:02AM +0000, Rajesh A wrote:
> Hi QEMU dev
> 
> Virt Manager is able to configure a QEMU VM with more CPU sockets
> than the physical host has.
> For example, in the below VM, when I request 16 vCPU cores,  by
> default it takes as 16 Sockets with 1 core each. The host itself
> has only 2 Sockets.

You've told virt-manager to overcommit your CPUs.

>   1.  How does QEMU allow this and how the VM works?

It is functionally fine. A vCPU is merely OS thread, and the OS
schedular will just schedule each vCPU as it would any OS thread.

It multiple vCPUs all try to run work at the same time, then they
are going to compete with each other for running time on the physical
CPUs, and so they'll only get a subset of the time they reall want.

>   2.  What is the recommended configuration of Sockets/Cores/Threads
> for best VM performance of a 16 core VM running on a 2 sockets host ?

You've not said how many cores & threads your host CPUs have, so we
can't answer that.

The normal recommend is to not overcommit logical CPUs, where logical
CPUs means sockets * cores * threads.

VMs created by virt-manager don't use CPU pinning, so they float
freely across host CPUs as decided by the host OS scheduler. When
having floating CPUs, the CPU topology should never use threads > 1,
but the mix of cores & sockets has essentially no impact on performance.
Since each vCPU will move across different host pCPUs over time, the
effective topology is constantly changing.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

* Re: QEMU cpu socket allocation
  2022-05-18  6:23   ` Rajesh A
@ 2022-05-18 14:09     ` Peter Zay
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Zay @ 2022-05-18 14:09 UTC (permalink / raw)
  To: Rajesh A; +Cc: qemu-discuss, qemu-devel, Ramya R (GIMEC), V G ASHWINI .


[-- Attachment #1.1: Type: text/plain, Size: 4512 bytes --]

Hi Rajesh,

>So, is it a bug that Virt Manager uses more Sockets by default, when i
choose “Copy host CPU Configuration” ?

Bug, or feature.

With a win10 client in a VM, Windows PC Health Check will complain that you
do not have enough CPUs to upgrade to win11 if you have
(Sockets,Cores,Threads) = (16,1,1).

If you have (Sockets,Cores,Threads) = (1,16,1), Windows will allow the
upgrade.

Looks like a bug.


On Wed, May 18, 2022 at 2:24 AM Rajesh A <rajesh.a@tatacommunications.com>
wrote:

> Hi Peter
>
>
>
> Thanks. Yes, I believe (Sockets,Cores,Threads) = (1,16,1) should be the
> best performance, as the VM does not need to access the memory of another
> NUMA node.
>
>
>
> So, is it a bug that Virt Manager uses more Sockets by default, when i
> choose “Copy host CPU Configuration” ?
>
>
>
> regards,
>
>
>
> *Rajesh A*
> Engineering Media Movement
> Media Services
>
>
>
> Direct +91 44 66674575   |  Mobile +91 9043011101   |  IP 564575
> rajesh.a@tatacommunications.com
>
>
> <http://tatacommunications.com/>
>
> www.tatacommunications.com
>
> <https://twitter.com/#!/tata_comm>
>
>  @tata_comm <https://twitter.com/#!/tata_comm>
>
>
>
>
>
> *From:* Peter Zay <peterzay1@gmail.com>
> *Sent:* 18 May 2022 01:33 AM
> *To:* Rajesh A <rajesh.a@tatacommunications.com>
> *Cc:* qemu-discuss@nongnu.org; qemu-devel@nongnu.org; Ramya R (GIMEC) <
> ramya.r@tatacommunications.com>; V G ASHWINI . <
> Ashwini.VG@contractor.tatacommunications.com>
> *Subject:* Re: QEMU cpu socket allocation
>
>
>
> *CAUTION*: This email originated from outside of the organization. Do not
> click links or open attachments unless you recognize the sender and know
> the content is safe.
>
> Hi Rajesh,
>
>
>
> Would the more intuitive CPU setting of (Sockets,Cores,Threads) = (1,16,1)
> be ok?
>
>
>
> Thanks.
>
>
>
>
>
> On Tue, May 17, 2022 at 10:03 AM Rajesh A <rajesh.a@tatacommunications.com>
> wrote:
>
> Hi QEMU dev
>
>
>
> Virt Manager is able to configure a QEMU VM with more CPU sockets than the
> physical host has.
>
> For example, in the below VM, when I request 16 vCPU cores,  by default it
> takes as 16 Sockets with 1 core each. The host itself has only 2 Sockets.
>
>    1. How does QEMU allow this and how the VM works?
>    2. What is the recommended configuration of Sockets/Cores/Threads for
>    best VM performance of a 16 core VM running on a 2 sockets host ?
>
>
>
>
>
> regards,
>
>
>
> *Rajesh A*
> Engineering Media Movement
> Media Services
>
>
>
> Direct +91 44 66674575   |  Mobile +91 9043011101   |  IP 564575
> rajesh.a@tatacommunications.com
>
>
>
> <https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftatacommunications.com%2F&data=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=RwEq2mM%2FD6EPV3weUzP1i87N7n%2Fxe619qWQzJjSYpVg%3D&reserved=0>
>
> www.tatacommunications.com
> <https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.tatacommunications.com%2F&data=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=CeVSNB1CC9Dn%2BRvtUdQAH13eTvPhjyYhk%2FVaW66yy3o%3D&reserved=0>
>
>
> <https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2F%23!%2Ftata_comm&data=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=Kqv3RAl3ZhDXSkPJeSJV2IRwewLPsoOf5fdVE%2BPm8iw%3D&reserved=0>
>
>  @tata_comm
> <https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2F%23!%2Ftata_comm&data=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=Kqv3RAl3ZhDXSkPJeSJV2IRwewLPsoOf5fdVE%2BPm8iw%3D&reserved=0>
>
>
>
>
>
>
>
>
> --
>
> Peter
>


-- 
Peter

[-- Attachment #1.2: Type: text/html, Size: 14979 bytes --]

[-- Attachment #2: image001.jpg --]
[-- Type: image/jpeg, Size: 2710 bytes --]

[-- Attachment #3: image002.jpg --]
[-- Type: image/jpeg, Size: 691 bytes --]

[-- Attachment #4: image003.png --]
[-- Type: image/png, Size: 76850 bytes --]

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

end of thread, other threads:[~2022-05-18 14:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17 10:50 QEMU cpu socket allocation Rajesh A
2022-05-17 20:03 ` Peter Zay
2022-05-18  6:23   ` Rajesh A
2022-05-18 14:09     ` Peter Zay
2022-05-18  8:33 ` Daniel P. Berrangé

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.