Re: QEMU cpu socket allocation

2022-05-18 Thread Peter Zay
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 
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
> rajes...@tatacommunications.com
>
>
> <http://tatacommunications.com/>
>
> www.tatacommunications.com
>
> <https://twitter.com/#!/tata_comm>
>
>  @tata_comm <https://twitter.com/#!/tata_comm>
>
>
>
>
>
> *From:* Peter Zay 
> *Sent:* 18 May 2022 01:33 AM
> *To:* Rajesh A 
> *Cc:* qemu-disc...@nongnu.org; qemu-devel@nongnu.org; Ramya R (GIMEC) <
> ramy...@tatacommunications.com>; V G ASHWINI . <
> ashwini...@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 
> 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
> rajes...@tatacommunications.com
>
>
>
> <https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftatacommunications.com%2F=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C=RwEq2mM%2FD6EPV3weUzP1i87N7n%2Fxe619qWQzJjSYpVg%3D=0>
>
> www.tatacommunications.com
> <https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.tatacommunications.com%2F=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C=CeVSNB1CC9Dn%2BRvtUdQAH13eTvPhjyYhk%2FVaW66yy3o%3D=0>
>
>
> <https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2F%23!%2Ftata_comm=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C=Kqv3RAl3ZhDXSkPJeSJV2IRwewLPsoOf5fdVE%2BPm8iw%3D=0>
>
>  @tata_comm
> <https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2F%23!%2Ftata_comm=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C=Kqv3RAl3ZhDXSkPJeSJV2IRwewLPsoOf5fdVE%2BPm8iw%3D=0>
>
>
>
>
>
>
>
>
> --
>
> Peter
>


-- 
Peter


Re: QEMU cpu socket allocation

2022-05-18 Thread Daniel P . Berrangé
On Tue, May 17, 2022 at 10:50:02AM +, 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 :|




RE: QEMU cpu socket allocation

2022-05-18 Thread Rajesh A
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
rajes...@tatacommunications.com<mailto:rajes...@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 
Sent: 18 May 2022 01:33 AM
To: Rajesh A 
Cc: qemu-disc...@nongnu.org; qemu-devel@nongnu.org; Ramya R (GIMEC) 
; V G ASHWINI . 

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 
mailto:rajes...@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
rajes...@tatacommunications.com<mailto:rajes...@tatacommunications.com>
[cid:image001.jpg@01D86AAD.F02877A0]
<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Ftatacommunications.com%2F=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C=RwEq2mM%2FD6EPV3weUzP1i87N7n%2Fxe619qWQzJjSYpVg%3D=0>
www.tatacommunications.com<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.tatacommunications.com%2F=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C=CeVSNB1CC9Dn%2BRvtUdQAH13eTvPhjyYhk%2FVaW66yy3o%3D=0>
[cid:image002.jpg@01D86AAD.F02877A0]<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2F%23!%2Ftata_comm=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C=Kqv3RAl3ZhDXSkPJeSJV2IRwewLPsoOf5fdVE%2BPm8iw%3D=0>
 
@tata_comm<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2F%23!%2Ftata_comm=05%7C01%7Crajesh.a%40tatacommunications.com%7C34740206d7594bd2c2cc08da38405798%7C202104622c5e4ec8b3e20be950f292ca%7C0%7C0%7C637884146402124571%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C=Kqv3RAl3ZhDXSkPJeSJV2IRwewLPsoOf5fdVE%2BPm8iw%3D=0>




--
Peter


Re: QEMU cpu socket allocation

2022-05-17 Thread Peter Zay
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 
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
> rajes...@tatacommunications.com
>
>
> 
>
> www.tatacommunications.com
>
> 
>
>  @tata_comm 
>
>
>
>
>


-- 
Peter


QEMU cpu socket allocation

2022-05-17 Thread Rajesh A
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
rajes...@tatacommunications.com
[cid:image002.jpg@01D86A08.A4FDF8E0]

www.tatacommunications.com
[cid:image003.jpg@01D86A08.A4FDF8E0]
 @tata_comm