Movatterモバイル変換


[0]ホーム

URL:


CN102222014A - Dynamic memory management system based on memory hot plug for virtual machine - Google Patents

Dynamic memory management system based on memory hot plug for virtual machine
Download PDF

Info

Publication number
CN102222014A
CN102222014ACN2011101626150ACN201110162615ACN102222014ACN 102222014 ACN102222014 ACN 102222014ACN 2011101626150 ACN2011101626150 ACN 2011101626150ACN 201110162615 ACN201110162615 ACN 201110162615ACN 102222014 ACN102222014 ACN 102222014A
Authority
CN
China
Prior art keywords
memory
virtual machine
internal memory
target value
enter step
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.)
Granted
Application number
CN2011101626150A
Other languages
Chinese (zh)
Other versions
CN102222014B (en
Inventor
金海�
廖小飞
马博
刘海坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huazhong University of Science and TechnologyfiledCriticalHuazhong University of Science and Technology
Priority to CN 201110162615priorityCriticalpatent/CN102222014B/en
Publication of CN102222014ApublicationCriticalpatent/CN102222014A/en
Application grantedgrantedCritical
Publication of CN102222014BpublicationCriticalpatent/CN102222014B/en
Expired - Fee Relatedlegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Landscapes

Abstract

The invention discloses a dynamic memory management system based on memory hot plug for a virtual machine, comprising a memory monitoring module, a memory distributing module and a memory hot plug module. The memory hot plug module adopts Linux memory hot plug mechanism to realize memory hot plug on a semi-virtual Linux virtual machine, thereby breaking through the initial memory toplimit of the virtual machine and efficiently improving the memory expandability of the virtual machine by increasing and reducing the memory randomly. On one hand, the memory distributing module dynamically predicts the memory requirement of the virtual machine and balances the memory pressure of each virtual machine, thereby being capable of satisfying the memory requirement of the virtual machine and also improving the memory utilization ratio of a physical machine; on the other hand, the memory distributing module can establish a new virtual machine by reasonably reducing the memory of the existing virtual machine when the memory of the physical machine is not enough, thereby realizing memory overuse and improving the memory utilization ratio of the physical machine.

Description

Virtual machine dynamic EMS memory management system based on the internal memory hot plug
Technical field
The invention belongs to computer application field, relate to the memory management of Xen half virtual virtual machine, be specially the dynamic EMS memory management system under a kind of multi-dummy machine environment.
Background technology
The resource extent of current computing system is constantly expanded, and processing power strengthens fast, and the resource kind becomes increasingly abundant, and application demand is versatile and flexible.Intel Virtualization Technology can the multiple computational resource of dynamic organization, realizes the scalable computing system framework of transparence, thereby makes up the computing environment that satisfies multiple application demand flexibly, improves the service efficiency of computational resource.Various virtualization solution continues to bring out, and virtualization software Xen is undoubtedly outstanding person wherein.Xen is the virtual machine project of increasing income that Cambridge University initiates, and its performance is near the performance of single-set operation system.Because its superior performance and increasing income property, thus extensively good by industry, be considered to one of the most promising virtualization solution in future.It is the critical function of Xen virutal machine memory management that balloon drives, and is used for adjusting the memory size of virtual machine.But balloon drives and to have defective, and the physical address space such as can not EVM(extended virtual machine) causes the virutal machine memory size to have the upper limit; The driving of frequent use balloon can cause physical address space discontinuous, produces memory fragmentation.The internal memory hot plug is an important technology of operating system memory management, can effectively improve the shortcoming that balloon drives, but also be unrealized on the Xen virtual machine.
Generally speaking, many virtual machines of operation use static memory to distribute on the separate unit physical machine, be that the memory size of virtual machine is constant all the time or by the administrator hand adjustment, when the virtual machine load variations, the low excessively situation of low memory or memory usage may occur.Therefore need a kind of dynamic memory management scheme, adjust the memory size of virtual machine automatically, satisfy the memory requirements of virtual machine and make full use of the physical machine internal memory according to the variation of each virtual machine load.
Summary of the invention
The object of the present invention is to provide a kind of virtual machine dynamic EMS memory management system based on the internal memory hot plug, this system can break the internal memory upper limit of virtual machine, increases or reduce virtual machine arbitrarily; Can adjust the memory size of each virtual machine dynamically according to the variation of virtual machine load, satisfy the memory requirements of virtual machine and improve the memory usage of physical machine; When the physical machine low memory, by rationally reducing the internal memory of existing virtual machine, the virtual machine that dynamic creation is new.
Virtual machine dynamic EMS memory management system based on the internal memory hot plug comprises
The internal memory monitoring module is used to obtain the memory information of each virtual machine;
Memory allocating module is used for carrying out Dram distribution and dynmaic establishing virtual machine according to the memory information of each virtual machine;
The internal memory hot plug module is used for the internal memory of virtual machine is adjusted to the internal memory desired value that memory allocating module calculates;
Described Dram distribution is carried out in the following manner:
(11) calculate the memory increase Δ M of each virtual machinel=MUsed(n)l-MUsed(n-1)lWith exchange partition increment Delta Sl=S (n)l-S (n-1)l, M whereinUsed(n)lAnd MUsed(n-1)lBe respectively the use internal memory of l virtual machine, S (n) at n and n-1 time pointlAnd S (n-1)lBe respectively the use exchange partition of l virtual machine at n and n-1 time point, l=1 ..., L, L are the virtual machine sum;
(12) predict the use internal memory M that the next time point of each virtual machine needsPredict(n+1)l=MUsed(n)l+ Δ Ml+ Δ Sl
(13) the average memory usage of n+1 time point of calculatingUavg(n+1)=Σi=1LMpredict(n+1)l/Σl=1LMtotal(n)l,;
(14) calculate the internal memory desired value M of each virtual machine at n+1 time pointTarget(n+1)l=MPredict(n+1)l/ UAvg(n+1);
(15) the invoke memory hot plug module is adjusted the internal memory of each virtual machine to desired value MTarget(n+1)l
(16) sleep T second, return step (11) then;
Described dynmaic establishing virtual machine carries out in the following manner:
(21) if the internal memory that the free memory of physical machine is set more than or equal to new virtual machine is then directly created new virtual machine, finish; Otherwise, enter step (22);
(22) calculate the existing current average memory usage U of virtual machineAvg=∑ MUsed/ (∑ MTotal-MNew+ MFree), wherein, ∑ MUsedBe the existing current use internal memory summation of virtual machine, ∑ MTotalBe the internal memory sum of existing virtual machine, MNewBe the internal memory that new virtual machine is set, MFreeBe the current free memory of physical machine;
(23) calculate the internal memory desired value M of each existing virtual machineTargetl=MUsedl/ UAvg, MUsedlBe l the current use internal memory of existing virtual machine;
(24) the invoke memory hot plug module is created new virtual machine after the internal memory of each existing virtual machine is adjusted to the internal memory desired value that step (23) obtains.
Further, described internal memory hot plug module is adjusted virutal machine memory in the following manner:
(31) the internal memory desired value of virtual machine and the current internal memory of virtual machine are compared, if greater than, step (32) entered; If less than, enter step (34); If equal, then finish;
(32) if the physical address space of virtual machine less than the internal memory desired value of virtual machine, then expand its physical address space to more than or equal to the internal memory desired value, remember that the memory pages in the new physics address space of expanding is an off-line page, enter step (33), otherwise, directly enter step (33);
(33) increase virutal machine memory to the internal memory desired value:
(331) if the internal memory desired value of virtual machine greater than current internal memory, is then calculated the difference DELTA of virutal machine memory desired value and current internal memory1, enter step (332), otherwise, finish;
(332) if there is the reservation page, then is one and keeps page storage allocation, remember that this reservation page is a free Page, return step (331); Otherwise, enter step (333);
(333) if Δ1Greater than 128M and there is the off-line application heap, then be an off-line application heap storage allocation, remember that this off-line application heap is the free memory section, return step (331), otherwise, enter step (334);
(335) according to the address sequencing one by one to the off-line page storage allocation up to the internal memory that is assigned with equal Δ1, the off-line page that note is assigned with internal memory is a free Page;
(34) reduce virutal machine memory to the internal memory desired value:
(341) if the internal memory desired value of virtual machine less than current internal memory, is then calculated the difference DELTA of current internal memory and virutal machine memory desired value2, enter step (342), otherwise, finish;
(342) if Δ2More than or equal to 128M, then enter step (343), otherwise, enter step (344);
(343) whether inquiry exists deletable application heap, if exist, then the internal memory with one of them application heap discharges to virtual machine manager, remembers that this application heap is the off-line application heap, returns step (341), otherwise, enter step (344);
(344) be Δ to VME operating system application size2Internal memory, the memory pages of applying for is discharged to virtual machine manager, and remembers that these pages are for keeping the page.
Particularly, the present invention has following characteristics:
(1) favorable expandability
Xen uses balloon to drive the memory size of adjusting virtual machine now, balloon drive can not EVM(extended virtual machine) physical address space, the internal memory upper limit in the time of promptly can not breaking through virtual machine activation, frequent in addition use balloon drives and can produce a large amount of memory fragmentations.The virutal machine memory hot plug technology that realizes among the present invention, physical address space that can EVM(extended virtual machine) makes the memory size no maximum of virtual machine, can increase or reduce virutal machine memory arbitrarily, effectively raises the extendability of virutal machine memory; Drive with balloon and to compare, the mode by the internal memory hot plug reduces the generation that internal memory can be avoided memory fragmentation.
(2) availability is good
The memory management of Xen virtual machine is static, can only manually adjust the virutal machine memory size, along with the variation of load, the situation of low memory or internal memory waste may occur.Dram distribution function among the present invention is the memory pressure of perception virtual machine dynamically, the memory requirements of prediction virtual machine, the memory pressure of balance virtual machine, can satisfy the memory requirements of virtual machine, improve the virtual machine performance, can improve the memory usage of physical machine again, strengthen the availability of virtual machine.
When the physical machine low memory, Xen can't create new virtual machine.Dynmaic establishing virtual machine function among the present invention can be when the physical machine low memory, by rationally reducing the internal memory of existing virtual machine, create new virtual machine, realize the excessive use of critical function internal memory (memory overcommit) in the Intel Virtualization Technology, strengthened the availability of virtual machine.
(3) good stability
The present invention is through test for a long time, use multiple test environment during test, comprise the various extreme cases of manual setting, and use various authoritys' benchmark to test for a long time, every function in the proof system all is stable as a result, reliably.
Description of drawings
Fig. 1 is a system construction drawing of the present invention;
Fig. 2 is system function module figure of the present invention;
Fig. 3 is physical address space constitutional diagram of the present invention;
Fig. 4 is that internal memory hot plug of the present invention drives workflow diagram;
Fig. 5 is that hot plug of the present invention increases the internal memory process flow diagram;
Fig. 6 reduces the internal memory process flow diagram for hot plug of the present invention;
Fig. 7 is Dram allocation flow figure of the present invention;
Fig. 8 is a dynmaic establishing virtual machine process flow diagram of the present invention.
Embodiment
The dynamic EMS memory management system that the present invention realizes is developed based on Xen4.0, at half virtual virtual machine.
System architecture as shown in Figure 1, this system applies is in the physical hardware of x86 framework, virtual machine manager (Virtual Machine Monitor) operates on the physical hardware, is responsible for the resource management of the bottom, such as memory management, CPU scheduling, device access etc.Domain 0 is a privileged domain, has only one, is in charge of each domain U.Domain U is the client territory, can have a plurality ofly, and the virtual machine of hereinafter mentioning all refers to domain U.Xenstore is the file system of a similar database, is set up by domain 0, shares with each domain U.Xenstore has stored the configuration and the status information of virtual machine, and every kind of information all has corresponding data item, and domain 0 and domain U carry out inter-domain communication by reading and writing same data item.Memory information monitoring process of operation among each domain U obtains memory information and sends to domain 0; Dram distribution process of operation among the domain 0, be responsible for receiving the memory information of domain U, for Dram distributes and dynmaic establishing virtual machine function is calculated the internal memory desired value of each domain U, and send to the internal memory hot plug driving among the domain U.The operating system of Domain 0 and domain U is 64 Linux (the kernel version is 2.6.31).
As shown in Figure 2, this system is made of three modules, is respectively the internal memory monitoring module, memory allocating module and internal memory hot plug module.
The effect of internal memory monitoring module is the memory information that monitors each virtual machine, and specific practice is to carry out inter-domain communication by xenstore.Process of operation obtains required memory information among the Domain U, comprises memory usage, exchange partition utilization factor etc., and write xenstore; Process of operation reads xenstore among the domain 0, obtains the memory information of domain U.The internal memory of virtual machine comprises use internal memory and free memory, and memory usage just is to use internal memory to account for the ratio of virutal machine memory.
The effect of memory allocating module is how to distribute virutal machine memory when calculating Dram distribution and dynmaic establishing virtual machine.Specific practice is to analyze the memory information that the internal memory monitoring module obtains, and uses corresponding allocation algorithm to calculate the desired value of each virutal machine memory size.
The effect of internal memory hot plug module is a memory size of adjusting each virtual machine, and specific practice is the virutal machine memory desired value that calculates according to memory allocating module, and the invoke memory hot plug drives adjusts virutal machine memory to desired value; The calling interface of user's attitude also is provided in addition, and manually the invoke memory hot plug drives and adjusts the virutal machine memory size.
The state that physical address space may occur in the internal memory hot plug driving implementation as shown in Figure 3.White portion is represented the free memory of operating system; Dash area is represented the unavailable internal memory of operating system, and comprise the off-line application heap that produces when reducing internal memory and keep the page, and the off-line page at the physical address space end that stays when increasing internal memory of fine granularity.
Dynamic EMS memory management system has the internal memory hot plug, and Dram distributes, and three kinds of basic functions of dynmaic establishing virtual machine are done detailed explanation below in conjunction with accompanying drawing and example to the present invention.
(1) as shown in Figure 4, the workflow of internal memory hot plug driving is as follows:
(1.1) load internal memory hot plug driver module, and initialization;
(1.2) receive the internal memory desired value, carry out internal memory hot plug task;
(1.3) increase internal memory processing function if the internal memory desired value greater than the virutal machine memory currency, is carried out, increase the associative operation of internal memory, enter step (1.4); Reduce internal memory processing function if desired value less than the virutal machine memory currency, is carried out, reduce the associative operation of internal memory, enter step (1.4);
(1.4), finish if desired value equals currency; Otherwise (certain step occurs wrong) enters step (1.3) behind the timeticks of dormancy (HZ), continues to carry out internal memory hot plug task.
As shown in Figure 5, the flow process of increase internal memory is as follows:
(A1) if the physical address space of virtual machine less than the internal memory desired value of virtual machine, then expand its physical address space to more than or equal to the internal memory desired value, remember that the memory pages in the new physics address space of expanding is an off-line page, enter step (2.2), otherwise, directly enter step (2.2)
(A2) if the internal memory desired value of virtual machine greater than current internal memory, is then calculated the difference DELTA of virutal machine memory desired value and current internal memory1, enter step (A3), otherwise, finish;
(A3) if there is the reservation page, then, remember that this reservation page is that free Page has promptly increased one page internal memory, returns step (A2) for one of them keeps page storage allocation; Otherwise, enter step (A4);
(A4) if Δ1More than or equal to 128M and there is the off-line application heap, then be one of them off-line application heap storage allocation, remember that this off-line application heap is that the free memory section has promptly increased by one section internal memory, return step (A2), otherwise, enter step (A5);
(A5) according to the address sequencing one by one to the off-line page storage allocation up to the internal memory that is assigned with equal Δ1, the off-line page that note is assigned with internal memory is a free Page, increase internal memory operation and finish this moment.
As shown in Figure 6, it is as follows to reduce the flow process of internal memory:
(B1) if the internal memory desired value of virtual machine less than current internal memory, is then calculated the difference DELTA of current internal memory and virutal machine memory desired value2, enter step (B2), otherwise, finish;
(B2) if Δ2More than or equal to 128M, then enter step (B3), otherwise, enter step (B4);
(B3) whether inquiry exists deletable application heap, deletable application heap is meant and can makes all memory pages in this application heap become free page by the internal memory migrating technology, if exist, then one of them application heap physical address corresponding space is deleted from memory allocator, and the internal memory of this application heap discharged to virtual machine manager, remember that this application heap is that the off-line application heap has promptly reduced one section internal memory, returns step (B1), otherwise, enter step (B4)
(B4) be Δ to VME operating system application size2Internal memory, the memory pages of applying for is discharged to virtual machine manager, and remembers that these pages for keeping the page, have promptly reduced size and have been Δ2Internal memory, the operation that reduce internal memory this moment is finished.
(2) as shown in Figure 7, the Dram flow process that shares out the work is as follows:
(2.1) obtain the memory information of each virtual machine by the internal memory monitoring module;
(2.2) calculate the memory increase Δ M of each virtual machinelWith exchange partition increment Delta Sl, computing method are as follows, wherein MUsed(n)lAnd MUsed(n-1)lBe respectively the use internal memory of l virtual machine, S (n) at n and n-1 time pointlAnd S (n-1)lBe respectively the use exchange partition of l virtual machine at n and n-1 time point, l=1 ..., L, L are the virtual machine sum, n time point is current point in time;
Figure BDA0000068870340000101
(2.3) prediction memory requirements, the use internal memory that promptly next time point needs, predicted value MPredict(n+1)lEqual current use internal memory MUsed(n)lAdd memory increase and exchange partition increment;
Mpredict(n+1)l=Mused(n)l+ΔMl+ΔSl
(2.4) the average memory usage U of n+1 time point of calculatingAvg(n+1), MTotal(n)lBe the internal memory of l virtual machine at n time point;
Figure BDA0000068870340000102
(2.5) calculate the internal memory desired value M of each virtual machine at n+1 time pointTarget(n+1)l, equal the memory requirements predicted value divided by average memory usage.
Mtarget(n+1)l=Mpredict(n+1)l/Uavg(n+1)
(2.6) if the virutal machine memory utilization factor in average memory usage scope (1~10%), enters step (2.7); Otherwise enter step (2.8);
|Mpredict(n+1)l/Mtotal(n)l-Uavg(n+1) |≤average memory usage scope
(2.7) internal memory desired value assignment is the internal memory currency, does not adjust memory size, and purpose is to reduce the number of times that internal memory is adjusted;
Mtarget(n+1)l=Mtotal(n)l
(2.8) if the internal memory desired value less than producing the critical value (Committed_AS the among/proc/meminfo) that internal memory overflows, enters step (2.9), otherwise enters step (2.10);
(2.9) internal memory desired value assignment is Committed_AS, avoids producing internal memory and overflows;
Mtarget(n+1)l=Committed_AS
(2.10) the invoke memory hot plug drives the internal memory of each virtual machine of adjustment to desired value MTarget(n+1)l
(2.11) sleep T second, T is the cycle that Dram distributes, and returns step (2.1) then.
Wherein step (2.6) is optimization process at some special circumstances to step (2.9), uses the memory usage scope to reduce the number of times that internal memory is adjusted on the one hand, will avoid producing internal memory on the other hand and overflow.Step (2.6) is to the dispensable step of step (2.9).
(3) as shown in Figure 8, the flow process of dynmaic establishing virtual machine is as follows:
(3.1) if the internal memory that the free memory of physical machine is set more than or equal to new virtual machine is then directly created new virtual machine, finish; Otherwise, enter step (3.2);
(3.2) obtain the memory information of each virtual machine by the internal memory monitoring module;
(3.3) behind the internal memory that the new virtual machine of reservation is set, calculate average memory usage UAvg, ∑ M whereinUsedBe the use internal memory summation of existing virtual machine, ∑ MTotalBe the internal memory sum of existing virtual machine, MNewBe the internal memory that new virtual machine is set, MFreeIt is the free memory of physical machine;
Uavg=∑Mused/(∑Mtotal-Mnew+Mfree)
(3.4) calculate the internal memory desired value M of each existing virtual machineTargetl, M whereinUsed lBe l the current use internal memory of existing virtual machine
Mtarget?l=Mused?l/Uavg
(3.5) the internal memory desired value M of invoke memory hot plug internal memory that drive to adjust each virtual machine to the step (3.4)Targetl
(3.6) create new virtual machine, this moment, physical machine had enough free memories to create new virtual machine.
Example:
Dynamic EMS memory management system set forth in the present invention can illustrate that experimental situation only needs a PC, disposes as follows by instantiation:
Figure BDA0000068870340000121
Need to install amended Xen 4.0 of the present invention and Linux 2.6.31 kernel on the physical machine, domain U and domain 0 use Linux 2.6.31 kernel, test three kinds of functions of the present invention below respectively.
(1) virutal machine memory hot plug test
(1.1) original state: save as 2G in the physical machine, domain 0 internal memory is fixed as 1G (can not be changed);
(1.2) virtual machine of a 256 MB of memory of establishment;
(1.3) coarseness increases internal memory: uses internal memory hot plug driving at user's attitude interface of domain 0 virutal machine memory to be set and be 512M, increased 256 MB of memory, promptly increased by two sections internal memories;
(1.4) fine granularity increases internal memory: it is 562M that virutal machine memory is set, and has increased by 50 internal memories;
(1.5) coarseness reduces internal memory: it is 434M that virutal machine memory is set, and has reduced the 128M internal memory, i.e. one section internal memory;
(1.6) fine granularity reduces internal memory: it is 400M that virutal machine memory is set, and has reduced the 34M internal memory.
More than test has proved that the virutal machine memory hot plug can break the initial internal memory upper limit of virtual machine, increases or reduce virutal machine memory arbitrarily.The test process of Dram distribution needs long-time frequent adjustment memory size in addition, can prove stability and reliability that the internal memory hot plug drives.
(2) dynmaic establishing virtual machine test
(2.1) original state: save as 2G in the physical machine, domain 0 internal memory is fixed as 1G, and the free memory of physical machine is about 1G;
(2.2) create two virtual machines, internal memory all is 500M, and the physical machine free time is about 20M;
(2.3) use " xm create " order directly to create the virtual machine of a 256 MB of memory, create failure, because the free memory deficiency of physical machine;
(2.4) use dynmaic establishing virtual machine function, create new virtual machine success;
(2.5) use dynmaic establishing virtual machine function, create the virtual machine success of the 4th 256 MB of memory;
(2.6) use dynmaic establishing virtual machine function, create the virtual machine success of the 5th 256 MB of memory.More than test has proved that dynmaic establishing virtual machine function can be under the situation of physical machine low memory, by rationally reducing the internal memory of existing virtual machine, create new virtual machine, has realized the excessive use of internal memory.
(3) Dram allocation for test
(3.1) original state: save as 2G in the physical machine, the domain0 internal memory is fixed as 1G, and the free memory of physical machine is about 1G;
(3.2) create two virtual machines, internal memory all is 512M;
(3.3) static memory allocation for test: a virtual machine operation benchmark Spec CPU 2006, another virtual machine idle running;
(3.4) after the static memory allocation for test finishes, two virtual machines are closed, create two virtual machines again according to identical configuration then;
(3.5) Dram allocation for test: a virtual machine operation benchmark Spec CPU 2006, another virtual machine idle running.
In Dram allocation for test process, along with the variation of virtual machine load, the dynamic change of two virutal machine memory sizes makes the virtual machine of high capacity have bigger internal memory, and the virtual machine of low load has less internal memory.
The test result of benchmark Spec CPU 2006 is as shown in the table, and Dram distributes the intensive test event perlbench of internal memory, and the performance of bzip2 and gcc has tangible lifting, and other test events are less demanding to internal memory, and performance change is little.The benchmark of operation high capacity has also proved high stability and the reliability that Dram distributes for a long time.

Claims (2)

Translated fromChinese
1.基于内存热插拔的虚拟机动态内存管理系统,包括1. Virtual machine dynamic memory management system based on memory hot swap, including内存监视模块,用于获取各虚拟机的内存信息;The memory monitoring module is used to obtain the memory information of each virtual machine;内存分配模块,用于依据各虚拟机的内存信息进行动态内存分配和动态创建虚拟机;The memory allocation module is used for dynamic memory allocation and dynamic creation of virtual machines according to the memory information of each virtual machine;内存热插拔模块,用于将虚拟机的内存调整到内存分配模块计算得到的内存目标值;A memory hot-swappable module, configured to adjust the memory of the virtual machine to the memory target value calculated by the memory allocation module;所述动态内存分配按照如下方式进行:The dynamic memory allocation is performed as follows:(11)计算各虚拟机的内存增量ΔMl=Mused(n)l-Mused(n-1)l和交换分区增量ΔSl=S(n)l-S(n-1)l,其中Mused(n)l和Mused(n-1)l分别为第l个虚拟机在第n和n-1个时间点的使用内存,S(n)l和S(n-1)l分别为第l个虚拟机在第n和n-1个时间点的使用交换分区,l=1,...,L,L为虚拟机总数;(11) Calculate the memory increment of each virtual machine ΔMl =Mused (n)l -Mused (n-1)l and the swap partition increment ΔSl =S(n)l -S(n-1)l , where Mused (n)l and Mused (n-1)l are the used memory of the lth virtual machine at the nth and n-1 time points respectively, and S(n)l and S(n-1)l is the swap partition used by the lth virtual machine at the nth and n-1 time points respectively, l=1,..., L, L is the total number of virtual machines;(12)预测各虚拟机下一个时间点需要的使用内存Mpredict(n+1)l=Mused(n)l+ΔMl+ΔSl(12) Predict the used memory Mpredict (n+1)l = Mused (n)l +ΔMl +ΔSl required by each virtual machine at the next point in time;(13)计算第n+1个时间点的平均内存利用率Uavg(n+1)=Σi=1LMpredict(n+1)l/Σl=1LMtotal(n)l,;(13) Calculate the average memory utilization at the n+1th time point u avg ( no + 1 ) = Σ i = 1 L m predict ( no + 1 ) l / Σ l = 1 L m total ( no ) l , ;(14)计算各虚拟机在第n+1个时间点的内存目标值Mtarget(n+1)l=Mpredict(n+1)l/Uavg(n+1);(14) Calculate the memory target value Mtarget (n+1)l =Mpredict (n+1)l /Uavg (n+1) of each virtual machine at the n+1 time point;(15)调用内存热插拔模块调整各虚拟机的内存至目标值Mtarget(n+1)l(15) calling the memory hot swap module to adjust the memory of each virtual machine to the target value Mtarget (n+1)l ;(16)睡眠T秒,然后返回步骤(11);(16) Sleep for T seconds, then return to step (11);所述动态创建虚拟机按照如下方式进行:The dynamic creation of a virtual machine is performed as follows:(21)若物理机的空闲内存大于或等于新虚拟机设定的内存,则直接创建新虚拟机,结束;否则,进入步骤(22);(21) If the free memory of the physical machine is greater than or equal to the memory set by the new virtual machine, then directly create a new virtual machine and end; otherwise, enter step (22);(22)计算已有虚拟机当前的平均内存利用率Uavg=∑Mused/(∑Mtotal-Mnew+Mfree),其中,∑Mused为已有虚拟机当前的使用内存总和,∑Mtotal为已有虚拟机的内存之和,Mnew为新虚拟机设定的内存,Mfree为物理机当前的空闲内存;(22) Calculate the current average memory utilization rate Uavg of the existing virtual machine =∑Mused /(∑Mtotal -Mnew +Mfree ), where ∑Mused is the sum of the current memory used by the existing virtual machine, ∑M used Mtotal is the sum of the memory of the existing virtual machine, Mnew is the memory set for the new virtual machine, and Mfree is the current free memory of the physical machine;(23)计算各已有虚拟机的内存目标值Mtargetl=Musedl/Uavg,Musedl为第l个已有虚拟机当前的使用内存;(23) Calculate the memory target value Mtargetl of each existing virtual machine=Musedl /Uavg , Musedl is the current used memory of the l-th existing virtual machine;(24)调用内存热插拔模块将各已有虚拟机的内存调整到步骤(23)得到的内存目标值后创建新虚拟机。(24) Create a new virtual machine after calling the memory hot swap module to adjust the memory of each existing virtual machine to the memory target value obtained in step (23).2.根据权利要求1所述的基于内存热插拔的虚拟机动态内存管理系统,其特征在于,所述内存热插拔模块按照如下方式调整虚拟机内存:2. the virtual machine dynamic memory management system based on memory hot swap according to claim 1, is characterized in that, described memory hot swap module adjusts virtual machine memory as follows:(31)将虚拟机的内存目标值与虚拟机的当前内存进行比较,若大于,进入步骤(32);若小于,进入步骤(34);若等于,则结束;(31) compare the memory target value of the virtual machine with the current memory of the virtual machine, if greater, enter step (32); if less than, enter step (34); if equal, then end;(32)若虚拟机的物理地址空间小于虚拟机的内存目标值,则扩展其物理地址空间至大于或等于内存目标值,记扩展的新物理地址空间中的内存页面为离线页面,进入步骤(33),否则,直接进入步骤(33);(32) If the physical address space of the virtual machine is less than the memory target value of the virtual machine, then expand its physical address space to be greater than or equal to the memory target value, record the memory page in the new physical address space of expansion as an offline page, enter step ( 33), otherwise, directly enter step (33);(33)增加虚拟机内存至内存目标值:(33) Increase the virtual machine memory to the memory target value:(331)若虚拟机的内存目标值大于当前内存,则计算虚拟机内存目标值与当前内存的差值Δ1,进入步骤(332),否则,结束;(331) If the memory target value of the virtual machine is greater than the current memory, calculate the difference Δ1 between the virtual machine memory target value and the current memory, and enter step (332), otherwise, end;(332)如果存在保留页面,则为一个保留页面分配内存,记该保留页面为可用页面,返回步骤(331);否则,进入步骤(333);(332) If there is a reserved page, then allocate memory for a reserved page, record this reserved page as an available page, and return to step (331); otherwise, enter step (333);(333)若Δ1大于128M且存在离线内存段,则为一个离线内存段分配内存,记该离线内存段为可用内存段,返回步骤(331),否则,进入步骤(334);(333) If Δ1 is greater than 128M and there is an offline memory segment, then allocate memory for an offline memory segment, record this offline memory segment as an available memory segment, return to step (331), otherwise, enter step (334);(335)按照地址先后顺序逐一对离线页面分配内存直到被分配的内存和等于Δ1,记被分配内存的离线页面为可用页面;(335) Allocate memory to the offline pages one by one according to the address sequence until the sum of the allocated memory is equal to Δ1 , and record the offline page of the allocated memory as an available page;(34)减小虚拟机内存至内存目标值:(34) Reduce the virtual machine memory to the memory target value:(341)若虚拟机的内存目标值小于当前内存,则计算当前内存与虚拟机内存目标值的差值Δ2,进入步骤(342),否则,结束;(341) If the memory target value of the virtual machine is less than the current memory, then calculate the difference Δ2 between the current memory and the virtual machine memory target value, enter step (342), otherwise, end;(342)若Δ2大于或等于128M,则进入步骤(343),否则,进入步骤(344);(342) If Δ2 is greater than or equal to 128M, then enter step (343), otherwise, enter step (344);(343)查询是否存在可删除的内存段,若存在,则将其中一个内存段的内存释放给虚拟机管理器,记该内存段为离线内存段,返回步骤(341),否则,进入步骤(344);(343) query whether there is a deletable memory segment, if there is, then release the memory of one of the memory segments to the virtual machine manager, record this memory segment as an offline memory segment, return to step (341), otherwise, enter step ( 344);(344)向虚拟机操作系统申请大小为Δ2的内存,将申请到的内存页面释放给虚拟机管理器,并记这些页面为保留页面。(344) Apply for memory with a size ofΔ2 to the virtual machine operating system, release the memory pages applied for to the virtual machine manager, and record these pages as reserved pages.
CN 2011101626152011-06-162011-06-16 Virtual machine dynamic memory management method based on memory hot swapExpired - Fee RelatedCN102222014B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN 201110162615CN102222014B (en)2011-06-162011-06-16 Virtual machine dynamic memory management method based on memory hot swap

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN 201110162615CN102222014B (en)2011-06-162011-06-16 Virtual machine dynamic memory management method based on memory hot swap

Publications (2)

Publication NumberPublication Date
CN102222014Atrue CN102222014A (en)2011-10-19
CN102222014B CN102222014B (en)2013-05-22

Family

ID=44778574

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN 201110162615Expired - Fee RelatedCN102222014B (en)2011-06-162011-06-16 Virtual machine dynamic memory management method based on memory hot swap

Country Status (1)

CountryLink
CN (1)CN102222014B (en)

Cited By (25)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102681792A (en)*2012-04-162012-09-19华中科技大学Solid-state disk memory partition method
CN103092678A (en)*2013-01-222013-05-08华中科技大学Multi-increment virtual machine memory management system and method
CN103309698A (en)*2012-03-162013-09-18鸿富锦精密工业(深圳)有限公司Virtual machine memory managing system and method
CN103324516A (en)*2013-07-042013-09-25曙光信息产业(北京)有限公司Virtualization-driven hardware management method and device
CN103365700A (en)*2013-06-282013-10-23福建师范大学Cloud computing virtualization environment-oriented resource monitoring and adjustment system
CN103605613A (en)*2013-11-212014-02-26中标软件有限公司Method and system for dynamically adjusting virtual-machine memory in cloud computing environment
CN104978233A (en)*2014-04-112015-10-14郑建锋Method and device for dynamically using memory
CN105162667A (en)*2015-09-102015-12-16华为技术有限公司Method and device for configuration of virtual machine
CN105320559A (en)*2014-07-302016-02-10中国移动通信集团广东有限公司Scheduling method and device of cloud computing system
CN105511940A (en)*2015-11-302016-04-20广州云宏信息科技股份有限公司Method and system authorizing virtual machine to access Xenstore in Xen virtualization
CN103176832B (en)*2013-02-072016-04-27宝龙计算机系统(湖南)有限公司One kind UNIX operating system runs method and the device of virtual opetrating system
CN105740050A (en)*2016-01-282016-07-06华中科技大学Trust transferring method in virtualization environment
CN106708596A (en)*2015-11-132017-05-24华为技术有限公司Input/output virtual resource adjustment method and processor
CN107391227A (en)*2017-07-202017-11-24郑州云海信息技术有限公司A kind of EMS memory management process and device
CN107506286A (en)*2017-09-262017-12-22郑州云海信息技术有限公司CPU and memory block automatically upper inserting method and system
CN107783812A (en)*2016-08-242018-03-09阿里巴巴集团控股有限公司Virutal machine memory management method and device
CN110580194A (en)*2019-08-292019-12-17上海仪电(集团)有限公司中央研究院Container scheduling method based on memory hot plug technology and management node scheduler
CN110580195A (en)*2019-08-292019-12-17上海仪电(集团)有限公司中央研究院Memory allocation method and device based on memory hot plug
CN110633130A (en)*2019-08-292019-12-31上海仪电(集团)有限公司中央研究院Virtual memory management method and device based on memory hot plug technology
US10719342B2 (en)2015-11-252020-07-21International Business Machines CorporationProvisioning based on workload displacement
CN111752674A (en)*2020-05-202020-10-09上海仪电(集团)有限公司中央研究院Technical architecture, memory allocation method, device and medium in Linux system environment
CN112114935A (en)*2020-09-182020-12-22北京金山云网络技术有限公司Hot plug method and related equipment
CN114237831A (en)*2022-02-252022-03-25阿里巴巴(中国)有限公司Hot plug method for virtual central processing unit, physical host and storage medium
CN115543862A (en)*2022-09-272022-12-30超聚变数字技术有限公司Memory management method and related device
CN119718539A (en)*2024-11-212025-03-28上海交通大学Memory hot plug control method for server non-perception security container and electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101504620A (en)*2009-03-032009-08-12华为技术有限公司Load balancing method, apparatus and system of virtual cluster system
CN101620573A (en)*2009-07-032010-01-06中国人民解放军国防科学技术大学Virtualization method of memory management unit of X86 system structure
CN101706742A (en)*2009-11-202010-05-12北京航空航天大学Method for dispatching I/O of asymmetry virtual machine based on multi-core dynamic partitioning
US20100312982A1 (en)*2009-06-042010-12-09Hitachi, Ltd.Storage management command control in virtualized environment
CN101916207A (en)*2010-08-282010-12-15华为技术有限公司 Energy saving method, device and system in desktop virtualization environment
CN101986285A (en)*2010-11-032011-03-16华为技术有限公司Virtual machine storage space management method, system and physical host
US20110083132A1 (en)*2009-10-022011-04-07Dor LaorMechanism for Prioritized Scheduling of Virtual Machines
CN102053858A (en)*2010-12-282011-05-11华中科技大学Virtual CPU dispatching method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101504620A (en)*2009-03-032009-08-12华为技术有限公司Load balancing method, apparatus and system of virtual cluster system
US20100312982A1 (en)*2009-06-042010-12-09Hitachi, Ltd.Storage management command control in virtualized environment
CN101620573A (en)*2009-07-032010-01-06中国人民解放军国防科学技术大学Virtualization method of memory management unit of X86 system structure
US20110083132A1 (en)*2009-10-022011-04-07Dor LaorMechanism for Prioritized Scheduling of Virtual Machines
CN101706742A (en)*2009-11-202010-05-12北京航空航天大学Method for dispatching I/O of asymmetry virtual machine based on multi-core dynamic partitioning
CN101916207A (en)*2010-08-282010-12-15华为技术有限公司 Energy saving method, device and system in desktop virtualization environment
CN101986285A (en)*2010-11-032011-03-16华为技术有限公司Virtual machine storage space management method, system and physical host
CN102053858A (en)*2010-12-282011-05-11华中科技大学Virtual CPU dispatching method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
HAI JIN等: "ChinaV: Building Virtualized Computing System", 《PROCEEDING OF 10TH IEEE INTERNATIONAL CONFERENCE ON HIGH PERFORMANCE COMPUTING AND COMMUNICATIONS》, 3 October 2008 (2008-10-03)*
王凌飞等: "Java虚拟机内存管理分析", 《现代电子技术》, 31 May 2007 (2007-05-31)*
郭晓琼: "虚拟机Xen及其内存管理研究", 《中国优秀硕士学位论文全文数据库》, 15 July 2008 (2008-07-15)*

Cited By (42)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103309698A (en)*2012-03-162013-09-18鸿富锦精密工业(深圳)有限公司Virtual machine memory managing system and method
CN102681792B (en)*2012-04-162015-03-04华中科技大学Solid-state disk memory partition method
CN102681792A (en)*2012-04-162012-09-19华中科技大学Solid-state disk memory partition method
CN103092678A (en)*2013-01-222013-05-08华中科技大学Multi-increment virtual machine memory management system and method
CN103092678B (en)*2013-01-222016-01-13华中科技大学A kind of many incremental virtual machine internal storage management system and method
CN103176832B (en)*2013-02-072016-04-27宝龙计算机系统(湖南)有限公司One kind UNIX operating system runs method and the device of virtual opetrating system
CN103365700A (en)*2013-06-282013-10-23福建师范大学Cloud computing virtualization environment-oriented resource monitoring and adjustment system
CN103365700B (en)*2013-06-282016-01-06福建师范大学A kind of facing cloud calculates monitoring resource and the adjustment System of virtualized environment
CN103324516A (en)*2013-07-042013-09-25曙光信息产业(北京)有限公司Virtualization-driven hardware management method and device
CN103324516B (en)*2013-07-042017-02-08曙光信息产业(北京)有限公司Virtualization-driven hardware management method and device
CN103605613A (en)*2013-11-212014-02-26中标软件有限公司Method and system for dynamically adjusting virtual-machine memory in cloud computing environment
CN103605613B (en)*2013-11-212016-09-21中标软件有限公司Cloud computing environment dynamically adjusts the method and system of virutal machine memory
CN104978233A (en)*2014-04-112015-10-14郑建锋Method and device for dynamically using memory
CN105320559A (en)*2014-07-302016-02-10中国移动通信集团广东有限公司Scheduling method and device of cloud computing system
CN105320559B (en)*2014-07-302019-02-19中国移动通信集团广东有限公司 A scheduling method and device for a cloud computing system
CN105162667A (en)*2015-09-102015-12-16华为技术有限公司Method and device for configuration of virtual machine
CN105162667B (en)*2015-09-102018-08-14华为技术有限公司Virtual machine configuration method and apparatus
CN106708596B (en)*2015-11-132020-02-14华为技术有限公司Method for adjusting input and output virtualized resources and processor
CN106708596A (en)*2015-11-132017-05-24华为技术有限公司Input/output virtual resource adjustment method and processor
US10725805B2 (en)2015-11-252020-07-28International Business Machines CorporationProvisioning based on workload displacement
US10719342B2 (en)2015-11-252020-07-21International Business Machines CorporationProvisioning based on workload displacement
CN105511940B (en)*2015-11-302019-02-01云宏信息科技股份有限公司The method and system of authorization virtual machine access Xenstore in a kind of Xen virtualization
CN105511940A (en)*2015-11-302016-04-20广州云宏信息科技股份有限公司Method and system authorizing virtual machine to access Xenstore in Xen virtualization
CN105740050B (en)*2016-01-282019-03-05华中科技大学A kind of Trust transitivity method under virtualized environment
CN105740050A (en)*2016-01-282016-07-06华中科技大学Trust transferring method in virtualization environment
CN107783812A (en)*2016-08-242018-03-09阿里巴巴集团控股有限公司Virutal machine memory management method and device
CN107783812B (en)*2016-08-242022-03-08阿里巴巴集团控股有限公司Virtual machine memory management method and device
CN107391227A (en)*2017-07-202017-11-24郑州云海信息技术有限公司A kind of EMS memory management process and device
CN107506286A (en)*2017-09-262017-12-22郑州云海信息技术有限公司CPU and memory block automatically upper inserting method and system
CN110580194A (en)*2019-08-292019-12-17上海仪电(集团)有限公司中央研究院Container scheduling method based on memory hot plug technology and management node scheduler
CN110633130A (en)*2019-08-292019-12-31上海仪电(集团)有限公司中央研究院Virtual memory management method and device based on memory hot plug technology
CN110580195A (en)*2019-08-292019-12-17上海仪电(集团)有限公司中央研究院Memory allocation method and device based on memory hot plug
CN110633130B (en)*2019-08-292023-10-31上海仪电(集团)有限公司中央研究院Virtual memory management method and device based on memory hot plug technology
CN110580195B (en)*2019-08-292023-11-07上海仪电(集团)有限公司中央研究院Memory allocation method and device based on memory hot plug
CN111752674A (en)*2020-05-202020-10-09上海仪电(集团)有限公司中央研究院Technical architecture, memory allocation method, device and medium in Linux system environment
CN111752674B (en)*2020-05-202023-08-01上海仪电(集团)有限公司中央研究院Technical architecture, memory allocation method, equipment and medium in Linux system environment
CN112114935A (en)*2020-09-182020-12-22北京金山云网络技术有限公司Hot plug method and related equipment
CN112114935B (en)*2020-09-182024-09-06北京金山云网络技术有限公司Hot plug method and related equipment
CN114237831A (en)*2022-02-252022-03-25阿里巴巴(中国)有限公司Hot plug method for virtual central processing unit, physical host and storage medium
CN115543862A (en)*2022-09-272022-12-30超聚变数字技术有限公司Memory management method and related device
CN115543862B (en)*2022-09-272023-09-01超聚变数字技术有限公司Memory management method and related device
CN119718539A (en)*2024-11-212025-03-28上海交通大学Memory hot plug control method for server non-perception security container and electronic equipment

Also Published As

Publication numberPublication date
CN102222014B (en)2013-05-22

Similar Documents

PublicationPublication DateTitle
CN102222014B (en) Virtual machine dynamic memory management method based on memory hot swap
US7996690B2 (en)System and method for dynamic utilization-based power allocation in a modular information handling system
Ibrahim et al.Governing energy consumption in Hadoop through CPU frequency scaling: An analysis
CN104238712B (en)Distributed power conveying
US8037251B2 (en)Memory compression implementation using non-volatile memory in a multi-node server system with directly attached processor memory
US20080082779A1 (en)File server that allows an end user to specify storage characteristics with ease
US20130063450A1 (en)Smart power management in graphics processing unit (gpu) based cluster computing during predictably occurring idle time
Vasudevan et al.Profile-based application assignment for greener and more energy-efficient data centers
GB2426360A (en)Reorganisation of memory for conserving power in a computing device
CN102193814A (en)Method and system for dynamically distributing embedded virtual memory
WO2016112713A1 (en)Processing method and device for memory page in memory
CN103297499A (en)Scheduling method and system based on cloud platform
TW202145010A (en)Methods of storing data, electronic devices and storage media
CN103218305A (en)Distribution method of memory space
CN116827798A (en)Device management method, device, equipment and machine-readable storage medium
CN111078407B (en)Memory management method and device, storage medium and electronic equipment
ITRM20110433A1 (en) ENERGY SAVING SYSTEM IN THE COMPANY DATE CENTERS.
US9015418B2 (en)Self-sizing dynamic cache for virtualized environments
CN115640098A (en)Virtual machine heterogeneous memory pooling method and system
US20240086086A1 (en)Ssd performance per power state improvement by deterministic utilization control
RoModeling and analysis of memory virtualization in cloud computing
CN113742059A (en)Task allocation method and device, computer equipment and storage medium
Ding et al.Review of virtual memory optimization in cloud environment
US20190294474A1 (en)Predictive queue map for parallel computing resource management
EP4160423B1 (en)Memory device, memory device operating method, and electronic device including memory device

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C14Grant of patent or utility model
GR01Patent grant
CF01Termination of patent right due to non-payment of annual fee

Granted publication date:20130522

Termination date:20200616

CF01Termination of patent right due to non-payment of annual fee

[8]ページ先頭

©2009-2025 Movatter.jp