# US 10,956,202 B1 · Methods and systems for tracking a virtual memory of a virtual machine

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

- Number: US 10,956,202 B1
- Document ID: US10956202B1
- Status: Granted
- Kind: B1
- Application number: 16/779,284
- Filed: 2020-01-31
- Granted: 2021-03-23
- Earliest claimed: 2018-03-05
- Assignees: Marvell Asia Pte Ltd
- Applicants: Marvell Asia Pte, Ltd.
- Inventors: Merav Sicron; Rafi Shalom
- Web page: https://patentgrep.com/patent/US10956202B1

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 3/0647: {Migration mechanisms}
- G06F 3/0664: {at device level, e.g. emulation of a storage device or system}
- G06F 9/4411: {Configuring for operating with peripheral devices; Loading of device drivers}
- G06F 2009/4557: {Distribution of virtual machine instances; Migration and load balancing}
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F 2009/45591: {Monitoring or debugging support}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods and systems for a virtual machine environment are provided. One method includes allocating a memory for storing a dirty pages data structure for tracking writes to a virtual machine memory by an adapter coupled to a computing device and shared by a plurality of virtual machines; initiating a tracking operation by the adapter or a virtual function driver to track writes to the virtual memory; providing access to the dirty pages data structure in response to a query command, while the adapter or the virtual function driver tracks writes to the virtual machine memory; and providing a number of dirty pages within the dirty pages data structure and a pointer the dirty pages data structure by the adapter or the virtual function driver.

## Claims

### Claim 1

A method comprising:
updating by a device, a data structure at a memory for tracking writes to a virtual memory used by a virtual machine executed by a processor to write data to a physical storage device, the device interfacing with the processor to write the data;
in response to a first query request, providing by the device a first list of dirty pages indicating data written using the virtual memory;
detecting by the device a last entry in the first list of dirty pages;
in response to a second query request, providing a second list of dirty pages by the device indicating data that was written to the virtual memory after the last entry; and
providing by the device, a number of dirty pages within the data structure and access to the data structure, after being instructed to stop tracking writes to the virtual memory.

### Claim 2 (depends on 1)

The method of claim 1, wherein writes to the virtual memory are tracked in response to migrating the virtual machine from a source computing device to a destination computing device.

### Claim 3 (depends on 1)

The method of claim 1, wherein the processor executes a physical function driver that allocates the memory for storing the data structure, and instructs the device to track writes to the virtual memory.

### Claim 4 (depends on 3)

The method of claim 3, wherein the physical function driver receives a quiesce command from a virtual machine monitor, and in response, instructs the device to stop tracking writes to the virtual memory.

### Claim 5 (depends on 3)

The method of claim 3, wherein the device requests more storage space from the physical function driver upon detecting that the memory is likely to become full.

### Claim 6

A method, comprising:
updating by a virtual function driver, a data structure at a memory for tracking writes to a virtual memory used by a virtual machine executed by a processor to write data to a storage device, the virtual function driver used by the virtual machine to access a physical resource;
in response to a first query request, providing by the virtual function driver, a first list of dirty pages indicating data written using the virtual memory;
detecting by the virtual function driver, a last entry in the first list of dirty pages;
in response to a second query request, providing by the virtual function driver, a second list of dirty pages indicating data that was written to the virtual memory after the last entry; and
providing by the virtual function driver, a number of dirty pages within the data structure and access to the data structure, after being instructed to stop tracking writes to the virtual memory.

### Claim 7 (depends on 6)

The method of claim 6, wherein writes to the virtual memory are tracked to migrate the virtual machine from a source computing device to a destination computing device.

### Claim 8 (depends on 6)

The method of claim 6, wherein the processor executes a physical function driver to allocate the memory for storing the data structure, and the physical function driver instructs the virtual function driver to track writes to the virtual memory.

### Claim 9 (depends on 8)

The method of claim 8, wherein the physical function driver issues the first query command to the virtual function driver.

### Claim 10 (depends on 6)

The method of claim 6, wherein the virtual function driver dynamically tracks writes to a first subset of the virtual memory, while a second subset of the virtual memory is reported by the virtual function driver as dirty, upon receiving instruction to stop tracking writes to the virtual memory.

### Claim 11 (depends on 6)

The method of claim 6, wherein in response to the memory becoming full, the virtual function driver dynamically allocates more storage space for the data structure.

### Claim 12

An apparatus, comprising:
a processor executing a virtual machine and a virtual function driver, the virtual function driver used by the virtual machine to access a physical resource; and
a memory for storing a data structure for tracking by the virtual function driver writes to a virtual memory used by the virtual machine to write data to a storage device;
wherein the virtual function driver updates the data structure for tracking writes to the virtual memory;
wherein in response to a first query request, the virtual function driver provides a first list of dirty pages indicating data written using the virtual memory, detects a last entry of the first list of dirty pages, and in response to a second query request, provides a second list of dirty pages indicating data that was written to the virtual memory after the last entry;
wherein after being instructed to stop tracking writes to the virtual memory, the virtual function driver provides a number of dirty pages within the data structure and access to the data structure.

### Claim 13 (depends on 12)

The apparatus of claim 12, wherein the processor executes a physical function driver to allocate the memory for storing the data structure, and the physical function driver instructs the virtual function driver to track writes to the virtual memory.

### Claim 14 (depends on 12)

The apparatus of claim 12, wherein the physical function driver issues the first query command to the virtual function driver.

### Claim 15 (depends on 12)

The apparatus of claim 12, wherein the virtual function driver dynamically tracks writes to a first subset of the virtual memory, while a second subset of the virtual memory is reported by the virtual function driver as dirty, upon receiving instruction to stop tracking writes to the virtual memory.

### Claim 16 (depends on 12)

The apparatus of claim 12, wherein in response to the memory becoming full, the virtual function driver dynamically allocates more storage space for the data structure.

### Claim 17

An apparatus, comprising
a processor executing a virtual machine using a virtual memory to write data to a storage device;
a device interfacing with the processor via a peripheral link to write data to the storage device; and
a memory storing a data structure for tracking writes to the virtual memory by the device;
wherein the device updates the data structure for tracking writes to the virtual memory;
wherein in response to a first query request, the device provides a first list of dirty pages indicating data written using the virtual memory, detects a last entry of the first list of dirty pages, and in response to a second query request, provides a second list of dirty pages indicating data that was written to the virtual memory after the last entry;
wherein after being instructed to stop tracking writes to the virtual memory, the device provides a number of dirty pages within the data structure and access to the data structure.

### Claim 18 (depends on 17)

The apparatus of claim 17, wherein the processor executes a physical function driver that allocates the memory for storing the data structure, and instructs the device to track writes to the virtual memory.

### Claim 19 (depends on 17)

The apparatus of claim 17, wherein the physical function driver receives a quiesce command from a virtual machine monitor, and in response, instructs the device to stop tracking writes to the virtual memory.

### Claim 20 (depends on 17)

The apparatus of claim 17, wherein writes to the virtual memory are tracked in response to migrating the virtual machine from a source computing device to a destination computing device.
