<div dir="ltr">Hi Satish,<div><br></div><div>Using host-passthrough on KVM is not only passthrough the physical</div><div>host CPU model, but will also "try" passthrough the same CPU flags.</div><div>That means the vcpu will contain the flags same as host CPU, but it</div><div>still depends on how KVM can support. In other words, KVM will only </div><div>set the flags what the host CPU have and what KVM itself can support.</div><div><br></div><div>Since QEMU has released to 4.2.0, perhaps you can try the latest </div><div>version and doing the pure KVM running to see if it bring up the</div><div>performance and consider upgrade KVM on compute nodes.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Satish Patel <<a href="mailto:satish.txt@gmail.com" target="_blank">satish.txt@gmail.com</a>> 於 2020年3月6日 週五 上午1:11寫道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Eddie,<br>
<br>
I have tried everything to match or fix CPU Topology layout but its<br>
never come down to correct as i mentioned in screenshot, I have check<br>
on Alicloud and they are also running KVM and their virtual machine<br>
lstopo output is really match with physical machine, like L1i / L1d<br>
cache layout etc.<br>
<br>
if you look at following output its strange i am using "-cpu host"<br>
option but still there are lots of missing flags on my virtual machine<br>
cpuinfo, is that normal?<br>
<br>
This is my VM output (virtual machine)<br>
<br>
# grep flags /proc/cpuinfo | uniq<br>
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov<br>
pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm<br>
constant_tsc arch_perfmon rep_good nopl xtopology eagerfpu pni<br>
pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt<br>
tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm<br>
arat fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt<br>
<br>
This is compute machine (physical host)<br>
<br>
# grep flags /proc/cpuinfo | uniq<br>
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov<br>
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx<br>
pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl<br>
xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor<br>
ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1<br>
sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c<br>
rdrand lahf_lm abm epb invpcid_single intel_ppin ssbd ibrs ibpb stibp<br>
tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2<br>
smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida<br>
arat pln pts md_clear spec_ctrl intel_stibp flush_l1d<br>
<br>
On Thu, Mar 5, 2020 at 11:26 AM Eddie Yen <<a href="mailto:missile0407@gmail.com" target="_blank">missile0407@gmail.com</a>> wrote:<br>
><br>
> Hi Satish,<br>
><br>
> Since you already set "cpu_mode = host-passthrough", there's no need<br>
> to set cpu_model.<br>
><br>
> BTW, we're not known about the CPU topology a lot. But IME we always<br>
> set "hw_cpu_sockets = 2" in specified image or flavor metadata if running<br>
> Windows instance. In default, KVM always allocate all vcpus into sockets<br>
> in CPU topology, and this will affect the Windows VM performance since<br>
> Windows only support maximum 2 CPU sockets.<br>
><br>
> Perhaps you can try limit socket numbers by setting hw_cpu_sockets in<br>
> image metadata (or hw:cpu_sockets in flavor metadata.)<br>
><br>
> Satish Patel <<a href="mailto:satish.txt@gmail.com" target="_blank">satish.txt@gmail.com</a>> 於 2020年3月5日 週四 下午10:46寫道:<br>
>><br>
>><br>
>> cpu_mode = cpu-passthrough<br>
>> cpu_model = none<br>
>><br>
>> Do you think cpu_model make difference ?<br>
>><br>
>><br>
>> Sent from my iPhone<br>
>><br>
>> On Mar 5, 2020, at 7:18 AM, Satish Patel<<a href="mailto:satish.txt@gmail.com" target="_blank">satish.txt@gmail.com</a>> wrote:<br>
>><br>
>> <br>
>><br>
>> cpu-passthrough<br>
>><br>
>> Sent from my iPhone<br>
>><br>
>> On Mar 4, 2020, at 9:24 PM, rui zang <<a href="mailto:rui.zang@yandex.com" target="_blank">rui.zang@yandex.com</a>> wrote:<br>
>><br>
>> <br>
>> Hi,<br>
>><br>
>> What is the value for the "cpu_mode" configuration option?<br>
>> <a href="https://docs.openstack.org/mitaka/config-reference/compute/hypervisor-kvm.html" rel="noreferrer" target="_blank">https://docs.openstack.org/mitaka/config-reference/compute/hypervisor-kvm.html</a><br>
>><br>
>> Thanks,<br>
>> Zang, Rui<br>
>><br>
>><br>
>> 05.03.2020, 01:24, "Satish Patel" <<a href="mailto:satish.txt@gmail.com" target="_blank">satish.txt@gmail.com</a>>:<br>
>><br>
>> Folks,<br>
>><br>
>> We are running openstack with KVM and i have noticed kvm presenting<br>
>> wrong CPU Tolopoly to VM and because of that we are seeing bad<br>
>> performance to our application.<br>
>><br>
>> This is openstack compute:<br>
>><br>
>> # lstopo-no-graphics --no-io<br>
>> Machine (64GB total)<br>
>>   NUMANode L#0 (P#0 32GB) + Package L#0 + L3 L#0 (25MB)<br>
>>     L2 L#0 (256KB) + L1d L#0 (32KB) + L1i L#0 (32KB) + Core L#0<br>
>>       PU L#0 (P#0)<br>
>>       PU L#1 (P#20)<br>
>>     L2 L#1 (256KB) + L1d L#1 (32KB) + L1i L#1 (32KB) + Core L#1<br>
>>       PU L#2 (P#1)<br>
>>       PU L#3 (P#21)<br>
>><br>
>> This is VM running on above compute<br>
>><br>
>> # lstopo-no-graphics --no-io<br>
>> Machine (59GB total)<br>
>>   NUMANode L#0 (P#0 29GB) + Package L#0 + L3 L#0 (16MB)<br>
>>     L2 L#0 (4096KB) + Core L#0<br>
>>       L1d L#0 (32KB) + L1i L#0 (32KB) + PU L#0 (P#0)<br>
>>       L1d L#1 (32KB) + L1i L#1 (32KB) + PU L#1 (P#1)<br>
>>     L2 L#1 (4096KB) + Core L#1<br>
>>       L1d L#2 (32KB) + L1i L#2 (32KB) + PU L#2 (P#2)<br>
>>       L1d L#3 (32KB) + L1i L#3 (32KB) + PU L#3 (P#3)<br>
>><br>
>> if you noticed P#0 and P#1 has own (32KB) cache per thread that is<br>
>> wrong presentation if you compare with physical CPU.<br>
>><br>
>> This is a screenshot of AWS vs Openstack CPU Topology and looking at<br>
>> openstack its presentation is little odd, is that normal?<br>
>><br>
>> <a href="https://imgur.com/a/2sPwJVC" rel="noreferrer" target="_blank">https://imgur.com/a/2sPwJVC</a><br>
>><br>
>> I am running CentOS7.6 with kvm 2.12 version.<br>
>><br>
</blockquote></div></div>