# US 2022/0027183 A1 · Fine-grained application-aware latency optimization for virtual machines at runtime

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0027183 A1
- Document ID: US20220027183A1
- Status: Published application
- Kind: A1
- Application number: 16/936,289
- Filed: 2020-07-22
- Published: 2022-01-27
- Earliest claimed: 2020-07-22
- Assignees: VMware, Inc.
- Applicants: VMware, Inc.
- Inventors: Xunjia LU; Haoqiang ZHENG
- Web page: https://patentgrep.com/patent/US20220027183A1

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 9/45545: {Guest-host, i.e. hypervisor is an application program itself, e.g. VirtualBox}
- G06F 9/4881: {Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues}
- G06F 2009/4557: {Distribution of virtual machine instances; Migration and load balancing}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method of selectively assigning virtual CPUs (vCPUs) of a virtual machine (VM) to physical CPUs (pCPUs), where execution of the VM is supported by a hypervisor running on a hardware platform including the pCPUs, includes determining that a first vCPU of the vCPUs is scheduled to execute a latency-sensitive workload of the VM and a second vCPU of the vCPUs is scheduled to execute a non-latency-sensitive workload of the VM and assigning the first vCPU to a first pCPU of the pCPUs and the second vCPU to a second pCPU of the pCPUs. A kernel component of the hypervisor pins the assignment of the first vCPU to the first pCPU and does not pin the assignment of the second vCPU to the second pCPU. The method further comprises selectively tagging or not tagging by a user or an automated tool, a plurality of workloads of the VM as latency-sensitive.

## Claims

### Claim 1

A method of selectively assigning virtual CPUs (vCPUs) of a virtual machine (VM) to physical CPUs (pCPUs), wherein execution of the VM is supported by a hypervisor running on a hardware platform including the pCPUs, the method comprising:
determining that a first vCPU of the vCPUs is scheduled to execute a latency-sensitive workload of the VM and a second vCPU of the vCPUs is scheduled to execute a non-latency-sensitive workload of the VM;
making an assignment the first vCPU to a first pCPU of the pCPUs and the second vCPU to a second pCPU of the pCPUs; and
causing the latency-sensitive workload to execute on the first vCPU and the non-latency-sensitive workload on the second vCPU,
wherein a kernel component of the hypervisor pins the assignment of the first vCPU to the first pCPU and does not pin the assignment of the second vCPU to the second pCPU.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
determining, while the second vCPU is executing the non-latency-sensitive workload, that the second vCPU is scheduled to execute a latency-sensitive workload; and
re-assigning the second vCPU to a third pCPU such that the second vCPU cannot be re-assigned to another pCPU of the pCPUs.

### Claim 3 (depends on 1)

The method of claim 1, wherein the kernel component, during execution of the VM, is not permitted to re-assign the first vCPU to any pCPU of the pCPUs and is permitted to re-assign the second vCPU to another pCPU of the pCPUs.

### Claim 4 (depends on 3)

The method of claim 3, wherein the kernel component, during execution of the VM, schedules another vCPU of the vCPUs to run on the second pCPU.

### Claim 5 (depends on 4)

The method of claim 4, wherein said another vCPU is running a workload of another VM.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
selectively tagging or not tagging a plurality of workloads of the VM as latency-sensitive,
wherein the workload executed by the first vCPU is tagged as latency-sensitive and the workload executed by the second vCPU is not tagged as latency-sensitive.

### Claim 7 (depends on 6)

The method of claim 6, wherein
the selective tagging or not tagging is performed by a guest operating system running in the VM or an application program running thereon, and is communicated via a channel to the kernel component of the hypervisor, and
the guest operating system runs the latency-sensitive and non-latency sensitive workloads.

### Claim 8

