CN107797934A - The method and storage device that distribution is ordered are gone in processing - Google Patents

The method and storage device that distribution is ordered are gone in processing Download PDF

Info

Publication number
CN107797934A
CN107797934A CN201610804881.1A CN201610804881A CN107797934A CN 107797934 A CN107797934 A CN 107797934A CN 201610804881 A CN201610804881 A CN 201610804881A CN 107797934 A CN107797934 A CN 107797934A
Authority
CN
China
Prior art keywords
distribution
order
gone
physical
ftl tables
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
CN201610804881.1A
Other languages
Chinese (zh)
Other versions
CN107797934B (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.)
Beijing Memblaze Technology Co Ltd
Original Assignee
Beijing Memblaze Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Memblaze Technology Co Ltd filed Critical Beijing Memblaze Technology Co Ltd
Priority to CN201610804881.1A priority Critical patent/CN107797934B/en
Priority to PCT/CN2017/100317 priority patent/WO2018041258A1/en
Publication of CN107797934A publication Critical patent/CN107797934A/en
Application granted granted Critical
Publication of CN107797934B publication Critical patent/CN107797934B/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/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of method and storage device for handling and going distribution to order, it is related to technical field of memory, the technical problem for solving the execution that processing in the prior art goes distribution order to influence I/O command.The method that processing goes distribution to order includes:The ranges of logical addresses for going distribution to order instruction is obtained according to distribution order is gone;FTL tables are updated, the list item of FTL tables is set to the first designated value corresponding to the ranges of logical addresses that will go distribution order instruction;Instruction goes distribution order to perform completion.The method that processing in the present invention goes distribution to order is applied to handle storage device.

Description

