# US 10,481,936 B2 · Efficient virtual machine memory monitoring with hyper-threading

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

- Number: US 10,481,936 B2
- Document ID: US10481936B2
- Status: Granted
- Kind: B2
- Application number: 15/438,995
- Filed: 2017-02-22
- Published: 2018-08-23
- Granted: 2019-11-19
- Earliest claimed: 2017-02-22
- Assignees: Red Hat Israel, Ltd.
- Applicants: Red Hat Israel, Ltd.
- Inventors: Michael Tsirkin
- Web page: https://patentgrep.com/patent/US10481936B2

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 9/4881: {Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues}
- G06F 9/5016: {the resource being the memory}
- G06F 11/30: Monitoring
- G06F 11/301: {where the computing system is a virtual computing platform, e.g. logically partitioned systems (virtual machines G06F9/45533; logical partitioning of resources G06F9/5077)}
- G06F 11/3037: {where the computing system component is a memory, e.g. virtual memory, cache (accessing, addressing or allocating within memory systems or architectures G06F12/00; checking stores for correct operation G11C29/00)}
- G06F 11/3072: {where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting}
- G06F 2009/45575: {Starting, stopping, suspending or resuming virtual machine instances}
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system and method for efficient virtual machine memory monitoring with hyper-threading includes executing, by a hypervisor executing on a plurality of physical processors, a virtual central processor unit (VCPU) of a virtual machine on a first hyper-thread. The plurality of physical processors include a first physical processor having the first hyper-thread and a second hyper-thread. The virtual machine executes on the first hyper-thread. Then, the second hyper-thread executes a memory monitoring instruction on a designated range of a shared memory to cause the second hyper-thread to stop executing. Then, a guest in the virtual machine updates the designated range of the shared memory by storing a first request in the designated range of the shared memory to wake up the second hyper-thread.

## Claims

### Claim 1

A method comprising: executing, by a hypervisor executing on a plurality of physical processors, a virtual central processor unit (VCPU) of a virtual machine, wherein the plurality of physical processors include a first physical processor having a first hyper-thread and a second hyper-thread, wherein the VCPU executes on the first hyper-thread; executing, by the second hyper-thread, a memory monitoring instruction on a designated range of a shared memory to cause the second hyper-thread to stop executing; and updating, by a guest in the virtual machine, the designated range of the shared memory by storing a first request in the designated range of the shared memory to wake up the second hyper-thread, wherein the first request is processed by a third hyper-thread.

### Claim 2 (depends on 1)

The method of claim 1, wherein the plurality of physical processors include a second physical processor having the third hyper-thread, and the method further comprises: notifying, by the second hyper-thread, the third hyper-thread to wake up a request executing task in the third hyper-thread responsive to updating the designated range of the shared memory; and responsive to receiving the notification, waking up, by the third hyper-thread, the request executing task, wherein the request executing task includes an instruction to execute the first request in the designated range of the shared memory.

### Claim 3 (depends on 2)

The method of claim 2, wherein notifying the third hyper-thread to wake up the request executing task includes sending, by the second hyper-thread, an inter-processor interrupt to the third hyper-thread.

### Claim 4 (depends on 2)

The method of claim 2, wherein notifying the third hyper-thread to wake up the request executing task includes executing, by the second hyper-thread, a write instruction into a second designated range of the shared memory, wherein the third hyper-thread monitors the second designated range of the shared memory.

### Claim 5 (depends on 2)

The method of claim 2, further comprising, responsive to waking up the request executing task, executing, by the third hyper-thread, the first request in the designated range of the shared memory.

### Claim 6 (depends on 2)

The method of claim 2, further comprising:
copying, by the second hyper-thread, the first request stored in the designated range of the shared memory to a memory location accessible to the request executing task; and
executing, by the third hyper-thread, the first request in the memory location accessible to the request executing task.

### Claim 7 (depends on 2)

The method of claim 2, wherein the plurality of physical processors include a third physical processor having a fourth hyper-thread, wherein a second virtual machine executes on the fourth hyper-thread, and wherein the method further comprises updating, by a second guest in the second virtual machine, the designated range of the shared memory by storing a second request in the designated range of the shared memory.

### Claim 8 (depends on 7)

The method of claim 7, further comprising executing, by the third hyper-thread, the second request stored in the designated range of the shared memory.

### Claim 9 (depends on 1)

