CN111352593B - Solid state disk data writing method for distinguishing fast writing from normal writing - Google Patents

Solid state disk data writing method for distinguishing fast writing from normal writing Download PDF

Info

Publication number
CN111352593B
CN111352593B CN202010132813.1A CN202010132813A CN111352593B CN 111352593 B CN111352593 B CN 111352593B CN 202010132813 A CN202010132813 A CN 202010132813A CN 111352593 B CN111352593 B CN 111352593B
Authority
CN
China
Prior art keywords
writing
fast
data
block
write
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010132813.1A
Other languages
Chinese (zh)
Other versions
CN111352593A (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
Original Assignee
Hangzhou Dianzi 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 Dianzi University filed Critical Hangzhou Dianzi University
Priority to CN202010132813.1A priority Critical patent/CN111352593B/en
Publication of CN111352593A publication Critical patent/CN111352593A/en
Application granted granted Critical
Publication of CN111352593B publication Critical patent/CN111352593B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • 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/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash 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/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/12Replacement control
    • G06F12/121Replacement control using replacement algorithms
    • G06F12/123Replacement control using replacement algorithms with age lists, e.g. queue, most recently used [MRU] list or least recently used [LRU] list
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0616Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/062Securing storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • G06F3/0649Lifecycle management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • G06F2212/1024Latency reduction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1032Reliability improvement, data loss prevention, degraded operation etc
    • G06F2212/1036Life time enhancement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1052Security improvement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/21Employing a record carrier using a specific recording technology
    • G06F2212/214Solid state disk

Abstract

The invention provides a solid state disk data writing method for distinguishing fast writing and normal writing. When data needs to be written, the identified hot data which is updated frequently is handed to a fast writing flow for processing through a hot data identification window, the hot data is quickly written into a fast writing block in a mode of being higher than normal stepping voltage, and the fast writing times w arefAnd increasing 1, sending other cold data to a normal write flow for processing, and writing the cold data into the normal write block in a normal stepping voltage mode. Managing a fast write queue by adopting a first-in first-out (FIFO) strategy, and dynamically adjusting a hot data identification threshold value in a periodic triggering mode at fixed time intervals according to gains brought by the fast write strategy and the overhead of rewriting due to due data retention time; the method can improve the performance of the solid state disk based on the NAND flash memory, can ensure the safety of effective user data, and has little influence on the service life of the solid state disk because the additional garbage recycling expense caused by fast writing is not obviously increased.

Description

Solid state disk data writing method for distinguishing fast writing from normal writing
Technical Field
The invention belongs to the field of solid state disk firmware optimization design, and particularly relates to a solid state disk data writing method for distinguishing fast writing from normal writing.
Background introduction
With the rapid development of new-generation information technologies such as cloud computing and mobile internet, the data volume shows exponential growth, and thus higher requirements are put on data processing and storage. Thanks to the rapid development of semiconductor technology, a NAND-based high-speed read-write solid state disk is increasingly entering enterprises and personal consumers. And the storage cost of each bit is reduced, so that the solid state disk of the NAND flash memory gradually occupies the market, and the storage hierarchical structure in the computer system is expected to be fundamentally changed.
The root cause of the stable decrease of NAND flash cost year by year is multi-bit storage of storage units, and 3D stacking technology in recent years. However, due to the physical characteristics of NAND storage cells. The continuous increase in the number of bits in a storage unit and the use of 3D stacking technology will inevitably result in a decrease in the reliability of each memory cell in a NAND flash memory. Therefore, maintaining the performance index of the solid state disk (such as the endurance and response time of the flash memory) will become more difficult, and become a significant challenge for the firmware design of the solid state disk.
In the solid state disk, there is a trade-off between the number of program/erase (P/E) times, data retention time and programming speed of the storage unit, i.e. data can be written by a slower programming speed, higher voltage precision can be obtained, and thus the solid state disk can bear larger and more program noise interference between the storage units or has longer data retention time. Similarly, under a certain programming noise, the P/E times (namely the service life of the solid state disk is prolonged) or the data writing speed (namely the performance of the solid state disk is improved) can be improved by shortening the retention time of data.
In the field of storage, it is generally assumed that data of a hard disk is to be preserved for about 10 years. To achieve long data retention, slow writing is typically employed for all data. In practical applications, however, many of the thermal-written data have short retention times, such as 1-2 days; this means that the fast write technique is applied to this portion of data, which does not violate the data retention time limit, but can improve the performance of the solid state disk.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a solid state disk data writing method for distinguishing fast writing from normal writing. The method combines a hot data identification technology, a part of hot data which are frequently updated adopts a fast writing technology, other data adopt a normal writing technology, and the response speed of the solid state disk is improved at the cost of the retention time of fast writing data.
In order to realize the purpose of the invention, the invention adopts the following technical scheme:
step (1) of judging the type of write data
The medium for storing user data at the bottom layer is a NAND flash memory and is divided into a fast writing block and a normal writing block. The fast write block is used for storing hot data written in a fast write mode, and the normal write block is used for storing cold data written in a normal write mode.
The flash translation layer adopts an on-demand page level address mapping method, stores mapping items of frequent access requests in a RAM of the flash translation layer, divides the mapping items into a read request mapping queue and a write request mapping queue, and adopts a Least Recently Used (LRU) strategy for management. A hot data identification window is arranged in the head area (namely the latest access area) of the write request mapping queue and is used for identifying hot data which are updated frequently.
When data needs to be written, the identified hot data which is updated frequently is handed to a fast writing flow for processing through a hot data identification window, the hot data is quickly written into a fast writing block in a mode of being higher than normal stepping voltage, and the fast writing times w arefAnd increasing 1, sending other cold data to a normal write flow for processing, and writing the cold data into the normal write block in a normal stepping voltage mode.
The data needing to be written comprises writing caused by garbage collection and normal user data writing.
Step (2), the concrete steps of the fast writing process:
s1, check if the current fast write block has enough space to write new data. If not, S2 is executed, otherwise, S5 is executed.
S2, checking whether the current fast writing block number exceeds the upper limit F of the fast writing block numbernum. If not, S3 is executed. Otherwise, S4 is executed.
S3, it is checked whether the number of current free blocks is less than a threshold. And if the number of the idle blocks is smaller than the threshold value, performing garbage collection from the normal write blocks, so that the number of the idle blocks is larger than the threshold value. Then, according to the wear leveling principle, a free block with the least wear number is selected as the current fast writing block, and then S5 is executed.
S4, according to FIFO principle, recovering the earliest advance in the fast writing queueAnd (4) entering blocks until the number of idle blocks is greater than a threshold value. In reclaiming a fast write block, the number of rewrites w of the fast write block for each valid page of data in the blockr=wr+1. Then, according to the wear leveling principle, a free block with the least wear number is selected as the current fast writing block, and then S5 is executed.
And S5, allocating a free page from the current fast writing block, fast writing the user data into the free page in a mode of higher than normal step voltage, and then ending the process.
Step (3), the specific steps of the normal writing process are as follows:
s1, check if the current normal write block has enough space to write new data. If not, S2 is executed, otherwise, S3 is executed.
S2, it is checked whether the number of current free blocks is less than a threshold. And if the number of the idle blocks is smaller than the threshold value, performing garbage collection from the normal write blocks, so that the number of the idle blocks is larger than the threshold value. Then, according to the wear leveling principle, a free block with the least wear number is selected as the current normal write block, and then S3 is executed.
And S3, allocating a free page from the current normal write block, writing the user data into the data page in a normal step voltage mode, and then ending the process.
Step (4), managing a fast write queue;
a first-in-first-out (FIFO) policy is employed to manage the fast write queue. The fast writing queue is stored in RAM, and the number of fast writing blocks is limited to F by the space limitation of RAMnum
The management of the fast writing queue adopts a periodic trigger mode, namely, every fixed time interval Tfast(1/2 set as the retention time T of the fast write data), detecting whether the actual storage time of each fast write block exceeds T/2 from the tail of the fast write queue, if so, garbage-collecting the fast write block until the actual storage time of the fast write block is found to be the fast write block smaller than T/2. In garbage collection of a fast write block, the number of rewrites w of the fast write block is also for each valid data page in the blockr=wr+1。
And (5) dynamically adjusting a thermal data identification threshold. Dynamically adjusting a hot data identification threshold at fixed time intervals according to benefits brought by a fast write strategy and the overhead of rewriting due to the expiration of data retention time;
the adjustment of the thermal data identification threshold value adopts a periodic trigger mode, namely, the adjustment is carried out at fixed time intervals ThotTriggering adjustment of the thermal data recognition threshold. The specific process is as follows:
s1, according to formula B ═ wf×(tr-tf)-wr×trCalculating fast write yield in the present cycle, where wfFor fast write times, wrNumber of rewrites for fast write data, trTime required for normal writing, tfThe time required for fast writing.
S2, comparing the fast writing practical B of the current periodcurProfit B from previous cyclepre. When B is presentcur<BpreIf so, reducing the identification amount of the thermal data by changing the threshold value of the thermal data identification; when B is presentcur=BpreThe current total income is equal to the total income of the previous period, and the size of a hot data window does not need to be adjusted; when B is presentcur>BpreAnd increasing the identification amount of the hot data by changing the threshold value of the hot data identification so as to further improve the performance of the flash memory by utilizing the fast write strategy.
S3, mixing wfAnd wrZero setting, BcurIs assigned to BpreAnd then proceeds to the next cycle.
The invention has the following beneficial effects:
the solid state disk data writing method provided by the invention adds a hot data fast writing mode, can improve the performance of the solid state disk based on the NAND flash memory, and can ensure the safety of effective user data, namely the retention time of the final user data is not influenced. In addition, the extra garbage recycling expense caused by fast writing cannot be obviously increased, so that the service life of the solid state disk is not greatly influenced.
Drawings
FIG. 1: general architecture of the invention
FIG. 2: thermal data identification process of the invention
FIG. 3: the dynamic adjustment process of the thermal number window of the invention
FIG. 4: flow of fast write block queue management of the present invention
FIG. 5: general procedure of the invention
FIG. 6: fast write flow of the present invention
FIG. 7: normal write flow of the invention
FIG. 8: specific case of the first write request processing of the present invention
FIG. 9: second embodiment of the write request processing of the present invention
FIG. 10: specific case of fast write queue and hot data window adjustment of the present invention
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the drawings only show the components related to the present invention rather than the number, shape and size of the components in actual implementation, and the type, amount and ratio of the components in actual implementation can be changed freely, and the layout of the components may be more complicated.
In order to make those skilled in the art better understand the technical solution of the present invention, the following detailed description of the present invention is provided with reference to the accompanying drawings and the specific embodiments, but not to be construed as limiting the present invention.
Example one
The embodiment provides a solid state disk data writing method for distinguishing fast writing from normal writing, and the overall architecture of the writing method is shown in fig. 1. The hot data identification module in the data writing method provided by the invention can be combined with the flash conversion layer, and the mapping cache table is divided into a data writing mapping cache table (W-CMT) and a data reading mapping cache table (R-CMT). And migrating the read request mapping item which hits in the R-CMT to the most frequently used (MRU) position of the R-CMT. And the write request mapping item in the R-CMT hit is migrated to the MRU position of the W-CMT. For both read and write map entries that hit in W-CMT, they are both migrated to the MRU location of W-CMT. And the hot data identification module can open a hot data identification window at the head (namely MRU position) of the W-CMT based on the design of the flash translation layer, and adjust the size of the hot data identification window through sensing fast write benefits.
The flow of thermal data identification is shown in fig. 2: if a request hits in the hot data window, identified as a hot data request, then for each data page, wfAdding 1; while other requests that do not hit in the hot data window are all identified as cold data requests. And sending the hot data to a fast writing flow for processing, and fast writing the hot data into the fast writing block in a mode of higher than normal step voltage. And sending the cold data to a normal write flow for processing, and writing the cold data into the normal write block in a normal mode.
At a fixed time interval ThotAfter the timing is finished, triggering adjustment of the thermal data identification threshold, that is, adjusting the identified thermal data amount by changing the size of the thermal data window, where a specific flow is shown in fig. 3: first, according to the formula B ═ wf×(tr-tf)-wr×trCalculating and calculating fast write gain B in the periodcur(ii) a Secondly, according to the formula
Figure BDA0002396263070000061
Figure BDA0002396263070000062
Calculating the size of the thermal data window for the next cycle, represented here
Figure BDA0002396263070000063
Taking the whole; finally, w isfAnd wrZero setting, BcurIs assigned to BpreAnd then proceeds to the next cycle. Wherein wfFor fast write times, wrNumber of rewrites for fast write data, trTime required for normal writing, tfTime required for fast write; b iscurAnd BpreFast write benefits of the current cycle and the previous cycle are respectively obtained; HDA is the size of the hot data window. The larger the HDA, the higher the probability that a write request hits in a hot data window, so the more data can be identified as hot; conversely, the probability of a write request hitting in a hot window of data is low, and less data is identified as hot. When B is presentcur/BpreWhen the total income is equal to 1, the current total income is equal to the total income of the previous period, and the size of a hot data window is not required to be adjusted; when B is presentcur/BpreWhen the current period is more than 1, the total fast write yield of the current period is larger than that of the previous period, which indicates that the heat degree of the current data is increased, so that the size of a hot data window is increased, and the performance of the flash memory is further improved by using a fast write strategy. On the contrary, Bcur/BpreAnd < 1, the total fast write benefit in the current period is lower than that in the previous period, the data heat degree is reduced, and the size of a hot data window is reduced.
At a fixed time interval TfastAfter timing is finished, fast write queue management is triggered, and a specific flow is shown in fig. 4: and detecting whether the actual storage time of each fast writing block exceeds T/2(T is the maximum retention time of the data page adopting the fast writing mode) from the tail part of the fast writing queue, and if so, performing garbage collection on the fast writing block until the fast writing block of which the actual storage time is less than T/2 is found. In garbage collection of a fast write block, the number of rewrites w of the fast write block is also for each valid data page in the blockr=wr+1. Furthermore, TfastSet to T/2.
Example two
In the solid state disk data writing method for distinguishing fast writing from normal writing provided by the present invention, when a write request arrives, the total processing flow is as shown in fig. 5:
s1, identify the request hot and cold, i.e. determine if the request hits in the hot data window of the W-CMT. If so, S2 is performed, otherwise S3 is performed.
S2, transferring the hit mapping item to the head of the W-CMT, then writing the request into the flash memory by adopting a fast writing process, and writing the fast writing times WfAnd adding 1, and ending the processing flow.
S3, judging whether the request hits in the W-CMT non-hot data window. If so, the hit map entry is migrated to the head of the W-CMT, followed by S5, otherwise S4 is performed.
And S4, judging whether the W-CMT is full. If so, the mapping entry in the LRU position of the W-CMT is culled, and then the mapping entry corresponding to the request is loaded from the R-CMT or the underlying translation table to the MRU position of the W-CMT, followed by S5.
And S5, completing the writing of the data page by adopting a normal writing flow, and ending the processing flow.
Further, the fast write flow is shown in fig. 6:
s1, check if the current fast write block has enough space to write new data. If not, S2 is executed, otherwise, S5 is executed.
S2, checking whether the current fast writing block number is equal to the upper limit F of the fast writing block numbernum. If so, then S3 is performed, otherwise S4 is performed.
S3, it is checked whether the number of current free blocks is less than a threshold. And if the number of the idle blocks is smaller than the threshold value, performing garbage collection from the normal write blocks, so that the number of the idle blocks is larger than the threshold value. And selecting a free block as the current fast writing block according to the wear leveling principle. Then S5 is executed.
And S4, according to the FIFO principle, recycling the earliest entering block in the fast writing queue until the number of free blocks is larger than the threshold value. In reclaiming a fast write block, the number of rewrites w of the fast write block for each valid page of data in the blockr=wr+1. Then, according to the wear leveling principle, a free block with the least wear number is selected as the current fast writing block, and then S5 is executed.
And S5, allocating a free page from the current fast writing block, fast writing the user data into the free page in a mode of higher than normal step voltage, and then ending the process.
Further, the normal write flow is shown in fig. 7:
s1, check if the current normal write block has enough space to write new data. If not, S2 is executed, otherwise, S3 is executed.
S2, checking whether the number of current free blocks is less than a threshold: and if the number of the idle blocks is smaller than the threshold value, performing garbage collection from the normal write blocks, so that the number of the idle blocks is larger than the threshold value. And selecting a free block as the current normal writing block according to a wear leveling principle. Then S3 is executed.
And S3, allocating a free page from the current normal write block, quickly writing the user data into the free page in a normal step voltage mode, and then ending the process.
For further detailed description of the processing flow of the data fast writing method of the present invention, the description is made with reference to two specific sets of actual request processing examples. A solid state disk data writing method for distinguishing fast writing from normal writing is provided for clearer and simpler understanding. Assuming that the number of data storage blocks of the whole flash memory is 8; wherein each data block consists of four data pages; thermal data window adjustment period Thot10000 ms; fast write queue management period Tfast5000 ms; fast write data retention time Tsave10000 ms; fast write data Block ceiling F num3; lower bound of free blocks F free1. The mapping mode adopts pure page level mapping managed by an LRU queue, the length of a W-CMT queue is 10, and the initial size of an HDA is 5.
Example three: and writing of hot data.
Assuming that the initial state is as shown in "initial state" in fig. 8, there is an existing "access data page LPN is 3, write access request, request size is 1, access arrival time is 9999.321 ms", and the processing procedure is as follows:
c1, the request hits in the hot data window of the W-CMT, the write is regarded as a hot data write, the number of fast writes WfAdd 1 and send to the fast write flow.
C2, the current fast write block is full, and the number of fast write blocks is 3, equal to Fnum. Therefore, according to the management principle of the first-in first-out of the fast write queue, the data block '1' at the tail part of the fast write queue is recycled and removed from the fast write queue.
C3, looking up the logical page number "3" through the mapping table. It is found that the logical page number "3" has been stored in the 2 nd physical page of the physical block "3", and the data of this location is set to invalid.
C4, selecting the block "4" with less erasing times from the free blocks as the current fast writing block, and inserting the block into the head of the fast writing queue.
C5, write the data in the first free page of block "4" with a step voltage higher than normal.
Example four: and writing cold data.
Assuming that the initial state is as shown in "initial state" in fig. 9, a request with "access data page LPN is 8, write access request, request size 1, and access arrival time 12001.321 ms" arrives, and the process is as follows:
c1, the request hits in the W-CMT non-hot data recognition window, and is sent to the normal write flow.
C2, since the current normal write block is full and the number of free blocks is 1, less than Ffree. The data block "6" in the normal write block is thus reclaimed according to the invalid page maximization principle.
C3, looking up the logical page number "8" through the mapping table. It is found that the logical page number "8" has been stored in the 1 st physical page of the physical block "2", and the data of this location is set to invalid.
C4, selecting the block "1" with less erasing times from the free blocks as the current normal writing block.
C5, writing the data into the first free page of block "1" with normal step voltages.
Example five: fast write queue and hot data window adjustment
Assume that the initial state at this time is as shown in "initial state" in fig. 10.
C1, when the time reaches 10000ms, the fast write queue adjusts the timing TfastEnd upEnter the fast write queue adjustment process of C2.
C2, since the write time of the tail data block of the fast write queue is 4817.091ms, 10000-4817.091 > TsaveAnd 2, the retention time of the fast writing data is more than half of 5000, so that the fast writing block 3 is recycled, and the tail data block of the fast writing queue is recycled and erased. And then judging whether the retention time of the fast write data block at the tail of the fast write queue expires again, and finishing the adjustment of the fast write queue because the write time of the data block at the tail of the fast write queue is 7000.983ms and 10000-7000.983 is less than 5000, and the retention time of the data block does not exceed half of the retention time of the data.
C3, thermal data Window timing ThotAnd ending the timing, and entering a hot data identification window adjusting process. Suppose present Bcur/Bpre1.2, therefore
Figure BDA0002396263070000091
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and it will be apparent to those skilled in the art that various modifications and variations can be made in the present invention. Any modification, equivalent replacement, or improvement made without departing from the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (1)

1. A solid state disk data writing method for distinguishing fast writing from normal writing is characterized by comprising the following steps:
step (1) of judging the type of write data
The medium for storing user data at the bottom layer is a NAND flash memory and is divided into a fast writing block and a normal writing block; the fast writing block is used for storing hot data written in a fast writing mode, and the normal writing block is used for storing cold data written in a normal writing mode;
the flash translation layer adopts an on-demand page level address mapping method, stores mapping items of frequent access requests in an RAM of the flash translation layer, divides the mapping items into a read request mapping queue and a write request mapping queue, and adopts a Least Recently Used (LRU) strategy for management; setting a hot data identification window in the head area of the write request mapping queue, wherein the hot data identification window is used for identifying hot data which are updated frequently; the head area is the latest access area;
when data needs to be written, the identified hot data which is updated frequently is handed to a fast writing flow for processing through a hot data identification window, the hot data is quickly written into a fast writing block in a mode of being higher than normal stepping voltage, and the fast writing times w arefAdding 1, sending other cold data to a normal write flow for processing, and writing the cold data into a normal write block in a normal step voltage mode;
the data needing to be written comprises writing caused by garbage recovery and normal user data writing;
step (2), the concrete steps of the fast writing process:
s1, checking whether the current fast writing block has enough space to write new data; if not, executing S2, otherwise, executing S5;
s2, checking whether the current fast writing block number exceeds the upper limit F of the fast writing block numbernum(ii) a If not, go to S3; otherwise, go to S4;
s3, checking whether the number of the current free blocks is less than a threshold value; if the number of idle blocks is less than the threshold value, garbage recovery is carried out from the normal write blocks, so that the number of the idle blocks is greater than the threshold value; selecting a free block with the least wear times as a current fast writing block according to a wear balancing principle, and then executing S5;
s4, according to FIFO principle, recycling the earliest entering block in the fast writing queue until the number of idle blocks is larger than the threshold value; in reclaiming a fast write block, the number of rewrites w of the fast write block for each valid page of data in the blockr=wr+ 1; selecting a free block with the least wear times as a current fast writing block according to a wear balancing principle, and then executing S5;
s5, allocating a free page from the current fast writing block, fast writing the user data into the data page in a mode of higher than normal step voltage, and then ending the process;
step (3), the specific steps of the normal writing process are as follows:
s1, checking whether the current normal write block has enough space to write new data; if not, executing S2, otherwise, executing S3;
s2, checking whether the number of the current free blocks is less than a threshold value; if the number of idle blocks is less than the threshold value, garbage recovery is carried out from the normal write blocks, so that the number of the idle blocks is greater than the threshold value; then, according to the wear leveling principle, selecting a free block with the least wear number as the current normal write block, and then executing S3;
s3, allocating an idle page from the current normal write block, writing the user data into the data page in a normal step voltage mode, and then ending the process;
step (4), managing a fast write queue;
managing a fast write queue by adopting a first-in first-out (FIFO) strategy; the fast writing queue is stored in RAM, and the number of fast writing blocks is limited to F by the space limitation of RAMnum
The management of the fast writing queue adopts a periodic trigger mode, namely, every fixed time interval TfastDetecting whether the actual storage time of each fast writing block exceeds T/2 from the tail part of the fast writing queue, if so, performing garbage collection on the fast writing block until the fast writing block of which the actual storage time is less than T/2 is found; in garbage collection of a fast write block, the number of rewrites w of the fast write block is also for each valid data page in the blockr=wr+ 1; the T is the retention time of the fast write data;
step (5), dynamically adjusting a thermal data identification threshold; dynamically adjusting a hot data identification threshold at fixed time intervals according to benefits brought by a fast write strategy and the overhead of rewriting due to the expiration of data retention time;
the adjustment of the thermal data identification threshold value adopts a periodic trigger mode, namely, the adjustment is carried out at fixed time intervals ThotTriggering adjustment of a thermal data identification threshold; the specific process is as follows:
s1, according to formula B ═ wf×(tr-tf)-wr×trCalculating fast write yield in the present cycle, where wfFor fast write times, wrNumber of rewrites for fast write data, trIn order to have the time required for normal writing,tftime required for fast write;
s2, comparing the fast writing practical B of the current periodcurProfit B from previous cyclepre(ii) a When B is presentcur<BpreIf so, reducing the identification amount of the thermal data by changing the threshold value of the thermal data identification; when B is presentcur=BpreThe current total income is equal to the total income of the previous period, and the size of a hot data window does not need to be adjusted; when B is presentcur>BpreIn the method, the identification amount of the hot data is increased by changing the threshold value of the hot data identification so as to further improve the performance of the flash memory by utilizing a fast write strategy;
s3, mixing wfAnd wrZero setting, BcurIs assigned to BpreAnd then proceeds to the next cycle.
CN202010132813.1A 2020-02-29 2020-02-29 Solid state disk data writing method for distinguishing fast writing from normal writing Active CN111352593B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010132813.1A CN111352593B (en) 2020-02-29 2020-02-29 Solid state disk data writing method for distinguishing fast writing from normal writing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010132813.1A CN111352593B (en) 2020-02-29 2020-02-29 Solid state disk data writing method for distinguishing fast writing from normal writing

Publications (2)

Publication Number Publication Date
CN111352593A CN111352593A (en) 2020-06-30
CN111352593B true CN111352593B (en) 2022-03-22

Family

ID=71192421

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010132813.1A Active CN111352593B (en) 2020-02-29 2020-02-29 Solid state disk data writing method for distinguishing fast writing from normal writing

Country Status (1)

Country Link
CN (1) CN111352593B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112433676A (en) * 2020-11-24 2021-03-02 合肥康芯威存储技术有限公司 Garbage recycling method and system for solid state disk
CN112783656A (en) * 2021-01-29 2021-05-11 网易(杭州)网络有限公司 Memory management method, medium, device and computing equipment
CN116644001B (en) * 2023-07-20 2023-10-17 合肥康芯威存储技术有限公司 Storage device and garbage recycling control method thereof

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10008275B1 (en) * 2017-05-24 2018-06-26 Lite-On Electronics (Guangzhou) Limited Control method for solid state storage device
CN109324759A (en) * 2018-09-17 2019-02-12 山东浪潮云投信息科技有限公司 The processing terminal of big data platform, the method read data and write data

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5520747B2 (en) * 2010-08-25 2014-06-11 株式会社日立製作所 Information device equipped with cache and computer-readable storage medium
TWI471862B (en) * 2011-08-19 2015-02-01 Silicon Motion Inc Flash memory controller
JP5112566B1 (en) * 2011-12-16 2013-01-09 株式会社東芝 Semiconductor memory device, nonvolatile semiconductor memory inspection method, and program
US9424946B2 (en) * 2013-02-08 2016-08-23 Seagate Technology Llc Non-volatile buffering to enable sloppy writes and fast write verification

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10008275B1 (en) * 2017-05-24 2018-06-26 Lite-On Electronics (Guangzhou) Limited Control method for solid state storage device
CN109324759A (en) * 2018-09-17 2019-02-12 山东浪潮云投信息科技有限公司 The processing terminal of big data platform, the method read data and write data

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SAN架构下的RAID数据存储技术研究与应用;苏博群;《万方数据库》;20160603;全文 *

Also Published As

Publication number Publication date
CN111352593A (en) 2020-06-30

Similar Documents

Publication Publication Date Title
US11893238B2 (en) Method of controlling nonvolatile semiconductor memory
EP2939120B1 (en) Priority-based garbage collection for data storage systems
CN111352593B (en) Solid state disk data writing method for distinguishing fast writing from normal writing
US8261010B2 (en) Methods for distributing log block associativity for real-time system and flash memory devices performing the same
US9003099B2 (en) Disc device provided with primary and secondary caches
CN110413537B (en) Flash translation layer facing hybrid solid state disk and conversion method
US9223694B2 (en) Data storage device and operating method thereof
JP6139381B2 (en) Memory system and method
CN108845957B (en) Replacement and write-back self-adaptive buffer area management method
CN110888600B (en) Buffer area management method for NAND flash memory
US11645006B2 (en) Read performance of memory devices
US9176866B2 (en) Active recycling for solid state drive
US20190303019A1 (en) Memory device and computer system for improving read performance and reliability
KR101403922B1 (en) Apparatus and method for data storing according to an access degree
CN111580754B (en) Write-friendly flash memory solid-state disk cache management method
KR101353967B1 (en) Data process method for reading/writing data in non-volatile memory cache having ring structure
CN114924690B (en) Method for optimizing read performance of flash memory based on unbalanced wear
US20240126433A1 (en) Method of controlling nonvolatile semiconductor memory
CN117632018A (en) Mixed storage system of persistent memory and flash memory and data writing method
CN114924690A (en) Read performance optimization method based on non-equilibrium wear flash memory
KR20130086691A (en) Hybrid storage device including non-volatile memory cache having ring structure

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