WO2007019155A1 - Reclaiming data storage capacity in flash memory systems - Google Patents

Reclaiming data storage capacity in flash memory systems Download PDF

Info

Publication number
WO2007019155A1
WO2007019155A1 PCT/US2006/030026 US2006030026W WO2007019155A1 WO 2007019155 A1 WO2007019155 A1 WO 2007019155A1 US 2006030026 W US2006030026 W US 2006030026W WO 2007019155 A1 WO2007019155 A1 WO 2007019155A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
data
blocks
file
erased
Prior art date
Application number
PCT/US2006/030026
Other languages
French (fr)
Inventor
Alan Welsh Sinclair
Barry Wright
Original Assignee
Sandisk Corporation
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
Priority claimed from US11/382,235 external-priority patent/US7558905B2/en
Application filed by Sandisk Corporation filed Critical Sandisk Corporation
Priority to AT06789157T priority Critical patent/ATE509314T1/en
Priority to EP06789157A priority patent/EP1920335B1/en
Priority to JP2008525135A priority patent/JP4533956B2/en
Priority to KR1020087004727A priority patent/KR101272642B1/en
Publication of WO2007019155A1 publication Critical patent/WO2007019155A1/en

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • G11C16/10Programming or data input circuits
    • 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
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • G11C16/10Programming or data input circuits
    • G11C16/14Circuits for erasing electrically, e.g. erase voltage switching circuits
    • G11C16/16Circuits for erasing electrically, e.g. erase voltage switching circuits for erasing blocks, e.g. arrays, words, groups
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C16/00Erasable programmable read-only memories
    • G11C16/02Erasable programmable read-only memories electrically programmable
    • G11C16/06Auxiliary circuits, e.g. for writing into memory
    • G11C16/34Determination of programming status, e.g. threshold voltage, overprogramming or underprogramming, retention
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7205Cleaning, compaction, garbage collection, erase control

