Skip to contentSkip to conversation

cpu frequency

DISCUSSION Nerijus Baliunas 3 participants 11 messages Dec 23, 2014 – Feb 4, 2015 KVM

lore
Share & tools
lore
#0 lore raw

Hello,

A commercial application running on Windows (kvm guest) detects CPU as:
CPU_0: CPU0, Intel64 Family 6 Model 42 Stepping 1, 64, 64, 2200, 078BFBFD000206A1, 10753, CPU 0
After some time, without reboot, it detects as:
CPU_0: CPU0, Intel64 Family 6 Model 42 Stepping 1, 64, 64, 2298, 078BFBFD000206A1, 10753, CPU 0

Windows Server 2012 Control Panel -> System shows CPU as 2.3 GHZ, but after reboot it might show 2.2 or 1.97 GHz.

The problem is, that commercial application stops working after it detects CPU frequency change (2200 -> 2298 in above case). Is it possible to patch qemu-kvm that it shows some constant frquency to the guest?

Regards,
Nerijus

maintainer
#1 lore raw
Quoted 9 lines · Nerijus Baliunas

Hello,

A commercial application running on Windows (kvm guest) detects CPU as:
CPU_0: CPU0, Intel64 Family 6 Model 42 Stepping 1, 64, 64, 2200, 078BFBFD000206A1, 10753, CPU 0
After some time, without reboot, it detects as:
CPU_0: CPU0, Intel64 Family 6 Model 42 Stepping 1, 64, 64, 2298, 078BFBFD000206A1, 10753, CPU 0

Quoted 6 lines

Windows Server 2012 Control Panel -> System shows CPU as 2.3 GHZ, but after reboot it might show 2.2 or 1.97 GHz.

The problem is, that commercial application stops working after it detects CPU frequency change (2200 -> 2298 in above case). Is it possible to patch qemu-kvm that it shows some constant frquency to the guest?

