CN108845957A - It is a kind of to replace and the adaptive buffer management method of write-back - Google Patents

It is a kind of to replace and the adaptive buffer management method of write-back Download PDF

Info

Publication number
CN108845957A
CN108845957A CN201810276887.5A CN201810276887A CN108845957A CN 108845957 A CN108845957 A CN 108845957A CN 201810276887 A CN201810276887 A CN 201810276887A CN 108845957 A CN108845957 A CN 108845957A
Authority
CN
China
Prior art keywords
buffer
write
data page
list
block
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
CN201810276887.5A
Other languages
Chinese (zh)
Other versions
CN108845957B (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.)
Hangzhou Dianzi University
Hangzhou Electronic Science and Technology University
Original Assignee
Hangzhou Electronic Science and Technology 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 Hangzhou Electronic Science and Technology University filed Critical Hangzhou Electronic Science and Technology University
Priority to CN201810276887.5A priority Critical patent/CN108845957B/en
Publication of CN108845957A publication Critical patent/CN108845957A/en
Application granted granted Critical
Publication of CN108845957B publication Critical patent/CN108845957B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • 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/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7205Cleaning, compaction, garbage collection, erase control

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The present invention provide it is a kind of displacement and the adaptive buffer management method of write-back, buffer area is divided into cache blocks record sheet, writing buffer and reading buffer;Wherein, cache blocks record sheet is for recording the location information for belonging to the data page of a logic data block in buffer area, the data page that writing buffer is modified for cache responses write request, reading buffer is for caching the data page that do not modified only in response to read request.The present invention, using the way to manage of page grade, adjusts reading buffer threshold value by periodic time self-adapting when loading and rejecting data page, the special variation of load read-write can be perceived, so that the management method can obtain higher cache hit rate under a variety of loading conditions.Simultaneously, it is adaptively clustered write-back using containing dirty pages, the pressure of FTL layers of garbage reclamation can be perceived, be adaptively adjusted writeback policies, it can efficiently reduce because the additional blocks erasing times that FTL garbage reclamation causes, improve the overall performance and service life of solid state hard disk.

Description

