IP Library Granted Patent US 12,367,059
Granted Patent B2
US 12,367,059 · App. 17/851,669 · Granted Jul 22, 2025

Efficient memory swap for virtual machines

Inventors: Michael Tsirkin (Yokneam Illit, IL); Andrea Arcangeli (Mineola, NY)
Assignee: Red Hat, Inc.
G06F9/45558G06F12/0223G06F2009/45583G06F2212/152
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,367,059
App. No.
17/851,669
Granted
Jul 22, 2025
Kind
B2
Abstract

Systems and methods for enhancing efficient memory swap for virtual machines. An example method may comprise: receiving, by a hypervisor running on a host computer system, a request, from a virtual machine managed by the hypervisor, to write to a virtual disk a content of a memory page identified by a guest physical address (GPA); detecting, by the hypervisor, that the content of the memory page is stored on a storage device; storing, on the virtual disk, an identifier of a location of the content of the memory page on the storage device; and un-mapping the GPA from the storage device.

Claims (39)

1. A method comprising:

receiving, by a hypervisor running on a host computer system, a request, from a virtual machine managed by the hypervisor, to write to a virtual disk a content of a memory page identified by a guest physical address (GPA);

detecting, by the hypervisor, that the content of the memory page is stored on a storage device;

storing, on the virtual disk, an identifier of a location of the content of the memory page on the storage device; and

un-mapping the GPA from the storage device responsive to receiving a notification that the memory page will not be used by the virtual machine.

2. The method of claim 1 , wherein the request comprises the notification.

3. The method of claim 1 , further comprising:

triggering a fault responsive to an access request to the memory page; and

allocating a new memory page without reading the content of the memory page from the storage device.

4. The method of claim 1 , wherein detecting that the content of the memory page is stored on the storage device further comprises: determining that a memory page identified by a host physical address (HPA) corresponding to the GPA is stored on the storage device.

5. The method of claim 1 , further comprising: allocating the memory page for a new use without reading the content of the memory page from the storage device.

6. The method of claim 1 , further comprising: generating the identifier of the location of the content of the memory page.

7. The method of claim 1 , further comprising: storing, on the storage device, the identifier of the location of the content of the memory page.

8. The method of claim 1 , further comprising: sending, to the virtual machine, a response indicating that the memory page has been swapped to the virtual disk.

9. The method of claim 1 , wherein un-mapping the memory page from the GPA is performed responsive to storing the identifier of the location of the content of the memory page on the storage device.

10. A system comprising:

a memory;

a processing device executing a hypervisor and operatively coupled to the memory, the processing device to:

detect, by a hypervisor running on a host computer system, that a content of the memory page has been stored in a host disk before receiving a request, from a virtual machine managed by the hypervisor, to swap to a virtual disk the memory page identified by a guest physical address (GPA);

store, on the virtual disk, an identifier of a location of the content of the memory page on the host disk; and

un-map the GPA from the host disk responsive to receiving a notification that the memory page will not be used by the virtual machine.

11. The system of claim 10 , wherein the request comprises the notification.

12. The method of claim 10 , wherein the processing device is further to:

trigger a fault responsive to an access request to the memory page; and

allocate a new memory page without reading the content of the memory page from the host disk.

13. The method of claim 10 , wherein the processing device is further to determine that a memory page identified by a host physical address (HPA) corresponding to the GPA is stored on the host disk.

14. The system of claim 10 , wherein the processing device is further to allocate the memory page for a new use without reading the content of the memory page from the host disk.

15. The system of claim 10 , wherein the processing device is further to generate the identifier of the location of the content of the memory page as a metadata of the content of the memory page.

16. A non-transitory machine-readable storage medium storing instructions which, when executed, cause a processing device executing a hypervisor to:

swap, by a hypervisor running on the processing device, to a storage device a memory page;

receive, by the hypervisor, a request, from a virtual machine managed by the hypervisor, to swap to a virtual disk the memory page identified by a guest physical address (GPA), wherein swapping is performed prior to receiving the request;

store, on the virtual disk, an identifier of a location of a content of the memory page on the storage device; and

un-map the memory page from the GPA responsive to receiving a notification that the memory page will not be used by the virtual machine.

17. The non-transitory machine-readable storage medium of claim 16 , wherein the instructions further cause the processing device to: responsive to swapping, generate the identifier of the location of the content of the memory page on the storage device.

18. The non-transitory machine-readable storage medium of claim 16 , wherein the instructions further cause the processing device to: responsive to receiving the request, determine that the content of the memory page is stored on the storage device.

19. The non-transitory machine-readable storage medium of claim 18 , wherein the instructions further cause the processing device to: responsive to determining that the content of the memory page is stored on the storage device, generate the identifier of the location of the content of the memory page on the storage device.

20. The non-transitory machine-readable storage medium of claim 16 , wherein the instructions further cause the processing device to:

trigger a fault responsive to an access request to the memory page; and

allocate a new memory page without reading the content of the memory page from the host disk.

Assignments (2)
CHANGE OF NAME Recorded Mar 3, 2026
From: RED HAT, INC.
To: RED HAT, LLC
Reel/Frame 074913/0759 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 14, 2022
From: TSIRKIN, MICHAEL; ARCANGELI, ANDREA
To: RED HAT, INC.
Reel/Frame 061088/0689 →