How are you running qemu-kvm? (Command line, or XML if you're using libvirt, or similar).

Paolo

maintainer
#3 lore raw
Quoted 7 lines

A commercial application running on Windows (kvm guest) detects CPU as:
CPU_0: CPU0, Intel64 Family 6 Model 42 Stepping 1, 64, 64, 2200, 078BFBFD000206A1, 10753, CPU 0
After some time, without reboot, it detects as:
CPU_0: CPU0, Intel64 Family 6 Model 42 Stepping 1, 64, 64, 2298, 078BFBFD000206A1, 10753, CPU 0

Quoted 6 lines

Windows Server 2012 Control Panel -> System shows CPU as 2.3 GHZ, but after reboot it might show 2.2 or 1.97 GHz.

The problem is, that commercial application stops working after it detects CPU frequency change (2200 -> 2298 in above case). Is it possible to patch qemu-kvm that it shows some constant frquency to the guest?

Do you know how the application computes the frequency?

In the case of Windows it's probably some timing loop that is executed at startup, and the result depends on frequency scaling in the host. Try adding this to the XML in the meanwhile, and see if the control panel shows the same value:

Inside <features>:

<hyperv>

    <relaxed state='on'/>

</hyperv>

Inside <clock offset='localtime'>:

<timer name='hypervclock' present='yes'/>

Paolo

#4 lore raw
Quoted 1 line · Paolo Bonzini <pbonzini <at> redhat.com> writes:

Do you know how the application computes the frequency?

No.

Quoted 7 lines

In the case of Windows it's probably some timing loop that is executed at startup, and the result depends on frequency scaling in the host. Try adding this to the XML in the meanwhile, and see if the control panel shows the same value:

Inside <features>:

Quoted 7 lines

<hyperv>

    <relaxed state='on'/>

</hyperv>

Inside <clock offset='localtime'>:

<timer name='hypervclock' present='yes'/>

So far Control Panel -> System shows CPU as 2.2 GHz, I rebooted once. So it seems OK.

Thanks,
Nerijus

#5 lore raw
Quoted 13 lines · Nerijus Baliunas <nerijus <at> users.sourceforge.net> writes:
Quoted 11 lines · Paolo Bonzini <pbonzini <at> redhat.com> writes:

In the case of Windows it's probably some timing loop that is executed at startup, and the result depends on frequency scaling in the host. Try adding this to the XML in the meanwhile, and see if the control panel shows the same value:

Inside <features>:

<hyperv>

    <relaxed state='on'/>

</hyperv>

Quoted 6 lines
Quoted 3 lines

Inside <clock offset='localtime'>:

<timer name='hypervclock' present='yes'/>

So far Control Panel -> System shows CPU as 2.2 GHz, I rebooted once. So it seems OK.

Unfortunately after the host reboot the problem reappeared once. It helped to reboot the VM. Any ideas what else to try?

Regards,
Nerijus

#6 lore raw
In reply to Paolo Bonzini
Quoted 24 lines · On Tue, 23 Dec 2014 15:40:22 +0100 Paolo Bonzini <[email protected]> wrote:
Quoted 7 lines

A commercial application running on Windows (kvm guest) detects CPU as:
CPU_0: CPU0, Intel64 Family 6 Model 42 Stepping 1, 64, 64, 2200, 078BFBFD000206A1, 10753, CPU 0
After some time, without reboot, it detects as:
CPU_0: CPU0, Intel64 Family 6 Model 42 Stepping 1, 64, 64, 2298, 078BFBFD000206A1, 10753, CPU 0

Quoted 6 lines

Windows Server 2012 Control Panel -> System shows CPU as 2.3 GHZ, but after reboot it might show 2.2 or 1.97 GHz.

The problem is, that commercial application stops working after it detects CPU frequency change (2200 -> 2298 in above case). Is it possible to patch qemu-kvm that it shows some constant frquency to the guest?

Do you know how the application computes the frequency?

In the case of Windows it's probably some timing loop that is executed at startup, and the result depends on frequency scaling in the host. Try adding this to the XML in the meanwhile, and see if the control panel shows the same value:

Inside <features>:

<hyperv>

Quoted 8 lines
    <relaxed state='on'/>

</hyperv>

Inside <clock offset='localtime'>:

<timer name='hypervclock' present='yes'/>

Paolo

It did not help. Today that commecrial application detects 2400, although Control Panel -> System shows 2.20 GHz.
So my question again - is it possible to patch qemu-kvm that it shows some constant frequency to the guest? But the answer is probably not, because I don't know how the application computes the frequency...

Regards,
Nerijus

maintainer
#7 lore raw
Quoted 5 lines · Nerijus Baliunas

It did not help. Today that commecrial application detects 2400, although Control Panel -> System shows 2.20 GHz.
So my question again - is it possible to patch qemu-kvm that it shows some constant frequency to the guest? But the answer is probably not, because I don't know how the application computes the frequency...

Indeed.

Paolo

#8 lore raw
In reply to Nerijus Baliunas
Quoted 6 lines

It did not help. Today that commecrial application detects 2400, although Control Panel -> System shows 2.20 GHz.
So my question again - is it possible to patch qemu-kvm that it shows some constant frequency to the guest? But the answer is probably not, because I don't know how the application computes the frequency...

Have you tried to disable turbo mode (assuming you have new enough CPU model) and fix frequency via frequency governor settings? If it helps, it can be an ugly hack with pre-up/post-up libvirt actions, though youd probably want to keep frequency the same to maximize performance.

#9 lore raw
Quoted 5 lines · On Tue, 3 Feb 2015 18:07:57 +0400 Andrey Korolyov <[email protected]> wrote:

Have you tried to disable turbo mode (assuming you have new enough CPU model) and fix frequency via frequency governor settings? If it helps, it can be an ugly hack with pre-up/post-up libvirt actions, though youd probably want to keep frequency the same to maximize performance.

I tried to alter frequency governor settings, but unsuccessfully. They seem to change but then revert back in some short time. CentOS 7, Intel(R) Xeon(R) CPU E5-2420 v2 @ 2.20GHz.

Regards,
Nerijus

#10 lore raw
Quoted 8 lines · Nerijus Baliunas
Quoted 5 lines · On Tue, 3 Feb 2015 18:07:57 +0400 Andrey Korolyov <[email protected]> wrote:

Have you tried to disable turbo mode (assuming you have new enough CPU model) and fix frequency via frequency governor settings? If it helps, it can be an ugly hack with pre-up/post-up libvirt actions, though youd probably want to keep frequency the same to maximize performance.

Quoted 4 lines

I tried to alter frequency governor settings, but unsuccessfully. They seem to change but then revert back in some short time. CentOS 7, Intel(R) Xeon(R) CPU E5-2420 v2 @ 2.20GHz.

I remember that the floating frequency was resulted in incorrect guest CPU information, so may be it is an exact solution for your situation. Those frequency values could be altered by running service, unfortunately I have a not enough knowledge about Centos7 packages to name it.