CN116126743A - Wear perception space allocation method based on persistent memory file system - Google Patents

Wear perception space allocation method based on persistent memory file system Download PDF

Info

Publication number
CN116126743A
CN116126743A CN202310132505.2A CN202310132505A CN116126743A CN 116126743 A CN116126743 A CN 116126743A CN 202310132505 A CN202310132505 A CN 202310132505A CN 116126743 A CN116126743 A CN 116126743A
Authority
CN
China
Prior art keywords
write
block
linked list
blocks
wear
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.)
Pending
Application number
CN202310132505.2A
Other languages
Chinese (zh)
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.)
Guizhou University
Original Assignee
Guizhou University
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 Guizhou University filed Critical Guizhou University
Priority to CN202310132505.2A priority Critical patent/CN116126743A/en
Publication of CN116126743A publication Critical patent/CN116126743A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention belongs to the technical field of computers, and particularly relates to a wear-sensing space allocation method based on a persistent memory file system, which comprises the following steps: dividing PM space into blocks formed by a plurality of continuous physical pages, and dividing all the blocks into G groups according to the size of the blocks; all blocks in the same group are organized into single-chain tables, and head nodes of G single-chain tables are stored as an array; setting a write counter for each page to record the write condition of the page, and storing all the write counters on an array; when an I/O request arrives, a multi-level allocation mechanism is adopted to directly allocate candidate blocks from corresponding packets according to the size of the I/O request, and a wear-aware reclamation mechanism is adopted to reclaim idle blocks. According to the invention, the candidate blocks are directly distributed from the corresponding groups by adopting a multi-stage distribution mechanism, and the idle blocks are recovered by adopting a wear-aware recovery mechanism, so that low-overhead high-precision wear balance is realized, and the system performance is greatly improved.

Description

