VirtualBox

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#14944 closed defect (wontfix)

Virtualbox issues an erroneous warning upon setting more CPUs than physical cores regardless of hyperthreading

Reported by: science_man Owned by:
Component: other Version: VirtualBox 5.0.12
Keywords: error, cpu, hyperthreading Cc:
Guest type: all Host type: all

Description

This issue is discussed in detail at https://forums.virtualbox.org/viewtopic.php?f=1&t=64548

The main problem is that if a host's CPU is hyperthreaded, the guest should be allowed to be allocated up to the number of hyperthreaded processors, but there is a warning if the number is greater than the number of physical CPUs. This behavior is also inconsistent, as described in the forum post.

Change History (10)

comment:1 by Frank Mehnert, 8 years ago

Resolution: wontfix
Status: newclosed

Sorry, I don't agree. If the host CPU is hyperthreaded then we do only count the number of physical cores, not the number of hyperthreads. Hyperthreads on the same CPU share certain units and therefore are not completely independent. Running a 2 VCPU guest on 2 hyperthreads of the same physical host core is not possible or will at least result in a very bad guest timing. You might argue that the guest can be made aware that it runs on 2 hyperthreads instead of running on two independent cores but the effort to implement this is really high and not worth the effort as long as there is other potential for optimizing SMP with VirtualBox.

comment:2 by Louis King Jr, 8 years ago

Thank you Frank.

in reply to:  1 comment:3 by gv_user, 8 years ago

Makes sense.

Last edited 8 years ago by gv_user (previous) (diff)

comment:4 by gv_user, 8 years ago

You're right. I was confused about this.

Last edited 8 years ago by gv_user (previous) (diff)

comment:5 by Louis King Jr, 8 years ago

If I were you Frank, I wouldn't bother responding. This user was extremely rude to me. Check the forum post.

Last edited 8 years ago by Louis King Jr (previous) (diff)

comment:6 by gv_user, 8 years ago

It's ok. I realize that I was incorrect.

Last edited 8 years ago by gv_user (previous) (diff)

comment:7 by gv_user, 8 years ago

My apologies.

Last edited 8 years ago by gv_user (previous) (diff)

comment:8 by ware, 7 years ago

Looking at this thread, I'm very disappointed. It shows a fundamental misunderstanding of what Hyper-Threading is. To start, HTT is a specific implementation of a more general technique called Simultaneous Multithreading. The theory behind it is that in the vast majority of cases, a single hardware thread will not utilize all of its resources. Making one "core" look like two logical processors allows more efficient utilization of a core's resources and give better performance.

When it comes to Intel's specific HTT implementation, it is well documented in both the Intel® 64 and IA-32 Architectures Optimization Reference Manual as well as the Intel® 64 and IA-32 Architectures Software Developer Manuals.

Unfortunately, the net effect of what this warning is telling end users to do is to never utilize all of their processing power. For example, in a quad-core processor with HTT enabled, there are 8 hardware threads presented to the OS. Setting up a Virtual Box guest on this same system, this warning would give guidance to only present 4 hardware threads to the guest, thus leaving the maximum CPU utilization of the system at 50%.

At best, the performance that can be had by following this warning would be the same performance as if an end-user was told to disable Hyper-Threading on their system.

I know this was closed as 'wontfix'. I would recommend revisiting that. After all, the competition of Virtual Box gets this right.

comment:9 by Frank Mehnert, 7 years ago

Implementing 2 hyperthreads on a physical core makes perfectly sense for normal applications, in particular for code working directly on the CPU registers. The picture is completely different for VMs because a VM is a heavy-weight process: Before guest code can be executed there is a world switch necessary. Getting the timing right is always a problem with virtual machines and allowing the users to run 8 threads on a CPU with 4 physical cores with 2 hyperthreads per core would make this even more complicated.

If you insist on running such a setup then just feel free to do so and use 'VBoxManage modifyvm' to tune your settings but then please don't report bugs about messed-up guest timing.

comment:10 by GnomeUser, 4 years ago

But what if we have two VMs running? The CPU with two physical cores with HT and two VM with 2 vCPU. Will they still run in parallel utilising the same physical cores or will they be separated and locked somehow? The same question if this VM is running in parallel with some system task on the host.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use