The method and storage device that distribution is ordered are gone in processing
Technical field
The present invention relates to technical field of memory, more particularly to a kind of handle to go distribution order, the method for read command, storage to set Standby and computer program.
Background technology
Main frame can be coupled in several ways between storage device, coupled modes include but is not limited to for example, by The connection master such as SATA, IDE, USB, PCIE, NVMe (NVM Express), SAS, Ethernet, optical-fibre channel, cordless communication network Machine and storage device.Main frame can be the message processing device that can be communicated through the above way with storage device, for example, individual People's computer, tablet personal computer, server, portable computer, the network switch, router, cell phone, personal digital assistant Deng.
Fig. 1 is the block diagram of storage device.Solid storage device 102 is coupled with main frame, for providing storage energy for main frame Power.Main frame can be coupled in several ways between solid storage device 102, coupled modes include but is not limited to for example, by SATA (Serial Advanced Technology Attachment, Serial Advanced Technology Attachment), SCSI (Small Computer System Interface, small computer system interface), (Serial Attached SCSI, serially connect SAS Meet SCSI), IDE (Integrated Drive Electronics, integrated drive electronics), USB (Universal Serial Bus, USB), PCIE (Peripheral Component Interconnect Express, PCIe, it is outer at a high speed Enclose component interconnection), NVMe (NVM Express, high speed non-volatile memory), Ethernet, optical-fibre channel, cordless communication network etc. even Connect main frame and solid storage device 102.Main frame can be the information processing that can be communicated through the above way with storage device Equipment, for example, personal computer, tablet personal computer, server, portable computer, the network switch, router, cell phone, Personal digital assistant etc..Storage device 102 include interface 103, control unit 104, one or more NVM (nonvolatile storage, Non-Volatile Memory) chip 105 and DRAM (Dynamic Random Access Memory, dynamic random-access Memory) 110.Nand flash memory, phase transition storage, FeRAM, MRAM etc. are common NVM.Interface 103 can adapt to pass through example Such as SATA, IDE, USB, PCIE, NVMe, SAS, Ethernet, optical-fibre channel mode and host exchanging data.Control unit 104 For controlling the data transfer between interface 103, NVM chips 105 and DRAM 110, storage management is additionally operable to, main frame is patrolled Volume address is to flash memory physical address map, erasure balance, bad block management etc..The more of software, hardware, firmware or its combination can be passed through Kind mode realizes control unit 104.Control unit 104 can be that FPGA (Field-programmable gate array, shows Field programmable gate array), ASIC (Application Specific Integrated Circuit, the integrated electricity of application specific Road) or its combination form.Control unit 104 can also include processor or controller, in processor or controller Software is performed to manipulate the hardware of control unit 104 to handle I/O command.Control unit 104 is additionally coupled to DRAM110, and can visit Ask DRAM 110 data.The data of the I/O command of FTL tables and/or caching can be stored in DRAM.
Control unit 104 includes flash interface controller (or being flash memory channel controller).Flash interface controller coupling NVM chips 105 are closed, and order is sent to NVM chips 105 in a manner of following the interface protocol of NVM chips 105, with operation NVM chips 105, and receive the command execution results exported from NVM chips 105.The interface protocol of NVM chips 105 includes Interface protocol or standard known to " Toggle ", " ONFI " etc..
Memory target (Target) is that the shared chip in nand flash memory encapsulation enables (CE, Chip Enable) signal One or more logic units (Logic Unit).Each logic unit has LUN (LUN, Logic Unit Number).It may include one or more tube cores (Die) in nand flash memory encapsulation.Typically, each logic unit corresponds to single Tube core.Logic unit may include multiple planes (Plane).Multiple planes in logic unit can be with parallel access, and NAND Multiple logic units in flash chip can perform order and report state independently of one another.Can be from http:// Www.micron.com/~/media/Documents/Products/Other%20Documents/ONFI3_ In " Open NAND Flash Interface Specification (Revision 3.0) " that 0Gold.ashx is obtained, carry The implication of target (target), logic unit, LUN, plane (Plane) has been supplied referring to it is a part for prior art.
Data are generally stored and read by page in storage medium, and data are erased in blocks.Block includes multiple pages.Storage Page (being referred to as Physical Page) on medium has fixed size, such as 17664 bytes.Certainly, Physical Page can also have other Size.
In solid storage device, logical address constitutes the solid-state storage that the upper layer software (applications)s such as operating system are perceived and set Standby memory space.Physical address is the address for accessing the physical memory cell of solid storage device.
Trim (trimming) order defined in ATA8-ACS2, there is the order of same or like implication in SCSI Being referred to as UNMAP in (Small Computer System Interface, small computer system interface) specification, (releasing is reflected Penetrate), and it is referred to as Deallocate (going to distribute) in NVMe specifications.Hereinafter, indicate to have same ATA8- with " going to distribute " The data set management that ACS2 " trimming ", SCSI " unmapped ", NVMe " going to distribute " have same or similar function is ordered Order, and also indicate that the order with same or similar function occurred in the agreement, specification or technology in other or future.
In going distribution to order, ranges of logical addresses is described.After distribution order is performed, there can be different effects Fruit.For example, (1) is performed after going distribution to order, then when reading the indicated ranges of logical addresses of distribution order, resulting is (perform other write operations to the ranges of logical addresses before) determined;(2) perform after going distribution to order, then read point During with the indicated ranges of logical addresses of order, resulting result is that full 0 (performs other write-ins to the ranges of logical addresses Before operation);(3) it is resulting when performing after going distribution to order, then reading the indicated ranges of logical addresses of distribution order As a result can be arbitrary value (perform other write operations to the ranges of logical addresses before).Go distribution order or other The implementation effect for going distribution to order is can be set or selected in order.
By using going distribution to order, main frame is it is possible to notify which logical address space of solid state hard disc no longer stores significant figure According to so as to which solid state hard disc is when reclaiming memory space, it is not necessary to move the data to have failed.However, in the prior art, performing Go to distribute in command procedure, it is necessary to the operation of substantial amounts of internal storage access, this seriously extend to go that distribution order handled when Between, and the performance of solid state hard disc is influenceed, and then influence the execution of simultaneous I/O command.
The content of the invention
It is an object of the invention to provide a kind of processing to go to distribute order, the method for read command, storage device and computer Program, for when high speed is to going distribution order to handle, not influenceing the execution of simultaneous I/O command.
The first aspect of the present invention provides a kind of method for handling and going distribution to order, and this method includes:Ordered according to distribution is gone Order obtains the ranges of logical addresses for going distribution order instruction;FTL tables are updated, the ranges of logical addresses pair of distribution order instruction will be gone The list item for the FTL tables answered is set to the first designated value;Instruction goes distribution order to perform completion.
With reference to the first aspect of the present invention, in the first possible implementation, processing goes the method for distribution order also Including:Valid data cell list is updated, valid data cell list is used for the data of each physical data elements of record storage equipment State;Valid data element count table is updated, wherein, valid data element count table is used to record physical block, bulk or thing Manage the quantity of the physical data elements in effective status in block group.
It is possible at second with reference to the possible implementation of the first of the first aspect of the present invention or first aspect In implementation, during updating FTL tables, other assemblies are prevented to access the list item for the FTL tables being updated, or, make other Component does not access the list item for the FTL tables being updated.
With reference to the first or second of possible implementation of the first aspect of the present invention, first aspect, the 3rd In the possible implementation of kind, renewal FTL tables include multiple list items of renewal FTL tables every time.
With reference to the first aspect of the present invention, first aspect the first one of to the third possible implementation, In four kinds of possible implementations, the internal memory that renewal FTL tables update multiple list items of storage FTL tables including the use of dma operation is empty Between.
With reference to the first aspect of the present invention the first one of to the 4th kind of possible implementation, it is possible at the 5th kind In implementation, the method that processing goes distribution to order also includes:According to valid data element count table, more new physical block, bulk Or the first priority of physical block group, first priority are the priority for performing garbage collection operation;It is excellent according to first First level performs garbage collection operation.
With reference to the first aspect of the present invention the first one of to the 5th kind of possible implementation, it is possible at the 6th kind In implementation, valid data cell list is valid data unit bitmap, and each bit is used to refer in valid data unit bitmap Show the state of the data of each physical data elements of storage device.
With reference to the first aspect of the present invention the first one of to the 6th kind of possible implementation, it is possible at the 7th kind In implementation, physical data elements are the parts of Physical Page or Physical Page.
One of the 5th kind to the 7th kind possible implementation with reference to the first aspect of the present invention, it is possible at the 8th kind In implementation, physical block, bulk or physical block group containing less valid data unit have the first higher priority.
With reference to the first aspect of the present invention the first one of to the 8th kind of possible implementation, it is possible at the 9th kind In implementation, after valid data cell list is updated, instruction goes to distribute command process completion;Or in renewal significant figure After element count table, instruction goes to distribute command process completion.
With reference to one of the first of the first aspect of the present invention or first aspect to the 9th kind of possible implementation, In tenth kind of possible implementation, before updating FTL tables, FTL corresponding to the ranges of logical addresses of distribution order instruction will be removed The list item of table locks;After updating FTL tables, the list item solution of FTL tables corresponding to the ranges of logical addresses of distribution order instruction will be gone Lock.
With reference to one of the first of the first aspect of the present invention or first aspect to the tenth kind of possible implementation, In a kind of tenth possible implementation, the method that processing goes distribution to order also includes:In response to receiving read command, FTL is inquired about Table obtains physical address corresponding to the logical address to be read, if physical address goes the first designated value of distribution state for instruction, The response to read command is used as using the second designated value.
With reference to one of the first of the first aspect of the present invention or first aspect to the tenth kind of possible implementation, In 12nd kind of possible implementation, the method that processing goes distribution to order also includes:In response to receiving read command, FTL is inquired about Table obtains physical address corresponding to the logical address to be read, if physical address goes the first designated value of distribution state for instruction, Inform that read logical address is invalid, illegal or go distribution state in one or more to main frame with status information.
With reference to the 12nd kind of possible implementation of the first aspect of the present invention, in the 13rd kind of possible implementation In, the method that processing goes distribution to order also includes:The driver of main frame is supplied to reading based on the status information being apprised of, generation Take the reading result or data of the application of the logical address.
When the method processing that the processing provided using the first aspect of the present invention goes distribution to order goes distribution to order, first root According to going distribution order to obtain the ranges of logical addresses for going distribution to order instruction, FTL tables are then updated, will go what distribution order indicated The list item of FTL tables is set to the first designated value corresponding to ranges of logical addresses, then indicates that distribution order performs completion, so as to With high speed to going distribution order to handle, and the processing on going distribution to order does not influence holding for simultaneous I/O command OK.
The second aspect of the present invention provides a kind of method for handling read command, and this method includes:In response to receiving read command, Inquire about FTL tables and obtain physical address corresponding to the logical address to be read, if physical address goes the first of distribution state for instruction Designated value, the response to read command is used as using the second designated value.
The third aspect of the present invention provides a kind of method for handling read command, and this method includes:In response to receiving read command, Inquire about FTL tables and obtain physical address corresponding to the logical address to be read, if physical address goes the first of distribution state for instruction Designated value, inform that read logical address is invalid, illegal or go to distribute shape in one or more to main frame with status information State.
With reference to the third aspect of the present invention, in the first possible implementation, handling the method for read command also includes: The driver of main frame is supplied to the reading result for the application for reading the logical address based on the status information being apprised of, generation Or data.
The fourth aspect of the present invention provides a kind of storage device, and the storage device includes acquisition module, update module and referred to Show module, wherein, acquisition module is used for according to the ranges of logical addresses for going distribution order acquisition to go distribution order instruction;Update mould Block is used to update FTL tables, and the list item of FTL tables corresponding to the ranges of logical addresses that will go distribution order instruction is set to first and specified Value;Indicating module goes distribution order to perform completion for instruction.
The fifth aspect of the present invention provides a kind of storage device, and the storage device includes control unit, interface, DRAM and one Individual or multiple NVM, wherein, be stored with FTL tables in DRAM, interface is used to exchange data with control unit, control unit in response to Distribution order is received, the ranges of logical addresses of distribution order instruction is gone according to going distribution order to obtain, and updates FTL tables, will Go the list item of FTL tables corresponding to the ranges of logical addresses of distribution order instruction to be set to the first designated value, and indicate to go distribution to order Perform completion.
The sixth aspect of the present invention provides a kind of computer program, when being loaded into storage device and in the control of storage device When being performed on part, the computer program code that computer program includes makes control unit perform first aspect or first aspect The first go the method that distribution orders to the processing described in one of the 13rd kind of possible implementation.
The 7th aspect of the application provides one kind and goes distribution method, and this goes distribution method to include:Step S1, basis goes to distribute Order obtains the ranges of logical addresses for going distribution order instruction;Step S2, FTL tables are updated, the logic of distribution order instruction will be gone The list item of FTL tables is set to preset value corresponding to address realm, wherein, the list items of FTL tables be used to indicating logical address with physically The corresponding relation of location;Step S3, in response to the renewal of FTL tables, effective page table is updated, effective page table is used for record storage equipment The state for the data that Physical Page is stored;Step S4, in response to the renewal of effective page table, active page count table is updated, wherein, have Effect page count table is used for the quantity for recording the Physical Page in effective status in physical block, bulk or physical block group.
With reference to the seventh aspect of the present invention, in the first possible implementation, distribution method is gone also to include:Step S5, the renewal in response to active page count table, the priority of more new physical block, bulk or physical block group, the priority are to thing Manage the priority of block, bulk or physical block group when performing garbage collection operation;Step S6, the physical block to highest priority, Bulk or physical block group perform garbage collection operation.
It is possible at second with reference to the seventh aspect of the present invention or the first possible implementation of the 7th aspect In implementation, step S2 includes:Multiple list items of renewal FTL tables every time.
With reference to second of possible implementation of the seventh aspect of the present invention, in the third possible implementation, During multiple list items of a CPU renewal FTL table, other CPU are prevented to access the list item for the FTL tables being updated, or, Other CPU are made not access the list item for the FTL tables being updated.
With reference to the third possible implementation of the seventh aspect of the present invention, in the 4th kind of possible implementation, The list item of the continuous multiple FTL tables of renewal memory space every time, and in the continuous multiple FTL of a CPU renewals memory space During the list item of table, other CPU are prevented to access the list item for the FTL tables being updated, or, other CPU is not accessed just In the list item for the FTL tables being updated.
With reference to one of the first of the seventh aspect of the present invention or the 7th aspect to the 4th kind of possible implementation, In 5th kind of possible implementation, in step S2, the memory headroom of the list item of multiple FTL tables is stored using dma operation renewal.
With reference to one of the first of the seventh aspect of the present invention or the 7th aspect to the 5th kind of possible implementation, In 6th kind of possible implementation, in step S2, preset value 0.
With reference to one of the first of the seventh aspect of the present invention or the 7th aspect to the 6th kind of possible implementation, In 7th kind of possible implementation, in step S2, logical address is the address of logical page (LPAGE), and physical address is the ground of Physical Page Location.
With reference to the 7th kind of possible implementation of the seventh aspect of the present invention, in the 8th kind of possible implementation, If memory space corresponding to logical page (LPAGE) is identical with the memory space of Physical Page, in effective page table, each bit is used to indicate one The validity of individual Physical Page.
With reference to the 7th kind of possible implementation of the seventh aspect of the present invention, in the 9th kind of possible implementation, If the memory space of Physical Page can accommodate multiple logical page (LPAGE)s, it is relative with logical address to be used for instruction for each bit in effective page table The validity for the physical storage areas answered.
With reference to one of the first of the seventh aspect of the present invention or the 7th aspect to the 9th kind of possible implementation, In tenth kind of possible implementation, in step S4, active page count table is array, linear list or chained list.
With reference to the seventh aspect of the present invention the first one of to the tenth kind of possible implementation, the tenth it is a kind of may Implementation in, in step S6, physical block that effective number of pages is 0, bulk or physical block that physical block group is highest priority, Bulk or physical block group.
One of with reference to the first of the seventh aspect of the present invention or the 7th aspect to a kind of the tenth possible implementation, In the 12nd kind of possible implementation, distribution method is gone also to include:Upon step s 2, distribution is gone to order to main frame feedback Processing is completed;Or after step s4, go to distribute command process completion to main frame feedback.
With reference to one of the first of the seventh aspect of the present invention or the 7th aspect to the 12nd kind of possible implementation, In the 13rd kind of possible implementation, distribution method is gone also to include:Between step S1 and step S2, distribution will be gone to order The list item of FTL tables corresponding to the ranges of logical addresses of instruction locks;Between step S2 and step S3, distribution order instruction will be gone Ranges of logical addresses corresponding to FTL tables list item unblock.
With reference to one of the first of the seventh aspect of the present invention or the 7th aspect to the 13rd kind of possible implementation, In the 14th kind of possible implementation, distribution method is gone also to include:Between step S1 and step S2, allocation table will be removed List item is reset, wherein, go the list item of allocation table to be used to store the information whether each logical address is allocated.
With reference to the 14th kind of possible implementation of the seventh aspect of the present invention, in the 15th kind of possible implementation In, go distribution method also to include:After allocation table will be gone to reset, go to distribute command process completion to main frame feedback.
, can at the 16th kind with reference to the 14th kind or the 15th kind of possible implementation of the seventh aspect of the present invention In the implementation of energy, distribution method is gone also to include:By dma operation to going allocation table to be updated.
The eighth aspect of the present invention provides a kind of method for handling read command, and this method includes:In response to receiving read command, Whether it is allocated by the logical address for going allocation table to judge that the read command is read, wherein, if the logical address read It is unassigned, inform that read logical address is invalid, illegal or go to distribute in one or more to main frame with status information State.
With reference to the eighth aspect of the present invention, in the first possible implementation, handling the method for read command also includes: The driver of main frame is supplied to the reading result for the application for reading the logical address based on the status information being apprised of, generation Or data.
The ninth aspect of the present invention provides a kind of method for handling write order, and this method includes:In response to receiving write order, For write order allocated physical address, FTL tables, valid data cell list, valid data unit are updated with the physical address distributed Count table and remove allocation table.
With reference to the ninth aspect of the present invention, in the first possible implementation, handling the method for write order also includes: In response to receiving write order, after the completion of FTL tables are updated, data are write to physical address, and handle to main frame feedback write order Complete.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, embodiment will be described below In the required accompanying drawing used be briefly described, it should be apparent that, drawings in the following description be only the present invention some Embodiment, for those of ordinary skill in the art, on the premise of not paying creative work, can also be attached according to these Figure obtains other accompanying drawings.
Fig. 1 is the block diagram of storage device;
Fig. 2 is the schematic diagram of the FTL tables that processing is gone before distribution order in the embodiment of the present invention two;
Fig. 3 is the schematic diagram for effective page table that the processing in the embodiment of the present invention two is gone before distribution order;
Fig. 4 is the schematic diagram for the active page count table that the processing in the embodiment of the present invention two is gone before distribution order;
Fig. 5 is the flow chart for the method that distribution order is gone in the processing in the embodiment of the present invention two;
Fig. 6 is the schematic diagram of the FTL tables that processing is gone after distribution order in the embodiment of the present invention two;
Fig. 7 is the schematic diagram for effective page table that the processing in the embodiment of the present invention two is gone after distribution order;
Fig. 8 is the schematic diagram for the active page count table that the processing in the embodiment of the present invention two is gone after distribution order;
Fig. 9 is the flow chart that read command is handled in the embodiment of the present invention two;
Figure 10 is the schematic diagram for removing allocation table that processing is gone before distribution order in the embodiment of the present invention three;
Figure 11 is the schematic diagram for removing allocation table that processing is gone after distribution order in the embodiment of the present invention three;
Figure 12 A are the flow chart of the method that distribution order is gone in processing in the embodiment of the present invention three;
Figure 12 B are the flow chart for the method that read command is responded in the embodiment of the present invention three;
Figure 12 C are the flow chart for the method that write order is responded in the embodiment of the present invention three;
Figure 13 is the schematic diagram of bulk in the embodiment of the present invention four;
Figure 14 is the schematic diagram of the FTL tables that processing is gone before distribution order in the embodiment of the present invention four;
Figure 15 is the schematic diagram for effective page table that the processing in the embodiment of the present invention four is gone before distribution order;
Figure 16 is the schematic diagram for the active page count table that the processing in the embodiment of the present invention four is gone before distribution order;
Figure 17 is the flow chart for the method that distribution order is gone in the processing in the embodiment of the present invention four;
Figure 18 is the schematic diagram of the FTL tables that processing is gone after distribution order in the embodiment of the present invention four;
Figure 19 is the schematic diagram for effective page table that the processing in the embodiment of the present invention four is gone after distribution order;
Figure 20 is the schematic diagram for the active page count table that the processing in the embodiment of the present invention four is gone after distribution order;
Figure 21 is the flow chart of the method that distribution order is gone in processing in the embodiment of the present invention five.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is part of the embodiment of the present invention, rather than whole embodiments.Based on this hair Embodiment in bright, the every other implementation that those of ordinary skill in the art are obtained under the premise of creative work is not made Example, belongs to the scope of protection of the invention.
Embodiment one
The table structure for storing the map information from logical address to physical address is referred to as FTL tables.FTL tables are that solid-state is deposited Store up the important metadata in equipment.FTL tables have recorded the address mapping relation in units of data page in storage device.FTL tables List item (or entry) including multiple FTL tables.In one example, it have recorded a logical page (LPAGE) in the list item of each FTL tables Address and the corresponding relation of a Physical Page.In another example, continuously multiple patrol is have recorded in the list item of each FTL tables Collect the corresponding relation of page address and continuous multiple Physical Page.In yet another embodiment, have recorded in the list item of each FTL tables The corresponding relation of logical block address and physical block address.In still another example, logical block address and thing are recorded in FTL tables Manage the mapping relations of block address, and/or the mapping relations of logical page address and physical page address.
In going distribution to order, ranges of logical addresses is described.After distribution order is performed, there can be different effects Fruit.For example, (1) is performed after going distribution to order, when reading the ranges of logical addresses for going distribution order indicated, resulting is (perform other write operations to the ranges of logical addresses before) determined;(2) perform after going distribution to order, gone point in reading During with the indicated ranges of logical addresses of order, resulting result is that full 0 (performs other write-ins to the ranges of logical addresses Before operation);(3) perform after going distribution to order, it is resulting when reading the ranges of logical addresses for going distribution order indicated As a result can be arbitrary value (perform other write operations to the ranges of logical addresses before).Go distribution order or other The implementation effect for going distribution to order is can be set or selected in order.By using going distribution to order, main frame is it is possible to notify that solid-state is hard Which logical address space of disk no longer stores valid data, so as to which solid state hard disc is when reclaiming memory space, it is not necessary to move The data of failure.
In solid state hard disc, there is the method that a variety of execution go distribution to order.Batch operation is gone to perform, by FTL tables, by The FTL list items indicated by the described ranges of logical addresses of distribution order are gone to be arranged to special marking (for example, 0).For example, going point Ranges of logical addresses with order instruction includes 0-7 and 100-103.Going distribution to order to perform this, being patrolled have recorded in FTL tables The curriculum offering for collecting address 0-7 and 100-103 entry is 0.So as to next read logical address LBA 0-7 or LBA During one or more of 100-103, physical address corresponding to these logical addresses is inquired in FTL tables and is 0 (implication is special Different mark), so as to which the result (for example, full 0) of the specified effect to meet distribution order is used as the response to read command.Can be with Understand, go distribution order indicated ranges of logical addresses to have different unit-sizeds from the list item of FTL tables. For example, go in distribution order, the memory space of corresponding 512 bytes of a logical address, and in FTL tables, a list item is corresponding 4KB (kilobytes) memory space.
In an embodiment according to the present invention, erasing or rubbish are performed in units of physical block, bulk either physical block group Rubbish reclaimer operation, hereafter to execution erasing or garbage collection operation in units of physical block, and performed in units of bulk Erasing or the corresponding processing of garbage collection operation go the method for distribution order to be described in detail, in units of physical block group The method that the processing that execution is wiped or garbage collection operation is corresponding goes distribution to order is referred to the acquisition of the two content, Wen Zhong No longer repeated.
Embodiment two
In the present embodiment, erasing or garbage collection operation are performed in storage device in units of physical block.In this implementation In example, the corresponding relation of a logical page address and a Physical Page is have recorded in the list item of each FTL tables.In solid state hard disc In, safeguard FTL tables, effective page table and active page count table.Wherein, Fig. 2 is that the processing in the present embodiment is gone before distributing order FTL tables schematic diagram, FTL tables instruction logical page address and physical page address corresponding relation.Fig. 3 is the place in the present embodiment The schematic diagram for effective page table that reason is gone before distribution order (only shows the effective of the physical block related to the FTL tables in Fig. 2 in Fig. 3 Page table), active page token record corresponds to the state of the data corresponding to logical page (LPAGE) stored in physical block.Fig. 4 is in the present embodiment Processing go distribution order before active page count table schematic diagram, have recorded in active page count table and locate in each physical block In the quantity of the Physical Page of effective status.It should be noted that the effective ratio marked in effective page table shown in Fig. 3 by horizontal line Spy indicate the logical address LBA0-LBA7 shown in Fig. 2 corresponding to Physical Page, do not mark horizontal line other significant bits instruction Physical Page corresponding to other logical addresses, and the Physical Page corresponding to inactive bit is not cited in any logical address. In the example in figure 3, the validity of each Physical Page of physical block is indicated by the use of bitmap as data structure, it will be appreciated that Various other data structures can be used.
Referring to Fig. 2, by taking physical block 1 as an example, its physical address is " storing logical address in PBA 1-4 " Physical Page is " LBA 0 " data, thus in effective page table of the physical block 1 shown in Fig. 3, physical address is " PBA 1-4 " Physical Page State for effectively (in Fig. 3, the 2nd row the 1st row position with " 1 " indicate).And the physical address of the physical block 1 shown in Fig. 2 For " PBA 1-0 " Physical Page not cited in any logical address, thus in effective page table of the physical block 1 shown in Fig. 3 In, physical address is " state of PBA 1-0 " Physical Page (in Fig. 3, is referred to be invalid in the position of the 1st row the 1st row with " 0 " Show).Other are similar, no longer describe one by one herein.Correspondingly, it is current in the active page count table instruction physical block 0 in Fig. 4 There are 5 Physical Page effective, currently there are 9 Physical Page effective in physical block 1, currently there is that 0 Physical Page is effective in physical block 2, thing Currently there are 11 Physical Page effective in reason block 3.
In the present embodiment, can according to corresponding to logical page (LPAGE) the memory space of memory space and Physical Page relation, it is determined that In effective page table, each bit is used for the physical storage areas for indicating validity.
In one example, memory space corresponding to logical page (LPAGE) is identical with the memory space of Physical Page, then in effective page table In, with 1 bit come the state of a Physical Page corresponding to indicating, to reduce the occupancy to memory headroom.For example, in FTL tables Logical page (LPAGE) corresponds to 4KB memory spaces, and the memory space of Physical Page is also 4KB (in addition to additional outer memory space of band), In this case, effectively in page table, each bit indicates the state of a Physical Page.
In another example, the memory space of memory space corresponding to logical page (LPAGE) and Physical Page differs, such as physics The memory space of page can accommodate multiple logical page (LPAGE)s, and logical page (LPAGE) corresponds to 4KB memory space, and the memory space of Physical Page can hold Receive multiple logical page (LPAGE)s (such as 4), in the case, in effective page table, each bit instruction is the same as the corresponding thing of logical address Manage the validity of storage region.For example, if physical block 1 includes 512 Physical Page, then effective page table of physical block 1 includes 2048 bits.Similarly, the logical address in physical block in the currently stored table by FTL is recorded in active page count table to draw The quantity of 4KB memory spaces.For example, if physical block 1 includes 512 16KB size Physical Page, and there are 9 in FTL tables Physical address corresponding to LBA belongs to physical block 1, then the active page of physical block 1 is counted as 9.
Fig. 5 is the flow chart for the method that distribution order is gone in the processing that the present embodiment provides, as shown in figure 5, the present embodiment carries The method that the processing of confession goes distribution to order includes:In response to receive distribution order, obtain go distribution order instruction (one or It is multiple) ranges of logical addresses (for example, LBA0-LBA3).
The list item (referring also to Fig. 2) of FTL tables corresponding to (one or more) logical address (for example, LBA0-LBA3) is added Lock, to avoid garbage reclamation (GC, Garbage Collection) or other tasks from accessing these list items of FTL tables simultaneously, Avoid causing mistake.Certainly, locking is not required in that, accesses the same list item of FTL tables simultaneously if there is no multiple tasks Possibility, even if not locking then, will not also cause mistake.
The list items of FTL tables corresponding to (one or more) logical address (for example, LBA0-LBA3) is reset, or by FTL The list item of table is arranged to designated value.Now, zero or other designated values as physical address, instruction is read the physical address and will obtained To perform the value for going distribution order specified (for example, the value of full 0 or be all the value of designated value).
As a kind of optional mode, when (one or more) ranges of logical addresses for going distribution order instruction is LBA0- During LBA3, after the clearing of FTL table list items to being associated with logical address LBA0-LBA3 is completed, you can gone point to main frame feedback Completed with command process.
The list item of the FTL tables of locking is unlocked, so as to allow other tasks to access these list items of FTL tables.
As another optional mode, according to the renewal of the list item of FTL tables, corresponding renewal is the same as the FTL tables being updated Effective page table of physical block corresponding to the physical address of list item.For example, after Fig. 6 goes distribution to order for the processing in the present embodiment The schematic diagram of FTL tables.And Fig. 2 shows the FTL tables that processing is gone before distribution order.Referring to Fig. 6, in response to LBA0-LBA3 pairs The list item for the FTL tables answered is cleared, and physical address PBA 1-4, PBA 3-6, PBA 1-9 and PBA 1-10 no longer store significant figure According to.Fig. 7 is the schematic diagram for effective page table that the processing in the present embodiment is gone after distribution order.And Fig. 3 shows processing and gone point With effective page table before order.Correspondingly, as shown in fig. 7, in effective page table of physical block 1, the address of physical block 1 is PBA1- 4th, PBA1-9 is changed into invalid (for example, corresponding bit is arranged to 0) with PBA1-10 Physical Page, and the active page of physical block 3 In table, the Physical Page that the address of physical block 3 is PBA3-6 is changed into invalid.
It is corresponding to update active page count table because the active page in physical block changes.For example, Fig. 8 is the present embodiment In processing go distribution order after active page count table schematic diagram.And Fig. 4 goes distribution to order for the processing in the present embodiment The schematic diagram of preceding active page count table.As shown in figure 8, it is cleared in response to the list item of FTL tables corresponding to LBA0-LBA3, thing The active page of reason block 1, which is counted from 9, is changed into 6, and the active page of physical block 3 counts from 11 and is changed into 10.Active page, which counts, can be used for referring to Show the priority of garbage collection operation.For example, when performing garbage collection operation, priority reclamation active page counts low physics Block.Further, 0 physical block is counted as to active page, erasing operation can be immediately performed to reclaim memory space.As another Individual example, in response to the renewal to active page count table, also update being returned for rubbish for the physical block that effective number of pages is updated The priority of receipts.So as to when performing garbage collection operation, select to be recovered according to the garbage reclamation priority of physical block Physical block.Wherein, the fewer physical block of effective number of pages, garbage reclamation priority is higher, is more first recovered.It is effective to safeguard Page count table, active page count table can be the plurality of data structures such as array, linear list, chained list.Alternatively, counted in active page After the completion of table renewal, go to distribute command process completion to main frame feedback.
After the completion of the method that distribution is ordered is gone using above-mentioned processing to going to distribute command process, to going, distribution order is signified Before the ranges of logical addresses write-in data shown, as shown in figure 9, in response to receiving read command, what inquiry FTL table acquisitions to be read patrols Physical address corresponding to address is collected, if physical address is zero, the response to read command is used as using full 0.Now, answered when main frame is read During with the address for going distribution order, predetermined result, e.g. full 0 will be obtained.Certainly, it is also possible to which other modes refer to main frame Show that read logical address is gone to distribute, for example, not providing the data read to main frame, and informed with status information to main frame The logical address that is read is invalid, illegal or go distribution state in one or more.Further, the driver base of main frame In the status information that storage device is informed, generation is supplied to the reading result or data for the application for reading these addresses.
In the method that above-mentioned processing goes distribution to order, if going to distribute order when indicating substantial amounts of ranges of logical addresses (for example, LBA 10000-LBA 20000), the clearing to multiple FTL tables list items are time-consuming, therefore, can pass through a variety of sides Formula accelerates the renewal operation to FTL table list items.For example, multiple FTL tables list items are updated every time, and it is multiple in 1 CPU renewal During FTL table list items, other CPU are prevented to access the FTL table list items being updated, or from other CPU is not attempted access and be updated FTL table list items.As another example, the memory headrooms of multiple FTL tables list items is stored to update using dma operation.According to In another right example, the continuous FTL tables list item of memory space is updated every time, and in the renewal continuous FTL tables of memory space During list item, the operation of other access FTL table list items is prevented, to reduce the random access to internal memory, to accelerate to FTL table list items Renewal operation.
Exemplarily, the FTL tables in the present embodiment, effective page table and active page count table are storable in DRAM.
Embodiment three
In embodiment three, go distribution to order for efficient process, also safeguard and remove allocation table.Further, allocation table will also be removed NVM is write, can be by removing the correct FTL tables of information acquisition of assignment table record so as to when being restarted after powered-off fault.
Figure 10 and Figure 11 is the schematic diagram of allocation table, wherein, Figure 10 is that processing goes distribution to order in the embodiment of the present invention The preceding schematic diagram for removing allocation table;Figure 11 is the schematic diagram for removing allocation table that processing is gone after distribution order in the embodiment of the present invention. As shown in Figure 10 and Figure 11, go in allocation table, the information whether each logical address that storage corresponds in FTL tables is allocated. As an example, the memory space of 1 bit is provided in allocation table is removed for each logical address of FTL tables.
As shown in figure 11, when logical address is allocated, (logical address has effectively physically i.e. in FTL tables Location), in allocation table is removed, by the logical address labeled as " allocated " (for example, corresponding 1 bit storage space is arranged to 0);When logical address is unassigned or has applied distribution order, the logical address is labeled in allocation table is removed For " going to distribute " (for example, corresponding 1 bit storage space is arranged into 1).
Exemplarily, allocation table is removed shown in corresponding Figure 10 of FTL tables before going distribution to order with the processing shown in Fig. 2 In, logical address LBA 0-LBA 7 are assigned effective physical address in FTL tables, thus are gone point as shown in Figure 10 With in table, LBA 0-LBA 7 are marked as " being allocated " (corresponding 1 bit storage space is disposed as 0).In response to receiving Go distribution to order, during distribution order is gone in the ranges of logical addresses execution to LBA0-LBA3, as shown in figure 11, go to distribute LBA0-LBA 3 is marked as " going to distribute " (corresponding 1 bit storage space is disposed as 1) in table, and goes in allocation table LBA4-LBA 7 is still marked as " being allocated " (corresponding 1 bit storage space is disposed as 0).At place as shown in Figure 6 Reason is gone in the FTL tables after distribution order, and the physical address of counterlogic address LBA 0-LBA3 list item is arranged to 0.Therewith Accordingly, effective page table and active page count table are correspondingly changed.Reference picture 3 and Fig. 7 understand that physical block 0 has with physical block 1 Effect page table have also been made corresponding renewal, and similarly, reference picture 4 and Fig. 8 understand that active page count table have also been made corresponding renewal.
Exemplarily, allocation table is gone to be stored in DRAM in the present embodiment.Alternatively, DRAM is updated by dma operation In remove allocation table.
Figure 12 A are the flow chart of the method that distribution order is gone in processing in the embodiment of the present invention three.Distributed in response to receiving Order obtains the ranges of logical addresses (referring in Figure 12 A 1212) for going distribution order indicated, example (referring in Figure 12 A 1210) Such as, LBA0-LBA 3 ranges of logical addresses is performed and goes to distribute.Ranges of logical addresses according to indicated by going distribution order, Allocation table (referring to Figure 10 and Figure 11) list item (referring in Figure 12 A 1214) is removed in renewal, such as will remove allocation table shown in Figure 11 In list item corresponding with logical address LBA0-LBA3 be labeled as " going to distribute " (there is 1 value).After it have updated allocation table, i.e., It can indicate to go distribution order to perform completion to main frame.So as to which the execution speed in embodiment three, going distribution to order has obtained pole Big lifting.
Next, foundation goes the indicated ranges of logical addresses of distribution order, the list item of FTL tables is updated, for example, will go to divide Reset with FTL list items corresponding to the indicated one or more logical addresses of order, or be arranged to designated value (referring in Figure 12 A 1218).Alternatively, before FTL tables are updated, also the list item of FTL tables corresponding to the one or more logical addresses to be updated is added Lock is (referring in Figure 12 A 1216), so as to which during avoiding FTL list items from being updated, other tasks read these FTL list items.And After updating FTL tables, also the list item of FTL tables corresponding to one or more logical addresses for being updated is unlocked (referring in Figure 12 A 1220)。
Correspondingly, also renewal (is joined with effective page table of physical block corresponding to the physical address of the list item for the FTL tables being updated See in Fig. 7 and Figure 12 A 1222) with active page count table (referring in Fig. 8 and Figure 12 A 1224).
Figure 12 B are the flow chart for the method that read command is responded in the embodiment of the present invention three.In embodiment three, referring to figure 12A, after the completion of going allocation table to update, i.e., inform that distribution order performs completion to main frame.This aft engine reads and is gone to distribute Logical address when, the specified instruction of such as full 0 should be received.In Figure 12 B, in response to receiving read command (referring in Figure 12 B 1230), allocation table (referring to Figure 11) is removed in inquiry, judges whether the logical address that read command is read is gone distribution (referring to Figure 12 B In 1232).If going allocation table to indicate that read logical address is in goes distribution state, with full 0 or other fingers specified It is shown as the response to read command (referring in Figure 12 B 1234).Only when area's allocation table indicate read logical address by During distribution, just inquire about FTL tables and obtain physical address (referring in Figure 12 B 1236) corresponding to the logical address to be read, and from obtaining The physical address obtained reads data as the response to read command (referring in Figure 12 B 1238).
Alternatively, the delay for going allocation table will read operation increased is inquired about, the reading for accessing allocated logical address Order, it is no positive effect that allocation table is removed in inquiry.Therefore, also record solid storage device is carrying out distribution order State.In response to receiving distribution order (referring in Figure 12 A 1210), labelling storage is carrying out distribution order. If in this case, receiving read command, allocation table is removed in inquiry first (referring in Figure 12 B 1232).And performed when going distribution to order After the completion of, such as after the completion of the step 1218 shown in Figure 12 A or step 1220 perform, labelling storage has been completed to going Distribute the execution of order.In the case, if receiving read command, step 1232 in Figure 12 B need not be performed, and directly performs figure Step 1236 in 12B.
Figure 12 C are the flow chart for the method that write order is responded in the embodiment of the present invention three.For being not written into consolidating for data State storage device, it goes in allocation table to indicate that all logical addresses are in distribution state.Write in response to logical address Enter data, go allocation table list item corresponding with the logical address for being written into data to be modified to the state of having distributed.And in response to holding Row goes distribution to order, and is gone list item of the logical address of distribution in allocation table is removed to be revised as distribution state again.Referring to Figure 12 C, it is write order allocated physical address when receiving write order (referring in Figure 12 C 1240), and with patrolling indicated by write order Collect address and the physical address renewal FTL tables of distribution (referring in Figure 12 C 1242).Data are write to allocated physical address, And completed to main frame feedback write order processing (referring in Figure 12 C 1244).Alternatively, to reduce write order processing delay, in step After rapid 1242, before physical address is write data into, i.e., completed to main frame feedback write order processing.Also update effective page table With active page count table (referring in Figure 12 C 1246), the response to be written into data as physical block.Also allocation table is removed in renewal, The logical address being written into is arranged to distribute (referring in Figure 12 C 1248) in the list item in removing allocation table.In Figure 12 C, step Rapid 1244, the order of step 1246 and step 1248 can adjust, and can also in parallel or concurrently be performed.Preferably, step 1244th, step 1246 occurs after step 1242 with step 1248.
Example IV
In the present embodiment, erasing or garbage collection operation are performed in storage device in units of bulk.Figure 13 is big The schematic diagram of block, as an example, as shown in figure 13, bulk is constructed on every 16 logic units (LUN).Each bulk includes 16 Individual physical block, each from 16 logic units (LUN).In Figure 13 example, bulk 0 includes coming from 16 logic lists Each physical block 0 of first (LUN), bulk 1 include the physical block 1 from each logic unit (LUN).
In the present embodiment, a logical address and the physics list in a bulk are have recorded in the list item of each FTL tables The corresponding relation of member.Exemplarily, in FTL tables, each logical address corresponds to 4KB memory space, and each thing in NVM Reason page includes 4 physical locations, (alternatively, in addition to such as school each physical location accommodates the data of 1 logical address of correspondence Test the out of band data of data).Figure 14 is the schematic diagram for the FTL tables that the processing in the present embodiment is gone before distribution order, referring to Figure 14, The physical location that the address of the PBA0-4 instruction bulks 0 recorded in FTL tables is 4, PBA 1-6 indicate that the address of bulk 1 is 6 thing Unit is managed, the PBA0-9 recorded in FTL tables indicates that the address of bulk 0 is 9 physical location, and the ground of PBA0-15 instruction bulks 0 Location is 15 physical location.It is of course also possible to there are various other modes to construct bulk, no longer repeated one by one herein.
As a kind of optional mode, page band, each interior same physical address of logic unit (LUN) are constructed in bulk Physical Page constitute " page band ".As shown in figure 13, Physical Page 0-0, Physical Page 0-1 ... and Physical Page 0-x constitute page Band 0.Wherein Physical Page 0-0, Physical Page 0-1 ... Physical Page 0-14 are used to store user data, and Physical Page 0-15 is used for Store the verification data being calculated according to all customer data in band.Certainly, for storing the Physical Page of verification data Can be located at page band in optional position, the above simply illustrate and it is non-limiting.Similarly, Tu13Zhong, Physical Page 2-0, physics Page 2-1 ... and Physical Page 2-x constitutes page band 2.
In the present embodiment, effective page table is provided for each bulk, is patrolled for recording corresponding to of being stored in corresponding bulk Collect the state of the data (data cell) of address.Figure 15 be the present embodiment in processing go distribution order before effective page table, it is necessary to Illustrate, Tu15Zhong, the significant bit marked in effective page table by horizontal line indicates logical address in Figure 14 FTL tables Physical location corresponding to LBA0-LBA7, other significant bits for not marking horizontal line indicate physics corresponding to other logical addresses Unit, and the physical location corresponding to inactive bit is not cited in any logical address.
Referring to Figure 15, by taking bulk 0 as an example, its physical address is " to store logical address in PBA 0-4 " physical location For " LBA 0 " data, thus in effective page table of bulk 0, address is " state of PBA 0-4 " physical location is effective (in Figure 15, " 1 " arranged by the 2nd row the 1st of effective page table (bulk 0) indicates).And the address of the bulk 0 shown in Figure 15 is " PBA 0-0 " physical location is not cited in any logical address, thus in effective page table of bulk 0, address is " PBA0-0 " Physical location state for it is invalid (in Figure 15, by effective page table (bulk 0) the 1st row the 1st arrange " 0 " indicate).Other classes Seemingly, no longer describe one by one herein.Alternatively, in effective page table, the shape of a corresponding physical location is indicated with 1 bit State, to reduce the occupancy to memory headroom.
Figure 16 is the active page count table that processing is gone before distribution order in the present embodiment, be have recorded in active page count table The quantity of physical location in effective status in each bulk.Correspondingly, as shown in figure 16, currently there are 9 in bulk 0 Physical location is effective, currently has 11 physical locations effective in bulk 1, has 0 physical location effective in bulk 2, has in bulk 3 11 physical locations are effective.
Figure 17 is the flow chart for the method that distribution order is gone in the processing that the present embodiment provides, as shown in figure 17, the present embodiment The method that the processing of offer goes distribution to order includes:In response to receiving distribution order (referring in Figure 17 1710), acquisition is gone point (one or more) ranges of logical addresses (for example, LBA0-LBA3) with order instruction (referring in Figure 17 1720).
The list item (referring to Figure 14) of FTL tables corresponding to (one or more) logical address (for example, LBA0-LBA3) is locked (referring in Figure 17 1730), to avoid garbage reclamation (GC, Garbage Collection) or other tasks from accessing FTL simultaneously These list items of table, avoid causing mistake.Certainly, locking is not required in that, FTL is accessed simultaneously if there is no multiple tasks The possibility of the same list item of table, even if not locking then, it will not also cause mistake.
The list items of FTL tables corresponding to (one or more) logical address (for example, LBA0-LBA3) is reset, or by FTL The list item of table is arranged to designated value (referring in Figure 17 1740).Now, zero or other designated values as physical address, instruction is read The physical address will be got to perform the value for going distribution order specified (for example, the value of full 0 or be all the value of designated value).
As a kind of optional mode, when (one or more) ranges of logical addresses for going distribution order instruction is LBA0- During LBA3, after the clearing of FTL table list items to being associated with logical address LBA0-LBA3 is completed, you can gone point to main frame feedback Completed with command process.
The list items of the FTL tables of locking is unlocked (referring in Figure 17 1750), so as to allow other tasks access FTL tables this A little list items.
As another optional mode, according to the renewal of the list item of FTL tables, corresponding renewal is the same as the FTL tables being updated Effective page table of bulk corresponding to the physical address of list item (referring in Figure 17 1760).For example, Figure 18 is the place in the present embodiment The schematic diagram for the FTL tables that reason is gone after distribution order.And Figure 14 is showing for the FTL tables that the processing in the present embodiment is gone before distribution order It is intended to.Referring to Figure 18, be cleared in response to the list item of FTL tables corresponding to LBA0-LBA3, physical address PBA0-4, PBA 1-6, PBA 0-9 and PBA 0-10 no longer store valid data.Correspondingly, Figure 19 is that the processing in the present embodiment is gone after distributing order The schematic diagram of effective page table.And Figure 15 is the schematic diagram for effective page table that the processing in the present embodiment is gone before distribution order.Such as figure Shown in 19, in effective page table of bulk 0, the physical address of bulk 0 becomes for PBA 0-4, PBA0-9 and PBA0-10 physical location For invalid (for example, corresponding bit is arranged to 0), and in effective page table of bulk 1, the address of bulk 1 is PBA1-6 thing Reason unit is changed into invalid.
Because effective physical location in bulk changes, the corresponding active page count table that updates is (referring in Figure 17 1770).For example, be cleared in response to the list item of FTL tables corresponding to LBA0-LBA3, Figure 20 is that the processing in the present embodiment is gone point Schematic diagram with the active page count table after order.And Figure 16 is the active page meter that the processing in the present embodiment is gone before distribution order The schematic diagram of number table.As shown in figure 20, the active page of bulk 0, which is counted from 9, is changed into 6, and the active page of bulk 1 is counted and is changed into from 11 10.Active page counts the priority that may be used to indicate garbage collection operation.For example, when performing garbage collection operation, it is preferential to return Receive active page and count low bulk.Further, 0 bulk is counted as to active page, erasing operation can be immediately performed to reclaim Memory space.As another example, in response to the renewal to active page count table, also update effective number of pages be updated it is big The priority (referring in Figure 17 1780) for garbage reclamation of block, so that when performing garbage collection operation, according to bulk Garbage reclamation priority selects the bulk to be recovered.Wherein, the fewer bulk of effective number of pages, garbage reclamation priority are got over Height, more first it is recovered.To safeguard active page count table, active page count table can be a variety of data such as array, linear list, chained list Structure.Alternatively, after the completion of the renewal of active page count table, go to distribute command process completion to main frame feedback.
The method that distribution is ordered is being gone to going distribution command process complete using according to embodiments of the present invention four processing provided Cheng Hou, to before going the indicated ranges of logical addresses write-in data of distribution order, in response to receiving read command, inquiry FTL tables obtain Physical address corresponding to the logical address that must be read, if physical address is zero, the response to read command is used as using full 0.Now, When main frame reading process goes distribution to order during corresponding address, predetermined result, e.g. full 0 will be obtained.Certainly, it is also possible to Other modes indicate that read logical address is gone to distribute to main frame, for example, the data read are not provided to main frame, and with shape State information informs that read logical address is invalid, illegal or go distribution state in one or more to main frame.Further, The status information that the driver of main frame is informed based on storage device, generation are supplied to the reading knot for the application for reading these addresses Fruit or data.
In the method that the processing that according to embodiments of the present invention four provide goes distribution to order, if going distribution order to indicate greatly During the ranges of logical addresses of amount (for example, LBA 10000-LBA 20000), the clearing to multiple FTL tables list items is time-consuming.Can Operated with the renewal accelerated in several ways to FTL table list items.For example, multiple FTL tables list items are updated every time, and at 1 During CPU updates multiple FTL tables list items, other CPU are prevented to access the FTL table list items being updated, or from other CPU is not attempted Access the FTL table list items being updated.As another example, the internal memories of multiple FTL tables list items is stored to update using dma operation Space.In still another example, the list item of the continuous FTL tables of memory space is updated every time, and in renewal memory space During continuous FTL table list items, the operation of other access FTL table list items is prevented, to reduce the random access to internal memory, to accelerate Renewal operation to FTL table list items.
Exemplarily, the FTL tables in the present embodiment, effective page table and active page count table are storable in DRAM.
Embodiment five
In embodiment three, go distribution to order for efficient process, also safeguard and remove allocation table.Further, allocation table will also be removed NVM is write, can be by removing the correct FTL tables of information acquisition of assignment table record so as to when being restarted after powered-off fault.
In embodiment five, allocation table is removed using shown in Figure 10 and Figure 11.Go in allocation table, storage corresponds to FTL tables In the information that whether is allocated of each logical address.As an example, carried in allocation table is removed for each logical address of FTL tables For the memory space of 1 bit.
Figure 21 is the flow chart of the method that distribution order is gone in processing in the embodiment of the present invention five.In response to receiving distribution life Make (referring in Figure 21 2110), obtain (one or more) ranges of logical addresses for going distribution order indicated (referring in Figure 21 2112), go to distribute for example, to perform the-LBA 3 of LBA 0 ranges of logical addresses.Logic according to indicated by going distribution order Allocation table (referring to Figure 10 and Figure 11) list item (referring in Figure 21 2114) is removed in address realm, renewal, such as by shown in Figure 11 Go in allocation table to be labeled as " going to distribute " (there is 1 value) with 3 corresponding list items of logical address LBA 0-LBA.It has updated point After table, you can go distribution order to perform completion to main frame instruction.So as in embodiment five, go the execution speed that distribution is ordered Great lifting is obtained.
Next, foundation goes the indicated ranges of logical addresses of distribution order, the list item of FTL tables is updated, for example, will go to divide Reset with FTL list items corresponding to the indicated one or more logical addresses of order, or be arranged to designated value (referring in Figure 21 2118).Alternatively, before FTL tables are updated, also the list item of FTL tables corresponding to the one or more logical addresses to be updated is added Lock is (referring in Figure 21 2116), so as to which during avoiding FTL list items from being updated, other tasks read these FTL list items.And more After new FTL tables, also the list item of FTL tables corresponding to one or more logical addresses for being updated is unlocked (referring in Figure 21 2120)。
Correspondingly, also renewal (is joined with effective page table of bulk block corresponding to the physical address of the list item for the FTL tables being updated See in Fig. 7 and Figure 21 2122) with active page count table (referring in Fig. 8 and Figure 21 2124).
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, any Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all be contained Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (10)