Wear perception space allocation method based on persistent memory file system
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a wear-aware persistent memory file system space allocation method.
Background
In recent years, there have been many new types of persistent memories (Persistent Memory, abbreviated as PM) such as phase change memories (Phase Change Memory, abbreviated as PCM), resistive RAM (ReRAM), 3D-Xpoint, etc. that have advantages of low latency, non-volatility, byte addressing, low power consumption, high storage density, etc. These persistent memories may be directly connected to the memory bus through DIMM slots, providing byte-addressed high-speed data access, while also being able to store data permanently like a disk. In addition, the CPU may also directly access the persistent memory through load/store instructions. The continuous development of the high-capacity persistent memory technology promotes the development of the field of software optimization research of the storage system. In recent years, there have been many persistent memory file systems (Persistent Memory File System) such as BPFS, SCMFS, PMFS, SIMFS, NOVA and HiNFS, etc. that use persistent memory as a storage device. The file system fully exploits the advanced characteristics of the novel persistent memory in the aspect of software design thought, and greatly improves the performance of the file system by optimizing the organization mode and the data consistency mechanism of file data, so that the throughput rate of file access reaches the GB/s level.
However, read-write asymmetry is common in large capacity persistent memories, i.e. write latency/power consumption is higher than read latency/power consumption. At the same time, it is common to have defects with low write endurance (PCM write endurance of about 10) 8 ) For example, when the number of writing of the memory cell of the PCM reaches 10 8 When left and right, the storage unit is worn out, so that the data of the whole file system becomes unreliable, and the service life of the persistent memory is seriously shortened. Therefore, it is necessary to disperse a large number of write operations to a small number of memory cells to other memory spaces so that the wear level of each memory cell is relatively even, thereby increasing the lifetime of the persistent memory.
The existing persistent memory allocator considering writing wear generally realizes a certain wear leveling by adopting a strategy of preferentially allocating low wear pages, but still cannot effectively solve the trade-off problem of performance and wear precision in the persistent memory wear leveling. The following description will take DWARM and WMAlloc as examples.
The DWARM divides all free pages of the PM into groups according to the write counter of the page, as shown in fig. 1 (a), all free pages belonging to the same group are linked by a single chain table. The DWARM then always allocates PM pages from the least worn packet or reclaims the free pages to the corresponding packet according to the write counter. To mitigate the overhead of locating the corresponding packets, DWARM constructs a linked list in DRAM to manage all packets. Furthermore, DWARM proposes an adaptive wear range determination algorithm to dynamically adjust the wear range of all packets.
However, DWARM achieves a certain wear leveling effect by selecting a low wear page for each allocation request, but still suffers from two problems: firstly, wear leveling and performance cost are closely related to the set grouping, namely, the fewer the grouping is, the unbalanced the wear of PM is, the more the grouping is, and the greater the metadata management cost of the wear leveling is; secondly, DWARM is a single granularity allocator, which can only allocate one 4KB page at a time, and multiple allocation operations are required to complete for multi-granularity allocation requests, resulting in serious degradation of DWARM performance.
As shown in fig. 1 (b), in order to provide multi-granularity distribution while achieving wear leveling, WMAlloc constructs 11 minimum heap trees (numbered from 0 to 10) to manage free blocks and sorts the blocks according to wear level of the blocks. For the ith minimum heap tree, if i is less than 10, then the block nodes in the heap represent one of the groups consisting of 2 i A block of consecutive pages; if i is equal to 10, the minimum heap tree managed block size exceeds 512 consecutive pages. Thus, each minimum heap tree represents an allocation granularity, except for the 10 th minimum heap tree. When the required block size is less than or equal to 512 pages, WMAlloc only needs to allocate the required block from the corresponding minimum heap tree once. In order to solve the problem of uneven wear among the heap, WMAlloc proposes a wear-leveling node migration mechanism, which exchanges the nodes in the heap tree with the least wear with the nodes in the heap tree with the greatest wear. Furthermore, the WMAlloc wear-aware reclamation forest mechanism temporarily divides the freed blocks into multiple mangrove groups according to the page write counter to speed up the block merge operation. When migrating, WMAlloc always migrates the blocks in the least worn red-black tree into the smallest heap tree.
WMAlloc is a multi-granularity distributor, but the following four problems still remain. First, WMAlloc has a large overhead to maintain the order of block nodes in the minimum heap tree. Secondly, for idle block merging, the time complexity of WMAlloc to locate adjacent blocks is high, being O (N) complexity, N representing the height of the red black tree. In addition, like DWRAM, the wear accuracy of WMAlloc is also closely related to the wear range set by its red-black tree. Finally, when the number of idle blocks in the minimum heap tree is smaller than the set threshold, the larger idle blocks in other minimum heap trees or red black trees are split into a plurality of sub-blocks, and then the sub-blocks are migrated into the minimum heap tree, and the abrasion degree of each sub-block needs to be recalculated during splitting, so that huge performance cost is brought. For example, assuming that a block in the red-black tree containing 15 consecutive pages will migrate to the 3 rd minimum heap tree, the block will be divided into four sub-blocks containing 8, 4, 2 and 1 consecutive pages, respectively, and inserted into the 3 rd, 2 nd, 1 st and 0 th minimum heap trees, respectively.
In summary, the prior art problems are: the existing persistent memory distributor can generate huge performance overhead in the process of realizing wear balance.
Disclosure of Invention
In order to solve the technical problems, the invention provides a wear-sensing space allocation method based on a persistent memory file system, which comprises the following steps:
s1: dividing PM space into blocks consisting of a plurality of continuous physical pages, dividing the blocks with the block sizes within a set range into a group according to the block sizes, dividing all the blocks into G groups, and numbering from 0 to G-1;
s2: all blocks in the same group are organized into single-chain tables, and head nodes of G single-chain tables are stored as an array;
s3: setting a write counter for each page to record the write condition of the page, storing all the write counters on an array, and storing the write counters in a continuous space of PM;
s4: when the I/O request comes, the candidate block is directly distributed from the corresponding group to be written into the I/O request by adopting a multi-level distribution mechanism according to the size of the I/O request, meanwhile, the value of a write counter of a write page of the candidate block is increased by 1, and the idle block is recovered by adopting a wear-aware recovery mechanism according to the page write condition recorded by the write counter.
Preferably, the grouping of the blocks having the block sizes within the set range includes:
for the ith group, when i is less than G-1, each block of the group contains pagesThe number of the surfaces is [2 ] i ,2 i+1 -1]Within the range; if i is equal to G-1, the set of blocks contains at least 2 G-1 Successive pages.
Preferably, the single-stranded list comprises:
in a non-head node of the single-chain table, recording the minimum abrasion degree min_write and the maximum abrasion degree max_write of pages, the first page number low_page_no of a block, the page number page_count and the next information of a subsequent pointer; the head node record of the single linked list comprises four metadata information including sum_write of abrasion degree of all nodes of the single linked list, node number_count, pointer head pointing to the first node of the linked list and pointer tail pointing to the last node of the linked list.
Preferably, the allocation of the candidate blocks using a multi-level allocation mechanism includes:
when a block containing N pages is allocated, a linked list with granularity being just larger than or equal to N is quickly positioned by constructing an auxiliary array LA, and a first block in the linked list is selected as a candidate block of the allocation request;
if the first block in the linked list just contains N pages, the first block is taken out from the linked list and the allocation is completed; if the first block contains more than N pages, splitting the block into two sub-blocks, wherein one sub-block contains N pages for distribution, and reinserting the rest sub-blocks into a single linked list corresponding to the size after modifying metadata information based on a linked list wear mean value dynamic adjustment insertion point method; if the linked list has no allocable nodes, continuing to explore the subsequent linked list by a bitmap-based positioning method to find allocable candidate blocks.
Further, the method for dynamically adjusting the insertion point based on the wear mean value of the linked list is adopted to reinsert the remaining sub-blocks into the single linked list corresponding to the size according to the size of the modified metadata information, and the method comprises the following steps:
first access LA [ N ]]To position the linked list to be inserted, respectively increasing max_write and 1 for the abrasion sum and node number of the linked list, and calculating the average abrasion degree write of the block inserted into the linked list through sum_write/node_count avg If the max_write of the block to be inserted is less than write avg It is inserted into the head of the linked listOtherwise, the tail of the linked list is inserted.
Further, calculating the average wear degree write of the block inserted into the linked list through sum_write/node_count avg Comprising:
Figure BDA0004084661710000041
where sum_write represents the sum of the wear degrees of all nodes of the single-chain table, max_write represents the highest wear degree of the page, and node_count represents the number of nodes of the single-chain table.
Further, continuing to explore the subsequent linked list by a bitmap-based positioning method to find allocable candidate blocks, including:
recording the availability of G linked lists in the bitmap, if the ith linked list contains at least one block node, setting the ith bit of the bitmap to 1, otherwise setting to 0, recording the bitmap to a temporary variable k, shifting k by LA [ N ] +1 bits to the right, skipping over the previous LA [ N ] +1 linked lists which do not meet the allocation condition, finding the LA [ N ] +LA [ k [ (k) ] +1 linked list by the distance from the LA [ N ] +1 linked list to the nearest available linked list, and continuing to select the first block of the linked list for allocation.
Preferably, the recovery of the idle block using a wear-aware recovery mechanism includes:
a recovery linked list is constructed to temporarily manage recently recovered blocks, the head section of the recovery linked list records four metadata information, namely sum_write of abrasion degree of subsequent nodes, node_count and pointer head/tail pointing to the first/last node of the linked list, and the idle blocks are recovered into the constructed single-chain list through an idle block node locator.
Further, the method for recycling the idle block into the constructed single-chain table through the idle block node locator comprises the following steps:
when new free blocks are recycled, firstly checking whether adjacent blocks exist in a recycling linked list, checking whether two elements of FBNL [ low_page_no-1] and FBNL [ low_page_no+page_count ] are empty through a free block node positioner, setting the size of a page abrasion difference threshold Maxgap in the blocks to be 5, calculating page abrasion difference max_write-min_write of a merging block through traversing the recording condition of a write counter corresponding to a page in the free block, merging the two blocks and completing the recycling process if the abrasion difference max_write-min_write is smaller than the threshold Maxgap, and inserting the high abrasion block into the back of the recycling linked list by dynamically adjusting an insertion point method based on the average value of the linked list if the abrasion difference max_write-min_write is larger than or equal to the threshold Maxgap.
The invention has the beneficial effects that: the method realizes low-overhead high-precision wear balance by dynamically adjusting the strategy of the insertion point and the wear difference threshold value in the block node based on the linked list wear average value; secondly, the free block node locator FBNL accelerates the merging process of the reclaimed blocks; in addition, based on the multi-stage linked list of the distribution granularity range grouping, the complexity distribution of O (1) is realized, meanwhile, the large block is prevented from being divided into small blocks, the external fragments are reduced, and the efficiency of inserting the idle blocks and the residual blocks in the recovery linked list back to the distributor is improved; the method for searching the allocable blocks based on the auxiliary array and the linked list availability bitmap avoids inefficient traversal operation; finally, max_write and min_write values in the remaining block nodes generated by allocation inherit the max_write and min_write of the original idle block nodes, so that huge expenditure caused by traversing the idle block to recalculate the max_write and the min_write is avoided, and the system performance is greatly improved by sacrificing tiny abrasion precision.
Drawings
FIG. 1 is a schematic diagram of a prior wear-leveling aware persistent memory file system allocator;
FIG. 2 is a schematic diagram of a wear-aware spatial allocation method based on a persistent memory file system according to the present invention;
FIG. 3 is a schematic diagram of various aspects of the present invention demonstrating reclaim blocks by changing the wear level of the blocks;
description of the drawings: FIG. 1 (a) is a schematic illustration of a single particle size dispenser DWARM; FIG. 1 (b) is a schematic diagram of a multi-granularity heap allocator WMAlloc; FIG. 3 (a) shows an unrecovered block B according to the invention 10 An initial recovery linked list schematic diagram; FIG. 3 (B) is block B 10 The abrasion degree is3, recovery block B 10 Schematic of (2); FIG. 3 (c) is block B 10 Recovery of Block B with a degree of wear of 18 10 Schematic of (2); FIG. 3 (d) is block B 10 Recovery of Block B with a wear degree of 10 10 Schematic of (2); FIG. 3 (e) is block B 10 Recovery of Block B with a wear degree of 15 10 Schematic of (2); FIG. 3 (f) is block B 10 Wear degree of 10 and block B 1 Recovery of Block B with a wear degree of 16 10 Is a schematic diagram of (a).
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
A wear-aware space allocation method based on a persistent memory file system, as shown in FIG. 2, comprises the following steps:
s1: dividing PM space into blocks consisting of a plurality of continuous physical pages, dividing the blocks with the block sizes within a set range into a group according to the block sizes, dividing all the blocks into G groups, and numbering from 0 to G-1;
s2: all blocks in the same group are organized into single-chain tables, and head nodes of G single-chain tables are stored as an array;
s3: setting a write counter for each page to record the write condition of the page, storing all the write counters on an array, and storing the write counters in a continuous space of PM;
s4: when the I/O request comes, the candidate block is directly distributed from the corresponding group to be written into the I/O request by adopting a multi-level distribution mechanism according to the size of the I/O request, meanwhile, the value of a write counter of a write page of the candidate block is increased by 1, and the idle block is recovered by adopting a wear-aware recovery mechanism according to the page write condition recorded by the write counter.
Grouping blocks having a block size within a set range, comprising:
for the ith group, when i is less than G-1, each block of the group contains a number of pages of [2 ] i ,2 i+1 -1]Within the range; if i is equal to G-1, the set of blocks contains at least 2 G-1 Successive pages.
The single strand watch includes:
in a non-head node of the single-chain table, recording the minimum abrasion degree min_write and the maximum abrasion degree max_write of pages, the first page number low_page_no of a block, the page number page_count and the next information of a subsequent pointer; the head node record of the single linked list comprises four metadata information including sum_write of abrasion degree of all nodes of the single linked list, node number_count, pointer head pointing to the first node of the linked list and pointer tail pointing to the last node of the linked list.
The head nodes of the G single linked lists are stored as an array, so that the function of quick positioning can be realized; for example, it is now necessary to allocate from the 3 rd linked list, only multi_list [3], and not to traverse from scratch.
The write counter is used for recording the write times of the page, and aims to realize wear balance; when the page is distributed, the writing times of the page are known, and the page with the smaller writing times can be distributed preferentially; for a multistage allocation mechanism, the method for dynamically adjusting the insertion point based on the wear mean value of the linked list can realize that blocks with less wear are stored in front of the linked list, so that the blocks can be allocated preferentially.
Allocating candidate blocks using a multi-level allocation mechanism, comprising:
when a block containing N pages is allocated, it is necessary to quickly locate a linked list with granularity just greater than or equal to N, i.e. just 2 is satisfied i The ith linked list not less than N is quickly positioned by constructing an auxiliary array LA, and for a distributor containing G single linked lists, LA contains 2 G-1 +1 integer elements, and LA [ j ]]The values of (2) are all set to i if and only if j.epsilon.2 i ,2 i+1 -1]The method comprises the steps of carrying out a first treatment on the surface of the In particular, LA 0]Is set to a value of-1, indicating that allocation of less than 1 page is illegal, LA 2 G-1 +1]Is set to G-1, meaning that MLAM allocation exceeds 2 G-1 When the pages are selected, positioning the pages to a last linked list, and selecting a first block in the linked list as a candidate block of the allocation request;
if the first block in the linked list just contains N pages, the first block is taken out from the linked list and the allocation is completed; if the first block contains more than N pages, splitting the block into two sub-blocks, wherein one sub-block contains N pages for distribution, and the residual sub-blocks are reinserted into a single linked list corresponding to the size according to the size of the residual sub-blocks after the metadata information is modified based on a linked list wear average dynamic adjustment insertion point method, and when the residual sub-blocks max_write and min_write are updated, the residual sub-blocks inherit the max_write and the min_write of the original block in order to avoid the expenditure caused by traversing the write counter of the residual sub-block pages.
The multi-stage linked list is divided into blocks with the size of the block being the ith linked list, and the size of the block is 2 i ,2 i+1 -1]In the range, the rest blocks are also inserted back into the corresponding singly linked list according to the size of the blocks; for example, the residual block size is 12, at [2 ] 3 ,2 4 -1]Within range, the remaining blocks are inserted back into the linked list numbered 3.
When the block size represented by the first node in the LA N-th linked list is smaller than N, continuing to explore the subsequent nodes of the linked list and traversing the subsequent linked list to find the allocable blocks all bring certain performance cost; to solve this problem, a bitmap-based positioning method is used to prevent inefficient traversal operations: if the linked list has no allocable nodes, continuing to explore the subsequent linked list by a bitmap-based positioning method to find allocable candidate blocks.
The method for dynamically adjusting the insertion point based on the wear mean value of the linked list is adopted to reinsert the remaining sub-blocks into the single linked list corresponding to the size according to the size of the modified metadata information, and comprises the following steps:
first access LA [ N ]]To position the linked list to be inserted, respectively increasing max_write and 1 for the abrasion sum and node number of the linked list, and calculating the average abrasion degree write of the block inserted into the linked list through sum_write/node_count avg If the max_write of the block to be inserted is less than write avg Inserting the data into the head of the linked list, otherwise inserting the data into the tail of the linked list;
calculating average wear degree write of blocks inserted into a linked list through sum_write/node_count avg Comprising:
Figure BDA0004084661710000091
where sum_write represents the sum of the wear degrees of all nodes of the single-chain table, max_write represents the highest wear degree of the page, and node_count represents the number of nodes of the single-chain table.
Continuing to explore the subsequent linked list by a bitmap-based positioning method to find assignable candidate blocks, including:
recording the availability of G linked lists in the bitmap, namely setting the ith bit of the bmp to be 1 if the ith linked list at least contains one block node, and setting the ith bit of the bmp to be 0 otherwise; recording bitmap to temporary variable k, shifting k by LA [ N ] +1 bit right, skipping over the previous LA [ N ] +1 linked list which does not meet the allocation condition, because k & (-k) represents the value corresponding to 1 in the binary of k, and LA [ k & (-k) ] is used to represent the distance from the LA [ N ] +1 linked list to the nearest available linked list; find the LA [ N ] +la [ k & (-k) ] +1 linked list by the distance LA [ k [ -k) ] from the LA [ N ] +1 linked list to the most recently available linked list, and continue to select the first block of linked list for allocation; therefore, the complexity of searching for a block satisfying the allocation condition using the LA array and the bitmap positioning method is O (1).
Recovering the idle block by adopting a wear-aware recovery mechanism, comprising:
a recovery linked list is constructed to temporarily manage recently recovered blocks, the head section of the recovery linked list records four metadata information, namely sum_write of abrasion degree of subsequent nodes, node_count and pointer head/tail pointing to the first/last node of the linked list, and the idle blocks are recovered into the constructed single-chain list through an idle block node locator.
However, since reclaiming the linked list requires merging of neighboring blocks, looking up neighboring blocks by traversal results in a severe performance degradation, a free block node locator (Free Block Node Locator, FBNL) is proposed to reduce the overhead of merging neighboring blocks.
FBNL is a pointer array, the number of array elements is the same as the number of PM pages, each element occupies 8 bytes, and is used for recording the address of the corresponding node in the recovery linked list. Specifically, the FBNL elements corresponding to the first page and the last page of the free block node of the recycle list are used to record the address of the corresponding node in the recycle list, and the other elements are set to NULL. For example, as shown in FIG. 3 (a), the free reclamation block B 0 Containing four consecutive pages numbered 2 to 5, only the 2 nd, 5 th element of FBNL stores the pointer to B 0 And the 3 rd and 4 th elements will remain NULL.
The idle block is recycled into the constructed single-chain table through the idle block node locator, which comprises the following steps:
when new free blocks are recycled, firstly checking whether adjacent blocks exist in a recycling linked list, checking whether two elements of FBNL [ low_page_no-1] and FBNL [ low_page_no+page_count ] are empty through a free block node positioner, setting the size of a page abrasion difference threshold Maxgap in the blocks to be 5, calculating page abrasion difference max_write-min_write of a merging block through traversing the recording condition of a write counter corresponding to a page in the free block, merging the two blocks and completing the recycling process if the abrasion difference max_write-min_write is smaller than the threshold Maxgap, and inserting the high abrasion block into the back of the recycling linked list by dynamically adjusting an insertion point method based on the average value of the linked list if the abrasion difference max_write-min_write is larger than or equal to the threshold Maxgap.
The page abrasion difference threshold value Maxgap in the block is an integer number, when the setting of the Maxgap is larger, more large idle blocks can be generated during merging, but the page abrasion difference in the large idle blocks is larger; when the Maxgap setting is small, wear leveling inside the free blocks can be achieved, but the large free blocks available to the system can be reduced.
As shown in FIG. 3 (a), the recovery linked list contains 10 number-B slaves 0 To B 9 Is a block with a total wear degree of 150. In addition, maxgap is set to 5, the released block (by B 10 Representation) contains only page 6. In this example, we will change block B by changing it 10 Demonstration of the abrasion degree of recovery B 10 Is a combination of the above-described conditions.
In the first case, as shown in FIG. 3 (B), the block B is released 10 Is 3 (i.e., max_write and min_write are both 3). First, in the head node of the recovery linked list, sum_write and node_count are increased by 3 and 1, respectively, and the average wear of the linked list is calculated to be 153/11, resulting in 13 (only the integer part is considered). Then calculate B 10 And B 0 The wear difference between the two, i.e. max_write and min_write of the merging blocks are 9 and 3, respectively, the wear difference max_write-min_write is greater than the set threshold Maxgap. Thus, the merging operation is abandoned. Similarly, B 10 And B 1 Nor can they be combined. Thus due to B 10 The maximum wear 3 of (2) is less than the average wear 13 of all the blocks in the recycle list, so the released blocks will be inserted into the head of the recycle list.
In the second case, let us assume that block B is released 10 Is 18. As shown in FIG. 3 (c), in analysis B 0 、B 1 And B 10 After the difference in wear between them, the release block B was found 10 Can not still be with B 0 And B 1 And (5) merging. Furthermore, block B 10 The maximum wear 18 is greater than the average wear 15 of the recovery chain. Thus, released block B 10 Is inserted into the tail of the recovery linked list.
Third case, assume release block B 10 Is 10. First check B 0 、B 1 And B 10 Wear differences between them. In three neighboring blocks, the combined max_write is 12 (inherited from B 1 ) Min_write is 8 (inherited from B) 0 ) The difference in wear is 4, less than the set threshold Maxgap. Thus, as shown in FIG. 3 (d), three blocks are combined into one large block, i.e., block B 0 The next pointer of (a) points to B 2 And delete B 1 Node, B 0 The data low_page_no, page_count, max_write, and min_write of the node are modified to 2, 6, 12, and 8, respectively.
Fourth case, assume release block B 10 Is 15. First verify B 0 、B 1 And B 10 Wear differences between them. However, the combined max_write summin_write is 15 and 8, respectively, resulting in a wear difference of 7, greater than the set threshold Maxgap. In addition, as shown in FIG. 3 (e), it can be observed that min_write is at block B 0 In, therefore, give up B 0 And B 10 Is performed in the same manner as the merging operation. Second check B 1 And B 10 The difference in wear between them, the difference in page wear of the merging blocks is found to be smaller than the set threshold Maxgap, therefore, B 10 Merging into block B 1 Is a kind of medium.
Fifth case, assume release block B 10 And B 1 Is 10 and 16, respectively. First check B 0 、B 1 And B 10 Wear differences between them. If three adjacent blocks are merged, max_write and min_write are 16 and 8, respectively, and the difference in wear of the merged blocks is 8, greater than the set threshold Maxgap. As shown in FIG. 3 (f), give up B 10 And B 0 、B 1 Merging operations between them, then, check B 0 And B 10 Wear differences between the two. Fortunately, the wear difference of the merge blocks meets the merge requirement, and thus, block B will be released 10 Merging into B 0 And modifies the corresponding data.
When the number of idle pages in the multi-stage linked list is smaller than the PM idle total number multiplied by a factor alpha, idle blocks in the recovery linked list are caused to migrate into the multi-stage linked list. First, calculate the average wear level write of all blocks in the recycle chain table avg (i.e., sum_write/node_count). Second, because the reclamation process requires that low wear blocks be placed in front of the reclamation chain table and high wear blocks be placed at the tail of the reclamation chain table, the reclamation chain table is traversed from scratch to obtain sub-chain tables with less wear than average wear. Finally, the blocks are inserted into corresponding multi-stage singly linked lists according to the sizes of the blocks, and the migration process does not need to be divided. Note that neither the insertion of the remaining blocks nor the migration of the reclaimed blocks requires further merging, as all the mergeable blocks have been merged during the reclamation process.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (9)

