# US 2016/0259732 A1 · Managing reuse information for memory pages

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

- Number: US 2016/0259732 A1
- Document ID: US20160259732A1
- Status: Published application
- Kind: A1
- Application number: 14/637,579
- Filed: 2015-03-04
- Published: 2016-09-08
- Earliest claimed: 2015-03-04
- Assignees: Cavium, Inc.
- Applicants: Cavium, Inc.
- Inventors: Shubhendu Sekhar Mukherjee
- Web page: https://patentgrep.com/patent/US20160259732A1

## CPC

- G06F 12/1009: using page tables, e.g. page table structures
- G06F 9/45533: {Hypervisors; Virtual machine monitors}
- G06F 9/45545: {Guest-host, i.e. hypervisor is an application program itself, e.g. VirtualBox}
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 12/0846: Cache with multiple tag or data arrays being simultaneously accessible
- G06F 12/0897: with two or more cache hierarchy levels (with multilevel cache hierarchies G06F12/0811)
- G06F 12/0864: using pseudo-associative means, e.g. set-associative or hashing
- G06F 12/1027: using associative or pseudo-associative address translation means, e.g. translation look-aside buffer [TLB]
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F 2212/1044: Space efficiency improvement
- G06F 2212/151: Emulated environment, e.g. virtual machine
- G06F 2212/657: Virtual address space management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Address translation and caching is managed using a processor that includes at least one CPU configured to run a hypervisor and at least one guest operating system. The managing includes: translating from virtual addresses to intermediate physical addresses using mappings in a first page table accessed by the guest operating system; translating from the intermediate physical addresses to physical addresses using mappings in a second page table accessed by the hypervisor; determining reuse information for a second memory page mapped by both the first page table and the second page table based on estimated reuse of data stored within the second memory page; storing the determined reuse information in both the first page table and the second page table; and using the stored reuse information to store cache lines in selected portions of a first cache.

## Claims

### Claim 1

A method for managing address translation and caching, the method comprising:
retrieving a first memory page from a storage device in response to a page fault issued after an attempt to retrieve data in the first memory page from a physical address space of a main memory of an external memory system;
issuing the attempt to retrieve the data in the first memory page in response to a cache miss issued after an attempt to retrieve the data in the first memory page from a first cache line of a first cache of the external memory system; and
managing address translation and caching from a processor that includes (1) at least one memory management unit coupled to the external memory system, and (2) at least one central processing unit configured to run a hypervisor and at least one guest operating system, the managing including:
translating from virtual addresses in a virtual address space to intermediate physical addresses in an intermediate physical address space using mappings in a first page table accessed by the guest operating system;
translating from the intermediate physical addresses to physical addresses in the physical address space of the main memory using mappings in a second page table accessed by the hypervisor;
determining reuse information for a second memory page mapped by both the first page table and the second page table based on estimated reuse of data stored within the second memory page;
storing the determined reuse information in both the first page table and the second page table; and
using the stored reuse information to store cache lines in selected portions of the first cache.

### Claim 2 (depends on 1)

The method of claim 1, wherein the estimated reuse of data stored within the second memory page comprises an estimated miss rate for blocks of data within the second memory page that are attempted to be retrieved from corresponding cache lines of the first cache.

### Claim 3 (depends on 2)

The method of claim 2, wherein the estimated miss rate for blocks of data within the second memory page comprises an average miss rate of multiple blocks of data within the second memory page accessed during previous execution of the guest operating system.

### Claim 4 (depends on 1)

The method of claim 1, wherein storing the determined reuse information in both the first page table and the second page table includes: (1) storing first reuse information determined by the guest operating system in the first page table, and (2) storing second reuse information determined by the hypervisor in the second page table.

### Claim 5 (depends on 4)

The method of claim 4, wherein determining reuse information for the second memory page mapped by both the first page table and the second page table based on estimated reuse of data stored within the second memory page includes: (1) determining the first reuse information based on miss rates associated with virtual addresses, and (2) determining the second reuse information based on miss rates associated with intermediate physical addresses.

### Claim 6 (depends on 4)

The method of claim 4, wherein using the stored reuse information to store cache lines in selected portions of the first cache includes processing the first reuse information and the second reuse information and using a result of the processing to store cache lines in selected portions of the first cache.

