Bug 1807280
| Summary: | [Hyper-V Enlightenment] flag 'hv_time' can't improve performance evidently | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Yu Wang <wyu> | ||||||
| Component: | qemu-kvm | Assignee: | Virtualization Maintenance <virt-maint> | ||||||
| qemu-kvm sub component: | General | QA Contact: | Yu Wang <wyu> | ||||||
| Status: | CLOSED NOTABUG | Docs Contact: | |||||||
| Severity: | medium | ||||||||
| Priority: | unspecified | CC: | lijin, ribarry, virt-maint, vkuznets, vrozenfe | ||||||
| Version: | 8.2 | Flags: | pm-rhel:
mirror+
|
||||||
| Target Milestone: | rc | ||||||||
| Target Release: | 8.3 | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2020-03-03 12:24:57 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
|
Description
Yu Wang
2020-02-26 01:22:38 UTC
Cc: Vadim I tried this on my Ivy Bridge and hv_time works as expected. My QEMU command line was: ~/qemu/x86_64-softmmu/qemu-system-x86_64 -machine q35,accel=kvm,kernel-irqchip=split -name guest=win10 -cpu host,-vmx,+kvm_pv_unhalt,hv_time -smp 6 -m 16384 -drive file=/var/lib/libvirt/images/WindowsServer2016_Gen1.qcow2,format=qcow2,if=none,id=drive-ide0-0-0 -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -m 8G -net nic,model=e1000e -net bridge,br=br0 -vnc :0 clock_gettime() takes around 420 CPU cycles. This is the expected result. What's the clocksource in use on the host? It should be 'tsc': # cat /sys/devices/system/clocksource/clocksource0/current_clocksource tsc Also, take a look at your dmesg and check that there's nothing about clocksource being unstable. The simplest way to check if hv_time is active from the Windows side will be crafting a simple code that calls QPF function https://docs.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancefrequency In case of hv_time the frequency will be 10MHz Even with hv_time parameter in qemu command line, WIndows can disable this option and go with other time stamp source, if for example "useplatformclock" was specified. Best, Vadim. Created attachment 1666929 [details]
QPF test app
(In reply to Vadim Rozenfeld from comment #3) > Created attachment 1666929 [details] > QPF test app Can QE run this app on the system and post the result back? Best, Vadim. QPF test app reports: Frequency = 3.57954 MHz so this is not Hyper-V TSC page clocksourse. I copied over this image to my SandyBridge server where WS2016 works well but it didn't help, apparently this Win10 image is somehow different. I also traced KVM to see if Windows enables TSC page and apparently it does: qemu-system-x86-15441 [002] 19678.928019: kvm_exit: reason MSR_READ rip 0xfffff80145f487a0 info 0 0 qemu-system-x86-15441 [002] 19678.928020: kvm_msr: msr_read 40000021 = 0x0 qemu-system-x86-15441 [002] 19678.928024: kvm_exit: reason MSR_WRITE rip 0xfffff80145f4886b info 0 0 qemu-system-x86-15441 [002] 19678.928025: kvm_msr: msr_write 40000021 = 0xd001 please make sure that useplatformclock is off. This parameter disables hy_time when it is turned on. (In reply to Vadim Rozenfeld from comment #7) > please make sure that useplatformclock is off. This parameter disables > hy_time when it is > turned on. The useplatformclock is "yes" in guest. After turn off useplatformclock, hv_time effective. It maybe our automation installed image problem, after install it with automation, the useplatformclock is "yes". If install it manually, there is no useplatformclock. BTW, do you know which setting or tools-installed will influence the useplatformclock? I have no idea. Thanks Yu Wang (In reply to Yu Wang from comment #8) > (In reply to Vadim Rozenfeld from comment #7) > > please make sure that useplatformclock is off. This parameter disables > > hy_time when it is > > turned on. > > The useplatformclock is "yes" in guest. > After turn off useplatformclock, hv_time effective. > > It maybe our automation installed image problem, after install it with > automation, the useplatformclock is "yes". > If install it manually, there is no useplatformclock. > > BTW, do you know which setting or tools-installed will influence the > useplatformclock? I have no idea. I have no idea ether. Basically on pre Vista platforms useplatformclock can be set by modifying boot.ini. For more modern platforms, if I'm not mistaken, bcd editor is the only official option to modify boot time parameters. Best, Vadim. > > Thanks > Yu Wang (In reply to Vadim Rozenfeld from comment #9) > (In reply to Yu Wang from comment #8) > > (In reply to Vadim Rozenfeld from comment #7) > > > please make sure that useplatformclock is off. This parameter disables > > > hy_time when it is > > > turned on. > > > > The useplatformclock is "yes" in guest. > > After turn off useplatformclock, hv_time effective. > > > > It maybe our automation installed image problem, after install it with > > automation, the useplatformclock is "yes". > > If install it manually, there is no useplatformclock. > > > > BTW, do you know which setting or tools-installed will influence the > > useplatformclock? I have no idea. > > I have no idea ether. Basically on pre Vista platforms useplatformclock > can be set by modifying boot.ini. For more modern platforms, if I'm not > mistaken, > bcd editor is the only official option to modify boot time parameters. > Got it, I checked our automation installed log, it set the useplatformclock to yes for other use after installing.I will make a note for this case. Thanks a lot! Yu Wang > Best, > Vadim. > > > > > Thanks > > Yu Wang 'bcdedit /set useplatformclock No' in the guest resolves the issue. Hi Vitaly, I have a question about this case. Since "The result is much smaller when adding the flag",how to judge "much smaller" ? eg. the cycles time with hv_time is less than 50%/30%/10% without hv_time. Thanks Yu Wang In my (In reply to Yu Wang from comment #12) > > Since "The result is much smaller when adding the flag",how to judge "much > smaller" ? In my testing it is somewhere around 9000 cycles without 'hv_time' and 400 with it so if you need a hard setting for an automated test set it to e.g. 10% (so we are 10x faster with the feature). |