KR20150007666A - Virtualization device and method for merging memory page thereof - Google Patents
Virtualization device and method for merging memory page thereof Download PDFInfo
- Publication number
- KR20150007666A KR20150007666A KR1020130081957A KR20130081957A KR20150007666A KR 20150007666 A KR20150007666 A KR 20150007666A KR 1020130081957 A KR1020130081957 A KR 1020130081957A KR 20130081957 A KR20130081957 A KR 20130081957A KR 20150007666 A KR20150007666 A KR 20150007666A
- Authority
- KR
- South Korea
- Prior art keywords
- page
- host
- tree
- candidate table
- item
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
Abstract
Description
The present invention relates to a virtualization apparatus and a method for merging a memory page thereof.
Virtualization technology is widely applied to various fields such as server virtualization, desktop virtualization, and cloud computing. However, resource management is becoming an important issue because of the unique use of single computing resources. In particular, techniques for effectively using memory resources have been studied.
For example, Kernel Virtual Machine (KVM), which can be used to adopt Linux as a host operating system, uses memory de-duplication technology called KSM (Kernel Shared Memory or Kernel Samepage Merging).
This is because, due to the nature of the operating system, there are cases where multiple guests have memory pages of the same content, respectively. Such de-duplication, or merge, To share, and to reduce the memory space required.
KSM mainly performs deduplication by scanning a page for an entire anonymous memory area. When page scanning is performed on an entire anonymous page, scanning is unnecessarily performed entirely, resulting in low efficiency and a problem of low duplicate removal rate.
In fact, in environments where multiple virtual machines are running, the same pages are known to be loaded from disk, that is, pages stored in the host's page cache.
Therefore, in order to increase the efficiency of memory de-duplication, a memory merge method is required to scan the page cache of the host to retrieve the page to be de-duplicated.
In the context of the present invention, Korean Patent Laid-Open No. 10-2013-0070501 ("Technology for Removing Memory Deduplication in a Virtual System") carries out a sequential memory deduplication operation on a first processor circuit and a parallel memory redundancy A removal operation is performed.
Korean Patent No. 10-1178752 ("Server-Based Desktop Virtual Machine Architecture Extension to Client Machines") discloses a configuration for extending a server-based desktop virtual machine to a client machine.
SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned problems, and it is an object of the present invention to provide a virtualization apparatus and a method of merging a memory page thereof with high efficiency of memory de-duplication.
According to a first aspect of the present invention, there is provided a virtualization apparatus including at least one guest loaded on a page basis from a disk image; And a clean page stored in a cache of the host, if there is a duplicated page that can be shared by the one or more guests, a host that leaves only one shared page and de- Wherein the host searches the duplicate page using a merge tree and a candidate table, the merge tree is a red-black tree (RB tree), the candidate table is a hash And is a table (hash table).
According to a second aspect of the present invention, there is provided a memory merging method for a virtualization apparatus, comprising: (a) receiving one or more guest data from a disk image into a memory in units of pages; step; (b) if there is a duplicate page that can be shared by the one or more guests among the clean pages stored in the cache of the host, only one shared page is left and de-duplication is performed; ; And (c) when the guest sharing the shared page wants to modify the shared page, generating a duplicate page by copy-on-write (CoW).
The present invention achieves a high efficiency of memory de-duplication in a virtualization apparatus and a method of merging a memory page thereof.
Memory space is reserved by deduplicating redundant pages for each virtual machine, that is, the host page cache used by the guest, leaving only one page in memory for pages of the same content.
For this purpose, the search efficiency of the red black tree and the hash table used is good, so that the efficiency of memory de-duplication is better.
The use of limited physical memory and memory depletion caused by using multiple virtual machines can be solved by deduplicating the free memory space.
1 illustrates a structure of a virtualization apparatus according to an embodiment of the present invention.
FIG. 2 illustrates a concept of a memory page merging method of a virtualization apparatus according to an embodiment of the present invention.
FIG. 3 shows a flow of a method of merging a memory page of a virtualization apparatus according to an embodiment of the present invention.
FIG. 4 illustrates an embodiment of a merge tree according to an embodiment of the present invention.
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings, which will be readily apparent to those skilled in the art. The present invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. In order to clearly illustrate the present invention, parts not related to the description are omitted, and similar parts are denoted by like reference characters throughout the specification.
Throughout the specification, when a part is referred to as being "connected" to another part, it includes not only "directly connected" but also "electrically connected" with another part in between . Also, when an element is referred to as "comprising ", it means that it can include other elements as well, without departing from the other elements unless specifically stated otherwise.
FIG. 1 illustrates a structure of a virtualization apparatus according to an embodiment of the present invention.
The
Each guest operating system can service its own applications with the help of a host operating system, for example, the kernel itself or a hypervisor. For each guest user, each guest is a complete computing device, and since it appears to be monopolizing itself, each guest is also called a virtual machine.
Each guest may be stored in the
The
The
That is, the
At this time, the deduplicated data is shared by the plurality of guests (100, 100 ') and therefore should not be modified. Therefore, duplicated pages are write-protected.
When the duplicated page needs to be modified, the
That is, when the
Therefore, since the pages to be deduplicated must be shared by the
The
FIG. 2 illustrates a concept of a memory page merging method of a virtualization apparatus according to an embodiment of the present invention.
The figure shows a summary of the above.
The first drawing illustrates the presence of
The second drawing shows a shared
Since the shared
FIG. 3 illustrates a flow of a method of merging a memory page of a virtualization apparatus according to an embodiment of the present invention.
The de-duplication (S100) of FIG. 2 is performed as follows.
As described above, the
If there is an item indicating duplication in the merge tree 204 (S120), the page is merged (S130), and if there is no item in the
If there is no item indicating redundancy in the candidate table 206, an item is added to the candidate table 206 (S150). If the item exists, the page is merged (S160) and the item is moved to the merge tree 204 (S170) .
That is, the
At this time, the
As described above, the
The Red Black Tree was invented by B-Tree inventor Rudolph Bayer in 1972 and the present name appeared in a paper by Robert Segovitch in 1978. Insertion, deletion, and search can be performed with the time complexity of the average O (log n) when there are n elements in the tree. In the worst case, the advantage of maintaining time complexity of O (log n) This is especially useful in cases where execution time is important, especially for real-time processing applications.
In addition, since only one bit is required to represent the color of the node, the spatial complexity can also be maintained at O (n), which consumes less resources.
FIG. 4 illustrates an embodiment of a
Because red-black trees are a kind of binary search tree, the data of all nodes is larger than the data of the left children and is smaller than the data of the right children. Thus, the retrieval and sequential listing of data (left child -> parent -> right child) is fast. Since the balance tree is a balanced tree, the length (height) of the path from the root node to each leaf node is not greatly different, so the search and sequential listing speeds are relatively constant.
The red-black tree has the added advantage that search and sequential listing speeds do not slow significantly even in the worst case, since they do not require much computation to maintain a high balance.
The red-black tree satisfies the following conditions in addition to the general binary search tree.
1. A node is a red node (R) or a black node (B).
2. The root node (starting point) is the black node (B).
3. All leaf nodes (BL) are black nodes (B) and have no data and have a null (NIL). In fact, the leaf node BL does not need to be explicitly loaded into the
4. All child nodes of the red node (R) are black nodes (B). Therefore, only the black node B can be the parent node of the red node R. [
5. Paths starting from an arbitrary node and reaching the leaf node BL have the same number of black nodes B except for the leaf node BL.
The figure shows an embodiment of a tree that satisfies all of these conditions. The black node B is shown without shading, the red node R is shown with a hatched line, and the leaf node BL is shown as being separated from the intermediate node by a null (NIL).
In the present invention, the red-black tree is used in the implementation of the
For example, if the content of a clean page in the
Now, let's take a closer look at the above and explain it more specifically.
First, let us first consider the above-described KSM in the prior art.
The KSM searches two Red-Black Trees to retrieve the deduplication target page. The deduplication target page is a page cache area used by guests such as code, binaries, and libraries used by the virtual machine.
As described above, the present invention improves this, so that each of the
In addition, since the deduplication is performed on the
Specifically, the page cache managed by the inode of the virtual disk image is scanned to find the page of the memory de-duplication target. As described above, the status of the page is checked first. That is, the page in the write-back state is not processed because the page is being synchronized with the disk. Pages in dirty state are forced to flush to synchronize with the disk. This allows the contents of the page to be quickly and up-to-date, thereby increasing the probability of deduplication. Finally, deduplication is performed on the latest page.
Two data structures are maintained for page deduplication, one is a
First, it is checked whether there is a page having the same content in the
If it does not exist in the
If the candidate table 206 does not find a page having the same content, the page is added to the candidate table 206. This process is repeated to perform page cache de-duplication.
The reason for maintaining two data structures is that the page with the same content as the deduplicated page is more likely to be scanned again. Therefore, instead of directly searching the hash table, the search is first performed in the
The page cache of each
However, since the memory management method according to the present invention performs deduplication with respect to the page cache, unlike the conventional page cache management technique of Linux, the deduplicated page must have a plurality of
When the registered virtual machine file size is large, it is more likely to search for similar pages in the same
In order to solve this problem, if the deduplication does not occur while the cache for one
For example, if deduplication does not occur while scanning 5% of a page against a single disk image (VDI), the page cache of the
The user can adjust the scan rate. The scan rate refers to the number of page scans during a single operation and the delay time during which one operation occurs. As the delay time is shortened and the number of scans is increased, more pages can be deduplicated, but since the usage rate of the
It will be understood by those skilled in the art that the foregoing description of the present invention is for illustrative purposes only and that those of ordinary skill in the art can readily understand that various changes and modifications may be made without departing from the spirit or essential characteristics of the present invention. will be. It is therefore to be understood that the above-described embodiments are illustrative in all aspects and not restrictive. For example, each component described as a single entity may be distributed and implemented, and components described as being distributed may also be implemented in a combined form.
The scope of the present invention is defined by the appended claims rather than the detailed description and all changes or modifications derived from the meaning and scope of the claims and their equivalents are to be construed as being included within the scope of the present invention do.
10: Virtualization device
20: Memory
30: Storage device
40: central processing unit
50: peripheral device
100: 1st guest
100 ': second guest
200: Host
202: Host page cache
204: Merge tree
206: candidate table
300: First guest disk image
300 ': second guest disk image
Claims (11)
One or more guest (s) loaded page by page from a disk image; And
A host which de-duplicates only one shared page when there is a duplicated page that can be shared by the at least one guest among clean pages stored in a cache of the host; Memory,
The host
The duplicate page is searched using the merge tree and the candidate table,
The merge tree is a red-black tree (RB tree)
Wherein the candidate table is a hash table.
The host
And when a guest sharing the shared page wants to modify the shared page, generates a duplicate page through copy-on-write (CoW).
The shared page is write-protected, removes connection information with the storage device,
Wherein the write prohibited state of the page copied at the time of writing is released.
The host
Searching for each of the clean pages whether there is an item indicating a duplicate page in the merge tree or the candidate table,
Searching the merge tree first, performing duplicate removal on the clean page when the item is present in the merge tree,
If the entry does not exist in the merge tree, searches the candidate table; if there is the entry in the candidate table, it performs duplicate removal on the clean page, then moves the item to the merge tree;
And adds the item to the candidate table when the candidate table does not include the item.
The host
And flushes a page page stored in the cache.
The host
And does not perform deduplication for a write-back page stored in the cache.
The host
If de-duplication does not occur while scanning the cache for one disk image above a threshold ratio,
A virtualization device that scans the cache for other disk images.
(a) loading one or more guests from a disk image into memory in page units;
(b) if there is a duplicate page that can be shared by the one or more guests among the clean pages stored in the cache of the host, only one shared page is left and de-duplication is performed; ; And
(c) generating a duplicate page through copy-on-write (CoW) when a guest sharing the shared page wants to modify the shared page.
The step (b)
Searching the cache for each of the clean pages by searching the merge tree or the candidate table for an item indicating a duplicate page,
The merge tree is a red-black tree (RB tree)
Wherein the candidate table is a hash table.
The step (b)
Retrieving the merge tree and performing deduplication on the clean page when the item is present in the merge tree;
Searching the candidate table if the item does not exist in the merge tree, and if the item exists in the candidate table, removing the duplicate of the clean page and moving the item to the merge tree; And
And adding the item to the candidate table if the candidate table does not include the item.
Wherein the step (b) includes the step of prohibiting writing of the shared page and removing connection information with the storage device,
And the step (c) includes a step of canceling a write-inhibited page of the copied page during the writing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020130081957A KR20150007666A (en) | 2013-07-12 | 2013-07-12 | Virtualization device and method for merging memory page thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020130081957A KR20150007666A (en) | 2013-07-12 | 2013-07-12 | Virtualization device and method for merging memory page thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
KR20150007666A true KR20150007666A (en) | 2015-01-21 |
Family
ID=52570522
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020130081957A KR20150007666A (en) | 2013-07-12 | 2013-07-12 | Virtualization device and method for merging memory page thereof |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR20150007666A (en) |
-
2013
- 2013-07-12 KR KR1020130081957A patent/KR20150007666A/en active Search and Examination
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11487787B2 (en) | System and method for near-synchronous replication for object store | |
Paulo et al. | A survey and classification of storage deduplication systems | |
US10983955B2 (en) | Data unit cloning in memory-based file systems | |
US9811276B1 (en) | Archiving memory in memory centric architecture | |
US10540279B2 (en) | Server-based persistence management in user space | |
US8930648B1 (en) | Distributed deduplication using global chunk data structure and epochs | |
US11775432B2 (en) | Method and system for storage virtualization | |
US20230359589A1 (en) | Deduplicating extents across systems | |
US10127242B1 (en) | Data de-duplication for information storage systems | |
US10698829B2 (en) | Direct host-to-host transfer for local cache in virtualized systems wherein hosting history stores previous hosts that serve as currently-designated host for said data object prior to migration of said data object, and said hosting history is checked during said migration | |
US9779026B2 (en) | Cache bypass utilizing a binary tree | |
US11010334B2 (en) | Optimal snapshot deletion | |
US9817865B2 (en) | Direct lookup for identifying duplicate data in a data deduplication system | |
US11169968B2 (en) | Region-integrated data deduplication implementing a multi-lifetime duplicate finder | |
US11182084B2 (en) | Restorable memory allocator | |
US10853185B1 (en) | Virtual machine image backup to exclude system page file | |
US10902014B1 (en) | Reducing network traffic when replicating memory data across hosts | |
Xu et al. | YuruBackup: a space-efficient and highly scalable incremental backup system in the cloud | |
US9852139B1 (en) | Directory partitioning with concurrent directory access | |
US11093169B1 (en) | Lockless metadata binary tree access | |
US10432727B1 (en) | Reducing network traffic when replicating memory data across hosts | |
KR20150007666A (en) | Virtualization device and method for merging memory page thereof | |
US20220197860A1 (en) | Hybrid snapshot of a global namespace | |
Appuswamy et al. | File-level, host-side flash caching with loris | |
CN115220651A (en) | Systems and methods relating to cloned objects |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
A302 | Request for accelerated examination | ||
E902 | Notification of reason for refusal | ||
AMND | Amendment | ||
E601 | Decision to refuse application | ||
AMND | Amendment |