IP Library › Granted Patent US 10,261,820
Granted Patent B2
US 10,261,820 · App. 15/251,943 · Granted Apr 16, 2019

Memory deduplication based on guest page hints

Inventors: Michael Tsirkin (Westford, MA); Uri Lublin (Ra'anana, IL)
Assignee: Red Hat Israel, Ltd.
G06F9/45558G06F11/1453H03M7/30H03M7/3091G06F2009/45583
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 10,261,820
App. No.
15/251,943
Granted
Apr 16, 2019
Kind
B2
Abstract

Methods, systems, and computer program products are included for de-duplicating one or more memory pages. A method includes receiving, by a hypervisor, a list of read-only memory page hints from a guest running on a virtual machine. The list of read-only memory page hints specifies a first memory page marked as writeable. The method also includes determining whether the first memory page matches a second memory page. In response to a determination that the first memory page matches the second memory page, the hypervisor may deduplicate the first and second memory pages.

Claims (57)

1. A method of de-duplicating one or more memory pages, comprising:

receiving, by a hypervisor, a list of read-only memory page hints from a guest running on a virtual machine, the list of read-only memory page hints specifying a first memory page that the guest will not modify for a time period and that is marked as writeable;

during a first comparison phase:

determining, by the hypervisor, whether a data structure stores a duplicate of the first memory page; and

in response to a determination that a second memory page stored in the data structure is a duplicate of the first memory page:

write protecting the first memory page; and

write protecting the second memory page if the second memory page is not write protected; and

during a second comparison phase;

determining whether the first memory page matches the second memory page;

in response to a determination that the first memory page does not match the second memory page, reversing, by the hypervisor, the one or more write protections applied during the first comparison phase; and

in response to a determination that the first memory page matches the second memory page, deduplicating, by the hypervisor, the first and second memory pages.

2. The method of claim 1 , wherein the list of read-only memory page hints is stored in a memory region shared between the hypervisor and the guest.

3. The method of claim 1 , further comprising:

searching, by the hypervisor, the data structure for the duplicate of the first memory page.

4. The method of claim 3 ,

wherein searching the data structure for the duplicate occurs during the first comparison phase.

5. The method of claim 1 , further comprising:

determining, during the first comparison phase, whether the second memory page is write protected.

6. The method of claim 3 , further comprising:

receiving, by the hypervisor, the time period during which the guest will not modify the first memory page, wherein the searching includes searching the data structure before the time period elapses.

7. The method of claim 6 , further comprising:

discarding, by the hypervisor, the list of read-only memory page hints after the time period has elapsed.

8. The method of claim 1 , further comprising:

receiving, by the hypervisor, a second list of read-only memory page hints from a second guest running on a second virtual machine, the second list of read-only memory page hints specifying a third memory page marked as writeable;

determining whether the third memory page matches the second memory page; and

in response to a determination that the third memory page matches the second memory page, deduplicating, by the hypervisor, the second and third memory pages.

9. The method of claim 1 , wherein the second comparison phase occurs after the first comparison phase.

10. The method of claim 1 , further comprising:

in response to a determination that the data structure does not store at least one duplicate of the first memory page, the deduplication module inserts the first memory page into the data structure.

11. A system for de-duplicating one or more memory pages, comprising:

a deduplication module that obtains a list of read-only memory page hints specifying a first memory page that the guest will not modify for a time period and that is marked as writeable,

wherein the deduplication module searches a data structure storing a second memory page and determines whether the first memory page is a duplicate of the second memory page; and

a marker module that during a first comparison phase, write protects the first memory page and if the second memory page is not write protected, write protects the second memory page,

wherein during a second comparison phase, the marker module determines whether the first memory page matches the second memory page, wherein in response to a determination that the first memory page does not match the second memory page during the second comparison phase, the marker module reverses the one or more write protections applied during the first comparison phase, and

wherein in response to a determination that the first memory page matches the second memory page during the second comparison phase, the deduplication module deduplicates the first and second memory pages.

12. The system of claim 11 , further comprising:

a guest that sends the list of read-only memory page hints to the deduplication module, wherein the guest runs on a virtual machine.

13. The system of claim 12 , further comprising:

a hypervisor that includes the deduplication module and the marker module.

14. The system of claim 13 , further comprising:

a hypervisor memory that stores the data structure, wherein the hypervisor is coupled to the hypervisor.

15. The system of claim 11 , wherein during the first comparison phase, the deduplication module searches the data structure for a duplicate of the first memory page before the time period elapses.

16. The system of claim 15 , wherein in response to a determination that the data structure does not store at least one duplicate of the first memory page, the deduplication module inserts the first memory page into the data structure.

17. The system of claim 11 , wherein the second comparison phase occurs after the first comparison phase.

18. A non-transitory machine-readable medium comprising a plurality of machine-readable instructions that when executed by one or more processors is adapted to cause the one or more processors to perform a method comprising:

receiving, by a hypervisor, a list of read-only memory page hints from a guest running on a virtual machine, the list of read-only memory page hints specifying a first memory page that the guest will not modify for a time period and that is marked as writeable;

during a first comparison phase:

determining, by the hypervisor, whether a data structure stores a duplicate of the first memory page; and

in response to a determination that a second memory page stored in the data structure is a duplicate of the first memory page:

write protecting the first memory page; and

write protecting the second memory page if the second memory page is not write protected; and

during a second comparison phase;

determining whether the first memory page matches the second memory page;

in response to a determination that the first memory page does not match the second memory page, reversing, by the hypervisor, the one or more write protections applied during the first comparison phase; and

in response to a determination that the first memory page matches the second memory page, deduplicating, by the hypervisor, the first and second memory pages.

19. The method of claim 1 , wherein the list of read-only memory page hints specifies a third memory page that the guest will not modify for the time period.

20. The method of claim 1 , wherein the list of read-only memory page hints specifies a third memory page that the guest will not modify for a second time period different from the first time period.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 21, 2016
From: TSIRKIN, MICHAEL; LUBLIN, URI
To: RED HAT ISRAEL, LTD.
Reel/Frame 039819/0740 →
Continuity (1)
Related Publication 20180059956A1 · Mar 1, 2018
Cited By (2)
US 12,238,211 US 12,493,564