1. a kind of handle the method for going distribution to order, it is characterised in that including:
The ranges of logical addresses for going distribution to order instruction is obtained according to distribution order is gone;
FTL tables are updated, the list item of FTL tables is set to the first designated value corresponding to the ranges of logical addresses that will go distribution order instruction;
Instruction goes distribution order to perform completion.
2. the method that distribution is ordered is gone in processing according to claim 1, it is characterised in that is also included:
Valid data cell list is updated, valid data cell list is used for the data of each physical data elements of record storage equipment State;
Valid data element count table is updated, wherein, valid data element count table is used to record physical block, bulk or physical block The quantity of physical data elements in effective status in group.
3. the method that distribution is ordered is gone in processing according to claim 2, it is characterised in that is also included:
According to valid data element count table, the first priority of more new physical block, bulk or physical block group, first priority For the priority for performing garbage collection operation;
Garbage collection operation is performed according to the first priority.
4. the method that distribution is ordered is gone in the processing according to Claims 2 or 3, it is characterised in that
After valid data cell list is updated, instruction goes to distribute command process completion;Or
After valid data element count table is updated, instruction goes to distribute command process completion.
5. the method that distribution is ordered is gone in the processing according to any one of Claims 1 to 4, in addition to:
In response to receiving read command, inquiry FTL tables obtain physical address corresponding to the logical address to be read, if physical address is The first designated value of distribution state is gone in instruction, and the response to read command is used as using the second designated value.
6. the method that distribution is ordered is gone in the processing according to any one of Claims 1 to 4, in addition to:
In response to receiving read command, inquiry FTL tables obtain physical address corresponding to the logical address to be read, if physical address is Indicate to go the first designated value of distribution state, inform that read logical address is invalid, illegal or place to main frame with status information Distribution state is gone in one or more.
A kind of 7. method for handling read command, it is characterised in that including:
In response to receiving read command, inquiry FTL tables obtain physical address corresponding to the logical address to be read, if physical address is The first designated value of distribution state is gone in instruction, and the response to read command is used as using the second designated value.
A kind of 8. method for handling read command, it is characterised in that including:
In response to receiving read command, inquiry FTL tables obtain physical address corresponding to the logical address to be read, if physical address is Indicate to go the first designated value of distribution state, inform that read logical address is invalid, illegal or place to main frame with status information Distribution state is gone in one or more.
A kind of 9. storage device, it is characterised in that including acquisition module, update module and indicating module, wherein, acquisition module is used According to the ranges of logical addresses for going distribution order acquisition to go distribution order instruction;Update module is used to update FTL tables, will go point The list item of FTL tables is set to the first designated value corresponding to ranges of logical addresses with order instruction;Indicating module is gone point for instruction Completion is performed with order.
A kind of 10. storage device, it is characterised in that including control unit, interface, DRAM and one or more NVM, wherein, FTL tables are stored with DRAM, interface is used to exchange data with control unit, and control unit is in response to receiving distribution order, root The ranges of logical addresses of distribution order instruction is gone according to going distribution order to obtain, and updates FTL tables, patrolling for distribution order instruction will be gone Collect the list item of FTL tables corresponding to address realm and be set to the first designated value, and indicate to go distribution order to perform completion.
CN201610804881.1A 2016-09-05 2016-09-05 Method for processing de-allocation command and storage device Active CN107797934B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201610804881.1A CN107797934B (en) 2016-09-05 2016-09-05 Method for processing de-allocation command and storage device
PCT/CN2017/100317 WO2018041258A1 (en) 2016-09-05 2017-09-04 Method for processing de-allocation command, and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610804881.1A CN107797934B (en) 2016-09-05 2016-09-05 Method for processing de-allocation command and storage device

