IP Library Granted Patent US 11,625,187
Granted Patent B2
US 11,625,187 · App. 17/136,644 · Granted Apr 11, 2023

Method and system for intercepting a discarded page for a memory swap

Inventors: Eui Seong Seo (Suwon-si, KR); Jong Seok Kim (Suwon-si, KR)
Assignee: Research & Business Foundation Sungkyunkwan University
G06F3/0655G06F3/0604G06F3/0679
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 11,625,187
App. No.
17/136,644
Granted
Apr 11, 2023
Kind
B2
Abstract

Provides is a method for memory swap. The method for memory swap according to the present disclosure may comprise storing a plurality of pages in a volatile memory; intercepting at least one page among the plurality of pages before the at least one page is discarded from the volatile memory; and compressing the at least one intercepted page and storing the compressed page in a memory swap space, wherein the plurality of pages include a first page, which is a clean page among file-mapped pages, and a second page, which is an anonymous page.

Claims (36)

1. A method for memory swap, the method comprising:

storing a plurality of pages in a volatile memory;

intercepting at least one page among the plurality of pages before the at least one page is discarded from the volatile memory; and

compressing the at least one intercepted page and storing the compressed page in a memory swap space,

wherein the plurality of pages include a first page, which is a clean page among file-mapped pages, and a second page, which is an anonymous page, and

wherein the storing in the memory swap space comprises:

calculating a first profit for the at least one intercepted page comparing the calculated first profit to an average profit to selectively store the first page or the second page,

when the calculated first profit is equal to or greater than the average profit, storing the first page in the memory swap space; and

when the calculated first profit is less than the average profit, storing the second page in the memory swap space.

2. The method of claim 1 , wherein the first profit is calculated by using a value obtained by subtracting a cost for writing a clean page into a memory from a cost expected when the second page is written into a non-volatile memory and loaded again, and a compression ratio of the first page or the second page.

3. The method of claim 2 , wherein the compression ratio is based on entropy values of data samples for the first page or the second page.

4. The method of claim 1 , wherein the average profit is calculated by using a fill ratio of the memory swap space, an average cost, a ratio of a number of attempts to read a page from the memory swap space to a number of times the page attempted to be read from the memory swap space is found when the read is attempted, and an average compression ratio of the plurality of pages.

5. The method of claim 1 , wherein the memory swap space includes a storage tree structure.

6. The method of claim 5 , wherein, if the at least one intercepted page is the first page, the storage tree structure matches all of the at least one intercepted page to one tree.

7. The method of claim 6 , wherein the matched one tree further includes metadata for the at least one intercepted page.

8. The method of claim 7 , wherein the metadata includes an inode number and a block device number.

9. The method of claim 1 , further comprising deleting the first page when the at least one intercepted page is the first page and the memory swap space is full.

10. The method of claim 1 , wherein the intercepting at least one page intercepts the at least one page before a kernel swap daemon is activated according to an occupancy rate of the volatile memory and the at least one page is discarded from the volatile memory by the activated kernel swap daemon.

11. The method of claim 1 , further comprising selecting a swap page to be removed from the memory swap space when the at least one intercepted page is the second page and the memory swap space is full.

12. The method of claim 11 , wherein the selecting a swap page to be removed from the memory swap space selects the swap page to be removed from the memory swap space based on a Least Recently Used (LRU) list.

13. The method of claim 12 , wherein the selecting a swap page to be removed from the memory swap space selects a swap page at a most rear position of the LRU list.

14. The method of claim 11 , wherein the selecting a swap page to be removed from the memory swap space selects the swap page to be removed from the memory swap space based on a criteria table including at least one of a first criterion, second criterion, and a third criterion.

15. The method of claim 14 , wherein the first criterion is configured based on a free space within the swap page, the second criterion is configured based on a number of zpages included in the swap page, and the third criterion is configured based on a number of file-mapped pages included in the swap page.

16. The method of claim 11 , wherein the selecting a swap page to be removed from the memory swap space generates a plurality of LRU lists, selects one LRU list from the LRU lists by using lottery selection, and selects the swap page to be removed from the memory swap space based on the selected LRU list.

17. The method of claim 16 , wherein the lottery selection is performed based on a value calculated by using a ratio of a number of swap pages included in the plurality of LRU lists to a total number of swap pages and a weight value of each of the plurality of LRU lists.

18. The method of claim 16 , wherein the selecting a swap page to be removed from the memory swap space selects a swap page at a most rear position of the selected LRU list.

19. A system for memory swap, the system comprising:

a volatile memory;

a non-volatile memory; and

a processor configured to control the volatile memory and the non-volatile memory,

wherein the volatile memory includes a first storage space for storing a plurality of pages; and

a second storage space for storing at least one page intercepted from the plurality of pages,

wherein the plurality of pages include a first page, which is a clean page among file-mapped pages, and a second page, which is an anonymous page, and

wherein the processor calculates a first profit for the at least one intercepted page and compares the calculated first profit to an average profit to selectively store the first page or the second page,

when the calculated first profit is equal to or greater than the average profit, the first page is stored in the second storage space; and

when the calculated first profit is less than the average profit, the second page is stored in the second storage space.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 29, 2020
From: SEO, EUI SEONG; KIM, JONG SEOK
To: RESEARCH & BUSINESS FOUNDATION SUNGKYUNKWAN UNIVERSITY
Reel/Frame 054767/0182 →
Priority Claims (1)
KR 10-2019-0179882 · Dec 31, 2019 · national
Continuity (1)
Related Publication 20210200463A1 · Jul 1, 2021