A computer system comprising:
a hardware platform that includes a plurality of physical CPUs (pCPUs); and
a memory coupled to the pCPUs, wherein
the memory has loaded therein a hypervisor which includes a kernel scheduler, and the hypervisor supports execution of one or more virtual machines (VMs), each of which includes a plurality of virtual CPUs (vCPUs), and
when the kernel scheduler determines that a first vCPU of the vCPUs is scheduled to execute a latency-sensitive workload of the VM and a second vCPU of the vCPUs is scheduled to execute a non-latency-sensitive workload of the VM, the kernel scheduler makes an assignment of the first vCPU to a first pCPU of the pCPUs and the second vCPU to a second pCPU of the pCPUs, and causes the latency-sensitive workload to execute on the first vCPU and the non-latency-sensitive workload to execute on the second vCPU, wherein the assignment is such that, during execution of the VM, the kernel scheduler is not permitted to re-assign the first vCPU to any pCPU of the pCPUs and is permitted to re-assign the second vCPU to another pCPU of the pCPUs.

### Claim 9 (depends on 8)

The computer system of claim 8, wherein
when the kernel scheduler determines, while the second vCPU is executing the non-latency-sensitive workload, that the second vCPU is scheduled to execute a latency-sensitive workload, the kernel scheduler re-assigns the second vCPU to a third pCPU, while the second vCPU is executing, such that the second vCPU cannot be re-assigned to another pCPU of the pCPUs.

### Claim 10 (depends on 8)

The computer system of claim 8, wherein the kernel component, during execution of the VM, schedules another vCPU of the vCPUs to run on the second pCPU.

### Claim 11 (depends on 10)

The computer system of claim 10, wherein said another vCPU is running a workload of another VM.

### Claim 12 (depends on 8)

The computer system of claim 8, wherein each of a plurality of workloads of the VM is tagged or not tagged as latency-sensitive, and the workload executed by the first vCPU is tagged as latency-sensitive and the workload executed by the second vCPU is not tagged as latency-sensitive.

### Claim 13 (depends on 12)

The computer system of claim 12, wherein each of a plurality of workloads of the VM is tagged or not tagged as latency-sensitive according to inputs by an automated tool.

### Claim 14 (depends on 8)

The computer system of claim 8, wherein the workloads tagged as latency-sensitive run workloads that are more time-critical than the workloads that are not tagged as latency-sensitive.

### Claim 15

A non-transitory computer-readable medium comprising instructions executable in a computer system having a hardware platform that includes a plurality of physical CPUs (pCPUs) and a memory having loaded therein the instructions which, when executed in the computer system, carries out a method of selectively assigning virtual CPUs (vCPUs) of a virtual machine (VM) running in the computer system to the pCPUs, said method comprising:
determining that a first vCPU of the vCPUs is scheduled to execute a latency-sensitive workload of the VM and a second vCPU of the vCPUs is scheduled to execute a non-latency-sensitive workload of the VM; and
making an assignment of the first vCPU to a first pCPU of the pCPUs and the second vCPU to a second pCPU of the pCPUs; and
causing the latency-sensitive workload to execute on the first vCPU and the non-latency-sensitive workload on the second vCPU,
wherein the assignment of the first vCPU is pinned to the first pCPU and the assignment of the second vCPU is not pinned to the second pCPU.

### Claim 16 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein the method further comprises:
determining, while the second vCPU is executing the non-latency-sensitive workload, that the second vCPU is scheduled to execute a latency-sensitive workload; and
re-assigning the second vCPU to a third pCPU such that the second vCPU cannot be re-assigned to another pCPU of the pCPUs.

### Claim 17 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein during execution of the VM, the first vCPU is not permitted to be assigned to any pCPU of the pCPUs and the second vCPU is permitted to be assigned to another pCPU of the pCPUs.

### Claim 18 (depends on 17)

The non-transitory computer-readable medium of claim 17, wherein during execution of the VM, another vCPU of the vCPUs is assigned to run on the second pCPU.

### Claim 19 (depends on 18)

The non-transitory computer-readable medium of claim 18, wherein said another vCPU is running a workload of another VM.

### Claim 20 (depends on 15)

The non-transitory computer-readable medium of claim 15, wherein
each of a plurality of workloads of the VM is tagged or not tagged as latency-sensitive, and the workload executed by the first vCPU is tagged as latency-sensitive and the workload executed by the second vCPU is not tagged as latency-sensitive, and
the workloads tagged as latency-sensitive run workloads that are more time-critical than the workloads that are not tagged as latency-sensitive.
