CN103106255A - Virtualized memory and mapping method and mapping device of storage based on hash table organization - Google Patents

Virtualized memory and mapping method and mapping device of storage based on hash table organization Download PDF

Info

Publication number
CN103106255A
CN103106255A CN2013100249607A CN201310024960A CN103106255A CN 103106255 A CN103106255 A CN 103106255A CN 2013100249607 A CN2013100249607 A CN 2013100249607A CN 201310024960 A CN201310024960 A CN 201310024960A CN 103106255 A CN103106255 A CN 103106255A
Authority
CN
China
Prior art keywords
hash table
mapping
lun
data
threshold value
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
CN2013100249607A
Other languages
Chinese (zh)
Other versions
CN103106255B (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.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry Co Ltd
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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201310024960.7A priority Critical patent/CN103106255B/en
Publication of CN103106255A publication Critical patent/CN103106255A/en
Application granted granted Critical
Publication of CN103106255B publication Critical patent/CN103106255B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a virtualized memory and a mapping method and a mapping device of storage based on a hash table organization, and relates to the mapping technology of a memory and memory organizations of a computer and the mapping technology of storage. The mapping method comprises steps as below: initializing number threshold value of the hash table; when adding a logic unit number (LUN), judging whether the number of hash tables currently created by the system is smaller than the number of the number threshold value, if the answer is yes, creating a new hash table, and mapping the added LUN data to the new hash table, if the answer is no, mapping the added LUN data to a created hash table which has the smallest number of the LUN amount. The invention further discloses a virtualized memory and a mapping device of storage based on the hash tables. The virtualized memory and the mapping method and the mapping device of storage based on the hash table organization provide an optimized scheme between searching efficiency and occupied area of a memory, are beneficial for performance optimization during a reality test, and improve utilization rate of system resources.

Description

A kind of mapping method and device of organizing virtual memory and storage based on Hash table
Technical field
The present invention relates to the mapping relations of calculator memory tissue and internal memory and storage, particularly a kind of mapping method and device of organizing virtual memory and storage based on Hash table.
Background technology
Along with the widespread use of storage, the user is more and more higher to the security requirement of data when transmitting and store, and has promoted the development of the high availability at all levels of storage.As available in the cluster height, cluster is high can guarantee that a node is delayed machine the time, and other node is taken over the work of the machine node of delaying.But a plurality of nodes provide when service will guarantee consistance to magnetic disc data accessing simultaneously, and present implementation method is to have to control a node visit data in magnetic disk, the disk read-write request of all the other nodes all is transmitted to controls node and process.
But the read-write requests of reading node sends to the speed that the distant-end node processing can reduce reading and writing data.In order to improve reading and writing data speed, come data cached with internal memory as buffer memory in node.When writing data, write request is returned after data are write buffer memory immediately, does not need to wait pending data to write disk.During read data, whether read request can be sought active data in buffer memory, if be cached with valid data directly from the buffer memory reading out data, do not need to read from disk.The application of cache module can effectively improve the read-write speed of data.
When using the buffer memory temporal data, the machine if one of them node is delayed, data do not have can be in time complete the disk that writes, can cause like this loss of data.So need to be between node Backup Data, when the node machine of delaying, the data of all the other node standbies can guarantee the correct disk that writes, and guarantee to write the integrality of data in magnetic disk.
No matter the important work of cache module is the size of LUN (Logical Unit Number, logical unit number), and all positions that guarantee all LUN can be mapped in page in cache module.Wherein a kind of mode is all to be mapped in a Hash table according to the data of hash algorithm with all LUN, distinguishes Different L UN in the territory by corresponding LUN in the page structure body.Mutual exclusion lock need to be first obtained in access to page in Hash table.When a plurality of LUN were read and write, concurrency conflict will increase, and affects efficient.Another kind of mode is that each LUN is mapped to a Hash table, and the Concurrency Access conflict can reduce like this, but the EMS memory occupation of hash table can sharply increase.
Summary of the invention
Technical matters to be solved by this invention is to provide a kind of mapping method and device of organizing virtual memory and storage based on Hash table, so that a kind of prioritization scheme to be provided between search efficiency and EMS memory occupation.
In order to solve the problems of the technologies described above, the invention discloses a kind of mapping method of organizing virtual memory and storage based on Hash table, comprising:
The number threshold value of initialization Hash table;
When adding logical unit number (LUN), if the number of the current Hash table that creates of judgement system is less than described number threshold value, create new Hash table, and with the data-mapping of the LUN that adds in new Hash table, if the number of the current Hash table that creates of judgement system equals described number threshold value, in the Hash table with the data-mapping of the LUN that adds mapping LUN minimum number in the Hash table that has created.
Preferably, said method also comprises:
In deletion LUN process, the Hash table of judgement and the data-mapping of the LUN that will delete whether with the data-mapping of other LUN, if not, will delete with the Hash table of the data-mapping of the LUN that will delete.
Preferably, said method also comprises: the initialization Hash table is long.
Preferably, in said method, the process of initialization Hash table length is as follows:
Computing system free memory page calculates Hash table according to the average length of the free memory page sum that calculates and hash table single linked list long.
The invention also discloses a kind of mapping device of organizing virtual memory and storage based on Hash table, comprising:
The first module, the number threshold value of initialization Hash table;
The second module when adding logical unit number (LUN), judges that whether the number of the current Hash table that creates of system is less than described number threshold value;
The 3rd module, the number of the Hash table that creates when system is current is during less than described number threshold value, create new Hash table, and with the data-mapping of the LUN that adds in new Hash table, the number of the Hash table that creates when system is current equals described number threshold value, in the Hash table with the data-mapping of the LUN that adds mapping LUN minimum number in the Hash table that has created.
Preferably, said apparatus also comprises:
Four module, in deletion LUN process, the Hash table of judgement and the data-mapping of the LUN that will delete whether with the data-mapping of other LUN, if not, will delete with the Hash table of the data-mapping of the LUN that will delete.
Preferably, said apparatus also comprises:
The 5th module, the initialization Hash table is long.
Preferably, in said apparatus, described the 5th module, computing system free memory page calculates Hash table according to the average length of the free memory page sum that calculates and hash table single linked list long.
The present techniques scheme provides a kind of prioritization scheme between search efficiency and EMS memory occupation, be beneficial to Performance tuning in the reality test, and improved resource utilization ratio.
Description of drawings
Fig. 1 is the virtual memory that provides of the present embodiment and the mapping method process flow diagram of storage;
Fig. 2 (a) is that the LUN number is 2, and the number threshold value of Hash table is the mapping relations schematic diagram of 4 o'clock;
Fig. 2 (b) is that the LUN number is 6, and the number threshold value of Hash table is the mapping relations schematic diagram of 4 o'clock.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, hereinafter in connection with accompanying drawing, technical solution of the present invention is described in further detail.Need to prove, in the situation that do not conflict, the application's embodiment and the feature in embodiment can make up arbitrarily mutually.
Embodiment 1
The present application people proposes to create a plurality of Hash tables, thereby each LUN is shone upon respectively from different Hash table, to improve resource utilization ratio.
Based on above-mentioned thought, the present embodiment provides a kind of mapping method of organizing virtual memory and storage based on Hash table, comprise the steps, as shown in Figure 1:
Step 100, the number threshold value of initialization Hash table;
Whether step 200 when adding logical unit number (LUN), judges the number of the current Hash table that creates of system less than initialized number threshold value, if so, and execution in step 300, otherwise execution in step 400;
Step 300 creates new Hash table, and with the data-mapping of the LUN that adds in new Hash table;
Step 400 is in the Hash table with the data-mapping of the LUN that adds mapping LUN minimum number in the Hash table that has created.
Wherein, during the number threshold value of initialization Hash table, can first arrange arbitrarily and count one by one threshold value, then align this number threshold value by test.Concrete, can according to access efficiency, align this number threshold value.Namely select the number threshold value of a suitable Hash table with the optimization of guaranteed efficiency and EMS memory occupation in the actual efficiency test.
And newly add in the process of LUN, can judge according to the count value of current Hash table specifically whether the number of current Hash table reaches the number threshold value, if not, create a new Hash table, and the counting that increases Hash table judges whether the number of current Hash table reaches the number threshold value to record the Hash table number that has created in current system when being convenient to follow-up interpolation LUN.Same, when the number of current Hash table has reached threshold value, travel through all Hash tables, search the Hash table of the LUN number minimum of binding mapping relation, with the LUN binding mapping relation of new interpolation, and increase Hash table and LUN binding counting.
Also be noted that, except adding LUN, also may store the operation of deletion LUN in practical application, the Hash table of judgement this moment and the data-mapping of the LUN that will delete whether with the data-mapping of other LUN, if not, will with the Hash table deletion of the data-mapping of the LUN that will delete.In the time of namely some LUN will being deleted, if the Hash table of this LUN correspondence mappings and lun binding are counted as 0, delete this Hash table.And, only delete this LUN and get final product during also with the data-mapping of other LUN when the Hash table of the data-mapping of the LUN that will delete.
In addition, in initialization procedure, except the number threshold value of initialization Hash table, also can the initialization Hash table long.Usually can first computing system free memory page, longer according to the average length calculating Hash table of free memory page sum and hash table single linked list.
Below in conjunction with the concrete implementation procedure that above-mentioned the method is described of using.Due to Hash table be single linked list, so the node average length of chained list can not be long, supposing to arrange node ' s length is 4.Hash table length can be calculated by the average length of free memory page and hash table single linked list, and specific formula for calculation is as follows:
hash_len=page_usage/4。
Be that Hash table length is that available page sum is divided by the average length of hash table single linked list.
The number threshold value that initialization subsequently arranges Hash table is 4.
When LUN adds 2 to, can create 2 Hash tables and come to bind respectively with these 2 LUN, the Hash table that create this moment and the mapping relations of LUN are as shown in Fig. 2 (a).
When lun add to surpass 4, the new LUN that adds can search the Hash table of the minimum lun of mapping, and with this Hash table binding mapping relation, the Hash table that create this moment and the mapping relations of LUN are as shown in Fig. 2 (b).
Embodiment 2
The present embodiment is introduced a kind of mapping device of organizing virtual memory and storage based on Hash table, and this device can be realized the method for above-described embodiment 1.Particularly, this device comprises the first module, the second module and the 3rd module at least.
The first module, the number threshold value of initialization Hash table;
The second module when adding LUN, judges that whether the number of the current Hash table that creates of system is less than described number threshold value;
The 3rd module, the number of the Hash table that creates when system is current is during less than described number threshold value, create new Hash table, and with the data-mapping of the LUN that adds in new Hash table, the number of the Hash table that creates when system is current equals described number threshold value, in the Hash table with the data-mapping of the LUN that adds mapping LUN minimum number in the Hash table that has created.
In addition, said apparatus can also comprise four module, this four module, in deletion LUN process, the Hash table of judgement and the data-mapping of the LUN that will delete whether with the data-mapping of other LUN, if not, will delete with the Hash table of the data-mapping of the LUN that will delete.
Also be noted that said apparatus except realizing above-mentioned each function, also come the initialization Hash table long by the 5th module.Particularly, the 5th module, computing system free memory page calculates Hash table according to the average length of the free memory page sum that calculates and hash table single linked list long.
One of ordinary skill in the art will appreciate that all or part of step in said method can come the instruction related hardware to complete by program, described program can be stored in computer-readable recording medium, as ROM (read-only memory), disk or CD etc.Alternatively, all or part of step of above-described embodiment also can realize with one or more integrated circuit.Correspondingly, each the module/unit in above-described embodiment can adopt the form of hardware to realize, also can adopt the form of software function module to realize.The application is not restricted to the combination of the hardware and software of any particular form.
The above is only preferred embodiments of the present invention, is not for limiting protection scope of the present invention.Within the spirit and principles in the present invention all, any modification of making, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (8)

1. a mapping method of organizing virtual memory and storage based on Hash table, is characterized in that, the method comprises:
The number threshold value of initialization Hash table;
When adding logical unit number (LUN), if the number of the current Hash table that creates of judgement system is less than described number threshold value, create new Hash table, and with the data-mapping of the LUN that adds in new Hash table, if the number of the current Hash table that creates of judgement system equals described number threshold value, in the Hash table with the data-mapping of the LUN that adds mapping LUN minimum number in the Hash table that has created.
2. the method for claim 1, is characterized in that, the method also comprises:
In deletion LUN process, the Hash table of judgement and the data-mapping of the LUN that will delete whether with the data-mapping of other LUN, if not, will delete with the Hash table of the data-mapping of the LUN that will delete.
3. method as claimed in claim 1 or 2, is characterized in that, the method also comprises:
The initialization Hash table is long.
4. method as claimed in claim 3, is characterized in that, the process of initialization Hash table length is as follows:
Computing system free memory page calculates Hash table according to the average length of the free memory page sum that calculates and hash table single linked list long.
5. a mapping device of organizing virtual memory and storage based on Hash table, is characterized in that, this device comprises:
The first module, the number threshold value of initialization Hash table;
The second module when adding logical unit number (LUN), judges that whether the number of the current Hash table that creates of system is less than described number threshold value;
The 3rd module, the number of the Hash table that creates when system is current is during less than described number threshold value, create new Hash table, and with the data-mapping of the LUN that adds in new Hash table, the number of the Hash table that creates when system is current equals described number threshold value, in the Hash table with the data-mapping of the LUN that adds mapping LUN minimum number in the Hash table that has created.
6. device as claimed in claim 5, is characterized in that, this device also comprises:
Four module, in deletion LUN process, the Hash table of judgement and the data-mapping of the LUN that will delete whether with the data-mapping of other LUN, if not, will delete with the Hash table of the data-mapping of the LUN that will delete.
7. device as described in claim 5 or 6, is characterized in that, this device also comprises:
The 5th module, the initialization Hash table is long.
8. device as claimed in claim 7, is characterized in that,
Described the 5th module, computing system free memory page calculates Hash table according to the average length of the free memory page sum that calculates and hash table single linked list long.
CN201310024960.7A 2013-01-23 2013-01-23 A kind of mapping method and device organizing virtual memory and storage based on Hash table Active CN103106255B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310024960.7A CN103106255B (en) 2013-01-23 2013-01-23 A kind of mapping method and device organizing virtual memory and storage based on Hash table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310024960.7A CN103106255B (en) 2013-01-23 2013-01-23 A kind of mapping method and device organizing virtual memory and storage based on Hash table

Publications (2)

Publication Number Publication Date
CN103106255A true CN103106255A (en) 2013-05-15
CN103106255B CN103106255B (en) 2016-03-02

Family

ID=48314110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310024960.7A Active CN103106255B (en) 2013-01-23 2013-01-23 A kind of mapping method and device organizing virtual memory and storage based on Hash table

Country Status (1)

Country Link
CN (1) CN103106255B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023809A (en) * 2009-09-21 2011-04-20 成都市华为赛门铁克科技有限公司 Storage system, method for reading data from storage system and method for writing data to storage system
US20120072670A1 (en) * 2010-09-21 2012-03-22 Lsi Corporation Method for coupling sub-lun load measuring metadata size to storage tier utilization in dynamic storage tiering

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023809A (en) * 2009-09-21 2011-04-20 成都市华为赛门铁克科技有限公司 Storage system, method for reading data from storage system and method for writing data to storage system
US20120072670A1 (en) * 2010-09-21 2012-03-22 Lsi Corporation Method for coupling sub-lun load measuring metadata size to storage tier utilization in dynamic storage tiering

Also Published As

Publication number Publication date
CN103106255B (en) 2016-03-02

Similar Documents

Publication Publication Date Title
US9298384B2 (en) Method and device for storing data in a flash memory using address mapping for supporting various block sizes
US9798472B1 (en) Extent level cache destaging
US11243706B2 (en) Fragment management method and fragment management apparatus
CN102467408B (en) Method and device for accessing data of virtual machine
US9152325B2 (en) Logical and physical block addressing for efficiently storing data
CN103399823B (en) The storage means of business datum, equipment and system
KR20110110720A (en) Method and system for wear leveling in a solid state drive
CN109445685B (en) User mode file system processing method
CN102521330A (en) Mirror distributed storage method under desktop virtual environment
JP2015512098A (en) Data migration for composite non-volatile storage
CN103942011A (en) Differential snapshot system and use method thereof
CN109766312A (en) A kind of block chain storage method, system, device and computer readable storage medium
US11093410B2 (en) Cache management method, storage system and computer program product
CN108089825B (en) Storage system based on distributed cluster
CN105446665A (en) Computer storage acceleration system and optimization method thereof
CN110187832B (en) Data operation method, device and system
US20240086332A1 (en) Data processing method and system, device, and medium
WO2023035646A1 (en) Method and apparatus for expanding memory, and related device
CN110109845A (en) Data cached management method, device, computer equipment and storage medium
CN104102460A (en) Cloud computing-based memory management method and device
CN113835616A (en) Data management method and system of application and computer equipment
CN105393228A (en) Method, device and user equipment for reading/writing data in nand flash
CN109375868B (en) Data storage method, scheduling device, system, equipment and storage medium
US10585592B2 (en) Disk area isolation method and device
CN115934002B (en) Solid state disk access method, solid state disk, storage system and cloud server

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