The method of claim 1, further comprising executing, by the hypervisor, a monitoring task in the second hyper-thread, wherein the monitoring task includes the memory monitoring instruction.

### Claim 10 (depends on 9)

The method of claim 9, further comprising:
determining, by the second hyper-thread, whether there are additional tasks to be executed in the second hyper-thread; and
responsive to determining that there are no additional tasks to be executed, executing, by the second hyper-thread, the memory monitoring instruction.

### Claim 11

A system comprising: a shared memory; a plurality of physical processors in communication with the shared memory, wherein the plurality of physical processors include a first physical processor having a first hyper-thread and a second hyper-thread; a virtual machine to execute on the first hyper-thread, wherein the virtual machine includes a virtual central processor unit (VCPU); and a hypervisor to execute on the plurality of physical processors to execute the VCPU on the first hyper-thread, wherein the second hyper-thread executes a memory monitoring instruction on a designated range of the shared memory to cause the second hyper-thread to stop executing, wherein a guest in the virtual machine updates the designated range of the shared memory by storing a first request in the designated range of the shared memory to wake up the second hyper-thread, wherein the first request is processed by a third hyper-thread.

### Claim 12 (depends on 11)

The system of claim 11, wherein the plurality of physical processors include a second physical processor having the third hyper-thread, wherein the second hyper-thread notifies the third hyper-thread to wake up a request executing task in the third hyper-thread responsive to updating the designated range of the shared memory, wherein responsive to receiving the notification, the third hyper-thread wakes up the request executing task, and wherein the request executing task includes an instruction to execute the first request in the designated range of the shared memory.

### Claim 13 (depends on 12)

The system of claim 12, wherein notifying the third hyper-thread to wake up the request executing task includes sending, by the second hyper-thread, an inter-processor interrupt to the third hyper-thread.

### Claim 14 (depends on 12)

The system of claim 12, wherein notifying the third hyper-thread to wake up the request executing task includes executing, by the second hyper-thread, a write instruction into a second designated range of the shared memory, wherein the third hyper-thread monitors the second designated range of the shared memory.

### Claim 15 (depends on 12)

The system of claim 12, wherein responsive to waking up the request executing task, the third hyper-thread executes the first request in the designated range of the shared memory.

### Claim 16 (depends on 12)

The system of claim 12, wherein the second hyper-thread copies the first request stored in the designated range of the shared memory to a memory location accessible to the request executing task, and wherein the third hyper-thread executes the first request in the memory location accessible to the request executing task.

### Claim 17 (depends on 12)

The system of claim 12, wherein the plurality of physical processors include a third physical processor having a fourth hyper-thread, wherein a second virtual machine executes on the fourth hyper-thread, and wherein a second guest in the second virtual machine updates the designated range of the shared memory by storing a second request in the designated range of the shared memory and the third hyper-thread executes the second request stored in the designated range of the shared memory.

### Claim 18 (depends on 11)

The system of claim 11, wherein the hypervisor executes a monitoring task in the second hyper-thread, wherein the monitoring task includes the memory monitoring instruction.

### Claim 19

A non-transitory machine readable medium storing instructions, which when executed by a plurality of physical processors, cause the plurality of physical processors to: execute, by a hypervisor executing on the plurality of physical processors, a virtual central processor unit (VCPU) of a virtual machine, wherein the plurality of physical processors include a first physical processor having a first hyper-thread and a second hyper-thread, wherein the VCPU executes on the first hyper-thread; execute, by the second hyper-thread, a memory monitoring instruction on a designated range of a shared memory to cause the second hyper-thread to stop executing; and update, by a guest in the virtual machine, the designated range of the shared memory by storing a first request in the designated range of the shared memory to wake up the second hyper-thread, wherein the first request is processed by a third hyper-thread.

### Claim 20 (depends on 19)

The non-transitory machine readable medium of claim 19, wherein the plurality of physical processors include a second physical processor having the third hyper-thread, and the non-transitory machine readable medium further comprises instructions, which when executed by the plurality of physical processors, cause the plurality of physical processors to: notify, by the second hyper-thread, the third hyper-thread to wake up a request executing task in the third hyper-thread responsive to updating the designated range of the shared memory; and responsive to receiving the notification, wake up, by the third hyper-thread, the request executing task, wherein the request executing task includes an instruction to execute the first request in the designated range of the shared memory.
