# US 9,354,916 B2 · Detection of guest disk cache

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

- Number: US 9,354,916 B2
- Document ID: US9354916B2
- Status: Granted
- Kind: B2
- Application number: 13/689,600
- Filed: 2012-11-29
- Published: 2014-05-29
- Granted: 2016-05-31
- Earliest claimed: 2012-11-29
- Assignees: Red Hat Israel, Ltd.
- Applicants: Red Hat, Inc.
- Inventors: Marcelo Tosatti; Avi Kivity; Henri Han Van Riel
- Web page: https://patentgrep.com/patent/US9354916B2

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 2009/45579: {I/O management, e.g. providing access to device drivers or storage}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A virtual machine disk page detector running on a computing device detects guest disk cache usage. The detector detects a request from a virtual operating system to read an object into a virtual memory page from a virtual disk, maintains a record of a page identifier and a corresponding virtual disk address in a guest cache data structure, and modifies a protection identifier of the virtual memory page to indicate that the virtual memory page is protected.

## Claims

### Claim 1

A method comprising:
detecting a request from a virtual operating system to read data from an anonymous memory allocation into a virtual memory page from a virtual disk, wherein the anonymous memory allocation comprises anonymous memory dedicated to a virtual machine and that is freed by the virtual machine while the virtual machine is running;
maintaining a record of a page identifier and a corresponding first virtual disk address in a guest cache data structure; and
modifying, by a processing device executing a hypervisor, a first protection identifier of the virtual memory page to indicate that the virtual memory page is write-protected.

### Claim 2 (depends on 1)

The method of claim 1, further comprising modifying the first protection identifier of the virtual memory page to indicate that the virtual memory page is not protected when the virtual operating system modifies the virtual memory page.

### Claim 3 (depends on 1)

The method of claim 1, further comprising reclaiming anonymous memory when the first protection identifier indicates that the virtual memory page is write-protected.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
detecting a virtual memory pagefault event;
identifying a second virtual disk address that corresponds with the virtual memory page of the pagefault event; and
reading a corresponding virtual disk page from the virtual disk.

### Claim 5 (depends on 1)

The method of claim 1, wherein the first protection identifier indicates in a first mode that the virtual memory page is writable and in a second mode that the virtual memory page is not writable.

### Claim 6 (depends on 5)

The method of claim 5, further comprising identifying in a page table which of a plurality of page entries has a second protection identifier indicative of the second mode and freeing physical memory corresponding to the identified plurality of page entries.

### Claim 7 (depends on 1)

The method of claim 1, further comprising monitoring the page table to identify a lookup request for a page entry associated with the virtual disk.

### Claim 8

A non-transitory computer readable storage medium comprising executable instructions that, when executed by a processing device, cause the processing device to:
detect, by the processing device, a request from a virtual operating system to read data from an anonymous memory allocation into a virtual memory page from a virtual disk, wherein the anonymous memory allocation comprises anonymous memory dedicated to a virtual machine and that is freed by the virtual machine while the virtual machine is running;
maintain, by the processing device, a record of a page identifier and a corresponding first virtual disk address in a guest cache data structure; and
modify, by the processing device executing a hypervisor, a first protection identifier of the virtual memory page to indicate that the virtual memory page is write-protected.

### Claim 9 (depends on 8)

The non-transitory computer readable storage medium of claim 8, wherein the processing device is to modify, by the processing device, the first protection identifier of the virtual memory page to indicate that the virtual memory page is not protected when the virtual operating system modifies the virtual memory page.

### Claim 10 (depends on 8)

The non-transitory computer readable storage medium of claim 8, wherein the processing device is to reclaim, by the processing device, the anonymous memory when the first protection identifier indicates that the virtual memory page is protected.

### Claim 11 (depends on 8)

The non-transitory computer readable storage medium of claim 8, wherein the processing device is to:
detect, by the processing device, a virtual memory pagefault event;
identify, by the processing device, a second virtual disk address that corresponds with the virtual memory page of the pagefault event; and
read, by the processing device, a corresponding virtual disk page from the virtual disk.

### Claim 12 (depends on 8)

The non-transitory computer readable storage medium of claim 8, wherein the first protection identifier indicates in a first mode that the virtual memory page is writable and in a second mode that the virtual memory page is not writable.

### Claim 13 (depends on 12)

The non-transitory computer readable storage medium of claim 12, wherein the processing device is to identify, by the processing device, in a page table which of a plurality of page entries has a second protection identifier indicative of the second mode and freeing physical memory corresponding to the identified plurality of page entries.

### Claim 14 (depends on 8)

The non-transitory computer readable storage medium of claim 8, wherein the processing device is to monitor, by the processing device, a page table to identify a lookup request for a page entry associated with the virtual disk.

### Claim 15

An apparatus comprising:
a memory to store a record of a page identifier; and
a processing device, coupled to the memory, wherein the processing device is to:
detect a request from a virtual operating system to read data from an anonymous memory allocation into a virtual memory page from a virtual disk, wherein the anonymous memory allocation comprises anonymous memory dedicated to a virtual machine and that is freed by the virtual machine while the virtual machine is running;
maintain the record of the page identifier and a corresponding first virtual disk address in a guest cache data structure; and
modify a first protection identifier of the virtual memory page to indicate that the virtual memory page is write-protected.

### Claim 16 (depends on 15)

The apparatus of claim 15, wherein the processing device is further to modify the first protection identifier of the virtual memory page to indicate that the virtual memory page is not protected when the virtual operating system modifies the virtual memory page.

### Claim 17 (depends on 15)

The apparatus of claim 15, wherein the processing device is further to reclaim anonymous memory when the first protection identifier indicates that the virtual memory page is protected.

### Claim 18 (depends on 15)

The apparatus of claim 15, wherein the processing device is further to:
detect a virtual memory pagefault event;
identify a second virtual disk address that corresponds with the virtual memory page of the pagefault event; and
read a corresponding virtual disk page from the virtual disk.

### Claim 19 (depends on 15)

The apparatus of claim 15, wherein the first protection identifier indicates in a first mode that the virtual memory page is writable and in a second mode that the virtual memory page is not writable.

### Claim 20 (depends on 19)

The apparatus of claim 19, wherein the processing device is further to identify in a page table which of a plurality of page entries has a second protection identifier indicative of the second mode and freeing physical memory corresponding to the identified plurality of page entries.