Publications (2)

Publication Number Publication Date
CN107797934A true CN107797934A (en) 2018-03-13
CN107797934B CN107797934B (en) 2022-07-22

Family

ID=61530474

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610804881.1A Active CN107797934B (en) 2016-09-05 2016-09-05 Method for processing de-allocation command and storage device

Country Status (1)

Country Link
CN (1) CN107797934B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110580228A (en) * 2018-06-11 2019-12-17 北京忆恒创源科技有限公司 De-allocation command processing method and storage device thereof
CN110928807A (en) * 2018-09-20 2020-03-27 爱思开海力士有限公司 Apparatus and method for checking valid data in a memory system
CN110955613A (en) * 2018-09-26 2020-04-03 北京忆恒创源科技有限公司 Intelligent data streaming and flow tracking for storage devices
CN111125033A (en) * 2018-10-31 2020-05-08 深信服科技股份有限公司 Space recovery method and system based on full flash memory array
CN111290975A (en) * 2018-12-07 2020-06-16 北京忆恒创源科技有限公司 Method for processing read command and pre-read command by using unified cache and storage device thereof
EP3834091A4 (en) * 2018-08-10 2022-04-20 Micron Technology, Inc. Data validity tracking in a non-volatile memory
EP3985519A1 (en) * 2020-10-13 2022-04-20 Dynatrace LLC Method and system for estimating garbage collection suspension contributions of individual allocation sites

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096639A (en) * 2009-12-15 2011-06-15 英特尔公司 Method for trimming data on non-volatile flash media
CN102662606A (en) * 2012-03-12 2012-09-12 记忆科技(深圳)有限公司 Raid configuration information processing method and raid controller
EP2530612A1 (en) * 2011-06-03 2012-12-05 Apple Inc. Mount-time unmapping of unused logical addresses in non-volatile memory systems
CN103019971A (en) * 2012-11-25 2013-04-03 向志华 Method of quickly responding to trim command, SSD (Solid State Disk) controller and system
CN103116553A (en) * 2011-11-16 2013-05-22 联想(北京)有限公司 Data use control method, device and storage equipment
US20130132650A1 (en) * 2011-11-23 2013-05-23 Samsung Electronics Co., Ltd. Storage device based on a flash memory and user device including the same
US20130275660A1 (en) * 2012-04-12 2013-10-17 Violin Memory Inc. Managing trim operations in a flash memory system
US20130339575A1 (en) * 2012-06-13 2013-12-19 Silicon Motion, Inc. Data storage device and data trimming method
CN103927263A (en) * 2014-04-01 2014-07-16 华为技术有限公司 Garbage recycling method and garbage recycling device
US20140258675A1 (en) * 2013-03-08 2014-09-11 Kabushiki Kaisha Toshiba Memory controller and memory system
CN104272243A (en) * 2012-05-31 2015-01-07 桑迪士克科技股份有限公司 Method and host device for assessing execution of trim commands

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096639A (en) * 2009-12-15 2011-06-15 英特尔公司 Method for trimming data on non-volatile flash media
EP2530612A1 (en) * 2011-06-03 2012-12-05 Apple Inc. Mount-time unmapping of unused logical addresses in non-volatile memory systems
CN102855193A (en) * 2011-06-03 2013-01-02 苹果公司 Mount-time unmapping of unused logical addresses in non-volatile memory systems
CN103116553A (en) * 2011-11-16 2013-05-22 联想(北京)有限公司 Data use control method, device and storage equipment
US20130132650A1 (en) * 2011-11-23 2013-05-23 Samsung Electronics Co., Ltd. Storage device based on a flash memory and user device including the same
CN102662606A (en) * 2012-03-12 2012-09-12 记忆科技(深圳)有限公司 Raid configuration information processing method and raid controller
US20130275660A1 (en) * 2012-04-12 2013-10-17 Violin Memory Inc. Managing trim operations in a flash memory system
CN104272243A (en) * 2012-05-31 2015-01-07 桑迪士克科技股份有限公司 Method and host device for assessing execution of trim commands
US20130339575A1 (en) * 2012-06-13 2013-12-19 Silicon Motion, Inc. Data storage device and data trimming method
CN103488572A (en) * 2012-06-13 2014-01-01 慧荣科技股份有限公司 Data storage device and data clearing method
CN103019971A (en) * 2012-11-25 2013-04-03 向志华 Method of quickly responding to trim command, SSD (Solid State Disk) controller and system
US20140258675A1 (en) * 2013-03-08 2014-09-11 Kabushiki Kaisha Toshiba Memory controller and memory system
CN103927263A (en) * 2014-04-01 2014-07-16 华为技术有限公司 Garbage recycling method and garbage recycling device

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110580228A (en) * 2018-06-11 2019-12-17 北京忆恒创源科技有限公司 De-allocation command processing method and storage device thereof
EP3834091A4 (en) * 2018-08-10 2022-04-20 Micron Technology, Inc. Data validity tracking in a non-volatile memory
US11586561B2 (en) 2018-08-10 2023-02-21 Micron Technology, Inc. Data validity tracking in a non-volatile memory
CN110928807A (en) * 2018-09-20 2020-03-27 爱思开海力士有限公司 Apparatus and method for checking valid data in a memory system
CN110928807B (en) * 2018-09-20 2023-04-07 爱思开海力士有限公司 Apparatus and method for checking valid data in a memory system
CN110955613A (en) * 2018-09-26 2020-04-03 北京忆恒创源科技有限公司 Intelligent data streaming and flow tracking for storage devices
CN111125033A (en) * 2018-10-31 2020-05-08 深信服科技股份有限公司 Space recovery method and system based on full flash memory array
CN111125033B (en) * 2018-10-31 2024-04-09 深信服科技股份有限公司 Space recycling method and system based on full flash memory array
CN111290975A (en) * 2018-12-07 2020-06-16 北京忆恒创源科技有限公司 Method for processing read command and pre-read command by using unified cache and storage device thereof
EP3985519A1 (en) * 2020-10-13 2022-04-20 Dynatrace LLC Method and system for estimating garbage collection suspension contributions of individual allocation sites
EP4354304A3 (en) * 2020-10-13 2024-06-19 Dynatrace LLC Method and system for estimating garbage collection suspension contributions of individual allocation sites