Definitions

  • This application relates to the operation of re-programmable non-volatile memory systems such as semiconductor flash memory, and, more specifically, to the management of the interface between a host device and the memory.
  • addresses of data files generated or received by the system are mapped into distinct ranges of a continuous logical address space established for the system.
  • the extent of the address space is typically sufficient to cover the full range of addresses that the system is capable of handling.
  • magnetic disk storage drives communicate with computers or other host systems through such a logical address space.
  • This address space has an extent sufficient to address the entire data storage capacity of the disk drive.
  • data files generated or received by an electronic system are uniquely identified and their data logically addressed by offsets within the file.
  • a form of this addressing method is used between computers or other host systems and a removable memory card known as a "Smart Card.” Smart Cards are typically used by consumers for identification, banking, point-of-sale purchases, ATM access and the like.
  • Flash memory systems are most commonly provided in the form of a memory card or flash drive that is removably connected with a variety of hosts such as a personal computer, a camera or the like, but may also be embedded within such host systems.
  • the host When writing data to the memory, the host typically assigns unique logical addresses to sectors, clusters or other units of data within a continuous virtual address space of the memory system.
  • DOS disk operating system
  • the host writes data to, and reads data from, addresses within the logical address space of the memory system.
  • a controller within the memory system translates logical addresses received from the host into physical addresses within the memory array, where the data are actually stored, and then keeps track of these address translations.
  • the data storage capacity of the memory system is at least as large as the amount of data that is addressable over the entire logical address space defined for the memory system.
  • a common host interface for such memory systems is a logical address interface similar to that commonly used with disk drives.
  • Files generated by a host to which the memory is connected are assigned unique addresses within the logical address space of the interface.
  • the memory system then commonly maps data between the logical address space and the physical blocks or metablocks of the memory.
  • the memory system keeps track of how the logical address space is mapped into the physical memory but the host is unaware of this.
  • the host keeps track of the addresses of its data files within the logical address space but the memory system operates without knowledge of this mapping.
  • the present invention is based upon a fundamental change, namely by changing the data transfer interface between the memory and the host system. Rather than communicating data between them by the use of logical addresses within a virtual address space, a data file is identified by a filename assigned by the host and its accessed by offset address within the file. The memory system then knows the host file to which each sector or other unit of data belongs.
  • the file unit being discussed herein is a set of data that is ordered, such as by having sequential offset addresses, and which is created and uniquely identified by an application program operating in a host computing system.
  • Block reclaim operations include garbage collection and data consolidation, wherein, in general, valid data of underutilized blocks are gathered together in other blocks and the underutilized blocks are then erased and made available for accepting new data.
  • blocks of memory cells are selected to be reclaimed on the basis of the content of the blocks.
  • a block of memory cells is typically reclaimed in response to the host closing a logical data block that is mapped into the physical block, not on the basis of the content of the physical block.
  • blocks partially filled with valid data are chosen for a reclaim operation based on the amount of valid data contained in them. Blocks with the least amount of valid data can be reclaimed most efficiently since there is less data to be copied to another block. Since the copying of data takes a significant amount of time away from other memory operations, such as data programming or reading, the selection of a block for reclaim that has the least amount of valid data, for example, means that this block can be made available for the storage of new data with the least negative effect on system performance.
  • some embodiments include taking the amount of erased capacity in the blocks into consideration when selecting a block to be reclaimed. If two blocks have the same amount of valid data stored in them but one has some erased capacity and the other does not, for example, the block without the erased capacity is reclaimed first since there is more to be gained.
  • the block with erased capacity has current value for the storage of new data, depending on the amount of data that can be written into it, while the block without erased capacity does not.
  • Figure 1 schematically illustrates a host and a connected non-volatile memory system as currently implemented
  • Figure 2 is a block diagram of an example flash memory system for use as the non-volatile memory of Figure 1;
  • Figure 3 is a representative circuit diagram of a memory cell array that may be used in the system of Figure 2;
  • Figure 4 illustrates an example physical memory organization of the system of Figure 2
  • Figure 5 shows an expanded view of a portion of the physical memory of Figure 4.
  • Figure 6 shows a further expanded view of a portion of the physical memory of Figures 4 and 5;
  • Figure 7 illustrates a common prior art logical address interface between a host and a re-programmable memory system
  • Figure 8 illustrates in a different manner than Figure 7 a common prior art logical address interface between a host and a re-programmable memory system
  • Figure 9 illustrates a direct file storage interface between a host and a reprogrammable memory system, according to the present invention.
  • Figure 10 illustrates in a different manner than Figure 9 a direct file storage interface between a host and a re-programmable memory system, according to the present invention
  • Figure 11 is a functional block diagram of a memory system operating with a direct data file storage interface
  • Figure 12 illustrates an operating cycle of a direct data file memory
  • Figures 13A-13D show four different examples of writing data of files directly into the memory
  • Figures 14A-14E show examples of a data file stored in various allowed combinations of types of blocks
  • Figure 15 is a list of permitted file states by the types of blocks in which data of individual files are stored.
  • Figure 16 is a state diagram showing permitted primary transitions between the file states listed in Figure 15;
  • Figure 17 is a table that describes the primary file state transitions illustrated in the state diagram of Figure 16;
  • Figure 18 is a state diagram showing resulting secondary transitions between the file states listed in Figure 15;
  • Figure 19 is a table that describes the secondary file state transitions illustrated in the state diagram of Figure 18;
  • Figure 20 is a summary table listing the types of blocks allocated as active blocks under conditions of Figures 15-20;
  • Figures 21A-21D show examples of block reclaim operations
  • Figure 22 is a flowchart that illustrates a reclaim operation in general terms
  • Figure 23 illustrates types of data stored in a typical partial memory cell block
  • Figure 24 provides details of a specific embodiment that carries out one of the steps of the flowchart of Figure 22;
  • Figure 25 provides details of an alternate embodiment to execute the same step of the flowchart of Figure 22.
  • Figure 26 is a table defining the block types placed on two block lists of yet another embodiment. " "'" "" FLASH MEMORY SYSTEM GENERAL DESCRIPTION
  • a common flash memory system and a typical operation with host devices are described with respect to Figures 1 - 8. It is in such a system that the various aspects of the present invention may be implemented.
  • a host system 1 of Figure 1 stores data into and retrieves data from a flash memory 2.
  • the flash memory can be embedded within the host, the memory 2 is illustrated to be in the more popular form of a card that is removably connected to the host through mating parts 3 and 4 of a mechanical and electrical connector.
  • flash memory cards that are commercially available, examples being those sold under trademarks CompactFlash (CF), the MultiMediaCard (MMC), Secure Digital (SD), miniSD, microSD, Memory Stick, SmartMedia and TransFlash.
  • Host systems that use such memory cards and flash drives are many and varied. They include personal computers (PCs), laptop and other portable computers, cellular telephones, personal digital assistants (PDAs), digital still cameras, digital movie cameras and portable audio players.
  • the host typically includes a built-in receptacle for one or more types of memory cards or flash drives but some require adapters into which a memory card is plugged.
  • the memory system usually contains its own memory controller and drivers but there are also some memory only systems that are instead controlled by software executed by the host to which the memory is connected. In some memory systems containing the controller, especially those embedded within a host, the memory, controller and drivers are often formed on a single integrated circuit chip.
  • the host system 1 of Figure 1 may be viewed as having two major parts, insofar as the memory 2 is concerned, made up of a combination of circuitry and software. They are an applications portion 5 and a driver portion 6 that interfaces with the memory 2.
  • the applications portion 5 can include a processor running word processing, graphics, control or other popular application software.
  • the applications portion 5 includes the software that operates the camera to take and store pictures, the cellular telephone to make and receive calls, and the like.
  • the memory system 2 of Figure 1 includes flash memory 1, and circuits 8 that both interface with the host to which the card is connected for passing data back and forth and control the memory 7.
  • the controller 8 typically converts between logical addresses of data used by the host 1 and physical addresses of the memory 7 during data programming and reading.
  • circuitry of a typical flash memory system that may be used as the non-volatile memory 2 of Figure 1 is described.
  • the system controller is usually implemented on a single integrated circuit chip 11 that is connected in parallel with one or more integrated circuit memory chips over a system bus 13, a single such memory chip 15 being shown in Figure 2.
  • the particular bus 13 that is illustrated includes a separate set of conductors 17 to carry data, a set 19 for memory addresses and a set 21 for control and status signals.
  • a single set of conductors may be time shared between these three functions.
  • other configurations of system buses can be employed, such as a ring bus that is described in United States patent application serial no. 10/915,039, filed August 9, 2004, entitled “Ring Bus Structure and It's Use in Flash Memory Systems," now publication no. 2006/0031593 Al.
  • a typical controller chip 11 has its own internal bus 23 that interfaces with the system bus 13 through interface circuits 25.
  • the primary functions normally connected to the bus are a processor 27 (such as a microprocessor or microcontroller), a read-only-memory (ROM) 29 containing code to initialize (“boot") the system, read-only-memory (RAM) 31 used primarily to buffer data being transferred between the memory and a host, and circuits 33 that calculate and check an error correction code (ECC) for data passing through the controller between the memory and the host.
  • the controller bus 23 interfaces with a host system through circuits 35, which, in the case of the system of Figure 2 being contained within a memory card, is done through external contacts 37 of the card that are part of the connector 4.
  • a clock 39 is connected with and utilized by each of the other components of the controller 11.
  • the memory chip 15, as well as any other connected with the system bus 13, typically contains an array of memory cells organized into multiple sub-arrays or planes, two such planes 41 and 43 being illustrated for simplicity but more, such as four or eight such planes, may instead be used.
  • the memory cell array of the chip 15 may not be divided into planes.
  • each plane has its own column control circuits 45 and 47 that are operable largely independently of each other.
  • the circuits 45 and 47 receive addresses of their respective memory cell array from the address portion 19 of the system bus 13, and decode them to address a specific one or more of respective bit lines 49 and 51.
  • the word lines 53 are addressed through row control circuits 55 in response to addresses received on the address bus 19.
  • Source voltage control circuits 57 and 59 are also connected with the respective planes, as are p-well voltage control circuits 61 and 63. If the memory chip 15 has a single array of memory cells, and if two or more such chips exist in the system, the array of each chip may be operated similarly to a plane or sub-array within the multi-plane chip described above.
  • Data are transferred into and out of the planes 41 and 43 through respective data input/output circuits 65 and 67 that are connected with the data portion 17 of the system bus 13.
  • the circuits 65 and 67 provide for both programming data into the memory cells and for reading data from the memory cells of their respective planes, through lines 69 and 71 connected to the planes through respective column control circuits 45 and 47.
  • each memory chip also contains some controlling circuitry that executes commands from the controller 11 to perform such functions.
  • Interface circuits 73 are connected to the control and status portion 21 of the system bus 13. Commands from the controller are provided to a state machine 75 that then provides specific control of other circuits in order to execute these commands.
  • Control lines 77 - 81 connect the state machine 75 with these other circuits as shown in Figure 2.
  • Status information from the state machine 75 is communicated over lines 83 to the interface 73 for transmission to the controller 11 over the bus portion 21.
  • a NAND architecture of the memory cell arrays 41 and 43 is currently preferred, although other architectures, such as NOR, can also be used instead.
  • Examples of NAND flash memories and their operation as part of a memory system may be had by reference to United States patents nos. 5,570,315, 5,774,397, 6,046,935, 6,373,746, 6,456,528, 6,522,580, 6,771,536 and 6,781,877 and United States patent application publication no. 2003/0147278.
  • FIG. 3 An example NAND array is illustrated by the circuit diagram of Figure 3, which is a portion of the memory cell array 41 of the memory system of Figure 2.
  • a large number of global bit lines are provided, only four such lines 91 - 94 being shown in Figure 2 for simplicity of explanation.
  • a number of series connected memory cell strings 97 - 104 are connected between one of these bit lines and a reference potential.
  • a plurality of charge storage memory cells 107 - 110 are connected in series with select transistors 111 and 112 at either end of the string. When the select transistors of a string are rendered conductive, the string is connected between its bit line and the reference potential. One memory cell within that string is then programmed or read at a time.
  • Word lines 115 - 118 of Figure 3 individually extend across the charge storage element of one memory cell in each of a number of strings of memory cells, and gates 119 and 120 control the states of the select transistors at each end of the strings.
  • the memory cell strings that share common word and control gate lines 115 - 120 are made to form a block 123 of memory cells that are erased together.
  • One row of memory cells, those along one of the word lines 115 - 118, are programmed at a time.
  • the rows of a NAND array are programmed in a prescribed order, in this case beginning with the row along the word line 118 closest to the end of the strings connected to ground or another common potential.
  • the row of memory cells along the word line 117 is programmed next, and so on, throughout the block 123.
  • the row along the word line 115 is programmed last.
  • a second block 125 is similar, its strings of memory cells being connected to the same global bit lines as the strings in the first block 123 but having a different set of word and control gate lines.
  • the word and control gate lines are driven to their proper operating voltages by the row control circuits 55. If there is more than one plane or sub-array in the system, such as planes 1 and 2 of Figure 2, one memory architecture uses common word lines extending between them. There can alternatively be more than two planes or sub-arrays that share common word lines. In other memory architectures, the word lines of individual planes or sub-arrays are separately driven.
  • the memory system may be operated to store more than two detectable levels of charge in each charge storage element or region, thereby to store more than one bit of data in each.
  • the charge storage elements of the memory cells are most commonly conductive floating gates but may alternatively be non- conductive dielectric charge trapping material, as described in United States patent application publication no. 2003/0109093.
  • FIG 4 conceptually illustrates an organization of the flash memory cell array 7 (Figure 1) that is used as an example in further descriptions below.
  • Four planes or sub-arrays 131 - 134 of memory cells may be on a single integrated memory cell chip, on two chips (two of the planes on each chip) or on four separate chips. The specific arrangement is not important to the discussion below. Of course, other numbers of planes, such as 1, 2, 8, 16 or more may exist in a system.
  • the planes are individually divided into blocks of memory cells shown in Figure 4 by rectangles!, such as blocks 137, 138, 139 and 140, located in respective planes 131 — 134. There can be dozens or hundreds of blocks in each plane.
  • the block of memory cells is the unit of erase, the smallest number of memory cells that are physically erasable together.
  • the blocks are operated in larger metablock units.
  • One block from each plane is logically linked together to form a metablock.
  • the four blocks 137 - 140 are shown to form one metablock 141. All of the cells within a metablock are typically erased together.
  • the blocks used to form a metablock need not be restricted to the same relative locations within their respective planes, as is shown in a second metablock 143 made up of blocks 145 - 148.
  • the memory system can be operated with the ability to dynamically form metablocks of any or all of one, two or three blocks in different planes. This allows the size of the metablock to be more closely matched with the amount of data available for storage in one programming operation.
  • the individual blocks are in turn divided for operational purposes into pages of memory cells, as illustrated in Figure 5.
  • the memory cells of each of the blocks 131 - 134 are each divided into eight pages PO - P7. Alternatively, there may be 16, 32 or more pages of memory cells within each block.
  • the page is the unit of data programming and reading within a block, containing the minimum amount of data that are programmed at one time.
  • a page is formed of memory cells along a word line within a block.
  • such pages within two or more blocks may be logically linked into metapages.
  • a metapage 151 is illustrated in Figure 5, being formed of one physical page from each of the four blocks 131 - 134.
  • the metapage 151 for example, includes the page P2 in of each of the four blocks but the pages of a metapage need not necessarily have the same relative position within each of the blocks.
  • the memory system can also be operated to form metapages of any or all of one, two or three pages in separate blocks in different planes. This allows the programming and reading operations to adaptively match the amount of data that may be conveniently handled in parallel and reduces the occasions when part of a metapage remains unprogrammed with data.
  • a metapage formed of physical pages of multiple planes contains memory cells along word line rows of those multiple planes. Rather than programming all of the cells in one word line row at the same time, they are more commonly alternately programmed in two or more interleaved groups, each group storing a page of data (in a single block) or a metapage of data (across multiple blocks).
  • a unit of peripheral circuits including data registers and a sense amplifier need not be provided for each bit line but rather are time-shared between adjacent bit lines. This economizes on the amount of substrate space required for the peripheral circuits and allows the memory cells to be packed with an increased density along the rows. Otherwise, it is preferable to simultaneously program every cell along a row in order to maximize the parallelism available from a given memory system.
  • the simultaneous programming of data into every other memory cell along a row is most conveniently accomplished by providing two rows of select transistors (not shown) along at least one end of the NAND strings, instead of the single row that is shown.
  • the select transistors of one row then connect every other string within a block to their respective bit lines in response to one control signal, and the select transistors of the other row connect intervening every other string to their respective bit lines in response to another control signal. Two pages of data are therefore written into each row of memory cells.
  • the amount of data in each logical page is typically an integer number of one or more sectors of data, each sector containing 512 bytes of data, by convention.
  • Figure 6 shows a logical data page of two sectors 153 and 155 of data of a page or metapage.
  • Each sector usually contains a portion 157 of 512 bytes of user or system data being stored and another number of bytes 159 for overhead data related either to the data in the portion 157 or to the physical page or block in which it is stored.
  • the number of bytes of overhead data is typically 16 bytes, making the total 528 bytes for eacn 'bf tr ⁇ e "" secto " rs 153 and 155.
  • the overhead portion 159 may contain an ECC calculated from the data portion 157 during programming, its logical address, an experience count of the number of times the block has been erased and re- programmed, one or more control flags, operating voltage levels, and/or the like, plus an ECC calculated from such overhead data 159.
  • the overhead data 159, or a portion of it, may be stored in different pages in other blocks.
  • FIG. 7 illustrates the most common interface between a host and such a mass memory system.
  • the host deals with data files generated or used by application software or firmware programs executed by the host.
  • a word processing data file is an example, and a drawing file of computer aided design (CAD) software is another, found mainly in general computer hosts such as PCs, laptop computers and the like.
  • CAD computer aided design
  • a document in the pdf format is also such a file.
  • a still digital video camera generates a data file for each picture that is stored on a memory card.
  • a cellular telephone utilizes data from files on an internal memory card, such as a telephone directory.
  • a PDA stores and uses several different files, such as an address file, a calendar file, and the like.
  • the memory card may also contain software that operates the host.
  • a common logical interface between the host and the memory system is illustrated in Figure 7.
  • a continuous logical address space 161 is large enough to provide addresses for all the data that may be stored in the memory system.
  • the host address space is typically divided into increments of clusters of data. Each cluster may be designed in a given host system to contain a number of sectors of data, somewhere between 4 and 64 sectors being typical.
  • a standard sector contains 512 bytes of data.
  • Files 1, 2 and 3 are shown in the example of Figure 7 to have been created.
  • An application program running on the host system creates each file as an ordered set of data and identifies it by a unique name or other reference. Enough available logical address space not already allocated to other files is assigned by the host to File 1.
  • File 1 is shown to have been assigned a contiguous range of available logical addresses. Ranges of addresses are also commonly allocated for specific purposes, such as a particular range for the host operating software, which are then avoided for storing data even if these addresses have not been utilized at the time the host is assigning logical addresses to the data.
  • the host keeps track of the memory logical address space by maintaining a file allocation table (FAT), where the logical addresses assigned by the host to the various host files by the conversion 160 are maintained.
  • FAT table is frequently updated by the host as new files are stored, other files deleted, files modified and the like.
  • the FAT table is typically stored in a host memory, with a copy also stored in the non-volatile memory that is updated from time to time. The copy is typically accessed in the non-volatile memory through the logical address space just like any other data file.
  • the host deallocates the logical addresses previously allocated to the deleted file by updating the FAT table to show that they are now available for use with other data files.
  • the host is not concerned about the physical locations where the memory system controller chooses to store the files.
  • the typical host only knows its logical address space and the logical addresses that it has allocated to its various files.
  • the memory system through a typical host/card interface, only knows the portions of the logical address space to which data have been written but does not know the logical addresses allocated to specific host files, or even the number of host files.
  • the memory system controller converts the logical addresses provided by the host for the storage or retrieval of data into unique physical addresses within the flash memory cell array where host data are stored.
  • a block 163 represents a working table of these logical-to-physical address conversions, which is maintained by the memory system controller.
  • the memory system controller is programmed to store data files within the blocks and metablocks of a memory array 165 in a manner to maintain the performance of the system at a high level.
  • Four planes or sub-arrays are used in this illustration. Data are preferably programmed and read with the maximum degree of parallelism that the system allows, across an entire metablock formed of a block from each of the planes.
  • At least one metablock 167 is usually allocated as a reserved block for storing operating firmware and data used by the memory controller.
  • Another metablock 169, or multiple metablocks may be allocated for storage of host operating software, the host FAT table and the like. Most of the physical storage space remains for the storage of data files.
  • the memory controller does not know, however, how the data received has been allocated by the host among its various file objects. All the memory controller typically knows from interacting with the host is that data written by the host to specific logical addresses are stored in corresponding physical addresses as maintained by the controller's logical-to-physical address table 163.
  • a few extra blocks of storage capacity are provided than are necessary to store the amount of data within the address space 161.
  • One or more of these extra blocks may be provided as redundant blocks for substitution for other blocks that may become defective during the lifetime of the memory.
  • the logical grouping of blocks contained within individual metablocks may usually be changed for various reasons, including the substitution of a redundant block for a defective block originally assigned to the metablock.
  • One or more additional blocks, such as metablock 171 are typically maintained in an erased block pool.
  • the controller converts the logical addresses assigned by the host to physical addresses within a metablock in the erased block pool.
  • metablocks not being used to store data within the logical address space 161 are then erased and designated as erased pool blocks for use during a subsequent data write operation.
  • the logical address space is divided into logical groups that each contain an amount of data equal to the storage capacity of a physical memory metablock, thus allowing a one-to-one mapping of the logical groups into the metablocks.
  • Data compaction typically involves reading all valid data metapages from a metablock and writing them to a new metablock, ignoring metapages with invalid data in the process.
  • the metapages with valid data are also preferably arranged with a physical address order that matches the logical address order of the data stored in them.
  • the number of metapages occupied in the new metablock will be less than those occupied in the old metablock since the metapages containing invalid data are not copied to the new metablock.
  • the old block is then erased and made available to store new data.
  • the additional metapages of capacity gained by the consolidation can then be used to store other data.
  • One challenge to efficiently control operation of memory arrays with very large erase blocks is to match and align the number of data sectors being stored during a given write operation with the capacity and boundaries of blocks of memory.
  • One approach is to configure a metablock used to store new data from the host with less than a maximum number of blocks, as necessary to store a quantity of data less than an amount that fills an entire metablock.
  • the use of adaptive metablocks is described in United States patent application serial no. 10/749,189, filed December 30, 2003, entitled “Adaptive Metablocks," now publication no. 2005/0144357 Al.
  • the fitting of boundaries between blocks of data and physical boundaries between metablocks is described in patent applications serial no. 10/841,118, filed May 7, 2004, now publication no. 2005/0144363 Al, and serial no. 11/016,271, filed December 16, 2004, now publication no. 2005/0144367 Al, entitled “Data Run Programming.”
  • the memory controller may also use data from the FAT table, which is stored by the host in the non-volatile memory, to more efficiently operate the memory system.
  • One such use is to learn when data has been identified by the host to be obsolete by deallocating their logical addresses. Knowing this allows the memory controller to schedule erasure of the blocks containing such invalid data before it would normally learn of it by the host writing new data to those logical addresses. This is described in United States patent application serial no. 10/897,049, filed July 21, 2004, entitled “Method and Apparatus for Maintaining Data on Non- Volatile Memory Systems," now publication no. 2006/0020744 Al.
  • FIG 8 the typical logical address host/memory interface as already shown in Figure 7 is illustrated differently.
  • the host generated data files are allocated logical addresses by the host.
  • the memory system then sees these logical addresses and maps them into physical addresses of blocks of memory cells where the data are actually stored.
  • a different type of interface between a host and memory system for the storage of mass amounts of data eliminates use of the logical address space.
  • the host instead logically addresses each file by a unique fileID (or other unique reference) and offset addresses of units of data (such as bytes) within the file.
  • This file address is given directly to the memory system controller, which then keeps its own table of where the data of each host file are physically stored.
  • This new interface can be implemented with the same memory system as described above with respect to Figures 2 - 6.
  • the primary difference with what is described above is the manner in which that memory system communicates with a host system.
  • This file-based interface is illustrated in Figure 9, which should be compared with the logical address interface of Figure 7.
  • An identification of each of the Files 1, 2 and 3 and offsets of data within the files of Figure 9 are passed directly to the memory controller.
  • This logical address information is then translated by a memory controller function 173 into physical addresses of metablocks and metapages of the memory 165.
  • a file directory keeps track of the host file to which each stored sector, page or other unit of file data belongs.
  • TEe file-based interface is also illustrated by Figure 10, which should be compared with the logical address interface of Figure 8. The logical address space and host maintained FAT table of Figure 8 are not present in Figure 10.
  • data files generated by the host are identified to the memory system by file number and offsets of data within the file.
  • the memory system controller then directly maps the files to the physical blocks of the memory cell array and maintains file directory and index table information of memory blocks into which host files are stored. It is then unnecessary for the host to maintain the file allocation table (FAT) that is currently necessary for managing a logical address interface.
  • FAT file allocation table
  • Figure 11 is a general block diagram of the major functions of a direct data file system that are carried out by the memory system firmware executed by its processor and by other circuits of the controller. It provides an overall framework in which the specific memory operations described hereinafter may be considered.
  • a file-based interface 601 layer passes commands and data between the memory system and an external host system or a host application being executed on the same memory card or flash drive, for the three main functions of the memory system, namely writing files, deleting files and reading files. Data are stored in a flash memory array 603.
  • a file block management function 605 organizes storage of data in flash memory according to the files by which the data is identified, and minimizes the incidence of blocks storing data for more than one file.
  • the physical block of memory cells of the memory 603 is the basic unit of data management.
  • Data are organized into metapages by a function 607 for writing into the memory 603, such that individual metapages contain data for a contiguous logical offset address range within a specific file.
  • a function 609 controls access to the memory 603 for reading data stored therein. The deletion of data of a file, when commanded by the host, causes a function 611 to update file indexing information maintained by a function 613 and lists of blocks in a function 615.
  • the file data indexing 613 indexes the individual files stored in the memory 603 by a unique file identifier and offset addresses of data within the file.
  • the data for each file are stored as a set of data groups having contiguous logical offset addresses.
  • a file directory identifies the locations in a file index table (FIT) of sets of data group entries for the individual files.
  • FIT file index table
  • garbage collection valid data of a source block are copied from blocks also containing obsolete data into one or more destination blocks that have at least some erased space. This gathers valid data into a fewer number of blocks, thus freeing up capacity occupied by obsolete data once the original source block(s) are erased.
  • data consolidation valid data of one partially filled block, which thus also contains erased but unused space, are combined with valid data of another partially filled block. Partially filled blocks result most commonly from writing a new file that is closed with its last erased block only partially filled. Once data are consolidated, the source blocks containing the data just copied, which are then duplicate data, are then erased and made available for the storage of new data.
  • a function 617 reclaims blocks by controlling the copying of valid file data from a physical block having unprogrammed metapages, or containing obsolete data, to other blocks. This allows the original block to be erased to reclaim the unused space it contained and make this space available for the storage of new file data.
  • a function 619 adaptively controls the occurrence and duration of block reclaim operations, according to the amount of reclaimable capacity and number of erased blocks. Block reclaim is performed at an optimum rate relative to the rate of writing new file data in a manner that maintains good overall performance of the memory system.
  • a translation layer 621 and interface layer 623 are above the file interface 601, which interfaces with the backend system of the flash memory and controls its operation.
  • the interface layer 623 has the capability of communicating data outside of the memory system with a host or otherwise, according one of three different protocols.
  • a file interface 625 is that being primarily described herein, wherein data of individual files are identified by a unique file identifier and logical offset addresses within the file.
  • An object interface 627 has a primary use to transfer data files between electronic devices, where the sizes of the files are usually known. Existing protocols for the interface 627 include the Media Transfer Protocol (MTP) and the Picture Transfer Protocol (PTP) from Microsoft Corporation.
  • MTP Media Transfer Protocol
  • PTP Picture Transfer Protocol
  • a backward compatible logical (LBA) interface 629 is also included in this example. Data are transferred through the interface 629 with the protocol currently used by flash memory cards, similar to that of magnetic disk drive systems, where the host addresses data to a defined logical address space of the memory system.
  • LBA backward compatible logical
  • the translation layer 621 includes protocol adaptors 631, 633 and 635 that function to convert the protocols of respective interface protocols 625, 627 and 629 into a common protocol for the file interface 601. Commands, data formats and the like are converted between different protocols by the translation layer.
  • the LBA protocol adaptor 635 additionally divides the logical address space of the memory system into static files. These files are then handled by the file interface 601 in the same manner as distinct files communicated through the interfaces 625 and 627. Details of the function of the LBA protocol adaptor 635 may be had by reference to United States patent application serial no. 11/196,869, filed August 3, 2005, naming S. A. Gorobets as inventor. More information of the translation and interface layers 621 and 623 is given in United States patent application serial no. 11/316,577, filed December 21, 2005, naming Alan Sinclair as inventor.
  • a new data file When a new data file is programmed into the memory, the data are written into an erased block of memory cells beginning with the first physical location in the block and proceeding through the locations of the block sequentially in order. The data are programmed in the order received from the host, regardless of the order of the offsets of that data within the file. Programming continues until all data of the file have been written into the memory. If the amount of data in the file exceeds the capacity of a single memory block, then, when the first block is full, programming continues in a second erased block. The second memory block is programmed in the same manner as the first, in order from the first location until either all the data of the file are stored or the second block is full. A third or additional blocks may be programmed with any remaining data of the file.
  • blocks or metablocks storing data of a single file need not be physically or logically contiguous.
  • block refers to either the block unit of erase or a multiple block “metablock,” depending upon whether metablocks are being used in a specific system.
  • FIG. 12 The state diagram of Figure 12 illustrates overall functioning of the memory operations shown in Figure 11.
  • Individual memory blocks may be viewed to be in one of three states. These are erased blocks 641, blocks 643 that are storing valid file data without reclaimable capacity and blocks 645 that may contain some valid file data but which also have reclaimable capacity from unprogrammed erased pages and/or obsolete (invalid) data stored in them.
  • Data are written to erased memory blocks by a function 647, thereby to result in blocks in category 643 or 645, depending upon whether the resulting programmed blocks retain any reclaimable capacity.
  • files are deleted, as indicated by a function 649, blocks 643 containing data of the file are converted to blocks 645 with reclaimable capacity. Unused storage capacity of the blocks 645 is reclaimed by a function 651 that results in returning those blocks to the status of erased blocks 641 to which new data may be written.
  • a data file 181 in this example, is larger than the storage capacity of one block or metablock 183 of the memory system, which is shown to extend between solid vertical lines. A portion 184 of the data file 181 is therefore also written into a second block 185. These memory cell blocks are shown to be physically contiguous but they need not be. Data from the file 181 are written as they are received streaming from the host until all the data of the 1 file have been written into the memory. In the example of Figure 13A, the data 181 are the initial data for file. [0094j A preferred way for the memory system to manage and keep track of the stored data is with the use of variable sized data groups.
  • data of a file are stored as a plurality of groups of data that may be chained together in a defined order to form the complete file.
  • the order of the data groups within the file is maintained by the memory system controller through use of the file index table (FIT).
  • FIT file index table
  • a new data group is begun whenever there is a discontinuity either in the logical offset addresses of the file data or in the physical space in which the data are being stored.
  • An example of such a physical discontinuity is when data of a file fills one block and begins to be written into another block.
  • a first data group fills the first block 183 the remaining portion 184 of the file is stored in the second block 185 as a second data group.
  • the first data group can be represented by (FO 5 DO), where FO is the logical offset of the beginning of the data file and DO is the physical location within memory where the file begins.
  • the second data group is represented as (Fl 3 Dl), where Fl is the logical file offset of data that is stored at the beginning of the second block 185 and Dl is the physical location where that data are stored.
  • the amount of data being transferred through the host-memory interface may be expressed in terms of a number of bytes of data, a number of sectors of data, or with some other granularity.
  • a host most often defines data of its files with byte granularity but then groups bytes into sectors of 512 bytes each, or into clusters of multiple sectors each, when communicating with a large capacity memory system through a current logical address interface. This is usually done to simplify operation of the memory system.
  • the file-based host-memory interface being described herein may use some other unit of data, the original host file byte granularity is generally preferred.
  • data offsets, lengths, and the like are preferably expressed in terms of byte(s), the smallest reasonable unit of data, rather than by sector(s), cluster(s) or the like. This allows more efficient use of the capacity of the flash memory storage with the techniques described herein.
  • the new file written into the memory in the manner illustrated in Figure 13A is then represented in a FIT as a sequence of index entries (F0,D0), (Fl 3 Dl) for the ⁇ aia " groups, in that order. That is, whenever the host system wants to access a particular file, the host sends its fileID or other identification to the memory system, which then accesses its FIT to identify the data groups that make up that file.
  • the length ⁇ length> of the individual data groups may also be included in their individual entries, for convenience of operation of the memory system. When used, the memory controller calculates and stores the lengths of the data groups.
  • a physical write pointer P is also preferably maintained to define the location for writing any further data received from the host for that file. Any new data for the file are written at the end of the file in the physical memory regardless of the logical position of the new data within the file.
  • the memory system allows multiple files to remain open at one time, such as 4 or 5 such files, and maintains a write pointer P for each of them.
  • the write pointers for different files point to locations in different memory blocks. If the host system wants to open a new file when the memory system limit of a number of open files already exists, one of the opened files is first closed and the new file is then opened.
  • Figure 13B illustrates the appending of data by the host to the end of the previously written but still open file of Figure 13A.
  • Data 187 are shown to be added by the host system to the end of the file, which are also written in the second block 185 at the end of the data for that file.
  • the appended data becomes part of the data group (Fl 3 Dl), which therefore now contains more data, since there is neither a logical nor a physical address discontinuity between the existing data group 184 and the appended data 189.
  • the full file is thus still represented as a sequence of index entries (F0,D0), (Fl 3 Dl) in the FIT.
  • the address of the pointer P is also changed to that of the end of the stored appended data.
  • FIG. 13C An example of the insertion of a block of data 191 into the previously written file of Figure 13A is shown in Figure 13C.
  • the memory system appends the inserted data at a location 193 at the end of the file data previously written. It is not necessary to rewrite the data of the file in their logical order when data are being inserted into an open file, although this may be done later in the background after the host closes the file. Since the inserted data is stored entirely within the second memory block 185, if forms a single new group (F1,D3).
  • the original file with the insert is then represented in the memory system FIT by data group index entries (F0,D0), (F1.D3), (F2,D1), (F3,D2), in that order. It should be noted from the examples of Figures 13A, 13B and 13C, that new data for a new or existing file may be written without making obsolete any data in the memory.
  • the file may be rewritten into the memory as a separate file by the host whenever data have been inserted.
  • This separate file may then be treated by the memory system as a new file.
  • the old file is then deleted by the host, and the memory system may respond by reclaiming the space in which the old file is stored, the data of which are now obsolete.
  • Figure 13D illustrates another example, wherein a certain portion of the data originally written in the manner shown in Figure 13A is updated.
  • a portion 195 of the data file is shown to be updated.
  • an updated portion 197 of the file is appended to the data previously written.
  • a portion 199 of the data previously written is now obsolete.
  • the file is represented in the memory system FIT by data groups index entries (FO 3 DO), (F1,D3), (F2,D1), (F3,D2), in that order.
  • the single data group (FO 5 DO) of Figure 13A is again divided into pieces in Figure 13D, one before the updated portion, the updated portion and one after the updated portion. It is desirable to reclaim the space 199 occupied by obsolete data but this is preferably done later, not as part of writing the file data in the memory. Such reclamation will typically result in a fewer number of data groups of data for a particular file being stored.
  • the offsets of the data of each file are preferably maintained continuous in the correct logical order after the file's creation or modification according to the preceding description. Therefore, as part of an operation to insert data into a file, for example, offsets of the inserted data provided by the host are continuous from the offset immediately preceding the insert and data already in the file after the insert are incremented by an amount of the inserted data. Updating an existing file most commonly results in data within a given address range of an existing file being replaced by a like amount of updated data, so the offsets of other data of the file usually need not be replaced.
  • An advantage of directly writing file data from the host into the flash memory in the manner just described is that the granularity or resolution of the data so stored may be maintained the same as that of the host. If a host application writes file data with a one-byte granularity, for example, that data may be also be written into the flash memory with a one-byte granularity. The amount and location of data within an individual data group is then measured in a number of bytes. That is, the same offset unit of data that is separately addressable within the host application file is also separately addressable within that file when stored in the flash memory. Any boundaries between data groups of the same file within a block are then specified in the index table to the nearest byte or other host offset unit. Similarly, boundaries between data groups of different files within a block are defined in the unit of the host offset.
  • the term "sector” is used herein with large block memories to denote the unit of stored data with which an ECC is associated.
  • the sector is also the minimum unit of data transfer to and from flash memory.
  • a "page” is used to denote a unit of memory cells within a block and is the minimum unit of programming.
  • the term “metapage” is used to denote a page with the full parallelism of a metablock. The metapage is the maximum unit of programming.
  • file-to-block mapping function 605 of Figure 11 An example of the file-to-block mapping function 605 of Figure 11 will now be described.
  • a destination block for storing the data is chosen according to a specific process. In this process, certain types of blocks are recognized on the basis of the structure of file data stored in them.
  • Each file stored in the memory system is then noted to be in one of a number of states, each file state being defined by the number and types of blocks in which data of the file are stored.
  • a "file block” has been fully programmed, and contains valid data of a single file. It may also contain some obsolete data.
  • a "program block” has been partially programmed, and contains valid data of only a single file. Some erased capacity remains in the block. It may also contain some obsolete data.
  • a "common block” has been partially programmed, and contains valid data of two or more files. Some erased capacity remains. It may also contain some obsolete data.
  • a "full common block” has been fully programmed and contains valid data of two or more files. It may also contain some obsolete data.
  • a "full program block” is a transient designation for a program block that has become full, when it contains the most recently written data for the file and also has some obsolete data, and the range of offset addresses that exist for the file can be accommodated by a single block. If the next data to be written for the file are beyond the range of offset addresses that can be accommodated by a single block, a full program block then becomes designated as a file block.
  • the full program block is equivalent to a full chaotic block of an existing logical block address (LBA) system, since certain logical offsets of the file are written multiple times in the block, once designating valid data and at least one other time to designate obsolete data.
  • LBA logical block address
  • Another type of block is the "erased block", where the total capacity of the block is unprogrammed and available to accept data. When the memory is full or nearly full of data, a pool of a specified minimum number of erased blocks is typically maintained by continuously reclaiming unused capacity that exists within blocks that are being used.
  • a "fractal block” is a collective term that refers to a program block, common block or a full common block.
  • a fractal block for a file contains valid data of the file, together with either unprogrammed memory capacity, valid data for other files, or both.
  • a primary purpose of the techniques described herein is to minimize the number of fractal blocks in a memory system by managing the type of active block that is designated to receive data of a file. This reduces the instances of garbage collection and data consolidation (block reclaim operations) necessary to maintain the "* ** " specified minimum number of erased blocks. The rate at which data may be written into the memory is then increased since less time is taken for internal copying of data to reclaim fragments of unused capacity in previously programmed blocks.
  • a "partial block” contains some unprogrammed capacity, valid data of one or more files and may contain some obsolete data.
  • the program block and common block are examples of partial blocks.
  • An "obsolete block” is a file block or a full common block that contains some obsolete data.
  • the obsolete block does not contain any erased capacity, and contains both valid and obsolete data.
  • invalid block contains no valid data.
  • the invalid block contains at least some obsolete data and may contain erased capacity but does not contain any valid data.
  • Figures 14A-14E illustrate some examples of the uses of the types of blocks listed above.
  • data of a file A have filled blocks 661 and 663, and partially filled a third block 665.
  • Data are written from left-to-right in each block of this example, first filling the block 661, then the block 663 and thereafter being written into a portion of the block 665.
  • the remaining portion of the block 665 is unprogrammed erased capacity that can store additional data.
  • the blocks 661 and 663 are file blocks, by the above-listed definitions, and the block 665 is a program block. Any new data will be written into the block 665, beginning at the program pointer P.
  • the pointer P moves from left-to-right as data are written to the block to always point to the next available storage location in the block. Such a pointer is maintained for individual blocks that retain unprogrammed erased capacity, whether currently active or not, so that the physical address of any other data to be written to the block is always known.
  • the block 667 contains the most recently written data of file A, some obsolete data and no unused capacity. Also by that definition, the total amount of data of file A stored in the two blocks 662 and 667 is equal to the storage capacity of one block. The last data for file A was written at the end of the block 667 where the program pointer P is shown. Any further data of file A that are received will be programmed into another block. That block can be another block into which the data of file A in block 667 are collected since the space occupied by obsolete data will be reclaimed. Alternatively, additional data can be written into a fully erased block.
  • the pointer P moves to the new block at the beginning location for additional data of file A.
  • the block 667 then becomes a file block.
  • the block 667 is thus transitory since it exists only for the time that it is exactly as shown in Figure 14B. Just before it is totally filed with data of file A, it is a program block and immediately upon any new data for file A being written, it becomes a file block.
  • FIG. 14C includes a block 669 that is a common block since it contains data of another file B as well as data of the current file A, plus some unprogrammed capacity. New data are written into the block 669 at the end of the file A, beginning where the program pointer P is shown.
  • Block 669 is the active block for file A. It may also be the active block for file B, in which case additional data of either of files A or B may be written at the program pointer P. Alternatively, a separate block (not shown) may be the active block for file B.
  • Data of a file may be written directly into erased capacity of a partial block that already contains data of another file, rather than into an erased block, in order to make good use of unprogrammed capacity in this form. This is particularly useful when a known quantity of file data less than the capacity of a full block is to be written.
  • Existing partial blocks are searched to find an amount of erased capacity that fits the known amount of data to be written.
  • the number of pages (or metapages if the metablocks are being used) of data is compared with the number of pages of unprogrammed, erased capacity in partial blocks. When unused erased space of a program block is programmed in this way, it is converted into a common block.
  • file A is stored in the file block 661, a portion of a block 671 and a portion of a block 673.
  • the block 671 is a full common block since it is full ' of data of two files A and B.
  • the block 673 is a program block, similar to the block 665 of Figure 14A.
  • the block 673 is the active block for the file and a pointer P points to the location of the unused capacity within the block 673 where additional data will first be written.
  • the file A is written in the example of Figure 14E into a portion of the full common block 671 and a common block 675.
  • the block 675 contains data of a third file C.
  • the pointer P points to the first location in the unused portion of the active block 675 where additional data will be written.
  • Figures 14A-14E show data of file A stored in multiple blocks in order to illustrate the several different types of blocks
  • a file in many cases may be small enough to be stored in a lesser number of blocks, even a single block.
  • the techniques described herein are also applicable to such small files.
  • a larger file can occupy pages in more than three blocks.
  • blocks 665, 667, 669, 671, 673 and 675 are fractal blocks. It is desired to minimize the number of fractal blocks occupied by data of any one file since their presence increases the likelihood of the need to reclaim unused capacity in them and thus adversely affect system performance. Unused erased capacity exists in partial blocks 665, 669, 673 and 675 but it may not be efficient to write new data from a host directly into this space unless the quantity of unwritten data for a file is known and that known amount matches the unused capacity of one of these blocks. It is most common that the amount of data from the host for a particular file is not known, so these bits of capacity are not readily filled.
  • Blocks 669, 671 and 675 contain data of more than one file, which means that when one of the files is deleted or its data stored in the common block becomes obsolete, data reclaim will likely be done to reclaim the capacity of the block occupied by obsolete data.
  • data of a particular file are allowed to be stored in only one, two or some " other number of fractal blocks at any one time.
  • data of any one file may be stored in two or fewer fractal blocks but no more.
  • a process of designating a new active block to store data of a file is so constrained.
  • One of a set of permitted file states is assigned to each file that is defined by the types of blocks in which data of the file are stored.
  • the type of block so designated depends upon the state of the file and, in many cases, also other factors.
  • FIG 15 in terms of types and combinations of fractal blocks and a full program block in which data of the file are stored, in a specific implementation of the memory operation concepts described herein.
  • Each of the permitted file states allows storage of data in no more than two fractal blocks or only one full program block. There is no restriction on the number of file blocks that may be associated with a file.
  • These file states are used to select an active block for the storage of file data, both when that data are received by the memory from a host and when the data are being relocated within the memory during a reclaim operation.
  • the state of every file stored in the memory system is monitored and recorded in the file index table (FIT) 613 ( Figure 11), such as in a header for the FIT records of the file, together with other information. Whenever a state transition occurs, the FIT entry is updated to record the new file state.
  • FIT file index table
  • Figure 15 are illustrated by a state diagram of Figure 16 and described in the table of Figure 17. These three figures provide the details of a preferred operation of the memory system, and are believed to be sufficient by themselves to do this. Certain aspects of this operation, however, will now be additionally described.
  • a file is designated to be in state 0 because no data are stored in a fractal block.
  • the only other type of block is a file block, so either the file has data written only to one or more file blocks, which most likely is a temporary condition because of the exactness required between the amount of data and block capacity, or the file has no data stored in any block.
  • This later condition occurs when the memory system first receives information of a new file but has not yet written any data for that file.
  • an active block needs to be designated to receive the data.
  • an erased block is designated as the active block. Once data are written into the erased block, the file transitions from state 0 to state 2 (see Figure 16) since this block has become an active program block.
  • a partial block is designated as the active block if one is available with enough erased capacity for storage of the known amount of data.
  • the file has then transitioned from state 0 to state 3 (see Figure 16).
  • Such a partial block can be a . program block or a common block. The best fit possible is made between the known data length and the remaining storage capacities of available partial blocks. If there is no partial block with sufficient capacity for the known amount of data, then the data are written to an erased block, resulting in the file transitioning from state 0 to state 2 instead.
  • a characteristic of a file in state 2 is that a program block is allocated to receive additional data of the file. But if the file is large enough, the block will eventually become full and another active block then needs to be designated. If the full block, now a file block, contains no obsolete data, the file returns to state 0, where no active block is designated. An erased block or a partial block is then designated as the new active block, depending upon the amount of additional data to be stored, as discussed above. But if the full block contains obsolete data and the maximum offset for the file is less than the range of offset addresses that can be accommodated by a single block, then it is a full program block, according to the definition given above.
  • the block be compacted by copying its valid data to an erased block, and the original block erased.
  • the resulting block then contains this valid data and erased capacity, which is a partial block.
  • This new partial block then becomes the active program block.
  • the state of the file has then transitioned from state 2 to state 1 and then back to state 2 (see Figure 16). But if data for the file are received, while in state 1, whose offset address is beyond the range of addresses that a single block can accommodate, the full program block becomes a file block. The file has then transitioned to state 0.
  • the active program block that exists when the file is in state 2 may be selected as a destination block for a known amount of data of another file from a source block during a reclaim operation.
  • the identity of the program block is maintained on a list of partial blocks that includes the available erased capacity in each of the blocks on the list.
  • the amount of data to be copied from a source block is fit into the erased capacity of a partial block on the list. If the program block for the current file is selected as a destination block for data of another file during a reclaim operation, the program block becomes an active common block of the current file, after the data of the other file is copied into its erased capacity.
  • the file has then transitioned from state 2 to state 3 (see Figures 15 and 16).
  • a transition from file state 4 to state 3 occurs when its program block is designated to be a reclaim block.
  • Data of the file in the program block are moved to a common block as part of a reclaim operation, after which the common block becomes the active block for the file.
  • the file is stored in two fractal blocks. Another block cannot be allocated as the active block until one of the fractal blocks is eliminated.
  • Data in the program block are therefore moved (data transition) to erased capacity of a partial block as part of a transition from state 4 to state 7, thereby eliminating the fractal program block.
  • the resulting common block then becomes the active block for the file.
  • a further possibility when the file is in state 3 is that the active common block to which data of the file are being written becomes full. The file then has no active block to which further data may be written, and has transitioned to state 5. This state is similar in operation to that of file state 0, in that there is no active block for the file but it is different in that data of the file is contained in a full common block when the file is in state 5.
  • state O there is no fractal block containing data of the file.
  • Both states O and 5 are usually temporary states from which a transition takes place as soon as additional data of the file are to be written.
  • file state 9 is a stable state, since a file may remain with two full common blocks for a time during which no additional data are written to the file. But there is no active block designated when the file is in that state.
  • Information of the file state is used for determining the type of block to be allocated as the active block for the file when data are to be programmed for a file and no active block currently exists for the file.
  • the table of Figure 20 summarizes in the right hand column the allocation of active blocks for files in any one of states 0-9 under the conditions set forth in the middle column. The type of block that is selected in the order shown.
  • “best fit partial block” is meant a partial block having an amount of erased capacity that the known amount of data can efficiently utilize. If there is not a suitable partial block, an erased block is most commonly chosen.
  • a "biggest partial block” is allocated, which is a block that does not have enough erased capacity to hold the entire amount of data to be written but which is the block that can hold ' the " greatest amount of that data.
  • the file then changes its state, and the new state controls the selection of the block to receive the remaining amount of data that does not fit into the biggest partial block.
  • an erased block is allocated as the active block.
  • part of the block management includes reclaiming unused capacity in blocks for the storage of new data. This is not of particular concern when the amount of data stored in the memory system is far less than its capacity but a memory system is preferably designed to operate as if it is full of data. That means that blocks which contain only obsolete data, and other blocks that contain valid data but also have some obsolete data and/or unwritten erased pages, can be dealt with in a manner to reclaim this unused capacity. The goal is to utilize the storage capacity of the memory system as completely as possible, while at the same time minimizing adverse effects on performance of the system. Reclaiming of blocks is noted as 617 in the overall system operation diagram of Figure 11.
  • Any valid data in a block designated for a reclaim operation is copied into one or more blocks (destination blocks) with sufficient erased capacity to store the valid data.
  • the destination block is selected in accordance with the block management techniques described above.
  • the data of each file stored in the source block are copied to a type of block that is selected on the basis of the state of file and other factors, as described above. Examples of data copying between different types of files as part of reclaims operation are given in Figures 21 A - 21D. LUUJ.46] """ ""” In figure 21 A, reclaim operations on two partial blocks 681 and 683 are illustrated, as examples.
  • the block 681 is a program block in which valid data of a file A are stored, while also containing erased capacity storing no data.
  • One possible reclaim operation depending upon the state of file A, is to copy data of file A of block 681 into available erased capacity of another partial block 685 that already includes data of a different file B, thus making it a common block.
  • the data group(s) in the block 681 is then no longer referenced in the FIT and the block the block is noted to be obsolete.
  • file A had one of states 2, 4 or 8 (see Figure 15) that includes a program block.
  • the data may then be moved to another fractal block while the file remains written to a maximum of two fractal blocks.
  • file A has transitioned to one of the states 3, 4, 6 or 7, which include data of the file being stored in a common block, depending on the types of blocks in which other data of the file are stored.
  • the block 683 of Figure 21A is a common block that is being reclaimed by copying its stored data of files C and D into erased capacity of a program block 687 containing data of file E, which then becomes a common block.
  • the data of files C and D in the block 683 are then obsolete, as is the block itself.
  • the state of each of the files C and D has not changed since the data have been moved from one common block to another.
  • the state of file E has changed either from 2 to 3 or from 8 to 7.
  • the data of each of the files C and D can be moved to different blocks from each other and need not necessarily be copied to available space of a common block.
  • the states of the files could then possibly transition to other states.
  • Illustrated in Figure 21B are reclaim operations on example blocks 689 and 691.
  • Each of these blocks is an obsolete block since it is full of data, both valid and obsolete.
  • the block 689 is a file block containing data of a file F, a portion of which are obsolete and the remainder valid. This can occur, for example, during an update of file F where new data are physically written at the end of the file that have the same logical offsets as existing data of the file, and the existing data then become obsolete.
  • the data of File F are copied into erased capacity of a Drogram block 693 containing data of a file G 5 resulting in changing the type of block 693 to a common block.
  • the valid data of the file F could alternatively be written to an erased block, which would then result in the block being a program block.
  • the block 691 of Figure 21B is a full common block containing invalid data of file H and valid data of file I.
  • the valid data of file I is copied, in this example, from the block 691 into an erased block 695.
  • the block 695 then becomes a program block.
  • the data of file I could be written to a partial block containing data of another file, if a good fit can be found.
  • the destination block will depend upon the state of file I at the time of the reclaim operation.
  • Figure 21D shows an example of a file block 697 in which data of a file J are stored.
  • file J is deleted by the host, the data of file J in block 697, and possibly also in other blocks, are rendered obsolete.
  • the block 697 then becomes invalid. Reclaiming the invalid block provides an erased block for the system erased block pool.
  • deletion of a file from the memory also commonly causes data of the file in one or more fractal blocks, such as a common block or a full common block, to become obsolete. That block is then subject to a reclaim operation since the remaining valid data of another file will be less than the storage capacity of the block and can be a small amount.
  • One or more lists are maintained for partial, obsolete and invalid blocks, depending upon the specific embodiment, as indicated by a step 701.
  • the list(s) may be kept as part of the block lists 615 ( Figure 11).
  • this list(s) of blocks is built at the time of initiation of the memory system, such as when power is first applied.
  • This list(s) can include other information of the blocks that enable the selection of one reclaim block at a time, such as the amount of valid data in each block and the amount of erased memory in each block. These quantities are typically measured in terms of a number of pages of the block, or metapages if metablocks are being used.
  • a preferred alternative technique is to maintain these lists in non-volatile memory and to add or update an entry for a block in the list whenever its status changes. With this technique, it is not necessary to scan the blocks and build the lists when the memory system is initialized.
  • the list(s) of such blocks changes constantly as data are written, updated, moved, deleted, and so forth. Changes that result in blocks changing their types to and from partial, obsolete and invalid cause the list(s) maintained by the step 701 of Figure 22 to change. Changes in the amount of valid data individually stored in such blocks, and in the amount of erased capacity are also noted in the block lists 615 ( Figure 11).
  • a single reclaim block is preferably identified from those on the updated list(s) as the next in order to be reclaimed. If a partial or obsolete block, it is a source of valid data to be copied into another block referred to as a destination block. Several specific techniques that may be used to select the source block are described below.
  • a next step 705 determines whether it is appropriate to perform the reclaim operation at the current time, considering the memory operations that need to be performed in response to commands of a host. If the host has sent an idle command " to the memory system, or something similar that indicates there will be some period of time when the host will not be expecting the memory system to perform a particular operation, then the memory system is free to carry out overhead operations in the foreground including a reclaim operation. Even if the memory system is busy writing data to or reading data from the memory in response to a host command, the reclaim operation, particularly its data copying, can be interleaved with data write and read operations. Such interleaving is described in United States patent applications serial no. 11/259,423 of Alan Sinclair, filed October 25, 2005, and serial no. 11/312,985 of Alan Bennett et al., filed December 19, 2005.
  • the process differs depending on whether the identified reclaim block contains valid data, and, if so, whether it contains valid data of more than one file. If a partial block or obsolete block, it will, by definition, contain valid data, and, if a common block or a full common block, will contain valid data of two or more files. Whether or not there is valid data in the reclaim block is determined by a step 707. If there is valid data that must be moved, data of a single file are identified and a destination block is identified to receive that data, in a next step 709.
  • the destination block is identified by the process described above with respect to Figures 15-17, in order to maintain all the data of the file to which the valid data belongs stored in two or fewer fractal blocks (in this example). Copying of the valid data of one file from the source reclaim block to the destination block is then begun, as indicated by a step 711. After these data are copied, the processing returns to the step 707 to determine whether data of another file remains. If so, the process of steps 709 and 711 are repeated for the additional data.
  • the destination block is selected independently of the earlier selection for data of a different file. This continues until it is determined in the step 707 that there is no more data in the source block to be moved, in which case the source block may be erased, per a step 713. This block may then be placed into the erased block pool for use to store new data.
  • step 707 if the source block contains no valid data, which is the case for an invalid block, there is no valid data to be moved.
  • the source block only needs to be erased. The processing therefore, in that case, bypasses the steps 709 and 711, as shown in Figure 22.
  • a single list is maintained by the step 701 of partial, obsolete and invalid blocks.
  • the amount of valid data in the block is included in the individual entries on the list.
  • the block selected from the list as the reclaim block is that having the least valid data. If there is one invalid block on the list, that block will be selected first since it has no valid data. If there are many invalid blocks on the list, the one that has been there the longest is chosen. If there is no invalid block on the list, then a block having the least amount of valid data is chosen as the reclaim block.
  • the reclaim operation then takes less time than when there is more valid data to be copied from one block to another.
  • other operations of the memory system such as the speed of writing data to and reading data from the memory, are maintained at a high rate.
  • a newly erased block is obtained at a lesser cost to memory performance.
  • This first embodiment of the process of Figure 22 for selecting a source block on the basis of the amount of valid data in fractal blocks on a single list has an advantage of being relative simple to implement. However, this process may be refined by also considering the value of partial blocks. Partial blocks have erased capacity into which data may be written, while neither the obsolete block nor the invalid block contains any erased capacity. Before obsolete blocks may be used for storing new data, any valid data must be moved out of them and into another block, so that they may then be erased and made available for the storage of new data. But partial blocks have erased capacity into which data may be written without having to endure the overhead of a reclaim operation. It may not be beneficial, for example, to reclaim a partial block only because it contains the least amount of valid data when it also contains a large amount of erased capacity into which data may be written.
  • a partial block is selected as a candidate for the reclaim source block on the basis of both the amount of valid data and the amount of erased capacity that exist in the partial blocks.
  • me components of data in a partial block are shown in Figure 23.
  • the block (can be a metablock) has a certain number of one or more pages (can be metapages) containing valid data and one or more other pages that are erased and into which data may be written.
  • the partial block may also contain one or more other pages that contain obsolete data, as shown in example of Figure 23.
  • the partial blocks are preferably maintained by the step 701 in a list that is separate from list(s) of obsolete and invalid blocks.
  • Partial blocks are moved toward a head of their list for a reclaim operation when they have little erased capacity (which means that they are not very useful in their present state) and small amounts of valid data that need to be moved. Such blocks will primarily contain obsolete data.
  • partial blocks having large amounts of erased capacity (meaning that they are potentially useful to store data) and large amounts of valid data to be moved will be the least likely to be identified as candidates for the reclaim block. Reclaiming a partial block with erased capacity does not add the same amount of storage capacity to the memory system as does reclaiming an obsolete block. Invalid blocks are clearly the most attractive blocks to reclaim since they have no beneficial erased capacity and no valid data that need to be copied.
  • step 701 three separate lists are maintained by the step 701, one for each of the partial, obsolete and invalid blocks. If there are invalid blocks, the reclaim block is selected from the list of invalid blocks until there are no more blocks on that list. There is no particular order of listing invalid blocks except possibly in a first-in first- out (FIFO) order so that the invalid block that has been on the list the longest is chosen first. Next, if there are no invalid blocks, a block is chosen from the obsolete block list that has the least amount of valid data of all the blocks on that list.
  • FIFO first-in first- out
  • a block on the partial block list is chosen in step 703 as the reclaim block.
  • a partial block could be chosen to be that with the least amount of valid data, it is preferred to rank the partial blocks in a way that recognizes the benefit of their erased capacity. " For this purpose, a "reclaim gain" can be calculated for each partial block, as follows:
  • S is the block size in terms of its total number of data storing pages
  • E is the number of pages of erased capacity into which data may be written
  • V is the number of pages containing valid data that needs to be moved to another block.
  • a constant k is included to weight the positive effect of the erased capacity of the block but can be set at 1.
  • kE increases, the resulting reclaim gain goes down.
  • V goes up, the reclaim gain also goes down.
  • the partial block with the highest value of reclaim gain is selected in the step 703 as the reclaim block.
  • Other mathematical expressions can alternately be used to define a reclaim gain in terms of E and V that balance the detriment to system operation of containing valid data and the benefit of having erased capacity.
  • the reclaim gain may be calculated each time there is a change in the block, such as each time data are written into its erased capacity, and stored as part of the information maintained by file directory or FIT.
  • FIG 25 shows a method of selecting a reclaim block (step 703 of Figure 22) from separate partial, obsolete and invalid block lists (as maintained by step 701 of Figure 22).
  • a step 721 first determines whether there is a block listed on the invalid block list. If there are multiple such blocks, the block that has been on the list the longest is selected by a step 723 as the reclaim block. If there is no block on the invalid block list, then it is determined by a step 725 whether there is an entry on the obsolete block list. If so, in the case where more than one block is on the obsolete block list, the block having the least amount of valid data is selected by a step 727 as the reclaim block.
  • the partial block list is consulted in a step 729.
  • " tn ' e one having the highest reclaim gain is selected as the reclaim block.
  • the reclaim gain takes into account the amount of valid data and erased capacity in the block, such as by using equation (1) above. If there is nothing on the partial block list, the process is repeated, by returning to the step 721, until a block appears on one of the lists. After the selection of a reclaim block, the processing proceeds to step 705 of Figure 22.
  • a third embodiment is shown by a flowchart of Figure 24.
  • Execution of the step 703 of Figure 22 also starts by a step 741 that looks for an entry on the invalid block list maintained by the step 701 of Figure 22. If there is more than one entry on the invalid block list, the oldest is selected by a step 743 of Figure 25 to be the reclaim block. If there is no entry on the invalid block list, a next step 745 determines whether there is an entry on the obsolete block list. If so, subsequent steps differ from the embodiment of Figure 24 in that, if there is also at least one entry on the partial block list, it is determined whether it is best to select the reclaim block from the obsolete or partial block lists.
  • a step 747 identifies the block on the obsolete block list that contains the least amount of valid data. It is then determined whether at least one block exists on the partial block list, by a step 749, and, if so, the block with the least amount of valid data is identified, in a step 751.
  • a next step 753 then makes a choice between the one block identified from the obsolete block list and the one block identified on the partial block list. For this purpose, a quantity (V + kE) is calculated for the block identified from the partial block list in the step 751, the terms V, E and k being the same as used above. It is this quantity that is compared with the amount V of valid data in the block identified in step 747 from the obsolete block list.
  • the obsolete block is chosen as the reclaim block, in a step 755. But if the V of the obsolete block is greater than the (V + kE) quantity of the identified partial block, then the partial block is selected in a step 757 as the reclaim block.
  • step 759 it is determined in a step 759 whether there is a block listed on the partial block list. If not, the process returns to the step 741 to be repeated until a block is placed on one of the three lists. If there are multiple partial blocks listed, then, in a step 761, the block having the least amount of valid data is selected as the reclaim block. Alternatively, the partial block may be selected by use of the reclaim gain as described with respect to step 731 of the second embodiment ( Figure 24).
  • the third embodiment may alternatively make use of only two lists.
  • the first list is an obsolete block list that contains entries for blocks that contain obsolete data and no erased memory capacity. Rather than using a separate invalid block list as show in Figure 25, both invalid and obsolete blocks are placed on a single "obsolete" block list.
  • the blocks may optionally contain valid data.
  • Each entry in the list has a field containing a value defining the amount of valid data in the block to which it relates.
  • the entries in the list are ordered according to the values in these fields. Blocks containing obsolete data and no valid data (invalid blocks) are therefore grouped together at the head of this first list.
  • the second list in this alternative to the third embodiment is a partial block list that contains entries for blocks that contain some erased memory capacity.
  • the blocks may optionally contain valid data.
  • Each entry in the list has a field containing a value defining the amount of valid data in the block to which it relates.
  • the entries in the list are ordered according to the values in these fields.
  • a block may be selected from the head (block with the least amount of invalid data) of either the first or second list by the technique of step 753 of Figure 25.
  • a table of Figure 26 sets forth details of the types of blocks that are placed on " ffie ' paftial and obsolete block lists for a reclaim operation according to this modification of the third embodiment.
  • a block contains both valid data and erased capacity. It does not matter whether there is any obsolete data in the block.
  • the block contains obsolete data and either valid data or erased capacity but not both.

Abstract

Host system data files are written directly to a large erase block flash memory system with a unique identification of each file and offsets of data within the file but without the use of any intermediate logical addresses or a virtual address space for the memory. Directory information of where the files are stored in the memory is maintained within the memory system by its controller, rather than by the host. A type of memory block is selected to receive additional data of a file that depends upon the types of blocks into which data of the file have already been written. Blocks containing data are selected for reclaiming any unused capacity therefrom by a process that selects blocks in order starting with those containing the least amount of valid data.

Description

RECLAIMING DATA STORAGE CAPACITY IN FLASH MEMORY
SYSTEMS
GENERAL BACKGROUND
[0001] This application relates to the operation of re-programmable non-volatile memory systems such as semiconductor flash memory, and, more specifically, to the management of the interface between a host device and the memory.
[0002] There are two primary techniques by which data communicated through external interfaces of host systems, memory systems and other electronic systems are addressed. In one of them, addresses of data files generated or received by the system are mapped into distinct ranges of a continuous logical address space established for the system. The extent of the address space is typically sufficient to cover the full range of addresses that the system is capable of handling. In one example, magnetic disk storage drives communicate with computers or other host systems through such a logical address space. This address space has an extent sufficient to address the entire data storage capacity of the disk drive. In the second of the two techniques, data files generated or received by an electronic system are uniquely identified and their data logically addressed by offsets within the file. A form of this addressing method is used between computers or other host systems and a removable memory card known as a "Smart Card." Smart Cards are typically used by consumers for identification, banking, point-of-sale purchases, ATM access and the like.
[0003] In an early generation of commercial flash memory systems, a rectangular array of memory cells were divided into a large number of groups of cells that each stored the amount of data of a standard disk drive sector, namely 512 bytes. An additional amount of data, such as 16 bytes, are also usually included in each group to store an error correction code (ECC) and possibly other overhead data relating to the user data and/or to the memory cell group in which the associated user data are stored. The memory cells in each such group are the minimum number of memory cells that are erasable together. That is, the erase unit is effectively the number of memory cells that store one data sector and any overhead data that is included. Examples of this type "of memory system are described in United States patents nos. 5,602,987 and 6,426,893, It is a characteristic of flash memory that the memory cells are erased prior to re-programming them with data.
[0004] Flash memory systems are most commonly provided in the form of a memory card or flash drive that is removably connected with a variety of hosts such as a personal computer, a camera or the like, but may also be embedded within such host systems. When writing data to the memory, the host typically assigns unique logical addresses to sectors, clusters or other units of data within a continuous virtual address space of the memory system. Like a disk operating system (DOS), the host writes data to, and reads data from, addresses within the logical address space of the memory system. A controller within the memory system translates logical addresses received from the host into physical addresses within the memory array, where the data are actually stored, and then keeps track of these address translations. The data storage capacity of the memory system is at least as large as the amount of data that is addressable over the entire logical address space defined for the memory system.
[0005] In later generations of flash memory systems, the size of the erase unit was increased to a block of enough memory cells to store multiple sectors of data. Even though host systems with which the memory systems are connected may program and read data in small minimum units such as sectors, a large number of sectors are stored in a single erase unit of the flash memβry. It is common for some sectors of data within a block to become obsolete as the host updates or replaces logical sectors of data. Since the entire block must be erased before any data stored in the block can be overwritten, new or updated data are typically stored in another block that has been erased and has remaining capacity for the data. This process leaves the original block with obsolete data that take valuable space within the memory. But that block cannot be erased if there are any valid data remaining in it.
[0006] Therefore, in order to better utilize the memory's storage capacity, it is common to consolidate or collect valid partial block amounts of data by copying them into an erased block so that the block(s) from which these data are copied may then be erased and their entire storage capacity reused. It is also desirable to copy the data in order "to "group data sectors within a block in the order of their logical addresses since this increases the speed of reading the data and transferring the read data to the host. If such data copying occurs too frequently, the operating performance of the memory system can be degraded. This particularly affects operation of memory systems where the storage capacity of the memory is little more than the amount of data addressable by the host through the logical address space of the system, a typical case. In this case, data consolidation or collection may be required before a host programming command can be executed. The programming time is then increased as a result.
[0007] The sizes of the blocks have been increasing in successive generations of memory systems in order to increase the number of bits of data that may be stored in a given semiconductor area. Blocks storing 256 data sectors and more are becoming common. Additionally, two, four or more blocks of different arrays or sub-arrays are often logically linked together into metablocks in order to increase the degree of parallelism in data programming and reading. Along with such large capacity operating units come challenges in operating them efficiently.
[0008] A common host interface for such memory systems is a logical address interface similar to that commonly used with disk drives. Files generated by a host to which the memory is connected are assigned unique addresses within the logical address space of the interface. The memory system then commonly maps data between the logical address space and the physical blocks or metablocks of the memory. The memory system keeps track of how the logical address space is mapped into the physical memory but the host is unaware of this. The host keeps track of the addresses of its data files within the logical address space but the memory system operates without knowledge of this mapping.
SUMMARY OF THE INVENTION
[0009] Many techniques have been developed that overcome to various degrees certain of the problems encountered in efficiently operating such large erase block irasn memδry " systems. The present invention, on the other hand, is based upon a fundamental change, namely by changing the data transfer interface between the memory and the host system. Rather than communicating data between them by the use of logical addresses within a virtual address space, a data file is identified by a filename assigned by the host and its accessed by offset address within the file. The memory system then knows the host file to which each sector or other unit of data belongs. The file unit being discussed herein is a set of data that is ordered, such as by having sequential offset addresses, and which is created and uniquely identified by an application program operating in a host computing system.
[0010] This is not employed by most current commercial memory systems since hosts now identify data to the memory system within all files by a common set of logical addresses without identifying the files. By identifying host data by file objects instead of using logical addresses, the memory system controller can store the data in a manner that reduces the need for such frequent data consolidation and garbage collection. The frequency of data copy operations and the amount of data copied are thus significantly reduced, thereby increasing the data programming and reading performance of the memory system. Further, the memory system controller maintains directory and index table information of the memory blocks into which host files are stored. It is then unnecessary for the host to maintain the file allocation table (FAT) that is currently necessary for managing a logical address interface.
[0011] Block reclaim operations include garbage collection and data consolidation, wherein, in general, valid data of underutilized blocks are gathered together in other blocks and the underutilized blocks are then erased and made available for accepting new data. In accordance with an aspect of the present invention, blocks of memory cells are selected to be reclaimed on the basis of the content of the blocks. In memory systems utilizing a logical address interface, a block of memory cells is typically reclaimed in response to the host closing a logical data block that is mapped into the physical block, not on the basis of the content of the physical block. By including block content in the selection criteria, more efficient operation of the memory system is made possible. iyui2] In" specific embodiments, blocks partially filled with valid data are chosen for a reclaim operation based on the amount of valid data contained in them. Blocks with the least amount of valid data can be reclaimed most efficiently since there is less data to be copied to another block. Since the copying of data takes a significant amount of time away from other memory operations, such as data programming or reading, the selection of a block for reclaim that has the least amount of valid data, for example, means that this block can be made available for the storage of new data with the least negative effect on system performance. Since some blocks containing a small amount of valid data also contain some erased capacity into which data may be written without having to reclaim the block, some embodiments include taking the amount of erased capacity in the blocks into consideration when selecting a block to be reclaimed. If two blocks have the same amount of valid data stored in them but one has some erased capacity and the other does not, for example, the block without the erased capacity is reclaimed first since there is more to be gained. The block with erased capacity has current value for the storage of new data, depending on the amount of data that can be written into it, while the block without erased capacity does not.
[0013] Other aspects, advantages, features and details of the present invention are included in a description of exemplary examples thereof that follows, which description should be taken in conjunction with the accompanying drawings.
[0014] All patents, patent applications, articles, other publications, documents and things referenced herein are hereby incorporated herein by this reference in their entirety for all purposes. To the extent of any inconsistency or conflict in the definition or use of terms between any of the incorporated publications, documents or things and the present application, those of the present application shall prevail.
BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 schematically illustrates a host and a connected non-volatile memory system as currently implemented; [UU16] Figure 2 is a block diagram of an example flash memory system for use as the non-volatile memory of Figure 1;
[0017] Figure 3 is a representative circuit diagram of a memory cell array that may be used in the system of Figure 2;
[0018] Figure 4 illustrates an example physical memory organization of the system of Figure 2;
[0019] Figure 5 shows an expanded view of a portion of the physical memory of Figure 4;
[0020] Figure 6 shows a further expanded view of a portion of the physical memory of Figures 4 and 5;
[0021] Figure 7 illustrates a common prior art logical address interface between a host and a re-programmable memory system;
[0022] Figure 8 illustrates in a different manner than Figure 7 a common prior art logical address interface between a host and a re-programmable memory system;
[0023] Figure 9 illustrates a direct file storage interface between a host and a reprogrammable memory system, according to the present invention;
[0024] Figure 10 illustrates in a different manner than Figure 9 a direct file storage interface between a host and a re-programmable memory system, according to the present invention;
[0025] Figure 11 is a functional block diagram of a memory system operating with a direct data file storage interface;
[0026] Figure 12 illustrates an operating cycle of a direct data file memory;
[0027] Figures 13A-13D show four different examples of writing data of files directly into the memory;
[0028] Figures 14A-14E show examples of a data file stored in various allowed combinations of types of blocks;
[0029] Figure 15 is a list of permitted file states by the types of blocks in which data of individual files are stored;
[0030] Figure 16 is a state diagram showing permitted primary transitions between the file states listed in Figure 15;
[0031] Figure 17 is a table that describes the primary file state transitions illustrated in the state diagram of Figure 16;
[0032] Figure 18 is a state diagram showing resulting secondary transitions between the file states listed in Figure 15;
[0033] Figure 19 is a table that describes the secondary file state transitions illustrated in the state diagram of Figure 18;
[0034] Figure 20 is a summary table listing the types of blocks allocated as active blocks under conditions of Figures 15-20;
[0035] Figures 21A-21D show examples of block reclaim operations;
[0036] Figure 22 is a flowchart that illustrates a reclaim operation in general terms;
[0037] Figure 23 illustrates types of data stored in a typical partial memory cell block;
[0038] Figure 24 provides details of a specific embodiment that carries out one of the steps of the flowchart of Figure 22;
[0039] Figure 25 provides details of an alternate embodiment to execute the same step of the flowchart of Figure 22; and
[0040] Figure 26 is a table defining the block types placed on two block lists of yet another embodiment. " "'" ""FLASH MEMORY SYSTEM GENERAL DESCRIPTION
[0041] A common flash memory system and a typical operation with host devices are described with respect to Figures 1 - 8. It is in such a system that the various aspects of the present invention may be implemented. A host system 1 of Figure 1 stores data into and retrieves data from a flash memory 2. Although the flash memory can be embedded within the host, the memory 2 is illustrated to be in the more popular form of a card that is removably connected to the host through mating parts 3 and 4 of a mechanical and electrical connector. There are currently many different flash memory cards that are commercially available, examples being those sold under trademarks CompactFlash (CF), the MultiMediaCard (MMC), Secure Digital (SD), miniSD, microSD, Memory Stick, SmartMedia and TransFlash. Although these cards have unique mechanical and/or electrical interfaces according to their standardized specifications, the flash memory included in each is very similar. These cards are all available from SanDisk Corporation, assignee of the present application. SanDisk also provides a line of flash drives under its Crazer trademark, which are hand held memory systems in small packages that have a Universal Serial Bus (USB) plug for connecting with a host by plugging into the host's USB receptacle. Each of these memory cards and flash drives includes controllers that interface with the host and control operation of the flash memory within them.
[0042] Host systems that use such memory cards and flash drives are many and varied. They include personal computers (PCs), laptop and other portable computers, cellular telephones, personal digital assistants (PDAs), digital still cameras, digital movie cameras and portable audio players. The host typically includes a built-in receptacle for one or more types of memory cards or flash drives but some require adapters into which a memory card is plugged. The memory system usually contains its own memory controller and drivers but there are also some memory only systems that are instead controlled by software executed by the host to which the memory is connected. In some memory systems containing the controller, especially those embedded within a host, the memory, controller and drivers are often formed on a single integrated circuit chip. LUU43] The host system 1 of Figure 1 may be viewed as having two major parts, insofar as the memory 2 is concerned, made up of a combination of circuitry and software. They are an applications portion 5 and a driver portion 6 that interfaces with the memory 2. In a personal computer, for example, the applications portion 5 can include a processor running word processing, graphics, control or other popular application software. In a camera, cellular telephone or other host system that is primarily dedicated to performing a single set of functions, the applications portion 5 includes the software that operates the camera to take and store pictures, the cellular telephone to make and receive calls, and the like.
[0044] The memory system 2 of Figure 1 includes flash memory 1, and circuits 8 that both interface with the host to which the card is connected for passing data back and forth and control the memory 7. The controller 8 typically converts between logical addresses of data used by the host 1 and physical addresses of the memory 7 during data programming and reading.
[0045] Referring to Figure 2, circuitry of a typical flash memory system that may be used as the non-volatile memory 2 of Figure 1 is described. The system controller is usually implemented on a single integrated circuit chip 11 that is connected in parallel with one or more integrated circuit memory chips over a system bus 13, a single such memory chip 15 being shown in Figure 2. The particular bus 13 that is illustrated includes a separate set of conductors 17 to carry data, a set 19 for memory addresses and a set 21 for control and status signals. Alternatively, a single set of conductors may be time shared between these three functions. Further, other configurations of system buses can be employed, such as a ring bus that is described in United States patent application serial no. 10/915,039, filed August 9, 2004, entitled "Ring Bus Structure and It's Use in Flash Memory Systems," now publication no. 2006/0031593 Al.
[0046] A typical controller chip 11 has its own internal bus 23 that interfaces with the system bus 13 through interface circuits 25. The primary functions normally connected to the bus are a processor 27 (such as a microprocessor or microcontroller), a read-only-memory (ROM) 29 containing code to initialize ("boot") the system, read-only-memory (RAM) 31 used primarily to buffer data being transferred between the memory and a host, and circuits 33 that calculate and check an error correction code (ECC) for data passing through the controller between the memory and the host. The controller bus 23 interfaces with a host system through circuits 35, which, in the case of the system of Figure 2 being contained within a memory card, is done through external contacts 37 of the card that are part of the connector 4. A clock 39 is connected with and utilized by each of the other components of the controller 11.
[0047] The memory chip 15, as well as any other connected with the system bus 13, typically contains an array of memory cells organized into multiple sub-arrays or planes, two such planes 41 and 43 being illustrated for simplicity but more, such as four or eight such planes, may instead be used. Alternatively, the memory cell array of the chip 15 may not be divided into planes. When so divided however, each plane has its own column control circuits 45 and 47 that are operable largely independently of each other. The circuits 45 and 47 receive addresses of their respective memory cell array from the address portion 19 of the system bus 13, and decode them to address a specific one or more of respective bit lines 49 and 51. The word lines 53 are addressed through row control circuits 55 in response to addresses received on the address bus 19. Source voltage control circuits 57 and 59 are also connected with the respective planes, as are p-well voltage control circuits 61 and 63. If the memory chip 15 has a single array of memory cells, and if two or more such chips exist in the system, the array of each chip may be operated similarly to a plane or sub-array within the multi-plane chip described above.
[0048] Data are transferred into and out of the planes 41 and 43 through respective data input/output circuits 65 and 67 that are connected with the data portion 17 of the system bus 13. The circuits 65 and 67 provide for both programming data into the memory cells and for reading data from the memory cells of their respective planes, through lines 69 and 71 connected to the planes through respective column control circuits 45 and 47.
[0049] Although the controller 11 controls the operation of the memory chip 15 to program ""data, read data, erase and attend to various housekeeping matters, each memory chip also contains some controlling circuitry that executes commands from the controller 11 to perform such functions. Interface circuits 73 are connected to the control and status portion 21 of the system bus 13. Commands from the controller are provided to a state machine 75 that then provides specific control of other circuits in order to execute these commands. Control lines 77 - 81 connect the state machine 75 with these other circuits as shown in Figure 2. Status information from the state machine 75 is communicated over lines 83 to the interface 73 for transmission to the controller 11 over the bus portion 21.
[0050] A NAND architecture of the memory cell arrays 41 and 43 is currently preferred, although other architectures, such as NOR, can also be used instead. Examples of NAND flash memories and their operation as part of a memory system may be had by reference to United States patents nos. 5,570,315, 5,774,397, 6,046,935, 6,373,746, 6,456,528, 6,522,580, 6,771,536 and 6,781,877 and United States patent application publication no. 2003/0147278.
[0051] An example NAND array is illustrated by the circuit diagram of Figure 3, which is a portion of the memory cell array 41 of the memory system of Figure 2. A large number of global bit lines are provided, only four such lines 91 - 94 being shown in Figure 2 for simplicity of explanation. A number of series connected memory cell strings 97 - 104 are connected between one of these bit lines and a reference potential. Using the memory cell string 99 as representative, a plurality of charge storage memory cells 107 - 110 are connected in series with select transistors 111 and 112 at either end of the string. When the select transistors of a string are rendered conductive, the string is connected between its bit line and the reference potential. One memory cell within that string is then programmed or read at a time.
[0052] Word lines 115 - 118 of Figure 3 individually extend across the charge storage element of one memory cell in each of a number of strings of memory cells, and gates 119 and 120 control the states of the select transistors at each end of the strings. The memory cell strings that share common word and control gate lines 115 - 120 are made to form a block 123 of memory cells that are erased together. This DiocK of "cells "co'ntaϊns the minimum number of cells that are physically erasable at one time. One row of memory cells, those along one of the word lines 115 - 118, are programmed at a time. Typically, the rows of a NAND array are programmed in a prescribed order, in this case beginning with the row along the word line 118 closest to the end of the strings connected to ground or another common potential. The row of memory cells along the word line 117 is programmed next, and so on, throughout the block 123. The row along the word line 115 is programmed last.
[0053] A second block 125 is similar, its strings of memory cells being connected to the same global bit lines as the strings in the first block 123 but having a different set of word and control gate lines. The word and control gate lines are driven to their proper operating voltages by the row control circuits 55. If there is more than one plane or sub-array in the system, such as planes 1 and 2 of Figure 2, one memory architecture uses common word lines extending between them. There can alternatively be more than two planes or sub-arrays that share common word lines. In other memory architectures, the word lines of individual planes or sub-arrays are separately driven.
[0054] As described in several of the NAND patents and published application referenced above, the memory system may be operated to store more than two detectable levels of charge in each charge storage element or region, thereby to store more than one bit of data in each. The charge storage elements of the memory cells are most commonly conductive floating gates but may alternatively be non- conductive dielectric charge trapping material, as described in United States patent application publication no. 2003/0109093.
[0055] Figure 4 conceptually illustrates an organization of the flash memory cell array 7 (Figure 1) that is used as an example in further descriptions below. Four planes or sub-arrays 131 - 134 of memory cells may be on a single integrated memory cell chip, on two chips (two of the planes on each chip) or on four separate chips. The specific arrangement is not important to the discussion below. Of course, other numbers of planes, such as 1, 2, 8, 16 or more may exist in a system. The planes are individually divided into blocks of memory cells shown in Figure 4 by rectangles!, such as blocks 137, 138, 139 and 140, located in respective planes 131 — 134. There can be dozens or hundreds of blocks in each plane. As mentioned above, the block of memory cells is the unit of erase, the smallest number of memory cells that are physically erasable together. For increased parallelism, however, the blocks are operated in larger metablock units. One block from each plane is logically linked together to form a metablock. The four blocks 137 - 140 are shown to form one metablock 141. All of the cells within a metablock are typically erased together. The blocks used to form a metablock need not be restricted to the same relative locations within their respective planes, as is shown in a second metablock 143 made up of blocks 145 - 148. Although it is usually preferable to extend the metablocks across all of the planes, for high system performance, the memory system can be operated with the ability to dynamically form metablocks of any or all of one, two or three blocks in different planes. This allows the size of the metablock to be more closely matched with the amount of data available for storage in one programming operation.
[0056] The individual blocks are in turn divided for operational purposes into pages of memory cells, as illustrated in Figure 5. The memory cells of each of the blocks 131 - 134, for example, are each divided into eight pages PO - P7. Alternatively, there may be 16, 32 or more pages of memory cells within each block. The page is the unit of data programming and reading within a block, containing the minimum amount of data that are programmed at one time. In the NAND architecture of Figure 3, a page is formed of memory cells along a word line within a block. However, in order to increase the memory system operational parallelism, such pages within two or more blocks may be logically linked into metapages. A metapage 151 is illustrated in Figure 5, being formed of one physical page from each of the four blocks 131 - 134. The metapage 151, for example, includes the page P2 in of each of the four blocks but the pages of a metapage need not necessarily have the same relative position within each of the blocks.
[0057] Although it is preferable to program and read the maximum amount of data in parallel across all four planes, for high system performance, the memory system can also be operated to form metapages of any or all of one, two or three pages in separate blocks in different planes. This allows the programming and reading operations to adaptively match the amount of data that may be conveniently handled in parallel and reduces the occasions when part of a metapage remains unprogrammed with data.
[0058] A metapage formed of physical pages of multiple planes, as illustrated in Figure 5, contains memory cells along word line rows of those multiple planes. Rather than programming all of the cells in one word line row at the same time, they are more commonly alternately programmed in two or more interleaved groups, each group storing a page of data (in a single block) or a metapage of data (across multiple blocks). By programming alternate memory cells at one time, a unit of peripheral circuits including data registers and a sense amplifier need not be provided for each bit line but rather are time-shared between adjacent bit lines. This economizes on the amount of substrate space required for the peripheral circuits and allows the memory cells to be packed with an increased density along the rows. Otherwise, it is preferable to simultaneously program every cell along a row in order to maximize the parallelism available from a given memory system.
[0059] With reference to Figure 3, the simultaneous programming of data into every other memory cell along a row is most conveniently accomplished by providing two rows of select transistors (not shown) along at least one end of the NAND strings, instead of the single row that is shown. The select transistors of one row then connect every other string within a block to their respective bit lines in response to one control signal, and the select transistors of the other row connect intervening every other string to their respective bit lines in response to another control signal. Two pages of data are therefore written into each row of memory cells.
[0060] The amount of data in each logical page is typically an integer number of one or more sectors of data, each sector containing 512 bytes of data, by convention. Figure 6 shows a logical data page of two sectors 153 and 155 of data of a page or metapage. Each sector usually contains a portion 157 of 512 bytes of user or system data being stored and another number of bytes 159 for overhead data related either to the data in the portion 157 or to the physical page or block in which it is stored. The number of bytes of overhead data is typically 16 bytes, making the total 528 bytes for eacn 'bf trϊe""secto"rs 153 and 155. The overhead portion 159 may contain an ECC calculated from the data portion 157 during programming, its logical address, an experience count of the number of times the block has been erased and re- programmed, one or more control flags, operating voltage levels, and/or the like, plus an ECC calculated from such overhead data 159. Alternatively, the overhead data 159, or a portion of it, may be stored in different pages in other blocks.
[0061] As the parallelism of memories increases, data storage capacity of the metablock increases and the size of the data page and metapage also increase as a result. The data page may then contain more than two sectors of data. With two sectors in a data page, and two data pages per metapage, there are four sectors in a metapage. Each metapage thus stores 2048 bytes of data. This is a high degree of parallelism, and can be increased even further as the number of memory cells in the rows are increased. For this reason, the width of flash memories is being extended in order to increase the amount of data in a page and a metapage.
[0062] The physically small re-programmable non-volatile memory cards and flash drives identified above are commercially available with data storage capacity of 512 megabytes (MB), 1 gigabyte (GB), 2 GB and 4GB, and may go higher. Figure 7 illustrates the most common interface between a host and such a mass memory system. The host deals with data files generated or used by application software or firmware programs executed by the host. A word processing data file is an example, and a drawing file of computer aided design (CAD) software is another, found mainly in general computer hosts such as PCs, laptop computers and the like. A document in the pdf format is also such a file. A still digital video camera generates a data file for each picture that is stored on a memory card. A cellular telephone utilizes data from files on an internal memory card, such as a telephone directory. A PDA stores and uses several different files, such as an address file, a calendar file, and the like. In any such application, the memory card may also contain software that operates the host.
[0063] A common logical interface between the host and the memory system is illustrated in Figure 7. A continuous logical address space 161 is large enough to provide addresses for all the data that may be stored in the memory system. The host address space is typically divided into increments of clusters of data. Each cluster may be designed in a given host system to contain a number of sectors of data, somewhere between 4 and 64 sectors being typical. A standard sector contains 512 bytes of data.
[0064] Three Files 1, 2 and 3 are shown in the example of Figure 7 to have been created. An application program running on the host system creates each file as an ordered set of data and identifies it by a unique name or other reference. Enough available logical address space not already allocated to other files is assigned by the host to File 1. File 1 is shown to have been assigned a contiguous range of available logical addresses. Ranges of addresses are also commonly allocated for specific purposes, such as a particular range for the host operating software, which are then avoided for storing data even if these addresses have not been utilized at the time the host is assigning logical addresses to the data.
[0065] When a File 2 is later created by the host, the host similarly assigns two different ranges of contiguous addresses within the logical address space 161, as shown in Figure 7. A file need not be assigned contiguous logical addresses but rather can be fragments of addresses in between address ranges already allocated to other files. This example then shows that yet another File 3 created by the host is allocated other portions of the host address space not previously allocated to the Files 1 and 2 and other data.
[0066] The host keeps track of the memory logical address space by maintaining a file allocation table (FAT), where the logical addresses assigned by the host to the various host files by the conversion 160 are maintained. The FAT table is frequently updated by the host as new files are stored, other files deleted, files modified and the like. The FAT table is typically stored in a host memory, with a copy also stored in the non-volatile memory that is updated from time to time. The copy is typically accessed in the non-volatile memory through the logical address space just like any other data file. When a host file is deleted, the host then deallocates the logical addresses previously allocated to the deleted file by updating the FAT table to show that they are now available for use with other data files. [UU67] The host is not concerned about the physical locations where the memory system controller chooses to store the files. The typical host only knows its logical address space and the logical addresses that it has allocated to its various files. The memory system, on the other hand, through a typical host/card interface, only knows the portions of the logical address space to which data have been written but does not know the logical addresses allocated to specific host files, or even the number of host files. The memory system controller converts the logical addresses provided by the host for the storage or retrieval of data into unique physical addresses within the flash memory cell array where host data are stored. A block 163 represents a working table of these logical-to-physical address conversions, which is maintained by the memory system controller.
[0068] The memory system controller is programmed to store data files within the blocks and metablocks of a memory array 165 in a manner to maintain the performance of the system at a high level. Four planes or sub-arrays are used in this illustration. Data are preferably programmed and read with the maximum degree of parallelism that the system allows, across an entire metablock formed of a block from each of the planes. At least one metablock 167 is usually allocated as a reserved block for storing operating firmware and data used by the memory controller. Another metablock 169, or multiple metablocks, may be allocated for storage of host operating software, the host FAT table and the like. Most of the physical storage space remains for the storage of data files. The memory controller does not know, however, how the data received has been allocated by the host among its various file objects. All the memory controller typically knows from interacting with the host is that data written by the host to specific logical addresses are stored in corresponding physical addresses as maintained by the controller's logical-to-physical address table 163.
[0069] In a typical memory system, a few extra blocks of storage capacity are provided than are necessary to store the amount of data within the address space 161. One or more of these extra blocks may be provided as redundant blocks for substitution for other blocks that may become defective during the lifetime of the memory. The logical grouping of blocks contained within individual metablocks may usually be changed for various reasons, including the substitution of a redundant block for a defective block originally assigned to the metablock. One or more additional blocks, such as metablock 171, are typically maintained in an erased block pool. When the host writes data to the memory system, the controller converts the logical addresses assigned by the host to physical addresses within a metablock in the erased block pool. Other metablocks not being used to store data within the logical address space 161 are then erased and designated as erased pool blocks for use during a subsequent data write operation. In a preferred form, the logical address space is divided into logical groups that each contain an amount of data equal to the storage capacity of a physical memory metablock, thus allowing a one-to-one mapping of the logical groups into the metablocks.
[0070] Data stored at specific host logical addresses are frequently overwritten by new data as the original stored data become obsolete. The memory system controller, in response, writes the new data in an erased block and then changes the logical-to- physical address table for those logical addresses to identify the new physical block to which the data at those logical addresses are stored. The blocks containing the original data at those logical addresses are then erased and made available for the storage of new data. Such erasure often must take place before a current data write operation may be completed if there is not enough storage capacity in the pre-erased blocks from the erase block pool at the start of writing. This can adversely impact the system data programming speed. The memory controller typically learns that data at a given logical address has been rendered obsolete by the host only when the host writes new data to their same logical address. Many blocks of the memory can therefore be storing such invalid data for a time.
[0071] The sizes of blocks and metablocks are increasing in order to efficiently use the area of the integrated circuit memory chip. This results in a large proportion of individual data writes storing an amount of data that is less than the storage capacity of a metablock, and in many cases even less than that of a block. Since the memory system controller normally directs new data to an erased pool metablock, this can result in portions of metablocks going unfilled. If the new data are updates of some data stored in another metablock, remaining valid metapages of data from that other metablock having logical addresses contiguous with those of the new data metapages are also desirably copied in logical address order into the new metablock. The old metablock may retain other valid data metapages. This results over time in data of certain metapages of an individual metablock being rendered obsolete and invalid, and replaced by new data with the same logical address being written to a different metablock.
[0072] In order to maintain enough physical memory space to store data over the entire logical address space 161, such data are periodically compacted or consolidated (garbage collection). It is also desirable to maintain sectors of data within the metablocks in the same order as their logical addresses as much as practical, since this makes reading data in contiguous logical addresses more efficient. So data compaction and garbage collection are typically performed with this additional goal. Some aspects of managing a memory when receiving partial block data updates and the use of metablocks are described in United States patent no. 6,763,424.
[0073] Data compaction typically involves reading all valid data metapages from a metablock and writing them to a new metablock, ignoring metapages with invalid data in the process. The metapages with valid data are also preferably arranged with a physical address order that matches the logical address order of the data stored in them. The number of metapages occupied in the new metablock will be less than those occupied in the old metablock since the metapages containing invalid data are not copied to the new metablock. The old block is then erased and made available to store new data. The additional metapages of capacity gained by the consolidation can then be used to store other data.
[0074] During garbage collection, metapages of valid data with contiguous or near contiguous logical addresses are gathered from two or more metablocks and rewritten into another metablock, usually one in the erased block pool. When all valid data metapages are copied from the original two or more metablocks, they may be erased for future use. [0075] Data consolidation and garbage collection take time and can affect the performance of the memory system, particularly if data consolidation or garbage collection needs to take place before a command from the host can be executed. Such operations are normally scheduled by the memory system controller to take place in the background as much as possible but the need to perform these operations can cause the controller to have to give the host a busy status signal until such an operation is completed. An example of where execution of a host command can be delayed is where there are not enough pre-erased metablocks in the erased block pool to store all the data that the host wants to write into the memory and data consolidation or garbage collection is needed first to clear one or more metablocks of valid data, which can then be erased. Attention has therefore been directed to managing control of the memory in order to minimize such disruptions. Many such techniques are described in the following United States patent applications: serial no. 10/749,831, filed December 30, 2003, entitled "Management of Non- Volatile Memory Systems Having Large Erase Blocks," now publication no. 2005/0144358 Al; serial no. 10/750,155, filed December 30, 2003, entitled "Non- Volatile Memory and Method with Block Management System,"; serial no. 10/917,888, filed August 13, 2004, entitled "Non- Volatile Memory and Method with Memory Planes Alignment," now publication no. 2005/0141313 Al; serial no. 10/917,867, filed August 13, 2004, now publication no. 2005/0141312 Al; serial no. 10/917,889, filed August 13, 2004, entitled "Non- Volatile Memory and Method with Phased Program Failure Handling," now publication no. 2005/0166087 Al; serial no. 10/917,725, filed August 13, 2004, entitled "Non- Volatile Memory and Method with Control Data Management," now publication no. 2005/0144365 Al; serial no. 11/192,220, filed July 27, 2005, entitled "Non- Volatile Memory and Method with Multi-Stream Update Tracking"; serial no. 11/192,386, filed July 27, 2005, entitled "Non- Volatile Memory and Method with Improved Indexing for Scratch Pad and Update Blocks"; and serial no. 11/191,686, filed July 27, 2005, entitled "Non- Volatile Memory and Method with Multi-Stream Updating".
[0076] One challenge to efficiently control operation of memory arrays with very large erase blocks is to match and align the number of data sectors being stored during a given write operation with the capacity and boundaries of blocks of memory. One approach is to configure a metablock used to store new data from the host with less than a maximum number of blocks, as necessary to store a quantity of data less than an amount that fills an entire metablock. The use of adaptive metablocks is described in United States patent application serial no. 10/749,189, filed December 30, 2003, entitled "Adaptive Metablocks," now publication no. 2005/0144357 Al. The fitting of boundaries between blocks of data and physical boundaries between metablocks is described in patent applications serial no. 10/841,118, filed May 7, 2004, now publication no. 2005/0144363 Al, and serial no. 11/016,271, filed December 16, 2004, now publication no. 2005/0144367 Al, entitled "Data Run Programming."
[0077] The memory controller may also use data from the FAT table, which is stored by the host in the non-volatile memory, to more efficiently operate the memory system. One such use is to learn when data has been identified by the host to be obsolete by deallocating their logical addresses. Knowing this allows the memory controller to schedule erasure of the blocks containing such invalid data before it would normally learn of it by the host writing new data to those logical addresses. This is described in United States patent application serial no. 10/897,049, filed July 21, 2004, entitled "Method and Apparatus for Maintaining Data on Non- Volatile Memory Systems," now publication no. 2006/0020744 Al. Other techniques include monitoring host patterns of writing new data to the memory in order to deduce whether a given write operation is a single file, or, if multiple files, where the boundaries between the files lie. United States patent application serial no. 11/022,369, filed December 23, 2004, entitled "FAT Analysis for Optimized Sequential Cluster Management," now publication no. 2006/0020745 Al, describes the use of techniques of this type.
[0078] To operate the memory system efficiently, it is desirable for the controller to know as much about the logical addresses assigned by the host to data of its individual files as it can. Data files can then be stored by the controller within a single metablock or group of metablocks, rather than being scattered among a larger number of metablocks when file boundaries are not known. The result is that the number and complexity of data consolidation and garbage collection operations are reduced. The performance of the memory system improves as a result. But it is difficult for the memory controller to know much about the host data file structure when the host/memory interface includes the logical address space 161 (Figure 7), as described above.
[0079] Referring to Figure 8, the typical logical address host/memory interface as already shown in Figure 7 is illustrated differently. The host generated data files are allocated logical addresses by the host. The memory system then sees these logical addresses and maps them into physical addresses of blocks of memory cells where the data are actually stored.
FILE-BASED MEMORY INTERFACE AND OPERATION
[0080] A different type of interface between a host and memory system for the storage of mass amounts of data eliminates use of the logical address space. The host instead logically addresses each file by a unique fileID (or other unique reference) and offset addresses of units of data (such as bytes) within the file. This file address is given directly to the memory system controller, which then keeps its own table of where the data of each host file are physically stored. This new interface can be implemented with the same memory system as described above with respect to Figures 2 - 6. The primary difference with what is described above is the manner in which that memory system communicates with a host system.
[0081] This file-based interface is illustrated in Figure 9, which should be compared with the logical address interface of Figure 7. An identification of each of the Files 1, 2 and 3 and offsets of data within the files of Figure 9 are passed directly to the memory controller. This logical address information is then translated by a memory controller function 173 into physical addresses of metablocks and metapages of the memory 165. A file directory keeps track of the host file to which each stored sector, page or other unit of file data belongs. [0082] TEe file-based interface is also illustrated by Figure 10, which should be compared with the logical address interface of Figure 8. The logical address space and host maintained FAT table of Figure 8 are not present in Figure 10. Rather, data files generated by the host are identified to the memory system by file number and offsets of data within the file. The memory system controller then directly maps the files to the physical blocks of the memory cell array and maintains file directory and index table information of memory blocks into which host files are stored. It is then unnecessary for the host to maintain the file allocation table (FAT) that is currently necessary for managing a logical address interface.
[0083] Figure 11 is a general block diagram of the major functions of a direct data file system that are carried out by the memory system firmware executed by its processor and by other circuits of the controller. It provides an overall framework in which the specific memory operations described hereinafter may be considered. A file-based interface 601 layer passes commands and data between the memory system and an external host system or a host application being executed on the same memory card or flash drive, for the three main functions of the memory system, namely writing files, deleting files and reading files. Data are stored in a flash memory array 603.
[0084] A file block management function 605 organizes storage of data in flash memory according to the files by which the data is identified, and minimizes the incidence of blocks storing data for more than one file. The physical block of memory cells of the memory 603 is the basic unit of data management.
[0085] Data are organized into metapages by a function 607 for writing into the memory 603, such that individual metapages contain data for a contiguous logical offset address range within a specific file. A function 609 controls access to the memory 603 for reading data stored therein. The deletion of data of a file, when commanded by the host, causes a function 611 to update file indexing information maintained by a function 613 and lists of blocks in a function 615.
[0086] The file data indexing 613 indexes the individual files stored in the memory 603 by a unique file identifier and offset addresses of data within the file. The data for each file are stored as a set of data groups having contiguous logical offset addresses. A file directory identifies the locations in a file index table (FIT) of sets of data group entries for the individual files. The identity of blocks that are erased, either partially programmed with file data or that contain file data together with obsolete data are maintained by the block list function 615.
[0087] The primary purpose of the garbage collection and data consolidation functions described above are to reclaim unused memory space for use to store additional data. In garbage collection, valid data of a source block are copied from blocks also containing obsolete data into one or more destination blocks that have at least some erased space. This gathers valid data into a fewer number of blocks, thus freeing up capacity occupied by obsolete data once the original source block(s) are erased. In data consolidation, valid data of one partially filled block, which thus also contains erased but unused space, are combined with valid data of another partially filled block. Partially filled blocks result most commonly from writing a new file that is closed with its last erased block only partially filled. Once data are consolidated, the source blocks containing the data just copied, which are then duplicate data, are then erased and made available for the storage of new data.
[0088] Both of the garbage collection and data consolidation operations are handled herein together as block reclamation. A function 617 reclaims blocks by controlling the copying of valid file data from a physical block having unprogrammed metapages, or containing obsolete data, to other blocks. This allows the original block to be erased to reclaim the unused space it contained and make this space available for the storage of new file data. A function 619 adaptively controls the occurrence and duration of block reclaim operations, according to the amount of reclaimable capacity and number of erased blocks. Block reclaim is performed at an optimum rate relative to the rate of writing new file data in a manner that maintains good overall performance of the memory system.
[0089] In the functional diagram of Figure 11, a translation layer 621 and interface layer 623 are above the file interface 601, which interfaces with the backend system of the flash memory and controls its operation. In this example, the interface layer 623 has the capability of communicating data outside of the memory system with a host or otherwise, according one of three different protocols. A file interface 625 is that being primarily described herein, wherein data of individual files are identified by a unique file identifier and logical offset addresses within the file. An object interface 627 has a primary use to transfer data files between electronic devices, where the sizes of the files are usually known. Existing protocols for the interface 627 include the Media Transfer Protocol (MTP) and the Picture Transfer Protocol (PTP) from Microsoft Corporation. A backward compatible logical (LBA) interface 629 is also included in this example. Data are transferred through the interface 629 with the protocol currently used by flash memory cards, similar to that of magnetic disk drive systems, where the host addresses data to a defined logical address space of the memory system.
[0090] The translation layer 621 includes protocol adaptors 631, 633 and 635 that function to convert the protocols of respective interface protocols 625, 627 and 629 into a common protocol for the file interface 601. Commands, data formats and the like are converted between different protocols by the translation layer. The LBA protocol adaptor 635 additionally divides the logical address space of the memory system into static files. These files are then handled by the file interface 601 in the same manner as distinct files communicated through the interfaces 625 and 627. Details of the function of the LBA protocol adaptor 635 may be had by reference to United States patent application serial no. 11/196,869, filed August 3, 2005, naming S. A. Gorobets as inventor. More information of the translation and interface layers 621 and 623 is given in United States patent application serial no. 11/316,577, filed December 21, 2005, naming Alan Sinclair as inventor.
[0091] When a new data file is programmed into the memory, the data are written into an erased block of memory cells beginning with the first physical location in the block and proceeding through the locations of the block sequentially in order. The data are programmed in the order received from the host, regardless of the order of the offsets of that data within the file. Programming continues until all data of the file have been written into the memory. If the amount of data in the file exceeds the capacity of a single memory block, then, when the first block is full, programming continues in a second erased block. The second memory block is programmed in the same manner as the first, in order from the first location until either all the data of the file are stored or the second block is full. A third or additional blocks may be programmed with any remaining data of the file. Multiple blocks or metablocks storing data of a single file need not be physically or logically contiguous. For ease of explanation, unless otherwise specified, it is intended that the term "block" as used herein refer to either the block unit of erase or a multiple block "metablock," depending upon whether metablocks are being used in a specific system.
[0092] The state diagram of Figure 12 illustrates overall functioning of the memory operations shown in Figure 11. Individual memory blocks may be viewed to be in one of three states. These are erased blocks 641, blocks 643 that are storing valid file data without reclaimable capacity and blocks 645 that may contain some valid file data but which also have reclaimable capacity from unprogrammed erased pages and/or obsolete (invalid) data stored in them. Data are written to erased memory blocks by a function 647, thereby to result in blocks in category 643 or 645, depending upon whether the resulting programmed blocks retain any reclaimable capacity. When files are deleted, as indicated by a function 649, blocks 643 containing data of the file are converted to blocks 645 with reclaimable capacity. Unused storage capacity of the blocks 645 is reclaimed by a function 651 that results in returning those blocks to the status of erased blocks 641 to which new data may be written.
[0093] Referring to Figure 13A, the writing of a data file to the memory system is illustrated. A data file 181, in this example, is larger than the storage capacity of one block or metablock 183 of the memory system, which is shown to extend between solid vertical lines. A portion 184 of the data file 181 is therefore also written into a second block 185. These memory cell blocks are shown to be physically contiguous but they need not be. Data from the file 181 are written as they are received streaming from the host until all the data of the1 file have been written into the memory. In the example of Figure 13A, the data 181 are the initial data for file. [0094j A preferred way for the memory system to manage and keep track of the stored data is with the use of variable sized data groups. That is, data of a file are stored as a plurality of groups of data that may be chained together in a defined order to form the complete file. Preferably, however, the order of the data groups within the file is maintained by the memory system controller through use of the file index table (FIT). As a stream of data from the host are being written, a new data group is begun whenever there is a discontinuity either in the logical offset addresses of the file data or in the physical space in which the data are being stored. An example of such a physical discontinuity is when data of a file fills one block and begins to be written into another block. This is illustrated in Figure 13A, wherein a first data group fills the first block 183 the remaining portion 184 of the file is stored in the second block 185 as a second data group. The first data group can be represented by (FO5DO), where FO is the logical offset of the beginning of the data file and DO is the physical location within memory where the file begins. The second data group is represented as (Fl3Dl), where Fl is the logical file offset of data that is stored at the beginning of the second block 185 and Dl is the physical location where that data are stored.
[0095] The amount of data being transferred through the host-memory interface may be expressed in terms of a number of bytes of data, a number of sectors of data, or with some other granularity. A host most often defines data of its files with byte granularity but then groups bytes into sectors of 512 bytes each, or into clusters of multiple sectors each, when communicating with a large capacity memory system through a current logical address interface. This is usually done to simplify operation of the memory system. Although the file-based host-memory interface being described herein may use some other unit of data, the original host file byte granularity is generally preferred. That is, data offsets, lengths, and the like, are preferably expressed in terms of byte(s), the smallest reasonable unit of data, rather than by sector(s), cluster(s) or the like. This allows more efficient use of the capacity of the flash memory storage with the techniques described herein.
[0096] The new file written into the memory in the manner illustrated in Figure 13A is then represented in a FIT as a sequence of index entries (F0,D0), (Fl3Dl) for the αaia "groups, in that order. That is, whenever the host system wants to access a particular file, the host sends its fileID or other identification to the memory system, which then accesses its FIT to identify the data groups that make up that file. The length <length> of the individual data groups may also be included in their individual entries, for convenience of operation of the memory system. When used, the memory controller calculates and stores the lengths of the data groups.
[0097] So long as the host maintains the file of Figure 13A in an opened state, a physical write pointer P is also preferably maintained to define the location for writing any further data received from the host for that file. Any new data for the file are written at the end of the file in the physical memory regardless of the logical position of the new data within the file. The memory system allows multiple files to remain open at one time, such as 4 or 5 such files, and maintains a write pointer P for each of them. The write pointers for different files point to locations in different memory blocks. If the host system wants to open a new file when the memory system limit of a number of open files already exists, one of the opened files is first closed and the new file is then opened.
[0098] Figure 13B illustrates the appending of data by the host to the end of the previously written but still open file of Figure 13A. Data 187 are shown to be added by the host system to the end of the file, which are also written in the second block 185 at the end of the data for that file. The appended data becomes part of the data group (Fl3Dl), which therefore now contains more data, since there is neither a logical nor a physical address discontinuity between the existing data group 184 and the appended data 189. The full file is thus still represented as a sequence of index entries (F0,D0), (Fl3Dl) in the FIT. The address of the pointer P is also changed to that of the end of the stored appended data.
[0099] An example of the insertion of a block of data 191 into the previously written file of Figure 13A is shown in Figure 13C. Although the host is inserting the data 191 into the file, the memory system appends the inserted data at a location 193 at the end of the file data previously written. It is not necessary to rewrite the data of the file in their logical order when data are being inserted into an open file, although this may be done later in the background after the host closes the file. Since the inserted data is stored entirely within the second memory block 185, if forms a single new group (F1,D3). But the making of this insert results in the previous data group (FO5DO) of Figure 13A being divided into two groups, one (F0,D0) before the insert and one (F2,D1) after the insert. This is because a new data group needs to be formed whenever there is a logical discontinuity of the data, such as occurs at the beginning Fl of the insert and at the end F2 of the insert. The group (F3,D2) is the result of physical address D2 being the beginning of the second block 185. The groups (F1,D3) and (F3,D2) are maintained separate, even though they are stored in the same memory block, because there is a discontinuity in the offsets of the data stored in them. The original file with the insert is then represented in the memory system FIT by data group index entries (F0,D0), (F1.D3), (F2,D1), (F3,D2), in that order. It should be noted from the examples of Figures 13A, 13B and 13C, that new data for a new or existing file may be written without making obsolete any data in the memory.
[00100] As an alternative to the insertion of data into an existing file that is illustrated in Figure 13C, the file may be rewritten into the memory as a separate file by the host whenever data have been inserted. This separate file may then be treated by the memory system as a new file. The old file is then deleted by the host, and the memory system may respond by reclaiming the space in which the old file is stored, the data of which are now obsolete.
[00101] Figure 13D illustrates another example, wherein a certain portion of the data originally written in the manner shown in Figure 13A is updated. A portion 195 of the data file is shown to be updated. Rather than rewriting the entire file in the memory system with the update, an updated portion 197 of the file is appended to the data previously written. A portion 199 of the data previously written is now obsolete. After updating, the file is represented in the memory system FIT by data groups index entries (FO3DO), (F1,D3), (F2,D1), (F3,D2), in that order. The single data group (FO5DO) of Figure 13A is again divided into pieces in Figure 13D, one before the updated portion, the updated portion and one after the updated portion. It is desirable to reclaim the space 199 occupied by obsolete data but this is preferably done later, not as part of writing the file data in the memory. Such reclamation will typically result in a fewer number of data groups of data for a particular file being stored.
[00102] The offsets of the data of each file are preferably maintained continuous in the correct logical order after the file's creation or modification according to the preceding description. Therefore, as part of an operation to insert data into a file, for example, offsets of the inserted data provided by the host are continuous from the offset immediately preceding the insert and data already in the file after the insert are incremented by an amount of the inserted data. Updating an existing file most commonly results in data within a given address range of an existing file being replaced by a like amount of updated data, so the offsets of other data of the file usually need not be replaced.
[00103] It will be noted that all of the data allocation and indexing functions described above with respect to Figure 13 are performed by the controller of the memory system. Along with an appropriate command, the host merely communicates the fileID and offsets of data within the file that are being sent to the memory system. The memory system does the rest.
[00104] An advantage of directly writing file data from the host into the flash memory in the manner just described is that the granularity or resolution of the data so stored may be maintained the same as that of the host. If a host application writes file data with a one-byte granularity, for example, that data may be also be written into the flash memory with a one-byte granularity. The amount and location of data within an individual data group is then measured in a number of bytes. That is, the same offset unit of data that is separately addressable within the host application file is also separately addressable within that file when stored in the flash memory. Any boundaries between data groups of the same file within a block are then specified in the index table to the nearest byte or other host offset unit. Similarly, boundaries between data groups of different files within a block are defined in the unit of the host offset.
[00105] The term "sector" is used herein with large block memories to denote the unit of stored data with which an ECC is associated. The sector is also the minimum unit of data transfer to and from flash memory. A "page" is used to denote a unit of memory cells within a block and is the minimum unit of programming. The term "metapage" is used to denote a page with the full parallelism of a metablock. The metapage is the maximum unit of programming.
FILE BLOCK MANAGEMENT
[00106] An example of the file-to-block mapping function 605 of Figure 11 will now be described. When data are written in the memory system, either from an external host or from internal host processing, or copied from some other location in the memory as part of a data reclaim operation, a destination block for storing the data is chosen according to a specific process. In this process, certain types of blocks are recognized on the basis of the structure of file data stored in them. Each file stored in the memory system is then noted to be in one of a number of states, each file state being defined by the number and types of blocks in which data of the file are stored. When data are to be written for a file, its current state and permitted transitions from one state to another are controlled to restrict the number of blocks containing data for a specific file that also contain data of one or more other files. This promotes the efficient utilization of the memory blocks and reduces the frequency of later reclaim operations necessary to maintain enough erased blocks in a full memory for accepting new or copied data.
[00107] The types of blocks recognized in this example that contain file data are as follows:
A "file block" has been fully programmed, and contains valid data of a single file. It may also contain some obsolete data.
A "program block" has been partially programmed, and contains valid data of only a single file. Some erased capacity remains in the block. It may also contain some obsolete data. A "common block" has been partially programmed, and contains valid data of two or more files. Some erased capacity remains. It may also contain some obsolete data.
A "full common block" has been fully programmed and contains valid data of two or more files. It may also contain some obsolete data.
A "full program block" is a transient designation for a program block that has become full, when it contains the most recently written data for the file and also has some obsolete data, and the range of offset addresses that exist for the file can be accommodated by a single block. If the next data to be written for the file are beyond the range of offset addresses that can be accommodated by a single block, a full program block then becomes designated as a file block. The full program block is equivalent to a full chaotic block of an existing logical block address (LBA) system, since certain logical offsets of the file are written multiple times in the block, once designating valid data and at least one other time to designate obsolete data.
[00108] Another type of block is the "erased block", where the total capacity of the block is unprogrammed and available to accept data. When the memory is full or nearly full of data, a pool of a specified minimum number of erased blocks is typically maintained by continuously reclaiming unused capacity that exists within blocks that are being used.
[00109] A "fractal block" is a collective term that refers to a program block, common block or a full common block. A fractal block for a file contains valid data of the file, together with either unprogrammed memory capacity, valid data for other files, or both. A primary purpose of the techniques described herein is to minimize the number of fractal blocks in a memory system by managing the type of active block that is designated to receive data of a file. This reduces the instances of garbage collection and data consolidation (block reclaim operations) necessary to maintain the "***" specified minimum number of erased blocks. The rate at which data may be written into the memory is then increased since less time is taken for internal copying of data to reclaim fragments of unused capacity in previously programmed blocks.
[00110] Additional terms are also used herein to collectively describe other types of blocks:
A "partial block" contains some unprogrammed capacity, valid data of one or more files and may contain some obsolete data. The program block and common block are examples of partial blocks.
An "obsolete block" is a file block or a full common block that contains some obsolete data. The obsolete block does not contain any erased capacity, and contains both valid and obsolete data.
An "invalid block" contains no valid data. The invalid block contains at least some obsolete data and may contain erased capacity but does not contain any valid data.
[00111] Figures 14A-14E illustrate some examples of the uses of the types of blocks listed above. In Figure 14A, data of a file A have filled blocks 661 and 663, and partially filled a third block 665. Data are written from left-to-right in each block of this example, first filling the block 661, then the block 663 and thereafter being written into a portion of the block 665. The remaining portion of the block 665 is unprogrammed erased capacity that can store additional data. The blocks 661 and 663 are file blocks, by the above-listed definitions, and the block 665 is a program block. Any new data will be written into the block 665, beginning at the program pointer P. The pointer P moves from left-to-right as data are written to the block to always point to the next available storage location in the block. Such a pointer is maintained for individual blocks that retain unprogrammed erased capacity, whether currently active or not, so that the physical address of any other data to be written to the block is always known.
[00112] The example of Figure 14B shows file A being stored in a file block
662 and a full program block 667. By the definition given above for a full program block, the block 667 contains the most recently written data of file A, some obsolete data and no unused capacity. Also by that definition, the total amount of data of file A stored in the two blocks 662 and 667 is equal to the storage capacity of one block. The last data for file A was written at the end of the block 667 where the program pointer P is shown. Any further data of file A that are received will be programmed into another block. That block can be another block into which the data of file A in block 667 are collected since the space occupied by obsolete data will be reclaimed. Alternatively, additional data can be written into a fully erased block. In either case, the pointer P moves to the new block at the beginning location for additional data of file A. The block 667 then becomes a file block. The block 667 is thus transitory since it exists only for the time that it is exactly as shown in Figure 14B. Just before it is totally filed with data of file A, it is a program block and immediately upon any new data for file A being written, it becomes a file block.
[00113] The example of Figure 14C includes a block 669 that is a common block since it contains data of another file B as well as data of the current file A, plus some unprogrammed capacity. New data are written into the block 669 at the end of the file A, beginning where the program pointer P is shown. Block 669 is the active block for file A. It may also be the active block for file B, in which case additional data of either of files A or B may be written at the program pointer P. Alternatively, a separate block (not shown) may be the active block for file B.
[00114] Data of a file may be written directly into erased capacity of a partial block that already contains data of another file, rather than into an erased block, in order to make good use of unprogrammed capacity in this form. This is particularly useful when a known quantity of file data less than the capacity of a full block is to be written. Existing partial blocks are searched to find an amount of erased capacity that fits the known amount of data to be written. The number of pages (or metapages if the metablocks are being used) of data is compared with the number of pages of unprogrammed, erased capacity in partial blocks. When unused erased space of a program block is programmed in this way, it is converted into a common block.
[00115] In Figure 14D, file A is stored in the file block 661, a portion of a block 671 and a portion of a block 673. The block 671 is a full common block since it is full' of data of two files A and B. The block 673 is a program block, similar to the block 665 of Figure 14A. The block 673 is the active block for the file and a pointer P points to the location of the unused capacity within the block 673 where additional data will first be written.
[00116] The file A is written in the example of Figure 14E into a portion of the full common block 671 and a common block 675. The block 675 contains data of a third file C. The pointer P points to the first location in the unused portion of the active block 675 where additional data will be written.
[00117] Although the examples of Figures 14A-14E show data of file A stored in multiple blocks in order to illustrate the several different types of blocks, a file in many cases may be small enough to be stored in a lesser number of blocks, even a single block. The techniques described herein are also applicable to such small files. Also, a larger file can occupy pages in more than three blocks.
[00118] It will be noted that blocks 665, 667, 669, 671, 673 and 675 are fractal blocks. It is desired to minimize the number of fractal blocks occupied by data of any one file since their presence increases the likelihood of the need to reclaim unused capacity in them and thus adversely affect system performance. Unused erased capacity exists in partial blocks 665, 669, 673 and 675 but it may not be efficient to write new data from a host directly into this space unless the quantity of unwritten data for a file is known and that known amount matches the unused capacity of one of these blocks. It is most common that the amount of data from the host for a particular file is not known, so these bits of capacity are not readily filled. Data may therefore need to be moved from another block into the unused space during a reclaim operation in order to make efficient use of the memory capacity. Blocks 669, 671 and 675 contain data of more than one file, which means that when one of the files is deleted or its data stored in the common block becomes obsolete, data reclaim will likely be done to reclaim the capacity of the block occupied by obsolete data.
[00119] Therefore, in order to reduce the number of time consuming data reclaim operations, data of a particular file are allowed to be stored in only one, two or some "other number of fractal blocks at any one time. In the specific example described herein, data of any one file may be stored in two or fewer fractal blocks but no more. A process of designating a new active block to store data of a file is so constrained. One of a set of permitted file states is assigned to each file that is defined by the types of blocks in which data of the file are stored. When a new active block needs to be assigned for receiving data of a particular file, such as when an existing block becomes full, the type of block so designated depends upon the state of the file and, in many cases, also other factors.
[00120] Definitions of ten permitted file states 0-9 are given in the table of
Figure 15, in terms of types and combinations of fractal blocks and a full program block in which data of the file are stored, in a specific implementation of the memory operation concepts described herein. Each of the permitted file states allows storage of data in no more than two fractal blocks or only one full program block. There is no restriction on the number of file blocks that may be associated with a file. These file states are used to select an active block for the storage of file data, both when that data are received by the memory from a host and when the data are being relocated within the memory during a reclaim operation. The state of every file stored in the memory system is monitored and recorded in the file index table (FIT) 613 (Figure 11), such as in a header for the FIT records of the file, together with other information. Whenever a state transition occurs, the FIT entry is updated to record the new file state.
[00121] Resulting primary transitions among the file states 0-9 defined in
Figure 15 are illustrated by a state diagram of Figure 16 and described in the table of Figure 17. These three figures provide the details of a preferred operation of the memory system, and are believed to be sufficient by themselves to do this. Certain aspects of this operation, however, will now be additionally described.
[00122] As shown in the table of Figure 15, a file is designated to be in state 0 because no data are stored in a fractal block. The only other type of block is a file block, so either the file has data written only to one or more file blocks, which most likely is a temporary condition because of the exactness required between the amount of data and block capacity, or the file has no data stored in any block. This later condition occurs when the memory system first receives information of a new file but has not yet written any data for that file. In either case, an active block needs to be designated to receive the data. When data of an unknown length are being provided from the host, an erased block is designated as the active block. Once data are written into the erased block, the file transitions from state 0 to state 2 (see Figure 16) since this block has become an active program block.
[00123] But when in file state 0 and data of the new file received from a host has a known length that is less than the storage capacity of a block, a partial block is designated as the active block if one is available with enough erased capacity for storage of the known amount of data. The file has then transitioned from state 0 to state 3 (see Figure 16). Such a partial block can be a. program block or a common block. The best fit possible is made between the known data length and the remaining storage capacities of available partial blocks. If there is no partial block with sufficient capacity for the known amount of data, then the data are written to an erased block, resulting in the file transitioning from state 0 to state 2 instead.
[00124] A characteristic of a file in state 2 is that a program block is allocated to receive additional data of the file. But if the file is large enough, the block will eventually become full and another active block then needs to be designated. If the full block, now a file block, contains no obsolete data, the file returns to state 0, where no active block is designated. An erased block or a partial block is then designated as the new active block, depending upon the amount of additional data to be stored, as discussed above. But if the full block contains obsolete data and the maximum offset for the file is less than the range of offset addresses that can be accommodated by a single block, then it is a full program block, according to the definition given above. It is then preferred that the block be compacted by copying its valid data to an erased block, and the original block erased. The resulting block then contains this valid data and erased capacity, which is a partial block. This new partial block then becomes the active program block. The state of the file has then transitioned from state 2 to state 1 and then back to state 2 (see Figure 16). But if data for the file are received, while in state 1, whose offset address is beyond the range of addresses that a single block can accommodate, the full program block becomes a file block. The file has then transitioned to state 0.
[00125] As a partial block, the active program block that exists when the file is in state 2 may be selected as a destination block for a known amount of data of another file from a source block during a reclaim operation. The identity of the program block is maintained on a list of partial blocks that includes the available erased capacity in each of the blocks on the list. The amount of data to be copied from a source block is fit into the erased capacity of a partial block on the list. If the program block for the current file is selected as a destination block for data of another file during a reclaim operation, the program block becomes an active common block of the current file, after the data of the other file is copied into its erased capacity. The file has then transitioned from state 2 to state 3 (see Figures 15 and 16).
[00126] Additionally, while the file is in state 2, there is a possibility that the data written into the program block for the file may be copied into another block that is a partial block storing data of another file, as part of an operation to reclaim the program block. In this situation, the destination block of the reclaim operation becomes an active common block. The file has transitioned from state 2 to state 4. Further data for the file are now written into the common block, which is the active block for the file.
[00127] When the active common block of a file in state 2 becomes full, it is designated as a full common block. The file is then contained in the limit of two fractal blocks, the full common block and the program block. Since another fractal block may not be allocated to receive data of the file, data of the file may be copied from the program block into an erased block and this new block is then designated as an active program block for the file. Such copying of file data as part of the file state transition is identified herein as a "data transition", and is so noted in Figures 16 and 17. The file has then transitioned from state 4 to state 8.
[00128] Any data transition is completed as a single operation before the state transition can be considered to be complete. This means that if the file needs an active" block into which data may be written, other operations cannot be performed by the memory until the data copying part of the data transition is complete. This data copying is therefore typically not interleaved with other memory operations over time.
[00129] A transition from file state 4 to state 3 occurs when its program block is designated to be a reclaim block. Data of the file in the program block are moved to a common block as part of a reclaim operation, after which the common block becomes the active block for the file. Further, once the active common block of a file in state 4 becomes full, the file is stored in two fractal blocks. Another block cannot be allocated as the active block until one of the fractal blocks is eliminated. Data in the program block are therefore moved (data transition) to erased capacity of a partial block as part of a transition from state 4 to state 7, thereby eliminating the fractal program block. The resulting common block then becomes the active block for the file.
[00130] When in state 3, data of the file are being written into an active common block. If data of the file are moved during a reclaim operation from the active common block to erased capacity of a partial block, the destination partial block becomes an active common block to which further data of the file are written. The file has then transitioned from state 3 to state 6. But if a good fit of the amount of data to be moved from the source program block cannot be made with the capacity of a partial block on the partial block list, the file data in the common block are moved from that block to an erased block and that erased block becomes an active program block for the file. The file has then transitioned from state 3 to state 2. In the course of this state transition, allocation of an active block includes making a data transition from the original common block to the new erased block, which then becomes the an active program block for the file.
[00131] A further possibility when the file is in state 3 is that the active common block to which data of the file are being written becomes full. The file then has no active block to which further data may be written, and has transitioned to state 5. This state is similar in operation to that of file state 0, in that there is no active block for the file but it is different in that data of the file is contained in a full common block when the file is in state 5. When in state O, there is no fractal block containing data of the file. Both states O and 5 are usually temporary states from which a transition takes place as soon as additional data of the file are to be written.
[00132] When in state 5, the possible transitions to other file states are similar to those when the file is in state 0 except that some data of the file are stored in a common block when in state 5 and not when in state 0. An erased block is allocated for additional data of the file if the amount of data is unknown, thus creating an active program block and transitioning the file to state 8. If the amount of data are known, they are written into remaining capacity of a partial block, if a good fit of sizes can be made, thereby causing the partial block to become an active common block, and the file transitions from state 5 to state 7. File state 8 is similar to state 2, except that data of the file are stored in a full common block when in state 8 and no such block exists when in file state 2. File state 7 is similarly related to file state 3.
[00133] When in file state 6 and the active common block is filled with data, the file is then stored in a full common block and common block. Since the limit in this embodiment of two fractal blocks has been reached, another block cannot be allocated as a program block or some other fractal block. Therefore, a data transition needs to take place. Data of the file from one of the common blocks are moved either into a partial block (file transition to state 7), which then becomes an active common block for the file, or into an erased block (file transition to state 8) if a suitable fit of the data with the erased capacity of a partial block cannot be made. .
[00134] When in file state 7, the active common block can become full. The file is then being stored in two full common blocks, transitioning to state 9.
[00135] Also while the file is in state 7, the common block may be designated as a reclaim block, so data of the file then needs to be relocated. A data transition then takes place. If data of the file are moved from the common block to an erased block, which thereafter becomes an active program block, a transition to file state 8 has taken place. If data of the file are instead moved into a partial block, the partial block then becomes a common block and the file state remains 7. LUU136] File state 9 is a stable state, since a file may remain with two full common blocks for a time during which no additional data are written to the file. But there is no active block designated when the file is in that state. Since the limit of two fractal blocks exists,a data transition must therefore be made before additional data can be written to the file. In the one case, all the data of the file in one of the two full common blocks may be moved to an erased block and this block then becomes an active program block for writing new data of the file. The file has then transitioned from state 9 to state 8. But if the amount of data of the file in one of the two full common blocks plus additional data of the file total less than the capacity of a block, then enough erased space is sought in a partial block. If found, data of the file from one of the full common blocks are moved into the partial block and it then becomes an active common block for writing the additional data for the file. This results in a transition from state 9 to state 7.
[00137] When in file state 8, data of the file are being written to an active program block while other data of the file remain stored in a full common block. When the program block becomes full, it becomes a file block and there is no longer an active block for the file. The state then transitions to state 5, where a further file transition allocates either an erased block or a partial block as the new active block, as described above.
[00138] But when in state 8 and the active program block of the file is selected as a destination block for a reclaim operation, the file state transitions directly to state 7, in a first case. This creates a common block which is active to receive the new data of the file. Alternatively, if the active program block for the file when in state 8 is designated as the source block of a reclaim operation, data of the file are moved into a partial block which then becomes an active common block for writing additional data to the file. The file state has also transitioned from state 8 to state 7, in a second case.
[00139] In addition to the primary file state transitions illustrated in Figures 16 and 17, there are a set of secondary file transitions that occur. These are shown in Figures 18 and 19. These secondary transitions of a current file of interest occur when all of the data of one file stored in a fractal block containing data of the current tile become obsolete. The obsolete data may be of the current file or of some other file. Data may become obsolete as a result of a file being deleted by a host, data previously written for a file being updated by a host, or data for a file being relocated during a reclaim operation. In the course of a file being updated, for example, all of the data for the file stored in a common block are rendered obsolete when all are updated by new data written into another block. In an example of a reclaim operation, if data of a file in a common block, which is not of the current file of interest, are copied into another block, that leaves the data of the other file in the common block obsolete.
[00140] The rendering of data to be obsolete in these circumstances causes the types of blocks in which the obsolete data are stored to change, with a resulting change in the state of a file. When a new active block is needed for data of the file, it is selected in the manner described with respect to Figures 16 and 17 but based upon the new file state.
[00141] The transitions of Figure 18 and identification in Figure 19 of the specific transitions that occur provide a full description of them. It will be noted that these transitions tend to reduce the number of fractal blocks containing data of a file, thus simplifying the file states. These transitions tend to cause the state of a file to migrate towards state 0 which has no fractal blocks.
[00142] Information of the file state is used for determining the type of block to be allocated as the active block for the file when data are to be programmed for a file and no active block currently exists for the file. The table of Figure 20 summarizes in the right hand column the allocation of active blocks for files in any one of states 0-9 under the conditions set forth in the middle column. The type of block that is selected in the order shown. By "best fit partial block" is meant a partial block having an amount of erased capacity that the known amount of data can efficiently utilize. If there is not a suitable partial block, an erased block is most commonly chosen. But if a best fit parital block cannot be identified for a file in either of states 2 or 3, a "biggest partial block" is allocated, which is a block that does not have enough erased capacity to hold the entire amount of data to be written but which is the block that can hold 'the "greatest amount of that data. The file then changes its state, and the new state controls the selection of the block to receive the remaining amount of data that does not fit into the biggest partial block. But if because of the amount of data and the available capacity in partial blocks, use of the biggest partial block makes it likely that the data will be spread out over more than two blocks, then an erased block is allocated as the active block.
[00143] The operations described above may be carried out by the processor 27 of the controller 11, executing stored firmware, in the example memory system shown in Figure 2.
RECLAIMING BLOCKCAPACITY
[00144] As described above, part of the block management includes reclaiming unused capacity in blocks for the storage of new data. This is not of particular concern when the amount of data stored in the memory system is far less than its capacity but a memory system is preferably designed to operate as if it is full of data. That means that blocks which contain only obsolete data, and other blocks that contain valid data but also have some obsolete data and/or unwritten erased pages, can be dealt with in a manner to reclaim this unused capacity. The goal is to utilize the storage capacity of the memory system as completely as possible, while at the same time minimizing adverse effects on performance of the system. Reclaiming of blocks is noted as 617 in the overall system operation diagram of Figure 11.
[00145] Any valid data in a block designated for a reclaim operation (source block) is copied into one or more blocks (destination blocks) with sufficient erased capacity to store the valid data. The destination block is selected in accordance with the block management techniques described above. The data of each file stored in the source block are copied to a type of block that is selected on the basis of the state of file and other factors, as described above. Examples of data copying between different types of files as part of reclaims operation are given in Figures 21 A - 21D. LUUJ.46] """ """ In figure 21 A, reclaim operations on two partial blocks 681 and 683 are illustrated, as examples. The block 681 is a program block in which valid data of a file A are stored, while also containing erased capacity storing no data. One possible reclaim operation, depending upon the state of file A, is to copy data of file A of block 681 into available erased capacity of another partial block 685 that already includes data of a different file B, thus making it a common block. The data group(s) in the block 681 is then no longer referenced in the FIT and the block the block is noted to be obsolete. When stored in block 681, file A had one of states 2, 4 or 8 (see Figure 15) that includes a program block. The data may then be moved to another fractal block while the file remains written to a maximum of two fractal blocks. After copying to block 685, file A has transitioned to one of the states 3, 4, 6 or 7, which include data of the file being stored in a common block, depending on the types of blocks in which other data of the file are stored.
[00147] The block 683 of Figure 21A is a common block that is being reclaimed by copying its stored data of files C and D into erased capacity of a program block 687 containing data of file E, which then becomes a common block. The data of files C and D in the block 683 are then obsolete, as is the block itself. The state of each of the files C and D has not changed since the data have been moved from one common block to another. However, the state of file E has changed either from 2 to 3 or from 8 to 7. Alternatively, the data of each of the files C and D can be moved to different blocks from each other and need not necessarily be copied to available space of a common block. The states of the files could then possibly transition to other states.
[00148] Illustrated in Figure 21B are reclaim operations on example blocks 689 and 691. Each of these blocks is an obsolete block since it is full of data, both valid and obsolete. The block 689 is a file block containing data of a file F, a portion of which are obsolete and the remainder valid. This can occur, for example, during an update of file F where new data are physically written at the end of the file that have the same logical offsets as existing data of the file, and the existing data then become obsolete. In this example, the data of File F are copied into erased capacity of a Drogram block 693 containing data of a file G5 resulting in changing the type of block 693 to a common block. The valid data of the file F could alternatively be written to an erased block, which would then result in the block being a program block.
[00149] The block 691 of Figure 21B is a full common block containing invalid data of file H and valid data of file I. The valid data of file I is copied, in this example, from the block 691 into an erased block 695. The block 695 then becomes a program block. Alternatively, the data of file I could be written to a partial block containing data of another file, if a good fit can be found. The destination block will depend upon the state of file I at the time of the reclaim operation.
[00150] As a result of each of the four specific examples of reclaim operations shown in Figures 21A and 21B, data stored in two partial blocks are combined into one, thereby leaving the other of the two blocks with only obsolete data. They are then invalid blocks. The entire space of each of the original blocks 681, 683, 689 and 691 is then reclaimed by erasing the block, as illustrated in Figure 21C. An erased block is the result of reclaiming an invalid block.
[00151] Figure 21D shows an example of a file block 697 in which data of a file J are stored. When file J is deleted by the host, the data of file J in block 697, and possibly also in other blocks, are rendered obsolete. The block 697 then becomes invalid. Reclaiming the invalid block provides an erased block for the system erased block pool.
[00152] The deletion of a file from the memory also commonly causes data of the file in one or more fractal blocks, such as a common block or a full common block, to become obsolete. That block is then subject to a reclaim operation since the remaining valid data of another file will be less than the storage capacity of the block and can be a small amount.
[00153] A reclaim operation is shown in general terms by a flowchart of Figure
22. One or more lists are maintained for partial, obsolete and invalid blocks, depending upon the specific embodiment, as indicated by a step 701. The list(s) may be kept as part of the block lists 615 (Figure 11). According to one memory operational technique, this list(s) of blocks is built at the time of initiation of the memory system, such as when power is first applied. This list(s) can include other information of the blocks that enable the selection of one reclaim block at a time, such as the amount of valid data in each block and the amount of erased memory in each block. These quantities are typically measured in terms of a number of pages of the block, or metapages if metablocks are being used. A preferred alternative technique is to maintain these lists in non-volatile memory and to add or update an entry for a block in the list whenever its status changes. With this technique, it is not necessary to scan the blocks and build the lists when the memory system is initialized. As an alternative to keeping all partial, obsolete and invalid blocks on the list(s), only those blocks that have a small amount of valid data below some set threshold amount are included, since one characteristic of a chosen reclaim block is that it has little or no valid data that needs to be copied. It is the copying of data from one block to another, necessary in many reclaim operations, which takes a significant amount of time, so this is usually performed first on those blocks having the lesser amount of data to be copied.
[00154] The list(s) of such blocks changes constantly as data are written, updated, moved, deleted, and so forth. Changes that result in blocks changing their types to and from partial, obsolete and invalid cause the list(s) maintained by the step 701 of Figure 22 to change. Changes in the amount of valid data individually stored in such blocks, and in the amount of erased capacity are also noted in the block lists 615 (Figure 11).
[00155] In a step 703, a single reclaim block is preferably identified from those on the updated list(s) as the next in order to be reclaimed. If a partial or obsolete block, it is a source of valid data to be copied into another block referred to as a destination block. Several specific techniques that may be used to select the source block are described below.
[00156] A next step 705 then determines whether it is appropriate to perform the reclaim operation at the current time, considering the memory operations that need to be performed in response to commands of a host. If the host has sent an idle command" to the memory system, or something similar that indicates there will be some period of time when the host will not be expecting the memory system to perform a particular operation, then the memory system is free to carry out overhead operations in the foreground including a reclaim operation. Even if the memory system is busy writing data to or reading data from the memory in response to a host command, the reclaim operation, particularly its data copying, can be interleaved with data write and read operations. Such interleaving is described in United States patent applications serial no. 11/259,423 of Alan Sinclair, filed October 25, 2005, and serial no. 11/312,985 of Alan Bennett et al., filed December 19, 2005.
[00157] If it is determined by the step 705 that a reclaim operation may be carried out, the process differs depending on whether the identified reclaim block contains valid data, and, if so, whether it contains valid data of more than one file. If a partial block or obsolete block, it will, by definition, contain valid data, and, if a common block or a full common block, will contain valid data of two or more files. Whether or not there is valid data in the reclaim block is determined by a step 707. If there is valid data that must be moved, data of a single file are identified and a destination block is identified to receive that data, in a next step 709. The destination block is identified by the process described above with respect to Figures 15-17, in order to maintain all the data of the file to which the valid data belongs stored in two or fewer fractal blocks (in this example). Copying of the valid data of one file from the source reclaim block to the destination block is then begun, as indicated by a step 711. After these data are copied, the processing returns to the step 707 to determine whether data of another file remains. If so, the process of steps 709 and 711 are repeated for the additional data. The destination block is selected independently of the earlier selection for data of a different file. This continues until it is determined in the step 707 that there is no more data in the source block to be moved, in which case the source block may be erased, per a step 713. This block may then be placed into the erased block pool for use to store new data.
[00158] Returning to the step 707, if the source block contains no valid data, which is the case for an invalid block, there is no valid data to be moved. The source block only needs to be erased. The processing therefore, in that case, bypasses the steps 709 and 711, as shown in Figure 22.
[00159] In a first embodiment of the process of Figure 22, a single list is maintained by the step 701 of partial, obsolete and invalid blocks. The amount of valid data in the block is included in the individual entries on the list. In the step 703, the block selected from the list as the reclaim block is that having the least valid data. If there is one invalid block on the list, that block will be selected first since it has no valid data. If there are many invalid blocks on the list, the one that has been there the longest is chosen. If there is no invalid block on the list, then a block having the least amount of valid data is chosen as the reclaim block. By choosing the block having the least amount of valid data of all the blocks on the list, the reclaim operation then takes less time than when there is more valid data to be copied from one block to another. As a result, other operations of the memory system, such as the speed of writing data to and reading data from the memory, are maintained at a high rate. A newly erased block is obtained at a lesser cost to memory performance.
[00160] This first embodiment of the process of Figure 22 for selecting a source block on the basis of the amount of valid data in fractal blocks on a single list has an advantage of being relative simple to implement. However, this process may be refined by also considering the value of partial blocks. Partial blocks have erased capacity into which data may be written, while neither the obsolete block nor the invalid block contains any erased capacity. Before obsolete blocks may be used for storing new data, any valid data must be moved out of them and into another block, so that they may then be erased and made available for the storage of new data. But partial blocks have erased capacity into which data may be written without having to endure the overhead of a reclaim operation. It may not be beneficial, for example, to reclaim a partial block only because it contains the least amount of valid data when it also contains a large amount of erased capacity into which data may be written.
[00161] Therefore, in other embodiments of the process of Figure 22, a partial block is selected as a candidate for the reclaim source block on the basis of both the amount of valid data and the amount of erased capacity that exist in the partial blocks. me components of data in a partial block are shown in Figure 23. The block (can be a metablock) has a certain number of one or more pages (can be metapages) containing valid data and one or more other pages that are erased and into which data may be written. The partial block may also contain one or more other pages that contain obsolete data, as shown in example of Figure 23.
[00162] In these other embodiments of the process of Figure 22, the partial blocks are preferably maintained by the step 701 in a list that is separate from list(s) of obsolete and invalid blocks. Partial blocks are moved toward a head of their list for a reclaim operation when they have little erased capacity (which means that they are not very useful in their present state) and small amounts of valid data that need to be moved. Such blocks will primarily contain obsolete data. Conversely, partial blocks having large amounts of erased capacity (meaning that they are potentially useful to store data) and large amounts of valid data to be moved will be the least likely to be identified as candidates for the reclaim block. Reclaiming a partial block with erased capacity does not add the same amount of storage capacity to the memory system as does reclaiming an obsolete block. Invalid blocks are clearly the most attractive blocks to reclaim since they have no beneficial erased capacity and no valid data that need to be copied.
[00163] In a second embodiment of the reclaim block identification step 703 of
Figure 22, three separate lists are maintained by the step 701, one for each of the partial, obsolete and invalid blocks. If there are invalid blocks, the reclaim block is selected from the list of invalid blocks until there are no more blocks on that list. There is no particular order of listing invalid blocks except possibly in a first-in first- out (FIFO) order so that the invalid block that has been on the list the longest is chosen first. Next, if there are no invalid blocks, a block is chosen from the obsolete block list that has the least amount of valid data of all the blocks on that list.
[00164] If there are no blocks on either of the invalid or obsolete lists, then a block on the partial block list is chosen in step 703 as the reclaim block. Although a partial block could be chosen to be that with the least amount of valid data, it is preferred to rank the partial blocks in a way that recognizes the benefit of their erased capacity. "For this purpose, a "reclaim gain" can be calculated for each partial block, as follows:
reclaim gain = (S - kE) (1)
V
[00165] where S is the block size in terms of its total number of data storing pages, E is the number of pages of erased capacity into which data may be written and V is the number of pages containing valid data that needs to be moved to another block. A constant k is included to weight the positive effect of the erased capacity of the block but can be set at 1. As the value of kE increases, the resulting reclaim gain goes down. As the value of V goes up, the reclaim gain also goes down. The partial block with the highest value of reclaim gain is selected in the step 703 as the reclaim block. Other mathematical expressions can alternately be used to define a reclaim gain in terms of E and V that balance the detriment to system operation of containing valid data and the benefit of having erased capacity. The reclaim gain may be calculated each time there is a change in the block, such as each time data are written into its erased capacity, and stored as part of the information maintained by file directory or FIT.
[00166] This second embodiment is illustrated in Figure 25, which shows a method of selecting a reclaim block (step 703 of Figure 22) from separate partial, obsolete and invalid block lists (as maintained by step 701 of Figure 22). A step 721 first determines whether there is a block listed on the invalid block list. If there are multiple such blocks, the block that has been on the list the longest is selected by a step 723 as the reclaim block. If there is no block on the invalid block list, then it is determined by a step 725 whether there is an entry on the obsolete block list. If so, in the case where more than one block is on the obsolete block list, the block having the least amount of valid data is selected by a step 727 as the reclaim block. If it is determined by the step 725 that there is no entry on the obsolete block list, then the partial block list is consulted in a step 729. When there is more than one block on the partial" block" list, "tn'e one having the highest reclaim gain is selected as the reclaim block. The reclaim gain takes into account the amount of valid data and erased capacity in the block, such as by using equation (1) above. If there is nothing on the partial block list, the process is repeated, by returning to the step 721, until a block appears on one of the lists. After the selection of a reclaim block, the processing proceeds to step 705 of Figure 22.
[00167] A third embodiment is shown by a flowchart of Figure 24. Execution of the step 703 of Figure 22 also starts by a step 741 that looks for an entry on the invalid block list maintained by the step 701 of Figure 22. If there is more than one entry on the invalid block list, the oldest is selected by a step 743 of Figure 25 to be the reclaim block. If there is no entry on the invalid block list, a next step 745 determines whether there is an entry on the obsolete block list. If so, subsequent steps differ from the embodiment of Figure 24 in that, if there is also at least one entry on the partial block list, it is determined whether it is best to select the reclaim block from the obsolete or partial block lists.
[00168] A step 747 identifies the block on the obsolete block list that contains the least amount of valid data. It is then determined whether at least one block exists on the partial block list, by a step 749, and, if so, the block with the least amount of valid data is identified, in a step 751. A next step 753 then makes a choice between the one block identified from the obsolete block list and the one block identified on the partial block list. For this purpose, a quantity (V + kE) is calculated for the block identified from the partial block list in the step 751, the terms V, E and k being the same as used above. It is this quantity that is compared with the amount V of valid data in the block identified in step 747 from the obsolete block list. If the (V + kE) quantity for the partial block is greater than V of the obsolete block, then the obsolete block is chosen as the reclaim block, in a step 755. But if the V of the obsolete block is greater than the (V + kE) quantity of the identified partial block, then the partial block is selected in a step 757 as the reclaim block.
[00169] By adding the erased capacity quantity kE of the identified partial block to its valid data V before comparing with only the valid data V of the identified oDsol'eϊe block, th'e 'process is biased in favor of selecting the obsolete block. An identified partial block with the same amount of valid data as an identified obsolete block will be retained since it is still has a potential use to store data in its erased capacity. Indeed, a partial block having an amount of valid data that is less than that of an obsolete block by an amount kE will be retained.
[00170] Returning to the step 745 of Figure 25, if there is no entry on the obsolete block list, then it is determined in a step 759 whether there is a block listed on the partial block list. If not, the process returns to the step 741 to be repeated until a block is placed on one of the three lists. If there are multiple partial blocks listed, then, in a step 761, the block having the least amount of valid data is selected as the reclaim block. Alternatively, the partial block may be selected by use of the reclaim gain as described with respect to step 731 of the second embodiment (Figure 24).
[00171] The third embodiment may alternatively make use of only two lists.
The first list is an obsolete block list that contains entries for blocks that contain obsolete data and no erased memory capacity. Rather than using a separate invalid block list as show in Figure 25, both invalid and obsolete blocks are placed on a single "obsolete" block list. The blocks may optionally contain valid data. Each entry in the list has a field containing a value defining the amount of valid data in the block to which it relates. The entries in the list are ordered according to the values in these fields. Blocks containing obsolete data and no valid data (invalid blocks) are therefore grouped together at the head of this first list.
[00172] The second list in this alternative to the third embodiment is a partial block list that contains entries for blocks that contain some erased memory capacity. The blocks may optionally contain valid data. Each entry in the list has a field containing a value defining the amount of valid data in the block to which it relates. The entries in the list are ordered according to the values in these fields. A block may be selected from the head (block with the least amount of invalid data) of either the first or second list by the technique of step 753 of Figure 25.
[00173] A table of Figure 26 sets forth details of the types of blocks that are placed on" ffie'paftial and obsolete block lists for a reclaim operation according to this modification of the third embodiment. To be placed on the partial block list, a block contains both valid data and erased capacity. It does not matter whether there is any obsolete data in the block. To be placed on the obsolete block list, the block contains obsolete data and either valid data or erased capacity but not both.
[00174] The processes described above with respect to Figures 22, 24 and 25 may be carried out by the processor 27 of the controller 11, executing stored firmware, in the example memory system shown in Figure 2.Conclusion
[00175] Although the various aspects of the present invention have been described with respect to exemplary embodiments thereof, it will be understood that the present invention is entitled to protection within the full scope of the appended claims.

Claims

IT IS CLAIMED:
1. A method of operating a non- volatile memory system with data storage cells grouped into blocks of memory cells that are erased prior to reprogramming, comprising: maintain at least one list including blocks that individually contain an amount of valid data less than a data storage capacity of the block, select a block from said at least one list on the basis of the amount of valid data therein relative to the amount of valid data in other blocks on said at least one list, copy the valid data from the selected block into another block, and thereafter erase the selected block, whereby the erased selected block becomes available for the storage of other data.
2. The method of claim 1, wherein selecting a block includes selecting the block from said at least one list only on the basis of the amount of valid data therein relative to the amount of valid data in other blocks on the list.
3. The method of claim 1, wherein selecting a block includes selecting the block from said at least one list that has the least amount of valid data therein relative to the amount of valid data in other blocks on the list.
4. The method of claim 1, wherein selecting a block from said at least one list additionally includes selecting the block from said at least one list on the basis of an amount of erased storage capacity therein relative to the amount of erased storage capacity in other blocks on said at least one list.
5. A method of operating a non- volatile memory system with storage cells grouped into blocks of memory cells that are erased prior to reprogramming, comprising: maintain at least one list including blocks that individually contain an amount of valid data plus either obsolete data or some erased data storage capacity or both, select a blόclc from said at least one list by considering both the relative amounts of valid data and the erased storage capacity of the blocks on said at least one list, and copy the valid data from the selected block into another block, and thereafter erase the selected block, whereby the erased block becomes available for the storage of other data.
6. The method of claim 5, wherein selecting the block from said at least one list includes trading off benefits of the selected block having a low amount of valid data relative to other blocks on said at least one list and the selected block having a high amount of erased storage capacity relative to other blocks on said at least one list.
7. A method of operating a non-volatile memory system with storage cells grouped into blocks of memory cells that are erased prior to reprogramming, comprising: maintain a first list of any blocks that individually contain an amount of valid data plus obsolete data but without erased data storage capacity, determining whether one or more blocks exist on the first list and, if so, identifying a first block from the first list on the basis of the amount of valid data in the blocks thereon, maintain a second list of any blocks that individually contain an amount of valid data plus some erased data storage capacity, determining whether one or more blocks exist on the second list and, if so, identifying a second block from the second list on the basis of both the amounts of valid data and erased storage capacity in the blocks thereon, select either the first or second block on the basis of value to operation of the memory system from reclaiming the blocks, and copy the valid data from the selected block into another block, and thereafter erase the selected block, whereby the selected first or second block has been reclaimed as an erased block that is available for the storage of other data.
8. A method of operating a non-volatile memory system with storage cells grouped into blocks of memory cells that are erased prior to reprogramming, comprising: maintain a first list including any blocks that individually contain an amount of valid data plus obsolete data but without erased data storage capacity, determining whether one or more blocks exist on the first list and, if so, identifying a first block from the first list that has the least amount of valid data of the blocks thereon, maintain a second list including any blocks that individually contain an amount of valid data plus some erased data storage capacity, determining whether one or more blocks exist on the second list and, if so, identifying a second block from the second list that has the least amount of valid data of the blocks thereon, select either the first or second block on the basis of the amount of valid data contained in them after adjusting the amount of valid data in the second block for the amount of erased data storage capacity in the second block, and copy the valid data from the selected block into another block, and thereafter erase the selected block, whereby the selected first or second block has becomes an erased block that is available for the storage of other data.
9. A method of operating a non-volatile memory system with storage cells grouped into blocks of memory cells that are erased prior to reprogramming, comprising: selecting a block for a reclaim operation on the basis of a content of at least some of the blocks, and thereafter reclaiming the selected block by copying valid data of the selected block into another block and then erasing the selected block.
10. The method of claim 9, wherein selecting a block for a reclaim operation includes doing so on the basis of the content of at least some of the blocks individually including a quantity of valid data. It. TM method of claim 10, wherein selecting a block for a reclaim operation additionally includes doing so on the basis of the content of at least some of the blocks individually including an amount of erased capacity remaining in the individual blocks for the storage of data.
12. The method of claim 11, wherein selecting a block for a reclaim operation additionally includes doing so on the basis of the content of at least some of the blocks individually including no obsolete data.
13. The method of claim 9, wherein selecting a block for a reclaim operation includes doing so on the basis of the content of at least some of the blocks individually including an amount of erased capacity remaining in the individual blocks for the storage of data.
14. The method of claim 9, wherein selecting a block for a reclaim operation includes doing so on the basis of the content of at least some of the blocks individually including no obsolete data.
15. A reprogrammable non-volatile memory system, comprising: blocks of non- volatile memory cells characterized by being erased prior to rewriting data therein, and a controller functionally connected with the memory cell blocks and that operates to select a block having a portion of its storage capacity not occupied by valid data to be reclaimed for use to store valid data on the basis of the relative amount of valid data stored in at least a plurality of the blocks, and then causes the valid data of the selected block to be copied to another block.
16. The memory system of claim 15, wherein the controller further operates to select the block to be reclaimed that contains the least amount of valid data among the at least a plurality of the memory system blocks. "17""" " TKe" memory system of claim 15, wherein the controller further operates to select the block to be reclaimed on the basis of an amount of erased capacity remaining individually in the at least a plurality of the blocks for the storage of data therein.
18. The memory system of claim 17, wherein the controller further operates to select the block to be reclaimed from the at least a plurality of the blocks that contains no obsolete data.
19. A reprogrammable non-volatile memory system, comprising: an array of non-volatile memory cells organized into blocks of memory cells that are simultaneously erasable, and a controller operably connected with the memory array that operates to: maintain a first list including any blocks that individually contain an amount of valid data plus obsolete data but without erased data storage capacity, determine whether one or more blocks exist on the first list and, if so, identify a first block from the first list that has the least amount of valid data of the blocks thereon, maintain a second list including any blocks that individually contain an amount of valid data plus some erased data storage capacity, determine whether one or more blocks exist on the second list and, if so, identify a second block from the second list that has the least amount of valid data of the blocks thereon, select either the first or second block on the basis of the amount of valid data contained in them after adjusting the amount of valid data in the second block for the amount of erased data storage capacity in the second block, and copy the valid data from the selected block into another block, and thereafter erase the selected block.
PCT/US2006/030026 2005-08-03 2006-08-01 Reclaiming data storage capacity in flash memory systems WO2007019155A1 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
AT06789157T ATE509314T1 (en) 2005-08-03 2006-08-01 RECLAIMING DATA STORAGE CAPACITY IN FLASH STORAGE SYSTEMS
EP06789157A EP1920335B1 (en) 2005-08-03 2006-08-01 Reclaiming data storage capacity in flash memory systems
JP2008525135A JP4533956B2 (en) 2005-08-03 2006-08-01 Free up data storage capacity of flash memory system
KR1020087004727A KR101272642B1 (en) 2005-08-03 2006-08-01 Reclaiming data storage capacity in flash memory systems

Applications Claiming Priority (6)

Application Number Priority Date Filing Date Title
US70538805P 2005-08-03 2005-08-03
US60/705,388 2005-08-03
US11/382,232 2006-05-08
US11/382,235 US7558905B2 (en) 2005-08-03 2006-05-08 Reclaiming data storage capacity in flash memory systems
US11/382,232 US7450420B2 (en) 2005-08-03 2006-05-08 Reclaiming data storage capacity in flash memories
US11/382,235 2006-05-08

Publications (1)

Publication Number Publication Date
WO2007019155A1 true WO2007019155A1 (en) 2007-02-15

Family

ID=37387322

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2006/030026 WO2007019155A1 (en) 2005-08-03 2006-08-01 Reclaiming data storage capacity in flash memory systems

Country Status (5)

Country Link
EP (1) EP1920335B1 (en)
JP (1) JP4533956B2 (en)
KR (1) KR101272642B1 (en)
AT (1) ATE509314T1 (en)
WO (1) WO2007019155A1 (en)

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008083001A1 (en) * 2006-12-26 2008-07-10 Sandisk Corporation Managing a lba interface in a direct data file memory system
US7739444B2 (en) 2006-12-26 2010-06-15 Sandisk Corporation System using a direct data file system with a continuous logical address space interface
US7917686B2 (en) 2006-12-26 2011-03-29 Sandisk Corporation Host system with direct data file interface configurability
US8046522B2 (en) 2006-12-26 2011-10-25 SanDisk Technologies, Inc. Use of a direct data file system with a continuous logical address space interface and control of file address storage in logical blocks
US8055832B2 (en) 2005-08-03 2011-11-08 SanDisk Technologies, Inc. Management of memory blocks that directly store data files
JP2011530758A (en) * 2008-08-11 2011-12-22 インディリンクス カンパニー リミテッド Flash memory control method and control device
US8166267B2 (en) 2006-12-26 2012-04-24 Sandisk Technologies Inc. Managing a LBA interface in a direct data file memory system
US8209461B2 (en) 2006-12-26 2012-06-26 Sandisk Technologies Inc. Configuration of host LBA interface with flash memory
US20140189207A1 (en) * 2012-12-31 2014-07-03 Alan Welsh Sinclair Method and system for managing background operations in a multi-layer memory
US9223693B2 (en) 2012-12-31 2015-12-29 Sandisk Technologies Inc. Memory system having an unequal number of memory die on different control channels
US9311229B2 (en) 2011-03-29 2016-04-12 Blackberry Limited System and method for managing flash memory
US9336133B2 (en) 2012-12-31 2016-05-10 Sandisk Technologies Inc. Method and system for managing program cycles including maintenance programming operations in a multi-layer memory
US9348746B2 (en) 2012-12-31 2016-05-24 Sandisk Technologies Method and system for managing block reclaim operations in a multi-layer memory
US9465731B2 (en) 2012-12-31 2016-10-11 Sandisk Technologies Llc Multi-layer non-volatile memory system having multiple partitions in a layer
US9734911B2 (en) 2012-12-31 2017-08-15 Sandisk Technologies Llc Method and system for asynchronous die operations in a non-volatile memory
US9778855B2 (en) 2015-10-30 2017-10-03 Sandisk Technologies Llc System and method for precision interleaving of data writes in a non-volatile memory
US10042553B2 (en) 2015-10-30 2018-08-07 Sandisk Technologies Llc Method and system for programming a multi-layer non-volatile memory having a single fold data path
US10120613B2 (en) 2015-10-30 2018-11-06 Sandisk Technologies Llc System and method for rescheduling host and maintenance operations in a non-volatile memory
US10133490B2 (en) 2015-10-30 2018-11-20 Sandisk Technologies Llc System and method for managing extended maintenance scheduling in a non-volatile memory
CN109558333A (en) * 2017-09-27 2019-04-02 北京忆恒创源科技有限公司 Solid storage device NameSpace with variable additional storage space (OP)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9772936B2 (en) * 2008-07-10 2017-09-26 Micron Technology, Inc. Data collection and compression in a solid state storage device
KR101993704B1 (en) 2012-08-24 2019-06-27 삼성전자주식회사 Storage device based on a flash memory and method for allocatting write memory block of memory controller controlling a flash memory
US9430376B2 (en) * 2012-12-26 2016-08-30 Western Digital Technologies, Inc. Priority-based garbage collection for data storage systems
US9349450B2 (en) * 2013-06-10 2016-05-24 Micron Technology, Inc. Memory devices and memory operational methods including single erase operation of conductive bridge memory cells

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002029575A2 (en) * 2000-09-29 2002-04-11 Emc Corporation System and method for hierarchical data storage in a log structure
US20030225961A1 (en) * 2002-06-03 2003-12-04 James Chow Flash memory management system and method

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10326227A (en) * 1997-05-23 1998-12-08 Nec Corp System for managing storage device using flash memory as storage medium
US6591358B2 (en) * 2001-01-26 2003-07-08 Syed Kamal H. Jaffrey Computer system with operating system functions distributed among plural microcontrollers for managing device resources and CPU
KR100389867B1 (en) * 2001-06-04 2003-07-04 삼성전자주식회사 Flash memory management method
JP2003208352A (en) * 2002-01-17 2003-07-25 Fujitsu Ltd Flash memory enabling restriction of writing frequency and ware levelling
US7254668B1 (en) * 2002-10-28 2007-08-07 Sandisk Corporation Method and apparatus for grouping pages within a block
JP4245959B2 (en) * 2003-04-09 2009-04-02 日本電信電話株式会社 Memory management method for IC card and IC card
JP2005122439A (en) * 2003-10-16 2005-05-12 Sharp Corp Device equipment and format conversion method for recording device of device equipment
WO2005066793A2 (en) * 2003-12-30 2005-07-21 Sandisk Corporation Non-volatile memory and method with non-sequential update block management
US7139864B2 (en) * 2003-12-30 2006-11-21 Sandisk Corporation Non-volatile memory and method with block management system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002029575A2 (en) * 2000-09-29 2002-04-11 Emc Corporation System and method for hierarchical data storage in a log structure
US20030225961A1 (en) * 2002-06-03 2003-12-04 James Chow Flash memory management system and method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HAN-JOON KIM ET AL: "A new flash memory management for flash storage system", COMPUTER SOFTWARE AND APPLICATIONS CONFERENCE, 1999. COMPSAC '99. PROCEEDINGS. THE TWENTY-THIRD ANNUAL INTERNATIONAL PHOENIX, AZ, USA 27-29 OCT. 1999, LOS ALAMITOS, CA, USA,IEEE COMPUT. SOC, US, 27 October 1999 (1999-10-27), pages 284 - 289, XP010549515, ISBN: 0-7695-0368-3 *
MEI-LING CHIANG ET AL: "Data Management in a Flash Memory Based STorage Server", INTERNET CITATION, XP002255590, Retrieved from the Internet <URL:http://citeseer.nj.nec.com/11056.html> *

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8055832B2 (en) 2005-08-03 2011-11-08 SanDisk Technologies, Inc. Management of memory blocks that directly store data files
WO2008083001A1 (en) * 2006-12-26 2008-07-10 Sandisk Corporation Managing a lba interface in a direct data file memory system
US7739444B2 (en) 2006-12-26 2010-06-15 Sandisk Corporation System using a direct data file system with a continuous logical address space interface
US7917686B2 (en) 2006-12-26 2011-03-29 Sandisk Corporation Host system with direct data file interface configurability
US8046522B2 (en) 2006-12-26 2011-10-25 SanDisk Technologies, Inc. Use of a direct data file system with a continuous logical address space interface and control of file address storage in logical blocks
US8166267B2 (en) 2006-12-26 2012-04-24 Sandisk Technologies Inc. Managing a LBA interface in a direct data file memory system
US8209461B2 (en) 2006-12-26 2012-06-26 Sandisk Technologies Inc. Configuration of host LBA interface with flash memory
JP2011530758A (en) * 2008-08-11 2011-12-22 インディリンクス カンパニー リミテッド Flash memory control method and control device
US9311229B2 (en) 2011-03-29 2016-04-12 Blackberry Limited System and method for managing flash memory
US9734911B2 (en) 2012-12-31 2017-08-15 Sandisk Technologies Llc Method and system for asynchronous die operations in a non-volatile memory
US20140189207A1 (en) * 2012-12-31 2014-07-03 Alan Welsh Sinclair Method and system for managing background operations in a multi-layer memory
US9336133B2 (en) 2012-12-31 2016-05-10 Sandisk Technologies Inc. Method and system for managing program cycles including maintenance programming operations in a multi-layer memory
US9348746B2 (en) 2012-12-31 2016-05-24 Sandisk Technologies Method and system for managing block reclaim operations in a multi-layer memory
US9465731B2 (en) 2012-12-31 2016-10-11 Sandisk Technologies Llc Multi-layer non-volatile memory system having multiple partitions in a layer
US9734050B2 (en) * 2012-12-31 2017-08-15 Sandisk Technologies Llc Method and system for managing background operations in a multi-layer memory
US9223693B2 (en) 2012-12-31 2015-12-29 Sandisk Technologies Inc. Memory system having an unequal number of memory die on different control channels
US9778855B2 (en) 2015-10-30 2017-10-03 Sandisk Technologies Llc System and method for precision interleaving of data writes in a non-volatile memory
US10042553B2 (en) 2015-10-30 2018-08-07 Sandisk Technologies Llc Method and system for programming a multi-layer non-volatile memory having a single fold data path
US10120613B2 (en) 2015-10-30 2018-11-06 Sandisk Technologies Llc System and method for rescheduling host and maintenance operations in a non-volatile memory
US10133490B2 (en) 2015-10-30 2018-11-20 Sandisk Technologies Llc System and method for managing extended maintenance scheduling in a non-volatile memory
CN109558333A (en) * 2017-09-27 2019-04-02 北京忆恒创源科技有限公司 Solid storage device NameSpace with variable additional storage space (OP)
CN109558333B (en) * 2017-09-27 2024-04-05 北京忆恒创源科技股份有限公司 Solid state storage device namespaces with variable additional storage space

Also Published As

Publication number Publication date
JP2009503735A (en) 2009-01-29
ATE509314T1 (en) 2011-05-15
KR20080042844A (en) 2008-05-15
EP1920335B1 (en) 2011-05-11
KR101272642B1 (en) 2013-06-10
EP1920335A1 (en) 2008-05-14
JP4533956B2 (en) 2010-09-01

Similar Documents

Publication Publication Date Title
US7450420B2 (en) Reclaiming data storage capacity in flash memories
EP1920335B1 (en) Reclaiming data storage capacity in flash memory systems
US8166267B2 (en) Managing a LBA interface in a direct data file memory system
US8209461B2 (en) Configuration of host LBA interface with flash memory
US8046522B2 (en) Use of a direct data file system with a continuous logical address space interface and control of file address storage in logical blocks
US7739444B2 (en) System using a direct data file system with a continuous logical address space interface
US7669003B2 (en) Reprogrammable non-volatile memory systems with indexing of directly stored data files
US7949845B2 (en) Indexing of file data in reprogrammable non-volatile memories that directly store data files
US7917686B2 (en) Host system with direct data file interface configurability
US8880483B2 (en) System and method for implementing extensions to intelligently manage resources of a mass storage system
US20080155175A1 (en) Host System That Manages a LBA Interface With Flash Memory
EP2097825B1 (en) Use of a direct data file system with a continuous logical address space interface
WO2007019197A2 (en) Management of memory blocks that directly store data files
EP1917577A2 (en) Indexing of file data in reprogrammable non-volatile memories that directly store data files
WO2008083001A9 (en) Managing a lba interface in a direct data file memory system
WO2008082999A2 (en) Configuration of host lba interface with flash memory

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 200680028318.4

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2006789157

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2008525135

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 1020087004727

Country of ref document: KR