CN107832119A - A kind of KVM live migration of virtual machine optimization methods for reducing internal memory and repeating copy - Google Patents
A kind of KVM live migration of virtual machine optimization methods for reducing internal memory and repeating copy Download PDFInfo
- Publication number
- CN107832119A CN107832119A CN201711153677.9A CN201711153677A CN107832119A CN 107832119 A CN107832119 A CN 107832119A CN 201711153677 A CN201711153677 A CN 201711153677A CN 107832119 A CN107832119 A CN 107832119A
- Authority
- CN
- China
- Prior art keywords
- bitmap
- migration
- dirty pages
- containing dirty
- copy
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Classifications
-
- 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
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- 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
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
-
- 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
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45583—Memory management, e.g. access or allocation
Abstract
The invention discloses a kind of KVM live migration of virtual machine optimization methods for reducing internal memory and repeating copy.The stage is copied in the iteration of thermophoresis, it is necessary to repeat copy internal memory containing dirty pages, and the operation of program all has principle of locality, the page next round that epicycle is changed is likely to be changed again, therefore the copy of many containing dirty pages is insignificant in fact;Memory copying policy optimization of the invention based on principle of locality, according to the containing dirty pages information of preceding two-wheeled, reference is provided for epicycle containing dirty pages copy, writing dirty page for continuous two-wheeled is not copied, so as to effectively reduce copy data volume;After improvement, when virtual machine modification internal memory is frequent, the optimization can significantly improve thermophoresis efficiency.
Description
Technical field
The present invention relates to KVM virtualization system, more particularly to a kind of KVM live migration of virtual machine for reducing internal memory and repeating copy
Optimization method.
Background technology
KVM live migration of virtual machine is mainly several including internal memory migration, equipment state migration, closing virtual machine, recovery virtual machine
In the individual stage, according to the different order in these stages, thermophoresis algorithm can be largely classified into two classes, i.e. pre-copy (pre-copy)
Migration algorithm and rear copy (post-copy) migration algorithm.KVM thermophoresis is real by pre-copy (pre-copy) migration algorithm
It is existing, it is generally the case that the stage is copied in iteration, containing dirty pages can be fewer and fewer, but under virtual machine high load condition, iteration copy rank
Section internal memory is accessed frequently, or network bandwidth is relatively low, network congestion, and containing dirty pages do not reach the threshold values for stopping copy, and this will cause
Transit time is long, causes thermophoresis to efficiently accomplish problem.
The content of the invention
It is a primary object of the present invention to excessively repeat asking for copy for internal memory containing dirty pages in KVM live migration of virtual machine algorithms
Topic, proposes the memory copying policy optimization based on principle of locality.
The purpose of the present invention is achieved through the following technical solutions:The stage is copied, it is necessary to weight in the iteration of thermophoresis
Internal memory containing dirty pages are copied again, and the operation of program all has principle of locality, the page next round that epicycle is changed is likely to again
Changed, therefore the copy of many containing dirty pages is insignificant in fact;Memory copying policy optimization based on principle of locality, according to
The containing dirty pages information of preceding two-wheeled, reference is provided for epicycle containing dirty pages copy, writing dirty page for continuous two-wheeled is not copied, from
And effectively reduce copy data volume;After improvement, when virtual machine modification internal memory is frequent, the optimization can significantly improve thermophoresis
Efficiency.The implementation method of the present invention is described below in detail:
The stage is copied in the iteration of thermophoresis, on the basis of original containing dirty pages bitmap migration_bitmap, increase by two
Individual new containing dirty pages bitmap:Cur_bitmap and pre_bitmap, copied for the n-th wheel, migration_bitmap storage migrations
All remaining containing dirty pages information after beginning;The containing dirty pages information that cur_bitmap storage epicycles obtain, i.e., the (n-1)th wheel newly produce in copying
Raw containing dirty pages;The containing dirty pages information obtained, i.e., the n-th -2 wheel new caused containing dirty pages in copying are taken turns in pre_bitmap storages (n-1)th;It is each
Wheel iteration copy will determine that epicycle needs the page being copied according to the information of these three containing dirty pages bitmaps, and specific strategy is shown in Table 1:
Memory copying strategy after table 1 optimizes
migration_bitmap | 0 | 1 | 1 | 1 | 1 |
cur_bitmap | ‐ | 0 | 0 | 1 | 1 |
pre_bitmap | ‐ | 0 | 1 | 0 | 1 |
Whether copy | It is no | It is no | It is | It is | It is no |
Specific memory copying strategy is as follows:
(1) when migration_bitmap [n] is 0, represent that the page is not changed, be not containing dirty pages, therefore not
Copy;
(2) when migration_bitmap [n] be 1, and cur_bitmap [n] and pre_bitmap [n] at the same be 0 feelings
Condition can not possibly occur;
(3) when migration_bitmap [n] be 1, cur_bitmap [n] to be 0, pre_bitmap [n] be 1 when, explanation
The containing dirty pages next round is likely to change again, therefore copies;
(4) when migration_bitmap [n] be 1, cur_bitmap [n] to be 1, pre_bitmap [n] be 0 when, explanation
The containing dirty pages are new caused, give copy here;
(5) when migration_bitmap [n] be 1, cur_bitmap [n] to be 1, pre_bitmap [n] be 1 when, explanation
The page is changed in preceding two-wheeled, it is likely that is changed, therefore not copied again;
After migration just starts, initialization migration_bitmap and cur_bitmap is 1, pre_bitmap 0, according to
The strategy that table 1 describes carries out memory copying, and the corresponding migration_bitmap positions of page for determining copy are revised as into 0,
Cur_bitmap, pre_bitmap are not changed;
Each round iteration afterwards, first empties pre_bitmap, and cur_bitmap information copies are to pre_bitmap;
Then cur_bitmap is emptied, carries out containing dirty pages synchronizing information, the containing dirty pages information of last round of iterative modifications is stored in cur_bitmap;
Migration_bitmap is not emptied, and the containing dirty pages information of last round of iterative modifications is stored in into migration_bitmap simultaneously;
The strategy described according to table 1 carries out memory copying;
When remaining containing dirty pages data are less than threshold values, then enter and shut down the copy stage, system can carry out last time containing dirty pages
It is synchronous, the page that all migration_bitmap containing dirty pages positions are 1, and the CPU of virtual machine, peripheral state are all copied to
Purpose host, migration work are completed.
The beneficial effects of the invention are as follows:The stage is copied, it is necessary to repeat copy internal memory containing dirty pages in the iteration of thermophoresis, and program
Operation all there is principle of locality, the page next round that epicycle is changed is likely to be changed again, therefore many containing dirty pages
Copy is insignificant in fact;Memory copying policy optimization of the invention based on principle of locality, believes according to the containing dirty pages of preceding two-wheeled
Breath, reference is provided for epicycle containing dirty pages copy, writing dirty page for continuous two-wheeled is not copied, and is copied so as to effectively reduce
Shellfish data volume;After improvement, when virtual machine modification internal memory is frequent, the optimization can significantly improve thermophoresis efficiency.
Brief description of the drawings
Fig. 1 is KVM live migration of virtual machine flows;
Fig. 2 excessively repeats copy flow chart to reduce internal memory containing dirty pages;
Embodiment
The present invention is described in further detail with specific embodiment below in conjunction with the accompanying drawings.
In the thermomigration process of existing KVM virtual machines, to the tactful fairly simple of memory copying implementation, policy depiction is such as
Under:
A, synchronous containing dirty pages bitmap, if containing dirty pages data are less than the threshold values for terminating iteration copy, iteration pre-copy is terminated, otherwise
Next round iteration copy is opened, that is, goes to step b;
B, containing dirty pages bitmap migration_bitmap is traveled through, if dirty_bit is 0, continues to travel through, if dirty_bit is
1, then go to step c;
C, it is zero pages to judge the page, if the page is zero pages, goes to step b, if
It is not zeropages, then goes to step d;
D, copy transmits the page, if the page is the last page last page of virutal machine memory, goes to step
Rapid a, otherwise go to step b.
Here so-called zero pages refer to the page for being actually not allocated to virtual machine, KVM storage allocations be by
It need to distribute, give virtual machine 4G internal memories, be not that firm beginning just distributes 4G physical memories to virtual machine, but distribution can transport
The minimum internal memory of row VME operating system;After virtual machine operation, if allocated internal memory can not meet that virtual machine runs need
Ask, then may proceed to storage allocation, until the internal memory of distribution reaches the 4G sizes originally set.
Traditional KVM thermomigration process is optimized for zero pages, reduces the internal memory that migration needs transmit
Data, but it is less to otherwise optimization, such as write working set (WWS, Writable Working Sets).WWS refers to,
Iteration pre-copy stage, operating system or the application software meeting some pages of frequent visit, these pages change in subsequent
Need to copy again again during generation, these pages are known as WWS.That is during iteration pre-copy, each round
Many pages of copy are to repeat with the page of last round of copy, when virtual machine load is low, repeat the internal memory of copy
Page is less, migration is influenceed little;But when loading higher, the page enormous amount of copy is repeated, when this can increase migration
Between, while more CPU and Internet resources will be taken, influence the performance of other virtual machines on host.
The inventive method provides reference information, in original by using preceding two-wheeled containing dirty pages message bit pattern for epicycle iteration copy
On the basis of some migration_bitmap, two new containing dirty pages bitmaps are added:Cur_bitmap and pre_bitmap.Assuming that
Epicycle copy is the n-th wheel, then the information of these three containing dirty pages bitmaps storage is as follows:
Migration_bitmap stores remaining containing dirty pages information all after migration starts as before optimization;
Cur_bitmap deposits new caused containing dirty pages in the containing dirty pages information that epicycle obtains, that is, the (n-1)th wheel copy;
New caused containing dirty pages in the containing dirty pages information obtained, that is, the n-th -2 wheel copy are taken turns in pre_bitmap storages (n-1)th;
Information according to these three containing dirty pages bitmaps as shown in Fig. 2 3. steps, is determined that epicycle needs by each round iteration copy
The page being copied, specific strategy are as shown in table 1.
Memory copying strategy after table 1 optimizes
migration_bitmap | 0 | 1 | 1 | 1 | 1 |
cur_bitmap | ‐ | 0 | 0 | 1 | 1 |
pre_bitmap | ‐ | 0 | 1 | 0 | 1 |
Whether copy | It is no | It is no | It is | It is | It is no |
Specific memory copying strategy is as follows:
(1) when migration_bitmap [n] is 0, represent that the page is not changed, be not containing dirty pages, therefore not
Copy;
(2) when migration_bitmap [n] be 1, and cur_bitmap [n] and pre_bitmap [n] at the same be 0 feelings
Condition can not possibly occur;
(3) when migration_bitmap [n] be 1, cur_bitmap [n] to be 0, pre_bitmap [n] be 1 when, explanation
The containing dirty pages next round is likely to change again, therefore copies;
(4) when migration_bitmap [n] be 1, cur_bitmap [n] to be 1, pre_bitmap [n] be 0 when, explanation
The containing dirty pages are new caused, give copy here;
(5) when migration_bitmap [n] be 1, cur_bitmap [n] to be 1, pre_bitmap [n] be 1 when, explanation
The page is all modified in preceding two-wheeled, it is likely that is changed, therefore not copied again.
After migration just starts, initialization migration_bitmap and cur_bitmap is 1, pre_bitmap 0, according to
The strategy that table 1 describes is copied, and the corresponding migration_bitmap positions of page for determining copy are revised as into 0, cur_
Bitmap, pre_bitmap are not changed.
Ensuing each round iteration, first empties pre_bitmap, and cur_bitmap information copies are to pre_
bitmap;Then cur_bitmap is emptied, carries out containing dirty pages synchronizing information, the containing dirty pages information of last round of iterative modifications is stored in cur_
bitmap;Migration_bitmap is not emptied, and the containing dirty pages information of last round of iterative modifications is stored in into migration_ simultaneously
bitmap.Memory copying is carried out according to table 1.
When remaining containing dirty pages data are less than threshold values, then into shutdown copy stage such as Fig. 2,4. 5. step, system can be carried out
Last time containing dirty pages are synchronous, by the page that all migration_bitmap containing dirty pages positions are 1, and the CPU of virtual machine, peripheral hardware
State is all copied to purpose host, and migration work is completed.
The present invention is not only limited to above-mentioned embodiment, and persons skilled in the art are according to disclosed by the invention interior
Hold, other a variety of specific embodiments can be used to implement the present invention.Therefore, every design structure and think of using the present invention
Road, some simple designs for changing or changing are done, both fall within the scope of the present invention.
Claims (1)
1. a kind of KVM live migration of virtual machine optimization methods for reducing internal memory and repeating copy, it is characterised in that this method includes:
The stage is copied in the iteration of thermophoresis, on the basis of original containing dirty pages bitmap migration_bitmap, increases by two newly
Containing dirty pages bitmap:Cur_bitmap and pre_bitmap, copied for the n-th wheel, migration_bitmap storage migrations start
All remaining containing dirty pages information afterwards;Cur_bitmap deposits the containing dirty pages information that epicycle obtains, i.e., the (n-1)th wheel is new caused in copying
Containing dirty pages;The containing dirty pages information obtained, i.e., the n-th -2 wheel new caused containing dirty pages in copying are taken turns in pre_bitmap storages (n-1)th;Each round changes
Generation copy will determine that epicycle needs the page being copied according to the information of these three containing dirty pages bitmaps, and specific strategy is shown in Table 1:
Memory copying strategy after table 1 optimizes
Specific memory copying strategy is as follows:
(1) when migration_bitmap [n] is 0, represent that the page is not changed, be not containing dirty pages, therefore do not copy;
(2) when migration_bitmap [n] be 1, and cur_bitmap [n] and pre_bitmap [n] at the same be 0 situation not
It is likely to occur;
(3) when migration_bitmap [n] be 1, cur_bitmap [n] to be 0, pre_bitmap [n] be 1 when, illustrate that this is dirty
Page next round is likely to change again, therefore copies;
(4) when migration_bitmap [n] be 1, cur_bitmap [n] to be 1, pre_bitmap [n] be 0 when, illustrate that this is dirty
Page is new caused, gives copy here;
(5) when migration_bitmap [n] be 1, cur_bitmap [n] to be 1, pre_bitmap [n] be 1 when, illustrate that this is interior
Deposit page to be changed in preceding two-wheeled, it is likely that changed, therefore do not copied again;
After migration just starts, initialization migration_bitmap and cur_bitmap is 1, pre_bitmap 0, according to table 1
The strategy of description carries out memory copying, and the corresponding migration_bitmap positions of page for determining copy are revised as into 0, cur_
Bitmap, pre_bitmap are not changed;
Each round iteration afterwards, first empties pre_bitmap, and cur_bitmap information copies are to pre_bitmap;Then
Cur_bitmap is emptied, carries out containing dirty pages synchronizing information, the containing dirty pages information of last round of iterative modifications is stored in cur_bitmap;
Migration_bitmap is not emptied, and the containing dirty pages information of last round of iterative modifications is stored in into migration_bitmap simultaneously;
The strategy described according to table 1 carries out memory copying;
When remaining containing dirty pages data are less than threshold values, then entering and shut down the copy stage, system can carry out the synchronization of last time containing dirty pages,
The page that all migration_bitmap containing dirty pages positions are 1, and the CPU of virtual machine, peripheral state are all copied to purpose
Host, migration work are completed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711153677.9A CN107832119A (en) | 2017-11-20 | 2017-11-20 | A kind of KVM live migration of virtual machine optimization methods for reducing internal memory and repeating copy |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711153677.9A CN107832119A (en) | 2017-11-20 | 2017-11-20 | A kind of KVM live migration of virtual machine optimization methods for reducing internal memory and repeating copy |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107832119A true CN107832119A (en) | 2018-03-23 |
Family
ID=61652822
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711153677.9A Withdrawn CN107832119A (en) | 2017-11-20 | 2017-11-20 | A kind of KVM live migration of virtual machine optimization methods for reducing internal memory and repeating copy |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107832119A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110392025A (en) * | 2018-04-20 | 2019-10-29 | 伊姆西Ip控股有限责任公司 | Method, equipment and the computer program product of managing distributing type system |
CN111090496A (en) * | 2019-12-06 | 2020-05-01 | 苏州浪潮智能科技有限公司 | Virtual machine memory migration method and device based on automatic iteration time adjustment |
CN111580933A (en) * | 2020-05-12 | 2020-08-25 | 西安交通大学 | Hardware acceleration-based virtual machine online migration method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103577249A (en) * | 2013-11-13 | 2014-02-12 | 中国科学院计算技术研究所 | Method and system for virtual machine online migration |
CN104268003A (en) * | 2014-09-30 | 2015-01-07 | 南京理工大学 | Memory state migration method applicable to dynamic migration of virtual machine |
CN105335223A (en) * | 2014-06-20 | 2016-02-17 | 富士通株式会社 | Virtual machine memory migration device, method and system on source host and destination host |
CN105700945A (en) * | 2016-01-12 | 2016-06-22 | 中南大学 | Clean room environment-based safe virtual machine migration method |
KR20160099365A (en) * | 2015-02-12 | 2016-08-22 | 한국전자통신연구원 | Apparatus and method for memory migration based on omitting redundant in virtial machine migration |
-
2017
- 2017-11-20 CN CN201711153677.9A patent/CN107832119A/en not_active Withdrawn
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103577249A (en) * | 2013-11-13 | 2014-02-12 | 中国科学院计算技术研究所 | Method and system for virtual machine online migration |
CN105335223A (en) * | 2014-06-20 | 2016-02-17 | 富士通株式会社 | Virtual machine memory migration device, method and system on source host and destination host |
CN104268003A (en) * | 2014-09-30 | 2015-01-07 | 南京理工大学 | Memory state migration method applicable to dynamic migration of virtual machine |
KR20160099365A (en) * | 2015-02-12 | 2016-08-22 | 한국전자통신연구원 | Apparatus and method for memory migration based on omitting redundant in virtial machine migration |
CN105700945A (en) * | 2016-01-12 | 2016-06-22 | 中南大学 | Clean room environment-based safe virtual machine migration method |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110392025A (en) * | 2018-04-20 | 2019-10-29 | 伊姆西Ip控股有限责任公司 | Method, equipment and the computer program product of managing distributing type system |
CN110392025B (en) * | 2018-04-20 | 2022-03-25 | 伊姆西Ip控股有限责任公司 | Method, apparatus and computer readable medium for managing distributed system |
CN111090496A (en) * | 2019-12-06 | 2020-05-01 | 苏州浪潮智能科技有限公司 | Virtual machine memory migration method and device based on automatic iteration time adjustment |
CN111090496B (en) * | 2019-12-06 | 2022-12-20 | 苏州浪潮智能科技有限公司 | Virtual machine memory migration method and device based on automatic iteration time adjustment |
CN111580933A (en) * | 2020-05-12 | 2020-08-25 | 西安交通大学 | Hardware acceleration-based virtual machine online migration method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104166606B (en) | File backup method and main storage device | |
CN102136993B (en) | A kind of methods, devices and systems of Data Migration | |
CN107832119A (en) | A kind of KVM live migration of virtual machine optimization methods for reducing internal memory and repeating copy | |
CN105607867B (en) | Master-slave deduplication storage system, method thereof, and computer-readable storage medium | |
CN106663022A (en) | Live migration of virtual machines that use externalized memory pages | |
CN103455433B (en) | EMS memory management process and system | |
DE112010003750T5 (en) | Hardware for parallel command list generation | |
CN102141931A (en) | Virtual machine establishing method, virtual machine monitor and virtual machine system | |
CN103559017B (en) | Character string matching method based on GPU heterogeneous computing platforms and system | |
US20170160940A1 (en) | Data processing method and apparatus of solid state disk | |
US20160147652A1 (en) | Data storage system and control method thereof | |
CN111814971A (en) | Memory allocation method of neural network | |
CN106682215A (en) | Data processing method and management node | |
CN104881248A (en) | Method for self-adaptive direct IO acceleration in file system directed to Solid State Drive (SSD) | |
US11474710B2 (en) | Application-specific memory scaling in multi-device systems | |
CN106339181A (en) | Method and system for processing data in storage system | |
US10372605B2 (en) | Generational garbage collector for trees under multi-version concurrency control | |
KR102114245B1 (en) | Graphics state manage apparatus and method | |
WO2016138785A1 (en) | Method and device for running process | |
Kim et al. | Accelerating gnn training with locality-aware partial execution | |
US20200043128A1 (en) | Processing system for graphs and operating method thereof | |
CN114443211A (en) | Virtual machine live migration method, equipment and storage medium | |
US10402315B1 (en) | Data storage system configured to write volatile scattered memory metadata to a non-volatile memory | |
US8990537B2 (en) | System and method for robust and efficient free chain management | |
CN110750363B (en) | Computer storage management method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20180323 |