Also Published As

Publication number Publication date
CN107797934B (en) 2022-07-22

Similar Documents

Publication Publication Date Title
CN107797934A (en) The method and storage device that distribution is ordered are gone in processing
CN109086219A (en) It removes distribution command handling method and its stores equipment
CN108139902A (en) The method and apparatus of SSD drive are accessed for providing mixed mode
CN106708424B (en) Apparatus and method for performing selective underlying exposure mapping on user data
CN107797938A (en) Accelerate to go the method and storage device for distributing command process
CN106448737A (en) Flash memory data reading method and device and solid disk drive
CN106681931A (en) Data storage device and operating method thereof
TWI423022B (en) Memory management method, memory controller and memory storage apparatus
CN108153482A (en) I/O command processing method and Media Interface Connector controller
KR20130116110A (en) Data storage device and operating method thereof
CN109558334B (en) Garbage data recovery method and solid-state storage device
KR101061483B1 (en) Memory circuit and memory circuit access method, memory management system and memory management method
US20220342542A1 (en) Using multi-stream storage devices in log structured storage system
CN106649144A (en) Data storage device and operating method thereof
CN108595349A (en) The address conversion method and device of mass-memory unit
CN109164976A (en) Optimize storage device performance using write buffer
CN108664213A (en) Atom write command processing method based on distributed caching and solid storage device
CN109558333A (en) Solid storage device NameSpace with variable additional storage space (OP)
CN109521944A (en) data storage device and data storage method
CN109144885A (en) The rubbish recovering method and solid storage device of solid storage device
CN108153582A (en) I/O command processing method and Media Interface Connector controller
CN109426436A (en) Rubbish recovering method and device based on variable length bulk
CN109840048A (en) Store command processing method and its storage equipment
CN104731710B (en) Storage management method, memorizer control circuit unit and memorizer memory devices
CN101609431A (en) The How It Works of flash memory device and flash memory device

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
CB02 Change of applicant information

Address after: 100192 room A302, building B-2, Dongsheng Science Park, Zhongguancun, 66 xixiaokou Road, Haidian District, Beijing

Applicant after: Beijing yihengchuangyuan Technology Co.,Ltd.

Address before: 100192 Room 302, 3 / F, building B-2, Dongsheng Science Park, 66 xixiaokou Road, Haidian District, Beijing

Applicant before: BEIJING MEMBLAZE TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
CB03 Change of inventor or designer information

Inventor after: Yu Songhai

Inventor after: Cai Shunan

Inventor after: Guo Zhihong

Inventor after: Gao Huijuan

Inventor before: Yu Songhai

Inventor before: Cai Shunan

Inventor before: Guo Zhihong

Inventor before: Gao Huijuan

CB03 Change of inventor or designer information