It is a kind of to replace and the adaptive buffer management method of write-back
Technical field
The invention belongs to the firmware optimization method design field based on flash memory solid-state disk, discloses a kind of displacement and return It is written from the buffer management method of adaptation.
Background technique
Toshiba proposed a kind of novel non-volatile memory medium --- nand flash memory (flash in 1989 Memory), the storage medium is because of its high-performance, low-power consumption, and the good advantage of shock resistance is widely used in embedded device, just Take formula computer and enterprise storage system.The flash memory being mentioned herein is nand flash memory.
Buffer area is a part indispensable in storage system composition, by the way that the data frequently accessed are stored in little Rong In the cache of amount, the I/O performance of storage system can be effectively improved.In decades, researcher is directed to mechanical hard disk Many classical effective buffer zone methods, such as FIFO (first in first out method) are proposed for the storage system of primary storage medium, (method is not used) in LRU at most, LFU (at least using method of replacing) and LRFU (frequently using method of replacing recently and least) Etc..But the bottom storage medium of solid state hard disk be flash memory, flash memory have the characteristics that it is obviously different with conventional magnetic media, Thus traditional buffer queue management algorithm towards mechanical hard disk is difficult to be applicable in the design of solid-state disk buffer area.
The nand flash memory of solid state hard disk bottom has following limitation:1) flash memory only provides reading and writing and erasing 3 kinds of operations, and this Three kinds of operating characteristics asymmetry, reading is most fast, writes and takes second place, and wipes most slow;2) flash memory is by page (page), block (block), plane (plane) structure carries out tissue;Page is the minimum unit of read/write, generally 2/4/8KB;Block be erasing minimum unit, one A block generally comprises 64/128 page;3) it can only be write once after flash memory erasing, i.e., so-called erase-before-write, this makes Original place is not supported to update at flash memory;4) program/erase (P/E) number of each storage unit of flash memory is limited, is more than this P/E times number Afterwards, data stored by flash memory is no longer reliable.
For the read-write asymmetry of flash memory, researcher proposes a series of buffer zone methods towards flash memory, according to Operation granularity can divide into page grade buffer zone method and block grade buffer zone method.
Page grade buffer zone method:Most improved method is all based on LRU, wherein classical effective method has CFLRU (the preferential displacement minimum recently of clean page) method, CCF-LRU (the preferential displacement minimum recently of cold clean page) method, AD- LRU (displacement of adaptive deque's minimum cold-zone) method.But these methods all only considered the state of displaced page in buffer area, and The characteristic for ignoring current accessed load, preferably performance could be obtained by causing all kinds of methods to be only applicable to specifically load.Phase Write back operations are carried out with single page for page grade buffer zone method, block grade buffer zone method is in write back operations, using block as tissue Unit carries out write-back, can effectively reconstruct access module, random write request is changed into continuous write request, so as to have Reduce the garbage reclamation expense of bottom FTL in effect ground.
Block grade buffer zone method:With BPLRU (block filling minimum displacement recently) method and the side FAB (largest block preferential substitution) Based on method, PUD-LRU (Predicted average Update Distance aware LRU) method, CLC are derived (Cold and Largest Cluster) method.But these block grade buffer zone methods, all only cache write request, with read request Based on load environment under, performance is bad.In addition, these block grade buffer area methods are in containing dirty pages write-back, to same time It writes the cold and hot of data page in block not to be distinguish, causes part dsc data page that can not perceive bottom by write-back, while when write-back too early The pressure of layer flash memory conversion coating (Flash Translation Layer, FTL) garbage reclamation is led using single writeback policies Cause FTL layers of additional garbage reclamation expense.
Summary of the invention
In view of the above-mentioned deficiencies in the prior art, the present invention announces a kind of buffer area pipe that displacement is adaptive with write-back Reason method can not only improve buffer area read-write hit rate according to load read write attribute dynamic adjustment Replacement Strategy, and can be Cluster write-back when retain dsc data page and according to flash translation layer (FTL) (FTL) garbage reclamation pressure adjust writeback policies reduce bottom dodge The erasing times of counterfoil.
To achieve the purpose of the present invention, the present invention uses following technical scheme:
It is a kind of displacement and the adaptive buffer management method of write-back, the buffer area is divided into cache blocks record sheet, writes Buffer area and reading buffer;The cache blocks record sheet is for recording the data page for belonging to a logic data block in buffer area Location information, the data page that the writing buffer is modified for cache responses write request, the reading buffer is for delaying Deposit the data page that do not modified only in response to read request;
The management method includes the following steps:
S1, when access request arrives, whether query caching block record sheet includes the corresponding caching block message of request, if depositing S2 is being executed, otherwise, is executing S4;
S2, with the presence or absence of the position indicator pointer for being directed toward request data page in query caching block record sheet, and if it exists, then execute Otherwise S3 executes S5;
Hiting data page migration to the MRU position of corresponding buffer area is updated the position in corresponding cache blocks record sheet by S3 Pointer list;S8 is executed later;
S4 adds corresponding record block message into cache blocks record sheet, while initializing all information of the record block, S5 is executed later;
S5 determines whether current buffer is full;If full, S6 is executed, otherwise, executes S7;
S6 compares the size of reading buffer Yu targets threshold Tau;If more than then selecting the number of the LRU position of reading buffer It is rejected according to page, otherwise, selects the data page of the LRU position of writing buffer as rejecting item and execute the write-back that adaptively clusters;More It is new to reject the corresponding record block message of data page, S7 is executed later;
The request data page of missing is loaded into corresponding buffer area, while the position for being directed toward the data page being added by S7 Into the position indicator pointer list of corresponding cache blocks record sheet, and update corresponding record block message;S8 is executed later;
S8 starts Replacement Strategy adjusting thresholds mechanism, is adjusted to threshold value Tau;Finally, terminating the place of this request Reason.
Further, the reading buffer and writing buffer are using LRU management queue, when buffer area hit requests and load When new data page, by hit requests and load new data page migration to queue MRU position.
Further, in the cache blocks record sheet, the information of a record block includes:It caches block number BlkNum, delay The clean page position pointer list C-list- for rushing in area and belonging to the data page number BlkSize of the record block, belong to the record block Index, the containing dirty pages position indicator pointer list D-list-index for belonging to the record block.
Further, in the step S3, the position indicator pointer list updated in corresponding cache blocks record sheet is specially:
The old position indicator pointer for being directed toward the migrating data page is rejected from C-list-index or D-list-index list, it Position is moved into judgement afterwards, if moving into reading buffer, position indicator pointer is stored in C-list-index in corresponding cache blocks;It is no Then, by the D-list-index in the position indicator pointer deposit record block of data page.
Further, in the step S6, the corresponding record block message of data page is rejected in the update, specially:
Found from C-list-index or D-list-index list be directed toward the rejecting data page old position indicator pointer simultaneously It rejects, and updates the BlkSize=BlkSize-1 of corresponding record block.
Further, described that the position for being directed toward the data page is added to corresponding cache blocks record in the step S7 In the position indicator pointer list of table, and corresponding record block message is updated, specially:
Judge request type, if read request, then the position indicator pointer of new addition data page is stored in corresponding caching record C-list-index in block;Otherwise, by the D-list-index in the position indicator pointer deposit record block of data page, later update pair The BlkSize=BlkSize+1 for the record block answered.
Further, in the step S6, the process for adaptively clustering write-back is:
S61 selects the data page of writing buffer LRU position as rejecting object, and inquires the corresponding caching of the data page D-list-index information in record block, executes S62 later;
S62 is successively read the data page that the position indicator pointer of D-list-index is directed toward, and according to positioned at buffer queue first half Part is the principle of dsc data, and the data page being directed toward to the position indicator pointer of the D-list-index judges, and will differentiate Reservation set Ф is added for the data page of heat, executes S63 later;
S63 calculates presently written amplification coefficient
Current write-back threshold value is calculated according to presently written amplification coefficient W
Wherein, Bw is the statistical value of buffer area write-back number in the fixed cycle;Fw is flash memory write operation in the fixed cycle Number statistical value;BlkMaxSize is the logical data block size, and t is constant coefficient;
S64 is executed later;
Number of pages E=BlkMaxSize-N is filled up in S64, calculating, and N is data page of the current record block in writing buffer Number, compares the size of E and Th later;If E≤Th executes S65;Otherwise, S66 is executed;
The E entire data blocks time of containing dirty pages composition for filling up page and write-back are read in S65, enabling page filling from bottom flash memory Bottom flash memory is written;S67 is executed later;
S66, does not enable page filling, and the containing dirty pages in D-list-index are all written back into bottom flash memory, execute S67;
Data page in set Ф is all moved into reading buffer by S67, while deleting the cache blocks record of former data block The location information of D-list-index in table, while the new position indicator pointer after transfer is stored in C-list-index;Finally tie Shu Benci clusters write back operations.
Further, in the step S8, the starting Replacement Strategy adjusting thresholds mechanism is adjusted threshold value Tau, Specifically adjustment process is:
S81 judges whether current request is hit, if so, executing S82, otherwise, executes S83;
S82 judges request type and hit area, if reading buffer reads hit, CRH adds 1;If reading buffer writes life In, then CWH adds 1;If writing buffer reads hit, DRH adds 1;If writing buffer writes hit, CRH adds 1;Finally execute S83;
S83 updates current TCount, i.e. TCount=TCount+1, while updating statistical value Bw and statistical value Fw, it After execute S84;
S84, judges whether TCount reaches threshold value update cycle CycleTime, if so, executing S85, otherwise, terminates This of threshold value Tau updates operation;
Wherein, CRH is that statistical variable is hit in the reading of reading buffer, and CWH writes hit statistical variable for reading buffer;DRH Statistical variable is hit for the reading of writing buffer, DWH writes hit statistical variable for writing buffer;TCount is current request operation It counts;CycleTime is the threshold value update cycle;
S85 calculates target writing buffer unit gain DR, target reading buffer unit gain CR:
Wherein BufSize is the size for reading and writing total buffer, and Tau ' is the threshold value before updating,
Cr, Cw are that read-write time delay cost coefficient is calculated in normalizing:
Wherein, ReadDelay and WriteDelay is respectively read latency and write delay in the period;S86 is executed later.
S86 updates threshold value Tau:
Update cycle buffer area write-back number statistical value Bw=0, period flash memory write number of operations statistical value Fw=0 simultaneously, Cycle count value TCount=1 finally terminates this update operation of threshold value Tau.
Compared with prior art, the present invention beneficial effect is:
Displacement proposed by the present invention and the adaptive buffer management method of write-back, use when loading and rejecting data page The way to manage of page grade, and reading buffer threshold value is adjusted by periodic time self-adapting, the special variation of load read-write can be perceived, so that The management method can obtain higher cache hit rate under a variety of loading conditions.Secondly, the manager proposed in the present invention Method can perceive the pressure of FTL layers of garbage reclamation, be adaptively adjusted writeback policies when containing dirty pages cluster write-back, can be effective Reduction because FTL garbage reclamation cause additional blocks erasing times, promote the overall performance and service life of solid state hard disk.
Detailed description of the invention
It in order to illustrate the embodiments of the present invention more clearly or the technical solution of the prior art, below will be to embodiment or existing The required attached drawing of technical description is briefly described, it should be apparent that, the accompanying drawings in the following description is only the present invention Some embodiments for those of ordinary skill in the art without creative efforts, can also basis These attached drawings obtain other attached drawings.
Fig. 1:Cache blocks record sheet schematic diagram of the invention.
Fig. 2:Read-write buffer queue structural schematic diagram of the invention.
Fig. 3:The write-back flow chart that adaptively clusters of the invention.
Fig. 4:Ct value of the invention adjusts flow chart.
Fig. 5:Request of the invention handles general flow chart.
Fig. 6:Instance processes procedure chart of the invention.
Specific embodiment
In order to make those skilled in the art more fully understand technical solution of the present invention, below in conjunction with attached drawing and specifically Embodiment, to the present invention carry out in detail introduce explanation.
In order to which invention is further described, it is necessary first to provide the definition of related notion of the present invention:
Data cached page:The basic read/write unit of caching, it is consistent with the physical page size of flash memory.
Caching data block:Division arithmetic is carried out to physics block size by request of data page address, obtains the consistent data of quotient The set of page composition, the maximum of the data block include that number of pages is consistent comprising number of physical pages with bottom physical block.
Logical page address:Host I/O requests P to number (Logical according to the logical address of the mark of its file system Page Number, LPN).
Logical block number (LBN):It is also the number (Block Number, BlkNum) of caching data block, specifies the BlkNum of request P The quotient obtained for its LPN divided by data block maximum number of pages.
A kind of displacement proposed by the present invention and the adaptive buffer management method of write-back, are divided into three portions for caching Point:Cache blocks record sheet, writing buffer (Write Buffer) and reading buffer (Read Buffer).
Cache blocks record sheet is used to record position and state of the different data page for belonging to a data block in buffer area. Cache blocks record sheet accelerates the inquiry of request data page by the position indicator pointer of record different data page, updates, the behaviour of write-back Make.
As shown in Figure 1, the information of record block specifically includes in cache blocks record sheet:Current caching block number BlkNum, The data page number BlkSize that the record block is belonged in current buffer belongs to the clean page position pointer list of the record block C-list-index belongs to the containing dirty pages position indicator pointer list D-list-index of the record block.The size of the cache blocks and The physical block of practical bottom is in the same size, that is, the data page number for including is identical, sizes values BlkMaxSize.Corresponding data The logical page address (Logical Page Number, LPN) of page removes BlkMaxSize, and acquired results are denoted as the caching belonging to it The number of block, corresponding remainder are the offset of its cache blocks.
After being used for cache responses write request modified data page (containing dirty pages), the data page of the buffer area occur for writing buffer Queue is formed according to LRU principle to be managed;The data page in the buffer area divides cold and hot again simultaneously, and the data page of first half is Hot page, latter half of data page are cold page.
Reading buffer is for caching the data page (clean page) that do not modify only in response to read request, the data of the buffer area Page equally uses LRU queue management.It will be moved to writing buffer after data page response write request in the buffer area, equally write slow Write-back, which occurs, for the dsc data page for rushing area can also be moved in reading buffer.
As shown in Fig. 2, the queue size of two kinds of buffer areas can be because in replacement process in the queue structure of read-write buffer area Middle dynamic select replaces object and changes.
To the hit situation of read-write buffer area, bottom read-write delay, buffer area write-back number, bottom data web update is write secondary Number carries out the statistics in period.
The reading hit statistical variable of writing buffer in the Orientation observation period is denoted as DRH, writing buffer writes hit system Meter variable is denoted as DWH;The reading hit statistical variable of reading buffer is denoted as CRH, and the hit statistical variable of writing of reading buffer is denoted as CWH;Buffer area write-back number is denoted as Bw in the period, and flash memory write number of operations is denoted as Fw in the period;Write delay in the period It is denoted as WriteDelay, read latency is denoted as ReadDelay.
When the data page for selecting writing buffer is as displacement object and is written back into flash memory, by the adaptive write-back that clusters of triggering Mechanism.
As shown in figure 3, write-back buffer block is determined by replacement data page, by the caching in the write-back mechanism that adaptively clusters The record information of D-list-index in block record, which determines the containing dirty pages set of write-back while identifying, retains hot containing dirty pages.It is clustering back During writing, whether page is used to fill according to current write-in amplification coefficient dynamic select.Its operating process is as follows:
S61 selects the data page V of writing buffer LRU position as rejecting object, and inquires the corresponding caching of the data page D-list-index information in record block, executes S62 later.
S62 is successively read the data page that the position indicator pointer of D-list-index is directed toward, and according to positioned at buffer queue first half Part is the principle of dsc data, is judged these data pages, and the data page for being determined as heat is added and retains set Ф, it After execute S63.
S63 calculates current write-back threshold valueWherein,S64 is executed later.
Number of pages E=BlkMaxSize-N is filled up in S64, calculating, and N is data page of the current record block in writing buffer Number, compares the size of E and Th later;If E≤Th executes S65;Otherwise, S66 is executed.
The E entire data blocks time of containing dirty pages composition for filling up page and write-back are read in S65, enabling page filling from bottom flash memory Bottom flash memory is written, executes S67 later.
S66, does not enable page filling, and the containing dirty pages in D-list-index are all written back into bottom flash memory, execute S67.
Data page in set Ф is all moved into reading buffer by S67, while deleting the cache blocks record of former data block The location information of D-list-index in table, while the new position indicator pointer after transfer is stored in C-list-index, finally tie Shu Benci clusters write back operations.
In management method proposed by the present invention, in replacement data page, by comparing threshold value Tau, (current goal reads buffering Area's size) and current reading buffer size, selection displacement buffer object.Its threshold value Tau can integrate the life of current read-write buffer area The read-write of middle situation and bottom postpones, and is periodically adjusted, adjusting thresholds mechanism is as shown in figure 4, process is as follows:
S81 judges whether current request is hit, if so, executing S82, otherwise, executes S83;
S82 judges request type and hit area, if reading buffer reads hit, CRH adds 1;If reading buffer writes life In, then CWH adds 1;If writing buffer reads hit, DRH adds 1;If writing buffer writes hit, CRH adds 1;Finally execute S83;
S83 updates current TCount, i.e. TCount=TCount+1, while updating statistical value Bw and statistical value Fw, it After execute S84;
S84, judges whether TCount reaches threshold value update cycle CycleTime, if so, executing S85, otherwise, terminates This subthreshold updates operation;
Wherein, CRH is that statistical variable is hit in the reading of reading buffer, and CWH writes hit statistical variable for reading buffer;DRH Statistical variable is hit for the reading of writing buffer, DWH writes hit statistical variable for writing buffer;TCount is current request operation It counts;CycleTime is the threshold value update cycle;
S85 calculates target writing buffer unit gain DR, target reading buffer unit gain CR:
Wherein BufSize is the size for reading and writing total buffer, and Tau ' is the threshold value before updating,
Cr, Cw are that read-write time delay cost coefficient is calculated in normalizing:
Wherein, ReadDelay and WriteDelay is respectively read latency and write delay in the period;S86 is executed later.
S86 updates threshold value Tau:
Update cycle buffer area write-back number statistical value Bw=0, period flash memory write number of operations statistical value Fw=0 simultaneously, Cycle count value TCount=1 finally terminates this update operation of threshold value Tau.
As shown in figure 5, request of the invention handles main-process stream, comprise the following steps:
S1 finds corresponding caching block number pBlkNum according to No. LPN conversion of request P when a request P is reached, It whether there is the caching block number in query caching block record sheet, and if it exists, then execute S2, otherwise, execute S4;
S2 traverses the position indicator pointer in cache blocks record list item, and inquiry request P whether there is in buffer area, if so, S3 is executed, otherwise, executes S5;
The data page of hit, is moved to the position MRU of corresponding buffering area by S3, buffer location where interpretation request data page It sets, while updating the position indicator pointer list in corresponding cache blocks record list item, the old pointer for being directed toward the data page is rejected, it will It is directed toward the new pointer deposit of the data page position;S8 is executed later;
S4 adds number pBlkNum cache blocks list item information into cache blocks record sheet, initializes the BlkNum of the list item =pBlkNum, BlkSize=0, D-list-index and C-list-index are sky, execute S5 later;
S5 judges whether current buffer is full, if full, execute S6, otherwise executes S7;
S6, the size of more current reading buffer size and threshold value Tau, if more than the LRU bit of reading buffer is then selected The data page set is rejected;Otherwise, it selects the data page of the LRU position of writing buffer as displacement buffer area, and executes certainly Adaptation clusters write-back mechanism;The old position for being directed toward the rejecting data page is found from C-list-index or D-list-index list It sets pointer and rejects, and update the BlkSize=BlkSize-1 of corresponding record block;Later, S7 is executed;
The request data page of missing is read in buffer area, while interpretation its request type from flash memory by S7;If read request, Then data page is loaded into reading buffer, while the C- of the pointer deposit cache blocks record of the position of the data page will be directed toward In list-index;Otherwise data page is loaded into writing buffer, while position indicator pointer is stored in the D- of corresponding cache blocks record In list-index;The BlkSize=BlkSize+1 in caching record table is updated later, later, executes S8;
S8 starts Ct value Tau, carries out period modulation to threshold value Tau, finally, terminating the processing of this request.
In the step S3, the position indicator pointer list updated in corresponding cache blocks record sheet is specially:
S31, buffer location then executes S32 if writing buffer where interpretation request data page;If reading buffer, Then execute S33;
The data page of hit, is moved to the MRU position of writing buffer by S32, while updating corresponding cache blocks record list item In D-list-index, the pointer of the old direction data page is rejected, the new pointer deposit of the data page position will be directed toward D-list-index;S8 is executed later;
The data page of hit, is moved to the MRU position of reading buffer by S33, while updating corresponding C-list-index, will The old pointer for being directed toward the data page is rejected, and new position indicator pointer is stored in C-list-index;S8 is executed later.
In order to which the process flow to management method of the invention is further described, in conjunction with specific one group of actual request Processing example is illustrated, and the instance processes process is as shown in Figure 6.
In this example, data block size is 4 data pages, and the size of buffer area is 10 data pages, when read-write postpones Prolong than being fixed as W/R=4/1, constant write-in amplification coefficient is W=1.5, and the threshold value update cycle is 10, current cycle count value TCount=1, threshold value Tau initial value are 5.
In this example, request sequence is as shown in Figure 6, is made of the logical address and request type requested, such as (R, 20) read request that an access data page LPN is 20, is indicated.
In this example, the process flow of (R, 20) is requested for first:
C1 is converted to obtain caching block number pBlkNum=20/4=5 according to LPN, be whether there is in query caching block record sheet The record information of the caching block number.
C2, there is no the information of the cache blocks, load the record list item of pBlkNum=5 into cache blocks record sheet, simultaneously The block number BlkNum=5, BlkSize=0, C-list-index and D-list-index for updating list item are sky.
C3, load request page enter buffer area, and discovery buffer area is full, compares reading buffer size RL (4) and present threshold value Tau (5), select writing buffer LRU position LPN=13 as displacement object.
C4, displaced page (LPN=13) belong to cache blocks VBlkNum=13/4=3, belong to the containing dirty pages LPN=of the cache blocks 14 are retained for heat, current write-back threshold valueBeing rounded is 2, and filling up page is 2, and monolith is selected to return It writes, and reading buffer includes remainder data page, does not need additional read operation, direct monolith write-back.
C5 empties the D-list-index in VBlkNum=3 cache blocks, and the data page of LPN=14 is moved into and reads buffering The tail portion of sector's column, and will be directed toward in the position indicator pointer deposit C-list-index of the data page
Request is loaded into buffer area by C6, judges the request to read type, the data page of LPN=20 is loaded into reading buffering The MRU position in area, and the position indicator pointer is deposited into the C-list-index of pBlkNum=20/4=5, while updating it BlkSize=1
C7, starting Ct value Tau updates, because of miss request, therefore cycle count value TCount is cumulative becomes 2, sentences Disconnected TCount is less than update cycle CycleTime, so directly terminating to update adjustment, terminates the operation of this request.
In this example, the process flow of (W, 1) is requested for second:
C8 is converted to obtain caching block number pBlkNum=1/4=0 according to LPN, be whether there is in query caching block record sheet The record information of the caching block number.
C9, traversing cache blocks C-list-index discovery, there are the data pages of LPN=1 to be located in reading buffer
C10 judges that the data page for write request, is then moved into the MRU of writing buffer by the type of request from reading buffer Position, while the position indicator pointer of C-list-index is removed, cache blocks note will be stored in relation to the new position indicator pointer of the data page In the D-list-index for recording table
C11, starting Ct value Tau update, because being that reading buffer writes hit, therefore statistical value CWH adds up, period later Count value TCount is cumulative to become 3, and the not up to update cycle terminates to adjust, and terminates the operation of this request.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.

Claims (8)

1. a kind of displacement and the adaptive buffer management method of write-back,
The buffer area is divided into cache blocks record sheet, writing buffer and reading buffer;
The cache blocks record sheet is described for recording the location information for belonging to the data page of a logic data block in buffer area The data page that writing buffer is modified for cache responses write request, the reading buffer is for caching only in response to read request And the data page that do not modified;It is characterized in that,
The management method includes the following steps:
S1, when access request arrives, whether query caching block record sheet includes the corresponding caching block message of request, and if it exists, is held Otherwise row S2 executes S4;
S2, with the presence or absence of the position indicator pointer for being directed toward request data page in query caching block record sheet, and if it exists, S3 is then executed, it is no Then, S5 is executed;
Hiting data page migration to the MRU position of corresponding buffer area is updated the position indicator pointer in corresponding cache blocks record sheet by S3 List;S8 is executed later;
S4 adds corresponding record block message into cache blocks record sheet, while initializing all information of the record block, later Execute S5;
S5 determines whether current buffer is full;If full, S6 is executed, otherwise, executes S7;
S6 compares the size of reading buffer Yu targets threshold Tau;If more than then selecting the data page of the LRU position of reading buffer It rejects, otherwise, selects the data page of the LRU position of writing buffer as rejecting item and execute the write-back that adaptively clusters;Update is picked Except the corresponding record block message of data page, S7 is executed later;
The request data page of missing is loaded into corresponding buffer area, while the position indicator pointer for being directed toward the data page being added by S7 Into the position indicator pointer list of corresponding cache blocks record sheet, and update corresponding record block message;S8 is executed later;
S8 starts Replacement Strategy adjusting thresholds mechanism, is adjusted to threshold value Tau;Finally, terminating the processing of this request.
2. displacement according to claim 1 and the adaptive buffer management method of write-back, which is characterized in that
The reading buffer and writing buffer will when buffer area hit requests and load new data page using LRU management queue Hit requests and load new data page migration to queue MRU position.
3. displacement according to claim 1 and the adaptive buffer management method of write-back, which is characterized in that
In the cache blocks record sheet, the information of a record block includes:The note is belonged in caching block number BlkNum, buffer area The data page number BlkSize for recording block, the clean page position pointer list C-list-index for belonging to the record block, the note is belonged to Record the containing dirty pages position indicator pointer list D-list-index of block.
4. displacement according to claim 3 and the adaptive buffer management method of write-back, which is characterized in that
In the step S3, the position indicator pointer list updated in corresponding cache blocks record sheet is specially:
The old position indicator pointer for being directed toward the migrating data page is rejected from C-list-index or D-list-index list, is sentenced later It is disconnected to move into position, if moving into reading buffer, position indicator pointer is stored in C-list-index in corresponding cache blocks;Otherwise, will D-list-index in the position indicator pointer deposit record block of data page.
5. displacement according to claim 3 and the adaptive buffer management method of write-back, which is characterized in that
In the step S6, the corresponding record block message of data page is rejected in the update, specially:
The old position indicator pointer for being directed toward the rejecting data page is found from C-list-index or D-list-index list and is rejected, And update the BlkSize=BlkSize-1 of corresponding record block.
6. displacement according to claim 3 and the adaptive buffer management method of write-back, which is characterized in that
In the step S7, the position indicator pointer that the position for being directed toward the data page is added to corresponding cache blocks record sheet is arranged In table, and corresponding record block message is updated, specially:
Judge request type, if read request, then the position indicator pointer of new addition data page is stored in corresponding caching record block C-list-index;Otherwise, it by the D-list-index in the position indicator pointer deposit record block of data page, updates later corresponding The BlkSize=BlkSize+1 of record block.
7. displacement according to claim 1 and the adaptive buffer management method of write-back, which is characterized in that
In the step S6, the process for adaptively clustering write-back is:
S61 selects the data page of writing buffer LRU position as rejecting object, and inquires the corresponding caching record of the data page D-list-index information in block, executes S62 later;
S62 is successively read the data page that the position indicator pointer of D-list-index is directed toward, and according to positioned at buffer queue first half For the principle of dsc data, the data page being directed toward to the position indicator pointer of the D-list-index judges, and will be determined as heat Data page be added retain set Ф, execute S63 later;
S63 calculates presently written amplification coefficient
Current write-back threshold value is calculated according to presently written amplification coefficient W
Wherein, Bw is the statistical value of buffer area write-back number in the fixed cycle;Fw is flash memory write number of operations system in the fixed cycle Evaluation;BlkMaxSize is the logical data block size, and t is constant coefficient;S64 is executed later;
Number of pages E=BlkMaxSize-N is filled up in S64, calculating, and N is data page number of the current record block in writing buffer, it Compare the size of E and Th afterwards;If E≤Th executes S65;Otherwise, S66 is executed;
S65, enables page filling, E is read from bottom flash memory fills up the containing dirty pages of page and write-back and form entire data block and be written back into Bottom flash memory;S67 is executed later;
S66, does not enable page filling, and the containing dirty pages in D-list-index are all written back into bottom flash memory, execute S67;
Data page in set Ф is all moved into reading buffer by S67, while being deleted in the cache blocks record sheet of former data block D-list-index location information, while by after transfer new position indicator pointer be stored in C-list-index;Finally terminate this The secondary write back operations that cluster.
8. displacement according to claim 7 and the adaptive buffer management method of write-back, which is characterized in that
In the step S8, the starting Replacement Strategy adjusting thresholds mechanism is adjusted threshold value Tau, specifically adjusts process For:
S81 judges whether current request is hit, if so, executing S82, otherwise, executes S83;
S82 judges request type and hit area, if reading buffer reads hit, CRH adds 1;If reading buffer writes hit, CWH adds 1;If writing buffer reads hit, DRH adds 1;If writing buffer writes hit, CRH adds 1;Finally execute S83;
S83 updates current TCount, i.e. TCount=TCount+1, while updating statistical value Bw and statistical value Fw, holds later Row S84;
S84, judges whether TCount reaches threshold value update cycle CycleTime, if so, executing S85, otherwise, terminates threshold value This of Tau updates operation;
Wherein, CRH is that statistical variable is hit in the reading of reading buffer, and CWH writes hit statistical variable for reading buffer;DRH is to write Statistical variable is hit in the reading of buffer area, and DWH writes hit statistical variable for writing buffer;TCount is current request operation meter Number;CycleTime is the threshold value update cycle;
S85 calculates target writing buffer unit gain DR, target reading buffer unit gain CR:
Wherein Buf_Size is the size for reading and writing total buffer, and Tau ' is the threshold value before updating,
Cr, Cw are that read-write time delay cost coefficient is calculated in normalizing:
Wherein, ReadDelay and WriteDelay is respectively read latency and write delay in the period;S86 is executed later.
S86 updates threshold value Tau:
Update cycle buffer area write-back number statistical value Bw=0 simultaneously, period flash memory write number of operations statistical value Fw=0, period Count value TCount=1 finally terminates this update operation of threshold value Tau.
CN201810276887.5A 2018-03-30 2018-03-30 Replacement and write-back self-adaptive buffer area management method Active CN108845957B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810276887.5A CN108845957B (en) 2018-03-30 2018-03-30 Replacement and write-back self-adaptive buffer area management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810276887.5A CN108845957B (en) 2018-03-30 2018-03-30 Replacement and write-back self-adaptive buffer area management method

Publications (2)

Publication Number Publication Date
CN108845957A true CN108845957A (en) 2018-11-20
CN108845957B CN108845957B (en) 2020-10-09

Family

ID=64211896

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810276887.5A Active CN108845957B (en) 2018-03-30 2018-03-30 Replacement and write-back self-adaptive buffer area management method

Country Status (1)

Country Link
CN (1) CN108845957B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783019A (en) * 2018-12-28 2019-05-21 上海威固信息技术股份有限公司 A kind of data intelligence memory management method and device
CN109857680A (en) * 2018-11-21 2019-06-07 杭州电子科技大学 A kind of LRU flash cache management method based on dynamic page weight
CN110888600A (en) * 2019-11-13 2020-03-17 西安交通大学 Buffer area management method for NAND flash memory
CN113722245A (en) * 2021-08-04 2021-11-30 广州市百果园信息技术有限公司 Buffer self-adaptive adjusting method, device, equipment and storage medium
CN116821174A (en) * 2023-07-17 2023-09-29 深圳计算科学研究院 Data query method and device based on logic data block

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040062159A1 (en) * 2002-09-26 2004-04-01 Park Yong Cheol Optical disc, method and apparatus for managing a defective area on an optical disc of write once type
US20040095666A1 (en) * 2002-11-20 2004-05-20 International Business Machines Corporation On-drive integrated sector format raid error correction code system and method
CN106528454A (en) * 2016-11-04 2017-03-22 中国人民解放军国防科学技术大学 Memory system cache mechanism based on flash memory
CN107589908A (en) * 2017-08-17 2018-01-16 暨南大学 The merging method that non-alignment updates the data in a kind of caching system based on solid-state disk
CN107590084A (en) * 2017-08-22 2018-01-16 浙江万里学院 A kind of page level buffering area improved method based on classification policy

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040062159A1 (en) * 2002-09-26 2004-04-01 Park Yong Cheol Optical disc, method and apparatus for managing a defective area on an optical disc of write once type
US20040095666A1 (en) * 2002-11-20 2004-05-20 International Business Machines Corporation On-drive integrated sector format raid error correction code system and method
CN106528454A (en) * 2016-11-04 2017-03-22 中国人民解放军国防科学技术大学 Memory system cache mechanism based on flash memory
CN107589908A (en) * 2017-08-17 2018-01-16 暨南大学 The merging method that non-alignment updates the data in a kind of caching system based on solid-state disk
CN107590084A (en) * 2017-08-22 2018-01-16 浙江万里学院 A kind of page level buffering area improved method based on classification policy

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
XIAO ZHI-BIN,ETC.: "Optimizing pipeline for a RISC processor with multimedia extension ISA", 《JOURNAL OF ZHEJIANG UNIVERSITY SCIENCE A》 *
杜晨杰,李君,姚英彪: "缓冲区管理层对固态盘的有效性研究", 《浙江万里学院学报》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857680A (en) * 2018-11-21 2019-06-07 杭州电子科技大学 A kind of LRU flash cache management method based on dynamic page weight
CN109783019A (en) * 2018-12-28 2019-05-21 上海威固信息技术股份有限公司 A kind of data intelligence memory management method and device
CN110888600A (en) * 2019-11-13 2020-03-17 西安交通大学 Buffer area management method for NAND flash memory
CN113722245A (en) * 2021-08-04 2021-11-30 广州市百果园信息技术有限公司 Buffer self-adaptive adjusting method, device, equipment and storage medium
CN113722245B (en) * 2021-08-04 2023-12-12 广州市百果园信息技术有限公司 Buffer self-adaptive adjustment method, device, equipment and storage medium
CN116821174A (en) * 2023-07-17 2023-09-29 深圳计算科学研究院 Data query method and device based on logic data block

Also Published As

Publication number Publication date
CN108845957B (en) 2020-10-09

Similar Documents

Publication Publication Date Title
CN108845957A (en) It is a kind of to replace and the adaptive buffer management method of write-back
CN107193646B (en) High-efficiency dynamic page scheduling method based on mixed main memory architecture
EP2939120B1 (en) Priority-based garbage collection for data storage systems
US8719501B2 (en) Apparatus, system, and method for caching data on a solid-state storage device
CN108762664B (en) Solid state disk page-level cache region management method
CN103136121B (en) Cache management method for solid-state disc
CN107391398B (en) Management method and system for flash memory cache region
CN107423229B (en) Buffer area improvement method for page-level FTL
CN111708481B (en) Solid State Disk (SSD) double-area wear leveling method based on super block
CN105389135B (en) A kind of solid-state disk inner buffer management method
CN108762671A (en) Mixing memory system and its management method based on PCM and DRAM
US9372810B2 (en) Collaborative caching
CN110413537B (en) Flash translation layer facing hybrid solid state disk and conversion method
CN103257935A (en) Cache management method and application thereof
US20090094391A1 (en) Storage device including write buffer and method for controlling the same
CN109739780A (en) Dynamic secondary based on the mapping of page grade caches flash translation layer (FTL) address mapping method
CN110262982A (en) A kind of method of solid state hard disk address of cache
CN113254358A (en) Method and system for address table cache management
CN107590084A (en) A kind of page level buffering area improved method based on classification policy
CN111580754B (en) Write-friendly flash memory solid-state disk cache management method
CN106909323B (en) Page caching method suitable for DRAM/PRAM mixed main memory architecture and mixed main memory architecture system
CN111352593A (en) Solid state disk data writing method for distinguishing fast writing from normal writing
CN111506517B (en) Flash memory page level address mapping method and system based on access locality
CN108664217A (en) A kind of caching method and system reducing the shake of solid-state disc storaging system write performance
CN102097128A (en) Self-adaptive buffer area replacement method based on flash memory

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
GR01 Patent grant
GR01 Patent grant