### Claim 7 (depends on 6)

The method of claim 6, wherein the first reuse information is stored independently from: (1) any bits used to indicate virtual addresses, and (2) any bits used to indicate intermediate physical addresses.

### Claim 8 (depends on 6)

The method of claim 6, wherein the second reuse information is stored independently from: (1) any bits used to indicate intermediate physical addresses, and (2) any bits used to indicate physical addresses.

### Claim 9 (depends on 1)

The method of claim 1, wherein the managing further includes updating at least one of: (1) reuse information stored in an entry of the first page table, or (2) reuse information stored in an entry of the second page table.

### Claim 10 (depends on 9)

The method of claim 9, wherein the updating is performed while preserving all bits of mapped addresses within the entry of the first or second page table.

### Claim 11 (depends on 1)

The method of claim 1, wherein the first cache comprises a last level cache.

### Claim 12

An apparatus comprising:
a storage device configured to store memory pages including a first memory page retrieved from the storage device in response to a page fault issued after an attempt to retrieve data in the first memory page from a physical address space, where the attempt to retrieve the data in the first memory page from the physical address space is issued in response to a cache miss;
an external memory system including: (1) a main memory controller coupled to main memory having the physical address space, and (2) a first cache configured to store a plurality of cache lines and to issue the cache miss after an attempt to retrieve the data in the first memory page from at least one of the cache lines; and
a processor that includes (1) at least one memory management unit coupled to the external memory system, and (2) at least one central processing unit configured to run a hypervisor and at least one guest operating system;
wherein the processor is configured to:
translate from virtual addresses in a virtual address space to intermediate physical addresses in an intermediate physical address space using mappings in a first page table accessed by the guest operating system;
translate from the intermediate physical addresses to physical addresses in the physical address space of the main memory using mappings in a second page table accessed by the hypervisor;
determine reuse information for a second memory page mapped by both the first page table and the second page table based on estimated reuse of data stored within the second memory page;
store the determined reuse information in both the first page table and the second page table; and
use the stored reuse information to store cache lines in selected portions of the first cache.

### Claim 13 (depends on 12)

The apparatus of claim 12, wherein the estimated reuse of data stored within the second memory page comprises an estimated miss rate for blocks of data within the second memory page that are attempted to be retrieved from corresponding cache lines of the first cache.

### Claim 14 (depends on 13)

The apparatus of claim 13, wherein the estimated miss rate for blocks of data within the second memory page comprises an average miss rate of multiple blocks of data within the second memory page accessed during previous execution of the guest operating system.

### Claim 15 (depends on 12)

The apparatus of claim 12, wherein storing the determined reuse information in both the first page table and the second page table includes: (1) storing first reuse information determined by the guest operating system in the first page table, and (2) storing second reuse information determined by the hypervisor in the second page table.

### Claim 16 (depends on 15)

The apparatus of claim 15, wherein determining reuse information for the second memory page mapped by both the first page table and the second page table based on estimated reuse of data stored within the second memory page includes: (1) determining the first reuse information based on miss rates associated with virtual addresses, and (2) determining the second reuse information based on miss rates associated with intermediate physical addresses.

### Claim 17 (depends on 15)

The apparatus of claim 15, wherein using the stored reuse information to store cache lines in selected portions of the first cache includes processing the first reuse information and the second reuse information and using a result of the processing to store cache lines in selected portions of the first cache.

### Claim 18 (depends on 17)

The apparatus of claim 17, wherein the first reuse information is stored independently from: (1) any bits used to indicate virtual addresses, and (2) any bits used to indicate intermediate physical addresses.

### Claim 19 (depends on 17)

The apparatus of claim 17, wherein the second reuse information is stored independently from: (1) any bits used to indicate intermediate physical addresses, and (2) any bits used to indicate physical addresses.

### Claim 20 (depends on 12)

The apparatus of claim 12, wherein the managing further includes updating at least one of: (1) reuse information stored in an entry of the first page table, or (2) reuse information stored in an entry of the second page table.

### Claim 21 (depends on 20)

The apparatus of claim 20, wherein the updating is performed while preserving all bits of mapped addresses within the entry of the first or second page table.

### Claim 22 (depends on 12)

The apparatus of claim 12, wherein the first cache comprises a last level cache.
