CN103218305B - The distribution method of memory space - Google Patents
The distribution method of memory space Download PDFInfo
- Publication number
- CN103218305B CN103218305B CN201310173741.5A CN201310173741A CN103218305B CN 103218305 B CN103218305 B CN 103218305B CN 201310173741 A CN201310173741 A CN 201310173741A CN 103218305 B CN103218305 B CN 103218305B
- Authority
- CN
- China
- Prior art keywords
- physical
- memory space
- logical
- memory
- amount
- 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.)
- Active
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides the distribution method of a kind of memory space, including: during user's write operation, when limited physics memory space inadequate, from shared amount of physical memory, search free physical panel and write data into described free physical panel;And distribute extension amount of physical memory for user, and it is transferred to data extend amount of physical memory.Therefore, improve into the utilization rate of memory space, decrease the demand to memory space, thus reduce cost.
Description
Technical field
This invention relates generally to field of computer technology, more specifically for, relate to a kind of storage sky
Between distribution method.
Background technology
The major function of memorizer is storage program and various data, and can be in computer running
At a high speed, the access of program or data it is automatically completed.Memorizer is the equipment with " memory " function.
Past computer system only comprises the most limited conventional storage device, by these storage devices being installed
Access them to different places, the memory space of these different mount points can not intercommunication,
They must there be is a clear and definite planning, during otherwise using before using limited storage device
It is likely to occur unforeseen problem, such as insufficient space etc..
Along with increasing storage device joins in system, this man-to-man structure substantially can not
Meet the demand of user, even cannot create a subregion exceeding disk size, though disk total amount
Size much larger than this subregion.DM(Device Mapper in linux system) technology can solve
Such issues that, it is a kind of mapping frame from logical device to physical equipment that Linux2.6 kernel provides
Frame mechanism, under this mechanism, user can formulate according to the needs of oneself very easily and realize storage money
The management strategy in source.
In the prior art, when a certain application needs a part of memory space when, the most in advance
From back end storage system, mark off a part of sufficiently large space be pre-assigned to this application, even if
This applies and temporarily need not use the biggest memory space, but due to this part memory space
Being reserved out, other application program cannot utilize these to be deployed but idle memory capacity.
On the one hand this allocation model makes the stored number left unused be continuously increased, and memory space utilization rate is low, phase
Improve system cost with answering;On the other hand user has to buy bigger memory capacity, thus enters
One step adds cost.
Summary of the invention
Low for memory space utilization rate in prior art, that system cost is high defect, the present invention proposes
Can solve the problem that the distribution method of a kind of memory space of drawbacks described above.
According to embodiments of the invention, it is provided that the distribution method of a kind of memory space, including: with
During the write operation of family, when limited physics memory space inadequate, search from shared amount of physical memory
Free physical panel also writes data into free physical panel;And distribute extension physical store for user
Space, and be transferred to data extend amount of physical memory.
Preferably, before user's write operation, distribute the first logical memory space for user and set up
Limited logical memory space in one logical memory space closes with the first mapping of limited amount of physical memory
System.
Preferably, the limited logical memory space set up in the first logical memory space is deposited with limited physics
First mapping relations in storage space, farther include: set up multiple logics of limited logical memory space
First mapping relations of panel and multiple physical extent of limited amount of physical memory also store.
Preferably, from shared amount of physical memory, search free physical panel and write data into the free time
Physical extent, farther includes: application is shared amount of physical memory and searches free physical panel;Build
The vertical free physical panel found maps with second of the logical extent in the second logical memory space closes
It is and stores;And write data in free physical panel according to the second mapping relations, wherein,
First logical memory space includes the second logical memory space.
Preferably, distribute extension amount of physical memory for user and be transferred to data extend physical store
Space, farther includes: distribute extension amount of physical memory for user, sets up extension logic storage sky
Between multiple logical extent with extension amount of physical memory multiple physical extent the 3rd mapping relations also
Store;And according to the second mapping relations and the 3rd mapping relations by data from free physical panel
Being transferred to extend amount of physical memory, wherein, the first logical memory space includes extending logic storage sky
Between.
Preferably, when writing data in free physical panel, by free time thing in space allocation table
The status indication in reason panel is busy state;Or when data to be transferred to expand from free physical panel
Exhibition amount of physical memory time, in space allocation table by the status indication in free physical panel be free time shape
State.
Preferably, the first mapping relations, the second mapping relations and the 3rd mapping relations are stored in and reflect
In firing table.
Preferably, after the amount of physical memory abundance distributed for user, according to the first mapping relations
Respectively data to be write for user are mapped to limited from limited logical memory space with the 3rd mapping relations
Amount of physical memory and from extension map logical storage space to extension amount of physical memory.
Preferably, according to the first mapping relations and the 3rd mapping relations respectively by data to be read for user
It is mapped to limited logical memory space from limited amount of physical memory and reflects from extension amount of physical memory
It is mapped to extend logical memory space.
Preferably, limited logical memory space and extension logical memory space sum are less than or equal to first
Logical memory space.
Utilize the distribution method of the memory space of the present invention, by apllied for user memory space and reality
Distribution memory space separates so that system can use relatively small and that utilization rate is high storage empty
Between meet the user's pre-configured demand to massive store space.When the space that user uses increases,
System can dynamically increase the memory capacity distributing to user.Thus the utilization of memory space is greatly improved
Rate, decreases the demand to memory space, correspondingly reduces cost.
Other features and advantages of the present invention will illustrate in the following description, and, partly from
Description becomes apparent, or understands by implementing the present invention.The purpose of the present invention and its
His advantage can be by knot specifically noted in the description write, claims and accompanying drawing
Structure realizes and obtains.
Accompanying drawing explanation
Below in conjunction with accompanying drawing, the preferred embodiments of the present invention are illustrated, it will be appreciated that this place is retouched
The preferred embodiment stated is merely to illustrate and explains the present invention, is not intended to limit the present invention.At accompanying drawing
In:
Fig. 1 is the diagram of the memory space distributing to user according to embodiments of the invention;
Fig. 2 is the overall flow figure of the distribution method of the memory space according to embodiments of the invention;
Fig. 3 is that the application according to embodiments of the invention is shared amount of physical memory and writes the tool of data
Body flow chart;And
Fig. 4 is the distribution extension amount of physical memory according to embodiments of the invention and moves data into
Particular flow sheet.
Detailed description of the invention
Below in conjunction with accompanying drawing, the preferred embodiments of the present invention are illustrated, it will be appreciated that this place is retouched
The preferred embodiment stated is merely to illustrate and explains the present invention, is not intended to limit the present invention.
Fig. 1 is to distribute to depositing of user according to an embodiment of the invention according to embodiments of the invention
The diagram in storage space.With reference to Fig. 1, before user's write operation, distribute the first logic storage for user
The limited logical memory space 102 in the first logical memory space 100 is also set up with limited in space 100
First mapping relations of amount of physical memory 112.That sets up in the first logical memory space 100 is limited
Logical memory space 102 farther includes with the first mapping relations of limited amount of physical memory 112:
Set up multiple logical extent of limited logical memory space 102 and multiple things of limited amount of physical memory
Manage first mapping relations in panel and store.As it is shown in figure 1, limited amount of physical memory 112
Including multiple physical extent PE(Physical Extend), the first logical memory space 100 includes many
Individual logical extent LE(Logical Extend) and limited logical memory space 102 include multiple logic
Panel LE.With the physical extent PE in amount of physical memory and the logical extent in logical memory space
LE is the mapping relations that unit is set up between amount of physical memory and logical memory space.Specifically, logical
Cross manager LVM2(Linux Volume Manager2version) it is user when distributing memory space,
First sufficiently large logical memory space 100 is distributed for user, by the part in logical memory space
102 set up the first mapping relations with limited amount of physical memory 112, and by these the first mapping relations
Storage is in the mapping table.After setting up mapping relations, user can use limited amount of physical memory
112.It is to say, without setting up the mapping relations of logical memory space and amount of physical memory,
Then user cannot use amount of physical memory to be written and read operation.
Fig. 2 is the overall flow figure of the distribution method of the memory space according to embodiments of the invention.
The distribution method 200 of memory space comprises the following steps.In step 202., behaviour is write user
During work, when limited physics memory space inadequate, from shared amount of physical memory, search idle thing
Reason panel also writes data into free physical panel.Specifically, when manager for user distribute limited
When amount of physical memory 112 can not meet the read-write demand of user, at shared amount of physical memory 108
In find one or several free physical panel PE and data write found temporarily
Or in several free physical panel PE.
In step 204, distribute extension amount of physical memory for user, and data are transferred to extension
Amount of physical memory.Specifically, when limited amount of physical memory 112 is not enough, manager is by whole
A part in extension amount of physical memory 110 distributes to user as extension amount of physical memory, and
The data being temporarily written in the free physical panel PE found are transferred to extend amount of physical memory.
Utilize the distribution method of the memory space of the embodiment of the present invention, memory space can be applied for user
Time, distribute limited memory space for user, and user's need can not be met at limited memory space
When asking, manager again distribute memory space for user and do not interfere with the read-write operation of user.
Thus improve the utilization rate of memory space, decrease the demand to memory space, thus avoid
After distributing sufficiently large memory space for user, cause a large amount of memory space idle and unserviceable
Shortcoming, correspondingly reduces the use cost of user.
Hereinafter, the distribution method of memory space will be described in detail with reference to Fig. 3 and Fig. 4.Fig. 3 is root
Share amount of physical memory according to the application of embodiments of the invention and write the particular flow sheet of data, with
And Fig. 4 is the distribution extension amount of physical memory according to embodiments of the invention the tool moved data into
Body flow chart.
During user's write operation, when limited physics memory space inadequate, empty from shared physical store
Search free physical panel between and write data into the particular flow sheet 300 in free physical panel and include
Step in detail below.In step 302, application is shared amount of physical memory and searches free physical dish
District, specifically, the shared amount of physical memory 108 that can be used in conjunction with by multiple users of application and
In the space allocation table of shared amount of physical memory search free physical panel, say, that not by
The physical extent that any user uses.Multiple physics of amount of physical memory are shared in space allocation table storage
The use state in panel, i.e. idle condition or busy state.In one embodiment, Ke Yitong
Cross logic 1 and represent idle condition, and represent busy state by logical zero.Use when there being user
During this physical extent, it is 0 by the status indication of this physical extent in space allocation table, on the contrary, when
When not having user to use this physical extent, it is 1 by the status indication of this physical extent.Real at another
Execute in example, idle condition can be represented by logical zero, and represent busy state by logic 1.
When there being user to use this physical extent, in space allocation table by the status indication of this physical extent it is
1, on the contrary, when not having user to use this physical extent, it is 0 by the status indication of this physical extent.
In step 304, the free physical panel found and the second logical memory space 106 are set up
In the second mapping relations of logical extent and store.Specifically, as it is shown in figure 1, searching
To shared amount of physical memory 108 in free physical panel and the second logical memory space in patrol
Setting up the second mapping relations (as indicated by dotted lines in fig. 1) and this second mapped between volume panel
Relation stores in the mapping table.
Within step 306, write data in free physical panel according to the second mapping relations, wherein,
First logical memory space 100 includes the second logical memory space 106.Specifically, reflect according to second
Penetrate relation, data are temporarily stored in free physical panel and this free physical panel is labeled as
The loss of data that busy state is caused to this physical extent write data to avoid other users, from
Without affecting the read-write operation of user.
With reference to Fig. 4, distribute for user to extend amount of physical memory and data are transferred to extend physics and deposit
The flow chart 400 in storage space farther includes step in detail below.In step 402, divide for user
Join extension amount of physical memory, set up multiple logical extent and the extension physics of extension logical memory space
3rd mapping relations of multiple physical extent of memory space also store.Specifically, with reference to Fig. 1,
Using the part in whole extension logical memory space 104 as extension logical memory space, by whole
A part for extension amount of physical memory 110 is as extension amount of physical memory, and is extending logic
The 3rd mapping relations are set up, i.e. set up extension logic between memory space and extension amount of physical memory
Multiple logical extent of memory space map with the 3rd of the multiple physical extent extending amount of physical memory
3rd mapping relations are also stored in the mapping table by relation.First logical memory space 100 includes expanding
Exhibition logical memory space a, i.e. part for whole extension logical memory space 104.
In step 404, according to the second mapping relations and the 3rd mapping relations by data from free physical
Panel is transferred to extend amount of physical memory.Specifically, according to the second mapping relations, it is temporarily written into
Data in shared amount of physical memory are transferred to extend amount of physical memory and in space allocation table
Middle idle condition that the physical extent being labeled as busy state before is again marked as, thus release is altogether
Enjoy amount of physical memory and be easy to other users use.This improves the profit of shared amount of physical memory
By rate.Such as, in one embodiment, the utilization rate of memory space improves about 60% to 80%,
Reduce the waste of the memory space of 20%.
This distribution for user extends the step execution of amount of physical memory repeatedly, but distributes for user
Extension amount of physical memory less than extension logical memory space.Additionally, limited logical memory space with
And extension logical memory space sum is less than or equal to the first logical memory space.Specifically, for user
Extension storage space has size and limits, i.e. owing to the amount of physical memory of user is not enough, be repeatedly
In the case of user distributes extension amount of physical memory, the limited amount of physical memory of initial allocation and expansion
The amount of physical memory sum of exhibition should be less than the first logical memory space of initial allocation.
Additionally, after the amount of physical memory abundance distributed for user, according to the first mapping relations and
Data to be write for user are mapped to finite from limited logical memory space by the 3rd mapping relations respectively
Manage memory space and from extension map logical storage space to extension amount of physical memory.Specifically,
When the limited amount of physical memory abundance distributed for user, normal write operation can be carried out, i.e.
According to the first mapping relations, data to be write for user are mapped to finite from limited logical memory space
Reason memory space.When the limited physics memory space inadequate distributed for user, it is assigned with expansion for user
After exhibition amount of physical memory, when user can be written and read the amount of physical memory abundance of operation, root
According to the 3rd mapping relations by data to be write for user from extending map logical storage space to extension physics
Memory space.
User, during read operation, is not related to the problem that memory space is the most sufficient, can directly enter
Row read operation.Specifically, respectively user to be read according to the first mapping relations and the 3rd mapping relations
The data taken are mapped to limited logical memory space from limited amount of physical memory and deposit from extension physics
Storage space is mapped to extension logical memory space.
Utilize the distribution method of the memory space of embodiments of the invention, by being initially user's distribution
It is assigned limit memory space during memory space, when user storage space deficiency, data is stored temporarily
In shared memory space, and after again distributing extension storage space for user, will store temporarily
Data at shared memory space are transferred to extension storage space, thus avoid the memory space of user
Too big, and the waste of the memory space that causes leaving unused in a large number.Therefore the utilization of memory space is greatly improved
Rate, reduces the cost of the storage device of system.Additionally, releasing user stores data in time temporarily
Share memory space, correspondingly improve the utilization rate of shared memory space.
These are only the preferred embodiments of the present invention, be not limited to the present invention, for ability
For the technical staff in territory, the present invention can have various modifications and variations.All spirit in the present invention and
Within principle, any modification, equivalent substitution and improvement etc. made, should be included in the guarantor of the present invention
Within the scope of protecting.
Claims (7)
1. the distribution method of a memory space, it is characterised in that including:
During user's write operation, when limited physics memory space inadequate, empty from shared physical store
Search free physical panel between and write data into described free physical panel;And
Distribute extension amount of physical memory for described user, and described data are transferred to described extension thing
Reason memory space;
Wherein, before described user's write operation, the first logical memory space is distributed also for described user
Set up the limited logical memory space in described first logical memory space empty with described limited physical store
Between the first mapping relations;
From described shared amount of physical memory, search described free physical panel and described data are write
Described free physical panel, farther includes:
Apply for described shared amount of physical memory and search described free physical panel;
Set up the free physical panel and second of the logical extent in the second logical memory space found
Mapping relations also store;And
According to described second mapping relations, described data are write in described free physical panel, wherein,
Described first logical memory space includes described second logical memory space;
Distribute described extension amount of physical memory for described user and described data are transferred to described extension
Amount of physical memory, farther includes:
Distribute described extension amount of physical memory for described user, set up extension logical memory space many
3rd mapping relations of individual logical extent and multiple physical extent of described extension amount of physical memory are gone forward side by side
Row storage;And
According to described second mapping relations and described 3rd mapping relations by described data from described idle thing
Reason panel is transferred to described extension amount of physical memory, and wherein, described first logical memory space includes
Described extension logical memory space.
Distribution method the most according to claim 1, it is characterised in that set up described first logic
Described limited logical memory space in memory space closes with the first mapping of limited amount of physical memory
System, farther includes:
Set up multiple logical extent of described limited logical memory space and described limited amount of physical memory
Described first mapping relations of multiple physical extent and store.
Distribution method the most according to claim 1, it is characterised in that when described data are write
Time in described free physical panel, by the status indication in described free physical panel in space allocation table
For busy state;Or
When described data are transferred to described extension amount of physical memory from described free physical panel,
The status indication in described free physical panel is idle condition by space allocation table.
Distribution method the most according to claim 1, it is characterised in that map described first and close
System, described second mapping relations and described 3rd mapping relations store in the mapping table.
Distribution method the most according to claim 4, it is characterised in that distributing for described user
Amount of physical memory abundance after,
According to described first mapping relations and described 3rd mapping relations respectively by be write for described user
Data are mapped to described limited amount of physical memory and from described expansion from described limited logical memory space
Exhibition map logical storage space is to described extension amount of physical memory.
Distribution method the most according to claim 4, it is characterised in that map according to described first
Data to be read for described user are deposited by relation and described 3rd mapping relations respectively from described limited physics
Storage space is mapped to described limited logical memory space and is mapped to from described extension amount of physical memory
Described extension logical memory space.
Distribution method the most according to claim 1, it is characterised in that described limited logical stores
Space and described extension logical memory space sum are less than or equal to described first logical memory space.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310173741.5A CN103218305B (en) | 2013-05-10 | 2013-05-10 | The distribution method of memory space |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310173741.5A CN103218305B (en) | 2013-05-10 | 2013-05-10 | The distribution method of memory space |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103218305A CN103218305A (en) | 2013-07-24 |
CN103218305B true CN103218305B (en) | 2016-08-17 |
Family
ID=48816121
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310173741.5A Active CN103218305B (en) | 2013-05-10 | 2013-05-10 | The distribution method of memory space |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103218305B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103488584B (en) * | 2013-09-26 | 2018-01-19 | 华为技术有限公司 | A kind of data processing method and device |
CN105653529B (en) * | 2014-11-12 | 2020-08-04 | 富泰华工业(深圳)有限公司 | Storage management system, management device and method |
CN105653467A (en) * | 2015-05-21 | 2016-06-08 | 宇龙计算机通信科技(深圳)有限公司 | Storage space distribution method and apparatus |
CN105681714A (en) * | 2016-02-26 | 2016-06-15 | 北京金山安全软件有限公司 | Video shooting method and device and electronic equipment |
CN105791423B (en) * | 2016-04-21 | 2019-04-05 | 上海新储集成电路有限公司 | Storage system and method based on internet of things structure |
CN107480071B (en) * | 2017-08-25 | 2020-11-03 | 深圳大学 | Cache data migration method and device |
CN111240576A (en) * | 2018-11-28 | 2020-06-05 | 瑞昱半导体股份有限公司 | Computer system, memory management method, and non-transitory computer readable medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102123176A (en) * | 2011-03-17 | 2011-07-13 | 杭州宏杉科技有限公司 | Space distribution and management method and device for network storage system |
CN102395958A (en) * | 2011-08-26 | 2012-03-28 | 华为技术有限公司 | Concurrent processing method and device for data packet |
CN102981782A (en) * | 2012-11-28 | 2013-03-20 | 华为技术有限公司 | Data processing method and device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6636950B1 (en) * | 1998-12-17 | 2003-10-21 | Massachusetts Institute Of Technology | Computer architecture for shared memory access |
US7231638B2 (en) * | 2002-12-03 | 2007-06-12 | International Business Machines Corporation | Memory sharing in a distributed data processing system using modified address space to create extended address space for copying data |
-
2013
- 2013-05-10 CN CN201310173741.5A patent/CN103218305B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102123176A (en) * | 2011-03-17 | 2011-07-13 | 杭州宏杉科技有限公司 | Space distribution and management method and device for network storage system |
CN102395958A (en) * | 2011-08-26 | 2012-03-28 | 华为技术有限公司 | Concurrent processing method and device for data packet |
CN102981782A (en) * | 2012-11-28 | 2013-03-20 | 华为技术有限公司 | Data processing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN103218305A (en) | 2013-07-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103218305B (en) | The distribution method of memory space | |
CN105593828B (en) | Manage method, distributed memory system and the management node of file | |
CN101997918B (en) | Method for allocating mass storage resources according to needs in heterogeneous SAN (Storage Area Network) environment | |
CN102255962B (en) | Distributive storage method, device and system | |
CN103797770B (en) | A kind of method and system of shared storage resources | |
CN102651009B (en) | Method and equipment for retrieving data in storage system | |
CN103430159B (en) | Dynamic memory management in virtualized computing environment | |
CN104461958B (en) | Support storage resource access method, storage control and the storage device of SR-IOV | |
CN109799951A (en) | It is supplied using the on-demand storage of distributed and virtual NameSpace management | |
CN103514249B (en) | A kind of automatic data reduction and system and storage device | |
CN106681842A (en) | Management method and device for sharing memory in multi-process system | |
CN102123176B (en) | Space distribution and management method and device for network storage system | |
CN106547612A (en) | A kind of multi-task processing method and device | |
CN103106150B (en) | A kind of storage system that realizes simplifies configuration and the method simplifying distribution automatically | |
CN104850358A (en) | Magnetic-optical-electric hybrid storage system and data acquisition and storage method thereof | |
US20140181042A1 (en) | Information processor, distributed database system, and backup method | |
CN104270412A (en) | Three-level caching method based on Hadoop distributed file system | |
CN103942011A (en) | Differential snapshot system and use method thereof | |
CN103412822A (en) | Operation method of non-volatile RAM, data operation method and relevant device | |
CN105357042A (en) | High-availability cluster system, master node and slave node | |
CN104317734A (en) | Memory allocation method and device applicable to SLAB | |
CN104410666A (en) | Method and system for implementing heterogeneous storage resource management under cloud computing | |
WO2015124117A1 (en) | System and method for an efficient database storage model based on sparse files | |
CN106354890A (en) | Implementation method of random access file system based on N-ary tree structure | |
CN103020201B (en) | A kind of system that stores simplifies configuration storage pool and the method for organization and administration automatically |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220126 Address after: 300450 3 / F, No. 15, Haitai Huake street, Huayuan Industrial Zone (outer ring), Tianjin Binhai New Area, Tianjin Patentee after: Tianjin Zhongke Shuguang Storage Technology Co.,Ltd. Address before: 100193 No. 36 Building, No. 8 Hospital, Wangxi Road, Haidian District, Beijing Patentee before: Dawning Information Industry (Beijing) Co.,Ltd. |
|
TR01 | Transfer of patent right |