1. The wear-sensing space allocation method based on the persistent memory file system is characterized by comprising the following steps of:
s1: dividing PM space into blocks consisting of a plurality of continuous physical pages, dividing the blocks with the block sizes within a set range into a group according to the block sizes, dividing all the blocks into G groups, and numbering from 0 to G-1;
s2: all blocks in the same group are organized into single-chain tables, and head nodes of G single-chain tables are stored as an array;
s3: setting a write counter for each page to record the write condition of the page, storing all the write counters on an array, and storing the write counters in a continuous space of PM;
s4: when the I/O request comes, the candidate block is directly distributed from the corresponding group to be written into the I/O request by adopting a multi-level distribution mechanism according to the size of the I/O request, meanwhile, the value of a write counter of a write page of the candidate block is increased by 1, and the idle block is recovered by adopting a wear-aware recovery mechanism according to the page write condition recorded by the write counter.
2. The method for assigning wear-aware space based on persistent memory file system according to claim 1, wherein grouping blocks having a block size within a set range comprises:
for the ith group, when i is less than G-1, each block of the group contains a number of pages of [2 ] i ,2 i+1 -1]Within the range; if i is equal to G-1, the set of blocks contains at least 2 G-1 Successive pages.
3. The method for assigning wear-aware space based on persistent memory file system according to claim 1, wherein said single-stranded table comprises:
in a non-head node of the single-chain table, recording the minimum abrasion degree min_write and the maximum abrasion degree max_write of pages, the first page number low_page_no of a block, the page number page_count and the next information of a subsequent pointer; the head node record of the single linked list comprises four metadata information including sum_write of abrasion degree of all nodes of the single linked list, node number_count, pointer head pointing to the first node of the linked list and pointer tail pointing to the last node of the linked list.
4. The method for assigning a wear-aware space based on a persistent memory file system according to claim 1, wherein assigning candidate blocks using a multi-level assignment mechanism comprises:
when a block containing N pages is allocated, a linked list with granularity being just larger than or equal to N is quickly positioned by constructing an auxiliary array LA, and a first block in the linked list is selected as a candidate block of the allocation request;
if the first block in the linked list just contains N pages, the first block is taken out from the linked list and the allocation is completed; if the first block contains more than N pages, splitting the block into two sub-blocks, wherein one sub-block contains N pages for distribution, and reinserting the rest sub-blocks into a single linked list corresponding to the size after modifying metadata information based on a linked list wear mean value dynamic adjustment insertion point method; if the linked list has no allocable nodes, continuing to explore the subsequent linked list by a bitmap-based positioning method to find allocable candidate blocks.
5. The method for assigning wear-aware space based on a persistent memory file system according to claim 4, wherein the method for dynamically adjusting the insertion point based on the linked list wear mean value is used to reinsert the remaining sub-blocks into the single linked list corresponding to the size after modifying the metadata information, and comprises the steps of:
first access LA [ N ]]To position the linked list to be inserted, respectively increasing max_write and 1 for the abrasion sum and node number of the linked list, and calculating the average abrasion degree write of the block inserted into the linked list through sum_write/node_count avg If the max_write of the block to be inserted is less than write avg It is inserted into the head of the linked list, otherwise it is inserted into the tail of the linked list.
6. The method for assigning wear-aware space based on persistent memory file system according to claim 5, wherein the average wear-level write after block insertion into the linked list is calculated by sum_write/node_count avg Comprising:
Figure FDA0004084661700000021
/>
where sum_write represents the sum of the wear degrees of all nodes of the single-chain table, max_write represents the highest wear degree of the page, and node_count represents the number of nodes of the single-chain table.
7. The method for persistent memory file system based wear-aware spatial allocation according to claim 4, wherein continuing to explore subsequent linked lists to find allocable candidate blocks by bitmap based positioning method comprises:
recording the availability of G linked lists in the bitmap, if the ith linked list contains at least one block node, setting the ith bit of the bitmap to 1, otherwise setting to 0, recording the bitmap to a temporary variable k, shifting k by LA [ N ] +1 bits to the right, skipping over the previous LA [ N ] +1 linked lists which do not meet the allocation condition, finding the LA [ N ] +LA [ k [ (k) ] +1 linked list by the distance from the LA [ N ] +1 linked list to the nearest available linked list, and continuing to select the first block of the linked list for allocation.
8. The method for allocating wear-aware space based on a persistent memory file system according to claim 1, wherein the recovering of the free blocks using a wear-aware recovery mechanism comprises:
a recovery linked list is constructed to temporarily manage recently recovered blocks, the head section of the recovery linked list records four metadata information, namely sum_write of abrasion degree of subsequent nodes, node_count and pointer head/tail pointing to the first/last node of the linked list, and the idle blocks are recovered into the constructed single-chain list through an idle block node locator.
9. The method for assigning wear-aware space based on persistent memory file system according to claim 8, wherein reclaiming free blocks into the constructed single-chain table by the free block node locator comprises:
when new free blocks are recycled, firstly checking whether adjacent blocks exist in a recycling linked list, checking whether two elements of FBNL [ low_page_no-1] and FBNL [ low_page_no+page_count ] are empty through a free block node positioner, setting the size of a page abrasion difference threshold Maxgap in the block to be 5, calculating page abrasion difference max_write-min_write of a merging block through the record condition of a write counter traversing pages in the free block, merging the two blocks and completing the recycling process if the abrasion difference max_write-min_write is smaller than the threshold Maxgap, and inserting the high abrasion block into the back of the recycling linked list by dynamically adjusting an insertion point method based on the linked list abrasion average value if the abrasion difference max_write-min_write is larger than or equal to the threshold Maxgap.
CN202310132505.2A 2023-02-17 2023-02-17 Wear perception space allocation method based on persistent memory file system Pending CN116126743A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310132505.2A CN116126743A (en) 2023-02-17 2023-02-17 Wear perception space allocation method based on persistent memory file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310132505.2A CN116126743A (en) 2023-02-17 2023-02-17 Wear perception space allocation method based on persistent memory file system

Publications (1)

Publication Number Publication Date
CN116126743A true CN116126743A (en) 2023-05-16

Family

ID=86308025

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310132505.2A Pending CN116126743A (en) 2023-02-17 2023-02-17 Wear perception space allocation method based on persistent memory file system

Country Status (1)

Country Link
CN (1) CN116126743A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117032599A (en) * 2023-10-10 2023-11-10 湖北长江万润半导体技术有限公司 Method and device for improving organization efficiency of flash memory blocks in flash memory block management

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117032599A (en) * 2023-10-10 2023-11-10 湖北长江万润半导体技术有限公司 Method and device for improving organization efficiency of flash memory blocks in flash memory block management

Similar Documents

Publication Publication Date Title
CN110347336B (en) Key value storage system based on NVM (non volatile memory) and SSD (solid State disk) hybrid storage structure
US10275361B2 (en) Managing multiple namespaces in a non-volatile memory (NVM)
JP3507132B2 (en) Storage device using flash memory and storage control method thereof
US20180181495A1 (en) Optimized hopscotch multiple hash tables for efficient memory in-line deduplication application
US7831624B2 (en) Skip list with address related table structure
CN102779096B (en) Page, block and face-based three-dimensional flash memory address mapping method
CN107153707B (en) Hash table construction method and system for nonvolatile memory
US9792073B2 (en) Method of LUN management in a solid state disk array
US6742078B1 (en) Management, data link structure and calculating method for flash memory
CN103838853B (en) Mixed file system based on different storage media
US20170286004A1 (en) Dedupe dram system algorithm architecture
US11061788B2 (en) Storage management method, electronic device, and computer program product
US11200159B2 (en) System and method for facilitating efficient utilization of NAND flash memory
US8954658B1 (en) Method of LUN management in a solid state disk array
US10365849B2 (en) Dual granularity dynamic mapping with packetized storage
CN111522507B (en) Low-delay file system address space management method, system and medium
CN109407985B (en) Data management method and related device
US8352707B2 (en) Implementing enhanced host to physical storage mapping using numerical compositions for persistent media
KR101413727B1 (en) Systems and methods for optimizing page selection in flash-memory devices
CN116126743A (en) Wear perception space allocation method based on persistent memory file system
CN111338569A (en) Object storage back-end optimization method based on direct mapping
CN106168883A (en) A kind of efficient data tissue and access method
CN116364148A (en) Wear balancing method and system for distributed full flash memory system
CN116360698A (en) Wear-sensing space allocation method for persistent memory file system based on multi-level bitmap
CN109871355B (en) Snapshot metadata storage method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination