VMware Cloud Community
nik-O
Contributor
Contributor
Jump to solution

vCPU vs logical CPU

Hello,

I would like to know, when a vm runs(1vCPU) and stay on the same host, does it stay on the same Logical CPU? if not what are the conditions for the coscheduler to schedule it on another lCPU?

I remember a long time ago i ve read somthing saying that the scheduler changes the lCPU handling the vCPU of the vm many times a second?

is it still true in vi3.5 or vsphere?

thanks for your answers!!!

0 Kudos
1 Solution

Accepted Solutions
RParker
Immortal
Immortal
Jump to solution

L2 cache is bound to the cores.

That's right! HARDWARE. There is your answer. You are overthinking the situation.

You install ESX or you install Windows, what's changed? NOTHING.

HOW they handle their internal process makes no difference. The L2/L3 cache is AT the hardware level.

Yes, I know you are thinking a VM has it's own cores, but you would be wrong, those are time sliced on the hardware via the Hyper Visor.

cache is on the CPU hardware.

View solution in original post

0 Kudos
7 Replies
admin
Immortal
Immortal
Jump to solution

Hi Nik,

I cannot think of not using the below two documents when I talk about Co-Scheduling on ESX (Relaxed and strict both). Please have a look at that and I think this article can give you more benefit.

I have attached the PDF document also which elaborate the concept in a greater detail.

if you found my answer to be useful, feel free to mark it as Helpful or Correct.

weinstein5
Immortal
Immortal
Jump to solution

vmkernel monitors cpu and every 20 ms will schedule the vCPU on on a LCPU and move if necessary - so to answer no the vCPU will not runb on the same LCPU all the time - vmkrnel is tries to balance the load across all LCPUs and it is this goal that will cause it to move a vCPU - this is true of ESX 3.5 and ESX 4.0

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
nik-O
Contributor
Contributor
Jump to solution

So what is the impact of possibly changing the lCPU every 20 ms on the L2 cache?

Does it increase the risk of miss hit?

So last question:

does the global L3 cache from the nehalem reduce this impact as it is shared between cpu?

Thank you for your helpful answers !

0 Kudos
weinstein5
Immortal
Immortal
Jump to solution

As I understand it the vmkernel handles the L2/L3 cache as part of the scheduling

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
RParker
Immortal
Immortal
Jump to solution

does the global L3 cache from the nehalem reduce this impact as it is shared between cpu?

I am going to answer a question with a question to ensure you know what you are basing this on, so I can guage whether or not you are asking a valid question.

Does this L3 cache impact software threads or SMP requests between CPU on a physical host? Programs utilize CPU, cache is done as a hardware level enhancement on the CPU bus. VM's are treated like processes on ESX.

So if you can answer that question, you will be able to answer your own question.

0 Kudos
nik-O
Contributor
Contributor
Jump to solution

L2 cache is bound to the cores.

vCPUs use the cache bound to the lCPU they are running on.

So when the vCPU is scheduled on another LCPU it uses the local L2 cache, "loosing" the data and instructions located in the previous L2 cache.

So doing that every 20 ms may fill the L2 caches with non optimal datas.

Am i right?

However, the L3 cache is larger and common to all cores, that means even when vCPUs are scheduled on different cores the L3 cache contains the data from all the underneath L2 caches, reducing the bad effects of L2 cache.

Is this correct? If yes the nehalem processors should improve the vsphere performances a lot?

0 Kudos
RParker
Immortal
Immortal
Jump to solution

L2 cache is bound to the cores.

That's right! HARDWARE. There is your answer. You are overthinking the situation.

You install ESX or you install Windows, what's changed? NOTHING.

HOW they handle their internal process makes no difference. The L2/L3 cache is AT the hardware level.

Yes, I know you are thinking a VM has it's own cores, but you would be wrong, those are time sliced on the hardware via the Hyper Visor.

cache is on the CPU hardware.

0 Kudos