JP2013200726A - Semiconductor memory - Google Patents

Semiconductor memory Download PDF

Info

Publication number
JP2013200726A
JP2013200726A JP2012068868A JP2012068868A JP2013200726A JP 2013200726 A JP2013200726 A JP 2013200726A JP 2012068868 A JP2012068868 A JP 2012068868A JP 2012068868 A JP2012068868 A JP 2012068868A JP 2013200726 A JP2013200726 A JP 2013200726A
Authority
JP
Japan
Prior art keywords
data
block
compaction
invalid
semiconductor memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2012068868A
Other languages
Japanese (ja)
Inventor
Takashi Hirao
孝史 平尾
Mitsunori Tadokoro
三徳 田所
Hiroki Matsudaira
弘樹 松平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2012068868A priority Critical patent/JP2013200726A/en
Priority to US13/599,087 priority patent/US9251055B2/en
Publication of JP2013200726A publication Critical patent/JP2013200726A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Memory System (AREA)

Abstract

PROBLEM TO BE SOLVED: To prevent a significant delay in the response to a write command by eliminating continuous compaction operations for an extended period.SOLUTION: Write processing by a write control unit, and data arrangement by an arrangement unit are alternately performed at a predetermined ratio. In the arrangement unit, during data arrangement corresponding to the predetermined ratio, if the results of validity determination to be invalid continue a predetermined set number, the validity determination processing this time is terminated.

Description

本発明の実施形態は、不揮発性半導体メモリを備えた半導体記憶装置に関する。   Embodiments described herein relate generally to a semiconductor memory device including a nonvolatile semiconductor memory.

SSD(solid state drive)において、データの消去単位(ブロック)と、データの管理単位が異なる場合、フラッシュメモリの書き換えが進むと、無効な(最新ではない)データによって、ブロックは穴あき状態になる。このような穴あき状態のブロックが増えると、実質的に使用可能なブロックが少なくなり、フラッシュメモリの記憶領域を有効利用できなくなる。そこで、例えば、フラッシュメモリのフリーブロック(内部に有効データを含まない、用途未割り当ての未使用ブロック)が所定の閾値より少なくなった場合、ブロック内の有効データを集めて別のブロックに書き直すコンパクションなどのフラッシュメモリの整理を実行し、用途未割り当てのフリーブロックを確保する。   In solid state drive (SSD), if the data erasure unit (block) is different from the data management unit, the block becomes perforated due to invalid (not up-to-date) data when the flash memory is rewritten. . If the number of such perforated blocks increases, the number of blocks that can be used substantially decreases, and the storage area of the flash memory cannot be effectively used. Therefore, for example, when the free blocks of the flash memory (internally unused valid blocks that do not contain valid data) become less than a predetermined threshold, the compaction data is collected and rewritten in another block. Arrange the flash memory, etc., and secure free blocks that are not allocated.

SSDに対し、ホスト装置からライト要求が入力されたときに、コンパクションが動作し続けると、ライト要求に対する応答が遅くなる。コンパクションを行なわないとフリーブロックが確保できないなどコンパクションを行なう必要があるときもあるが、コンパクションを行なわなくてもフリーブロックが存在する時は、ライト要求に対する応答を優先するのが望ましい。   If the compaction continues to operate when a write request is input from the host device to the SSD, the response to the write request is delayed. In some cases, it is necessary to perform compaction because, for example, a free block cannot be secured unless compaction is performed. However, if there is a free block without performing compaction, it is desirable to give priority to a response to a write request.

特開2008−276733号公報JP 2008-276733 A 特開2010−152778号公報JP 2010-152778 A 特開2008−257773号公報JP 2008-257773 A

本発明の一つの実施形態は、長時間の連続的なコンパクション動作をなくすことで、ライトコマンドに対する大きな応答の遅れを防ぐ半導体記憶装置を提供することを目的とする。   An object of one embodiment of the present invention is to provide a semiconductor memory device that prevents a large delay in response to a write command by eliminating a long-time continuous compaction operation.

本発明の一つの実施形態によれば、半導体記憶装置は、不揮発性半導体メモリとコントローラとを備える。不揮発性半導体メモリでは、ブロック単位で消去が行われる。コントローラは、ホスト装置からのデータを前記不揮発性半導体メモリのブロックに書き込むライト制御部と、前記不揮発性半導体メモリの整理対象ブロックに記憶された各データが有効か無効かを判定し、有効と判定されたデータを順次選択して新たなブロックへ書き直すデータ整理を行う整理部とを有し、前記ライト制御部による書き込み処理と前記整理部による新たなブロックへ書き直しを所定の比率をもって交互に実行する。前記整理部は、前記所定の比率に対応する前記データ整理の最中に、無効である有効無効判定の結果が所定の設定回数連続した場合、今回の有効無効判定処理を終了させる。   According to one embodiment of the present invention, a semiconductor memory device includes a nonvolatile semiconductor memory and a controller. In the nonvolatile semiconductor memory, erasing is performed in units of blocks. The controller determines whether each data stored in the block to be organized in the nonvolatile semiconductor memory is valid or invalid, and a write control unit that writes data from the host device to the block of the nonvolatile semiconductor memory. A data reorganization unit that sequentially selects selected data and rewrites the data to a new block, and alternately executes a write process by the write control unit and a rewrite to a new block by the reorganization unit at a predetermined ratio. . The organizing unit ends the current valid / invalid determination process when the invalid / invalid determination result continues for a predetermined number of times during the data reduction corresponding to the predetermined ratio.

図1は、SSDの内部構成例を示すブロック図である。FIG. 1 is a block diagram illustrating an internal configuration example of an SSD. 図2は、アドレス変換テーブルを示す図である。FIG. 2 shows an address conversion table. 図3は、ブロック管理テーブルを示す図である。FIG. 3 is a diagram illustrating a block management table. 図4は、ブロック管理を概念的に示す図である。FIG. 4 is a diagram conceptually showing block management. 図5は、データに付加される逆引き情報を示す図である。FIG. 5 is a diagram showing reverse lookup information added to data. 図6は、データの有効無効判定処理を概念的に示す図である。FIG. 6 is a diagram conceptually showing the data validity / invalidity determination processing. 図7は、1:Nコンパクションを概念的に示す図である。FIG. 7 is a diagram conceptually illustrating 1: N compaction. 図8は、比較例による1:Nコンパクションの動作手順例を示すフローチャートである。FIG. 8 is a flowchart illustrating an example of an operation procedure of 1: N compaction according to the comparative example. 図9は、コンパクション元ブロックの一例を示す図である。FIG. 9 is a diagram illustrating an example of the compaction source block. 図10は、実施形態による1:Nコンパクションの動作手順例を示すフローチャートである。FIG. 10 is a flowchart illustrating an example of an operation procedure of 1: N compaction according to the embodiment. 図11は、実施形態によるダミーデータの書き込みを概念的に示す図である。FIG. 11 is a diagram conceptually illustrating writing of dummy data according to the embodiment.

以下に添付図面を参照して、実施形態にかかる半導体記憶装置を詳細に説明する。なお、この実施形態により本発明が限定されるものではない。   Exemplary embodiments of a semiconductor memory device will be explained below in detail with reference to the accompanying drawings. In addition, this invention is not limited by this embodiment.

(第1の実施形態)
図1は、SSD(Solid State Drive)100の構成例を示すブロック図である。SSD100は、ATAインタフェース(ATA I/F)などのホストインタフェース2を介してパーソナルコンピュータあるいはCPUなどのホスト装置(以下、ホストと略す)1と接続され、ホスト1の外部記憶装置として機能する。ホスト1は、例えば、パーソナルコンピュータのCPU、スチルカメラ、ビデオカメラなどの撮像装置のCPUである。SSD100は、ホストインタフェース2と、不揮発性半導体メモリとしてのNAND型フラッシュメモリ(以下、NANDと略す)10と、NAND10よりも高速アクセスが可能でランダムアクセス可能な半導体メモリであるRAM20と、NANDコントローラ(NANDC)31と、コントローラ30とを備える。
(First embodiment)
FIG. 1 is a block diagram illustrating a configuration example of an SSD (Solid State Drive) 100. The SSD 100 is connected to a host device (hereinafter abbreviated as a host) 1 such as a personal computer or a CPU via a host interface 2 such as an ATA interface (ATA I / F), and functions as an external storage device of the host 1. The host 1 is a CPU of an imaging apparatus such as a CPU of a personal computer, a still camera, or a video camera. The SSD 100 includes a host interface 2, a NAND flash memory (hereinafter abbreviated as “NAND”) 10 as a nonvolatile semiconductor memory, a RAM 20 that is a semiconductor memory that can be accessed at higher speed than the NAND 10, and a NAND controller ( NANDC) 31 and controller 30.

NAND10は、ホスト1によって指定されたユーザデータ11を記憶したり、RAM20で管理される管理情報を不揮発管理テーブル12としてバックアップ記憶する。NAND10は、複数のメモリセルがマトリクス状に配列されたメモリセルアレイを有し、個々のメモリセルは上位ページ及び下位ページを使用して多値記憶が可能である。NAND10は、複数のメモリチップによって構成され、各メモリチップは、データ消去の単位である物理ブロックを複数配列して構成される。また、NAND10では、物理ページごとにデータの書き込み及びデータの読み出しが行われる。物理ブロックは、複数の物理ページによって構成されている。   The NAND 10 stores user data 11 designated by the host 1 and backup-stores management information managed by the RAM 20 as a nonvolatile management table 12. The NAND 10 has a memory cell array in which a plurality of memory cells are arranged in a matrix, and each memory cell can store multiple values using an upper page and a lower page. The NAND 10 is constituted by a plurality of memory chips, and each memory chip is constituted by arranging a plurality of physical blocks which are data erasing units. In the NAND 10, data is written and data is read for each physical page. A physical block is composed of a plurality of physical pages.

RAM20は、ホスト1からのデータをNAND10にライトする際に一時的にデータを保存するためのライトバッファ25としての記憶領域と、アドレス変換テーブル21、ブロック管理テーブル22などの管理情報を記憶、更新するための記憶領域と、NAND10からリードされたデータを一時記憶するなどのための作業領域を有する。アドレス変換テーブル21、ブロック管理テーブル22などの管理情報は、NAND10に記憶されている不揮発管理テーブル12が起動時などに展開されたものである。   The RAM 20 stores and updates a storage area as a write buffer 25 for temporarily storing data when writing data from the host 1 to the NAND 10, and management information such as an address conversion table 21 and a block management table 22. And a work area for temporarily storing data read from the NAND 10. The management information such as the address conversion table 21 and the block management table 22 is developed when the nonvolatile management table 12 stored in the NAND 10 is activated.

NANDC31は、NAND10とのインタフェース処理を行うNAND I/F、誤り訂正回路、DMAコントローラなどを備えており、RAM20に一時記憶されたデータをNAND10に書き込んだり、NAND10に記憶されているデータを読み出してRAM20に転送したりする。   The NANDC 31 includes a NAND I / F that performs interface processing with the NAND 10, an error correction circuit, a DMA controller, and the like, and writes data temporarily stored in the RAM 20 to the NAND 10 and reads data stored in the NAND 10. Or transferred to the RAM 20.

ホスト1はSSD100に対し、リードまたはライトする際には、ホストインタフェース2を介して論理アドレスとしてのLBA(Logical Block Addressing)をSSD100に入力する。LBAは、セクタ(サイズ:例えば512B)に対して0からの通し番号をつけた論理アドレスである。本実施の形態においては、ライトバッファ25,NAND10でデータを管理する単位として、セクタサイズよりも大きく、物理ブロックサイズよりも小さいクラスタという管理単位を定義する。この実施形態では、クラスタという1つの管理単位を使用するが、クラスタよりサイズが大きく、ブロックサイズ以下のサイズである他の管理単位を追加し、2つの管理単位を使用してもよい。この実施形態では、簡単化のためにクラスタサイズは、ページサイズと同じとする。   When the host 1 reads from or writes to the SSD 100, the host 1 inputs LBA (Logical Block Addressing) as a logical address to the SSD 100 via the host interface 2. LBA is a logical address in which a serial number from 0 is assigned to a sector (size: eg, 512 B). In this embodiment, as a unit for managing data by the write buffer 25 and the NAND 10, a management unit called a cluster larger than the sector size and smaller than the physical block size is defined. In this embodiment, one management unit called a cluster is used, but another management unit having a size larger than the cluster and smaller than the block size may be added to use two management units. In this embodiment, the cluster size is the same as the page size for simplicity.

コントローラ30は、ブロック管理部31と、データアクセス部32とを備える。データアクセス部32は、リード制御部33、ライト制御部34、整理部35を備える。   The controller 30 includes a block management unit 31 and a data access unit 32. The data access unit 32 includes a read control unit 33, a write control unit 34, and an organizing unit 35.

ブロック管理部31は、ブロックの使用状態(使用中であるアクティブブロックであるか未使用であるフリーブロックであるか)を管理するとともに、エラーが多いなど記憶領域として使用できないバッドブロックを識別管理する。ブロック管理部31は、データアクセス部32に対して、使用すべきフリーブロックまたはアクティブブロックを通知する。また、ブロック管理部31は、ホスト1からの書き込みとコンパクションの動作比率を示すギア比(後述する)の制御を行い、このギア比をデータアクセス部32に通知する。   The block management unit 31 manages the use state of the block (whether it is an active block that is being used or a free block that is not being used), and identifies and manages bad blocks that cannot be used as a storage area due to many errors. . The block management unit 31 notifies the data access unit 32 of a free block or an active block to be used. In addition, the block management unit 31 controls a gear ratio (described later) indicating the operation ratio between writing from the host 1 and compaction, and notifies the data access unit 32 of this gear ratio.

データアクセス部32は、ホスト1から指定されたデータのリードライト制御や、NAND10の整理(コンパクション)などを実行する。データアクセス部32は、ブロック供給元であるブロック管理部31から通知されるフリーブロックを使用してホスト1から指定されたデータのライト制御を行い、またブロック管理部31から通知されるアクティブブロック(コンパクション元ブロック)およびフリーブロック(コンパクション先ブロック)を使用してコンパクションを実行する。さらに、データ管理部33は、ブロック管理部31から通知されたギア比にしたがって、ホスト1からの書き込みとコンパクションを行うことで1:Nコンパクション(後述する)を実現する。   The data access unit 32 executes read / write control of data designated by the host 1, organizing (compaction) of the NAND 10, and the like. The data access unit 32 performs write control of data designated by the host 1 using a free block notified from the block management unit 31 that is a block supply source, and also performs an active block (notified from the block management unit 31). Compaction is performed using a compaction source block) and a free block (compact destination block). Further, the data management unit 33 implements 1: N compaction (described later) by performing writing and compaction from the host 1 in accordance with the gear ratio notified from the block management unit 31.

リード制御部33は、ホスト1からリードコマンドおよびリードアドレスとしてのLBAが入力されると、正引きのアドレス変換テーブル21を参照してLBAに対応するデータをNAND10から読み出し、読み出したデータをホスト1に送信する。   When a read command and an LBA as a read address are input from the host 1, the read control unit 33 reads data corresponding to the LBA from the NAND 10 with reference to the forward address conversion table 21, and reads the read data from the host 1. Send to.

ライト制御部34は、ライコマンド、ライトアドレスとしてのLBA、ライトデータが入力されると、LBAで指定されたデータをライトバッファ25に書き込む。ライトバッファ25に空き領域がない場合は、ライトバッファ25からデータを追い出して、追い出したデータをブロック管理テーブル22などを参照してNAND10に書き込む。この書き込みに応じて、アドレス変換テーブル21、ブロック管理テーブル22などを更新する。   When a write command, an LBA as a write address, and write data are input, the write control unit 34 writes the data specified by the LBA into the write buffer 25. If there is no free space in the write buffer 25, data is evicted from the write buffer 25, and the evicted data is written to the NAND 10 with reference to the block management table 22 or the like. In response to this writing, the address conversion table 21, the block management table 22, and the like are updated.

整理部35は、NAND10でのデータ整理(コンパクション)を実行する。NAND10は、ブロック単位で消去し、ページ単位で追記書き込みを行う記憶デバイスである。そのため、NAND10では、上書きはできず、書き込みは常に消去済みの未書き込みなページ領域に対して行われる。書き込みを繰り返していると、未使用なフリーブロックは徐々に無くなっていき、ある時点で新規に使えるフリーブロックが無くなってしまう。また、書き込みを繰り返し行うことにより、有効なデータと無効なデータが混在するブロックや無効なデータのみを含むブロックが発生してくる。そこで、複数のブロックから有効なデータを集めて新規のフリーブロックにデータを移動させるコンパクションを行うことによって、コンパクション元のブロックが無効なデータ領域となり、コンパクション元のブロックをフリーブロックとして使用することができる。コンパクション処理を行うことによって、再びフリーブロックを生成することができ、NAND10に対し新たなデータの書き込みを行うことができる。   The organizing unit 35 performs data organization (compaction) in the NAND 10. The NAND 10 is a storage device that erases in block units and performs additional writing in page units. Therefore, in the NAND 10, overwriting cannot be performed, and writing is always performed on an unwritten page area that has been erased. When writing is repeated, unused free blocks gradually disappear, and there are no free blocks that can be newly used at a certain point. Further, by repeatedly performing writing, a block in which valid data and invalid data are mixed or a block including only invalid data is generated. Therefore, by performing compaction that collects valid data from multiple blocks and moves the data to a new free block, the compaction source block becomes an invalid data area, and the compaction source block can be used as a free block. it can. By performing the compaction process, a free block can be generated again, and new data can be written to the NAND 10.

図2に示すように、RAM20で管理されるアドレス変換テーブル21には、LBAのクラスタアドレスと、クラスタデータが記憶されているNAND10上の記憶位置(物理アドレス:例えばブロック番号+ブロック内記憶位置)と、当該クラスタにデータが存在するか否かを示すデータ有無フラグとの対応が登録されている。クラスタアドレスとは、LBAをクラスタサイズで割ったものである。このアドレス変換テーブル21は、論理アドレスからその論理アドレスに対応するデータが存在する記憶デバイス位置を検索することができ、正引きテーブルとして機能する。4この正引きのアドレス変換テーブル21は、リード処理などに使用される。また、NAND10へのデータの書き込みによって、クラスタアドレスとNAND上の記憶位置との関係が異なった場合、アドレス変換テーブル21が更新される。   As shown in FIG. 2, in the address conversion table 21 managed by the RAM 20, the cluster address of the LBA and the storage location on the NAND 10 where the cluster data is stored (physical address: for example, block number + intra-block storage location) And a data presence / absence flag indicating whether or not data exists in the cluster is registered. The cluster address is the LBA divided by the cluster size. The address conversion table 21 can search the storage device position where the data corresponding to the logical address exists from the logical address, and functions as a forward lookup table. 4 This forward address conversion table 21 is used for read processing and the like. Further, when the relationship between the cluster address and the storage position on the NAND differs due to the writing of data to the NAND 10, the address conversion table 21 is updated.

図3に示すように、RAM20で管理されるブロック管理テーブル22には、ブロック番号毎に、各ブロックがアクティブブロックであるかフリーブロックであるかを示すブロック使用/未使用情報や、エラーが多いなど記憶領域として使用できないバッドブロックを識別する不良ブロックフラグなどが登録されている。このブロック管理テーブル22を使用して、NAND10に対する書き込みの際に使用するフリーブロックを選択する。また、ブロック管理テーブル22を使用して、コンパクションの際に使用するフリーブロック(コンパクション先ブロック)を選択する。   As shown in FIG. 3, the block management table 22 managed by the RAM 20 has a lot of block use / unused information indicating whether each block is an active block or a free block for each block number, and many errors. For example, a bad block flag for identifying a bad block that cannot be used as a storage area is registered. Using this block management table 22, a free block to be used when writing to the NAND 10 is selected. In addition, the block management table 22 is used to select a free block (compaction destination block) to be used for compaction.

図4は、SSD100でのブロック管理を概念的に示す図である。ブロックは、前述したように、アクティブブロックとフリーブロックに分類される。例えば、同じLBAのデータを上書きする場合は、つぎのような処理が行われる。論理アドレスA1にブロックサイズの有効なデータが保存されており、記憶領域としてはブロックB1が使用されていたとする。ホスト1から論理アドレスA1のブロックサイズの更新データを上書きするコマンドを受信した場合、フリーブロック(ブロックB2とする)を1個確保し、そのフリーブロックにホスト1から受信したデータを書き込む。その後、論理アドレスA1とブロックB2を関係付ける。その結果、ブロックB2はアクティブブロックになり、ブロックB1に保存されたデータは無効になるためブロックB1はフリーブロックとなる。   FIG. 4 is a diagram conceptually showing block management in the SSD 100. As described above, the blocks are classified into active blocks and free blocks. For example, when data of the same LBA is overwritten, the following processing is performed. It is assumed that valid data having a block size is stored at the logical address A1, and the block B1 is used as a storage area. When a command for overwriting update data having a block size of the logical address A1 is received from the host 1, one free block (referred to as block B2) is secured, and the data received from the host 1 is written in the free block. Thereafter, the logical address A1 is related to the block B2. As a result, the block B2 becomes an active block, and the data stored in the block B1 becomes invalid, so the block B1 becomes a free block.

このように、SSD100では、同じ論理アドレスA1のデータであっても、実際の記録領域として使用されるブロックは書込みの度に変化する。なお、ブロックサイズの更新データ書き込みでは、必ず書き込み先ブロックが変化するが、ブロックサイズ未満の更新データ書き込みでは、同じブロックに更新データが書き込まれることもある。例えばブロックサイズ未満のページデータが更新される場合、当該ブロック内において同じ論理アドレスの旧ページデータが無効化され、新たに書き込まれた最新のページデータが有効ページとして管理される。ブロック内の全データが無効化されると、当該ブロックはフリーブロックとして解放される。   As described above, in the SSD 100, even if the data has the same logical address A1, the block used as the actual recording area changes every time writing is performed. Note that, in writing update data with a block size, the write destination block always changes, but with update data writing with a block size less than that, update data may be written in the same block. For example, when page data smaller than the block size is updated, old page data having the same logical address in the block is invalidated, and the latest page data newly written is managed as a valid page. When all the data in the block is invalidated, the block is released as a free block.

図4において、ホスト1からのデータは、書き込み先ブロック(フリーブロック)に書き込まれる。ホスト1からのデータが書き込まれたブロックはアクティブブロックとなる。アクティブブロックは、NAND10の書き換えが進むと、フリーブロックとして解放されたり、コンパクションでの書き込み元のブロックを経てフリーブロックとして解放されたりする。フリーブロックは、その後、ホスト1からのユーザデータをライトするための書き込み先ブロックや、コンパクションにおいてデータをライトするためのコンパクション先ブロックとして利用される。   In FIG. 4, data from the host 1 is written into a write destination block (free block). The block in which data from the host 1 is written becomes an active block. When rewriting of the NAND 10 proceeds, the active block is released as a free block, or released as a free block through a writing source block in compaction. Thereafter, the free block is used as a write destination block for writing user data from the host 1 or a compaction destination block for writing data in compaction.

ここで、アドレス変換テーブル21では、論理アドレスとしてのLBAからこのLBAに対応するデータのNAND10で記憶位置を検索する正引きの検索が行われ、このアドレス変換テーブル21は、リード処理などに使用される。一方、NAND10でのデータの記憶位置から論理アドレスとしてのLBAを検索する処理は、逆引きの検索であり、この逆引きの検索は、主に、コンパクションの際に使用される。逆引きのアドレス変換テーブルを用意してもよいが、逆引きのアドレス変換テーブルは、NAND10、RAM20で多くの記憶領域を使用するので、この実施形態では、図5に示すように、クラスタデータDclに、当該クラスタデータの逆引き情報GIを付加し、逆引き情報GIが付加されたクラスタデータDclをNAND10に記憶する。   Here, in the address conversion table 21, a forward search is performed to search the storage location from the LBA as a logical address with the NAND 10 of the data corresponding to the LBA, and this address conversion table 21 is used for read processing and the like. The On the other hand, the process of retrieving the LBA as a logical address from the data storage position in the NAND 10 is a reverse lookup, and this reverse lookup is mainly used for compaction. Although a reverse address conversion table may be prepared, since the reverse address conversion table uses a large number of storage areas in the NAND 10 and the RAM 20, in this embodiment, as shown in FIG. In addition, the reverse lookup information GI of the cluster data is added, and the cluster data Dcl to which the reverse lookup information GI is added is stored in the NAND 10.

逆引き情報GIは、逆引き情報が付加されるクラスタデータDclの論理アドレス(LBA)を有している。逆引き情報GIとして、LBAの他に、当該クラスタデータDclが有効か無効かを示す有効フラグを持たせるようにしてもよいが、そのためには、NAND10上で頻繁な有効フラグの更新が発生し、非現実的であるので、ここでは逆引き情報GIとして、有効フラグを持たずLBAのみを持っている場合のクラスタデータDclの有効無効判定について説明する。   The reverse lookup information GI has a logical address (LBA) of the cluster data Dcl to which the reverse lookup information is added. As the reverse lookup information GI, in addition to the LBA, a valid flag indicating whether the cluster data Dcl is valid or invalid may be provided. For this purpose, the valid flag is frequently updated on the NAND 10. Since it is unrealistic, here, the validity / invalidity determination of the cluster data Dcl in the case of having only the LBA without the validity flag as the reverse lookup information GI will be described.

LBA=A0の論理アドレスを持つクラスタデータG0をNAND10上の位置(ページ)P0に書き込むとする。クラスタデータG0に付加される逆引き情報GIは、論理アドレスA0を持つ。次に、LBA=A0が異なるデータG1によって更新された場合、NAND10の場合、書き込み済みの物理的位置に上書きすることはできないため、このデータG1は、物理的には異なる位置(ページ)P1に書き込まれる。クラスタデータG1に付加される逆引き情報GIも、論理アドレスA0を持つことになる。この段階では、データG1が論理アドレスA0の最新のデータとなるので、データG0は無効データとなり、データG1は有効データとなる。しかし、この場合は、逆引き情報GIに有効フラグを持たせないようにしているので、データG0に付加される逆引き情報(LBA=A0)と、データG1に付加される逆引き情報(LBA=A0)のみを見たのでは、それぞれが自身が論理アドレスA0のデータであるという情報を持つのみで、どちらが有効であるかを識別することはできない。   It is assumed that cluster data G0 having a logical address of LBA = A0 is written to a position (page) P0 on the NAND 10. The reverse lookup information GI added to the cluster data G0 has a logical address A0. Next, when LBA = A0 is updated with different data G1, in the case of NAND10, the written physical position cannot be overwritten, so this data G1 is physically located at a different position (page) P1. Written. The reverse lookup information GI added to the cluster data G1 also has a logical address A0. At this stage, since the data G1 is the latest data of the logical address A0, the data G0 is invalid data and the data G1 is valid data. However, in this case, since the valid flag is not given to the reverse lookup information GI, the reverse lookup information added to the data G0 (LBA = A0) and the reverse lookup information added to the data G1 (LBA) If only = A0) is seen, each has only information that it is the data of the logical address A0, and it cannot be identified which is valid.

そこで、正引きのアドレス変換テーブル21と逆引き情報GIを照合し、お互いを指し合っているものが有効データで、片方だけしか指していないものを無効データと判定する有効無効判定を実行する。具体的には、コンパクションの際には、あるブロックのクラスタデータを別のブロックに移動させようとしたとき、無効なデータは移動する必要がなく、有効なデータのみを移動させるので、そのクラスタデータが有効か否かを有効無効判定処理によって判断する。コンパクション対象の各ブロックに含まれる各クラスタデータが無効か有効かを順次判定していくので、まず判定対象のクラスタデータに付加されている逆引き情報GIを読み出し、この逆引き情報GIが指し示している論理アドレス(LBA)と一致するアドレス変換テーブル21のエントリを取り出し、このエントリ内の正引き情報が判定対象のクラスタデータの記憶位置を指し示しているか否かを判定し、指し示しているときに、当該判定対象のクラスタデータが有効であると判定する。しかし、正引き情報が他の記憶位置を指し示しているときは、当該判定対象のクラスタデータが無効であると判定する。このような有効無効判定処理を、コンパクション対象のブロック内の各クラスタデータに関して繰り返し実行することで、所要数の有効なクラスタデータを集める。   Accordingly, the forward address conversion table 21 and the reverse lookup information GI are collated, and valid / invalid determination is performed in which the data pointing to each other is valid data, and the data pointing to only one is determined to be invalid data. Specifically, during compaction, when trying to move cluster data of one block to another block, invalid data does not need to be moved, only valid data is moved. Whether or not is valid is determined by a validity / invalidity determination process. Since it is sequentially determined whether each cluster data included in each block to be compacted is invalid or valid, the reverse lookup information GI added to the cluster data to be judged is first read and this reverse lookup information GI indicates When an entry of the address conversion table 21 that matches the logical address (LBA) is taken out, it is determined whether or not the forward lookup information in this entry indicates the storage location of the cluster data to be determined. It is determined that the cluster data to be determined is valid. However, when the forward lookup information points to another storage position, it is determined that the cluster data to be determined is invalid. Such a valid / invalid determination process is repeatedly performed for each cluster data in the compaction target block, thereby collecting a required number of valid cluster data.

図6は、上述したデータG0とデータG1に関する有効無効判定を示すものである。位置P0に記憶されているクラスタデータG0に付加される逆引き情報GIはLBA=A0であるので、アドレス変換テーブル21のLBA=A0のエントリに含まれる正引き情報を取得する。この正引き情報はLBA=A0の論理アドレスのデータが位置P1に存在することを示しているので、逆引き情報と正引き情報の照合結果は不一致となり、このクラスタデータG0は無効と判定される。位置P1に記憶されているクラスタデータG1に付加される逆引き情報GIはLBA=A0であるので、同様に、アドレス変換テーブル21のLBA=A0のエントリに含まれる正引き情報を取得する。この正引き情報はLBA=A0の論理アドレスのデータが位置P1に存在することを示しているので、逆引き情報と正引き情報の照合結果が一致となり、このクラスタデータG0は有効と判定される。   FIG. 6 shows the validity / invalidity determination regarding the data G0 and the data G1 described above. Since the reverse lookup information GI added to the cluster data G0 stored at the position P0 is LBA = A0, the forward lookup information included in the LBA = A0 entry of the address translation table 21 is acquired. Since the forward lookup information indicates that the data of the logical address of LBA = A0 exists at the position P1, the collation result of the reverse lookup information and the forward lookup information is inconsistent, and this cluster data G0 is determined to be invalid. . Since the reverse lookup information GI added to the cluster data G1 stored at the position P1 is LBA = A0, the forward lookup information included in the entry of LBA = A0 in the address translation table 21 is acquired in the same manner. Since this forward lookup information indicates that the data of the logical address of LBA = A0 exists at the position P1, the collation result of the reverse lookup information and the forward lookup information coincides, and this cluster data G0 is determined to be valid. .

このように、有効無効判定を行うには、読み出し対象のクラスタデータの逆引き情報GIをNAND10から読み出す必要がある。また、逆引き情報GIと正引きのアドレス変換テーブル21の照合を行なわなければならず、一定の処理時間が発生する。つまり、クラスタデータを別のブロックに移動するコンパクション処理の実際のデータの移動(読み出しおよび書き込み)が発生しなくても、有効無効判定を繰り返し行うことは一定の処理時間が発生することになる。判定対象のクラスタデータが有効なデータである場合には、コンパクション先ブロックへの書き込みが発生するが、判定対象のクラスタデータが無効なデータだった場合は、コンパクション先ブロックへの書き込みは発生しない。   Thus, in order to perform the validity / invalidity determination, it is necessary to read the reverse lookup information GI of the cluster data to be read from the NAND 10. Further, the reverse lookup information GI and the forward lookup address conversion table 21 must be collated, and a certain processing time is generated. In other words, even if the actual data movement (reading and writing) of the compaction process for moving the cluster data to another block does not occur, repeatedly performing the validity / invalidity determination requires a certain processing time. If the cluster data to be determined is valid data, writing to the compaction destination block occurs. However, if the cluster data to be determined is invalid data, writing to the compaction destination block does not occur.

フリーブロックが多く存在している時は、コンパクションを行う必要がないが、一定量の書き込みがされてフリーブロックが少なくなったときは、コンパクションを行う必要がある。フリーブロックがほとんど無くなってからコンパクションによりフリーブロックを作り出そうとすると、ホスト1からのライトコマンドに対する応答が悪くなる。なぜならば、まず、コンパクションによりフリーブロックを作り出すための処理時間がかかり、その処理時間の経過後にフリーブロックが用意できた時点でホスト1からのデータの書き込みが可能となるからである。   When there are many free blocks, it is not necessary to perform compaction. However, when a certain amount of data is written and the number of free blocks is reduced, compaction is required. If there is almost no free block and an attempt is made to create a free block by compaction, the response to the write command from the host 1 becomes worse. This is because, first, it takes a processing time to create a free block by compaction, and data can be written from the host 1 when the free block is prepared after the processing time elapses.

そこで、本実施形態では、ライトコマンドに対する応答速度を極端に低下させないために、ホスト1からのデータ書き込みとコンパクションによる書き込みを一定の割合(比率)で動作させる手法を採用している。ホスト1からのデータ書き込みが1ブロック(1ページ)に対して、コンパクションによる書き込みをNブロック(Nページ)行う手法を、ギア比が1:Nのコンパクションという。   Therefore, in the present embodiment, a method of operating data writing from the host 1 and writing by compaction at a constant rate (ratio) is employed in order not to extremely reduce the response speed to the write command. A method of performing data writing by compaction for N blocks (N pages) for one block (1 page) of data writing from the host 1 is called compaction with a gear ratio of 1: N.

ホストデータの書き込み先ブロックをHostDstと呼び、コンパクション先ブロックをCmpDstと呼び、コンパクション元ブロックをCmpSrcと呼ぶ。HostDstに1ページ書くことに対して、CmpDstにNページ書くことにより、1:Nコンパクションが行われる。HostDstに1ブロック分のデータを書く期間をコンパクションタームと呼ぶ。本実施形態では、ページサイズとクラスタサイズを同じとしているので、HostDstに1クラスタデータ書くことに対して、CmpDstにNクラスタデータを書くことにより、1:Nコンパクションが行われる。   The host data write destination block is called HostDst, the compaction destination block is called CmpDst, and the compaction source block is called CmpSrc. In contrast to writing one page in HostDst, 1: N compaction is performed by writing N pages in CmpDst. A period for writing data for one block in HostDst is called a compaction term. In this embodiment, since the page size and the cluster size are the same, 1: N compaction is performed by writing N cluster data in CmpDst as opposed to writing 1 cluster data in HostDst.

フリーブロックがブロック全体のうち、一定量以上の十分な数が存在するときは、コンパクションを行う必要がなく、HostDstに対する書き込みのみを行う。これを1:0コンパクションという。通常、1:0コンパクションから動作開始して、フリーブロックが少なくなってきてアクティブブロックが増えてきたら、1:1や1:2のコンパクションを行う。フリーブロックが少ない場合などコンパクションを多めにしたいときは、1:NのNを大きくする。ところが、Nが大きな1:Nコンパクションでは、ホストデータのブロックHostDstの全ページへの書き込みが終了しても、コンパクションで次のフリーブロックを確保ができない場合、つまりコンパクション処理でフリーブロックを生成するのが間に合わず、ホストデータの書き込み先ブロックHostDstの確保が待たされる場合、結果的にギア比は0:1となり、ホスト1からの書き込みを一時的に保留され、コンパクション処理のみを行うことになる。このように、ギア比を変えることにより、ホスト1からのデータ書き込みと、コンパクションによる書き込みのバランスを取りながら動作させることが可能となる。例えば、ギア比は、フリーブロックとアクティブブロックの割合から決定する。   When there is a sufficient number of free blocks over the entire block, there is no need to perform compaction, and only writing to HostDst is performed. This is called 1: 0 compaction. Normally, the operation starts from 1: 0 compaction, and when free blocks decrease and active blocks increase, 1: 1 or 1: 2 compaction is performed. To increase the compaction, such as when there are few free blocks, increase N of 1: N. However, in 1: N compaction with a large N, even if the writing of the host data block HostDst to all pages is completed, the next free block cannot be secured by compaction, that is, a free block is generated by compaction processing. However, if the host data write destination block HostDst is not secured in time, the gear ratio becomes 0: 1 as a result, writing from the host 1 is temporarily suspended, and only compaction processing is performed. In this way, by changing the gear ratio, it is possible to operate while balancing the data writing from the host 1 and the writing by compaction. For example, the gear ratio is determined from the ratio between the free block and the active block.

ギア比の制御は、ブロック供給元であるブロック管理部31が行う。ブロック要求元であるデータアクセス部32は、ブロック管理部31から与えられたギア比に応じて、ホスト1からのデータの書き込み動作(ライト制御部34)とコンパクション動作(整理部35)を行うだけで、整理部35のコンパクション結果(どの程度フリーブロックが作成できるかなど)に対しての責任は持たない。これにより、データアクセス部32は、単純な動作処理のみを行なうハードウェアあるいはソフトウェアにて実現できる。   The gear ratio is controlled by the block management unit 31 that is a block supply source. The data access unit 32 that is a block request source only performs a data write operation (write control unit 34) and a compaction operation (organization unit 35) from the host 1 in accordance with the gear ratio given from the block management unit 31. Therefore, there is no responsibility for the compaction result of the organizing unit 35 (how much free blocks can be created, etc.). As a result, the data access unit 32 can be realized by hardware or software that performs only simple operation processing.

図7は、ギア比が1:3のコンパクションを示している。図7では、4つのアクティブブロックであるコンパクション元ブロックCmpSrc内の有効クラスタデータを3つのフリーブロックであるコンパクション先ブロックCmpDstに移動することで、1つ分のフリーブロックを作成するコンパクションを行っている。この場合は、1:3のコンパクションであるので、ホスト1からのデータを1つのブロックHostDstに書き込むのに対し、コンパクションによる書き込みを3つのブロックCmpDstに行っている。   FIG. 7 shows a compaction with a gear ratio of 1: 3. In FIG. 7, the effective cluster data in the compaction source block CmpSrc that is the four active blocks is moved to the compaction destination block CmpDst that is the three free blocks, and compaction for creating one free block is performed. . In this case, since compaction is 1: 3, data from the host 1 is written in one block HostDst, whereas writing by compaction is performed in three blocks CmpDst.

図8は、比較例による1:Nのコンパクション手順を示すものである。まず、ホスト1からのライトデータが1ページ分だけブロックHostDstにライトされる(ステップS100)。つぎに、コンパクション元ブロックCmpSrc内のデータが1ページ分読み出され(ステップS110)、前述のデータの有効無効判定が行われる(ステップS120)。データが無効であった場合は(ステップS130:No)、コンパクション元ブロックCmpSrc内の次のページのデータを読み出され(ステップS110)、その後同様の有効無効判定が行われる(ステップS120)。このようにして、有効なデータを発見できるまで有効無効判定が行われる。有効なデータが発見されると(ステップS130:Yes)、この有効データがコンパクション先ブロックCmpDstに書き込まれる(ステップS140)。   FIG. 8 shows a 1: N compaction procedure according to a comparative example. First, write data from the host 1 is written to the block HostDst for one page (step S100). Next, one page of data in the compaction source block CmpSrc is read (step S110), and the above-described data validity / invalidity determination is performed (step S120). If the data is invalid (step S130: No), the data of the next page in the compaction source block CmpSrc is read (step S110), and then the same valid / invalid determination is performed (step S120). In this way, valid / invalid determination is performed until valid data can be found. When valid data is found (step S130: Yes), this valid data is written into the compaction destination block CmpDst (step S140).

つぎに、コンパクション先ブロックCmpDstへの書き込みがN回繰り返されたか否かが判定され(ステップS150)、コンパクション先ブロックCmpDstへの書き込みがN回未満の場合は、手順がステップS110に移行される。このようにして、コンパクション先ブロックCmpDstへの書き込みがN回終了するまでは、データの有効無効判定と、コンパクション先ブロックCmpDstへのデータ書込みが繰り返される。そして、コンパクション先ブロックCmpDstへのN回の書き込みが終了すると、今回のホストデータに関する1:Nのコンパクション手順が終了したか否かが判定され(ステップS160)、終了していない場合は、手順がステップS100に移行されて、今度は、ホスト1からのライトデータが次の1ページ分だけブロックHostDstにライトされる。このような処理が繰り返される。ステップS160において、今回のホストデータに関する1:Nのコンパクション手順が終了したと判定されると、今回のホストデータに関する1:Nのコンパクション手順が終了される。   Next, it is determined whether or not the writing to the compaction destination block CmpDst has been repeated N times (step S150). If the writing to the compaction destination block CmpDst is less than N times, the procedure proceeds to step S110. In this manner, data validity / invalidity determination and data writing to the compaction destination block CmpDst are repeated until the writing to the compaction destination block CmpDst is completed N times. When N times of writing to the compaction destination block CmpDst are finished, it is determined whether or not the 1: N compaction procedure for the current host data is finished (step S160). The process proceeds to step S100, and this time, the write data from the host 1 is written to the block HostDst for the next one page. Such a process is repeated. If it is determined in step S160 that the 1: N compaction procedure for the current host data has been completed, the 1: N compaction procedure for the current host data is terminated.

このようにして、基本的には、ブロックHostDstへの1ページ書き込みと、コンパクション先ブロックCmpDstへのNページの有効データの書き込みとが、交互に行われる。   In this way, basically, one page writing to the block HostDst and N pages of valid data writing to the compaction destination block CmpDst are alternately performed.

ところが、コンパクション処理は、前述したコンパクション先ブロックCmpDstの状態(フリーブロック数など)だけでなく、コンパクション元ブロックCmpSrcの状態によっても書き込みの進行状態が変わってくる。図8に示した比較例では、コンパクション元ブロックCmpSrcが有効データで詰まっているときは、ステップS120、S130の有効無効判定において有効判定が頻繁に発生し、コンパクション先ブロックCmpDstへの書き込み(ステップS140)は、頻繁に行われる。しかしながら、比較例では、図9に示すように、コンパクション元ブロックCmpSrcに無効データで詰まってて有効データが最後のページ付近にしか存在しない場合は、有効データを発見できるまで、ステップS110〜S130の有効無効判定処理がループし続ける。   However, in the compaction process, not only the state of the compaction destination block CmpDst (the number of free blocks and the like) described above, but also the progress of writing changes depending on the state of the compaction source block CmpSrc. In the comparative example shown in FIG. 8, when the compaction source block CmpSrc is clogged with valid data, valid judgments frequently occur in the valid / invalid judgments of steps S120 and S130, and writing to the compaction destination block CmpDst (step S140). ) Is done frequently. However, in the comparative example, as shown in FIG. 9, when the compaction source block CmpSrc is clogged with invalid data and valid data exists only in the vicinity of the last page, steps S110 to S130 are performed until valid data can be found. The validity / invalidity determination process continues to loop.

コンパクション処理は、有効なデータを整理して、有効なデータをフリーブロックに詰めて無効なデータ領域を作ることにより、フリーブロックを確保しようというものである。そのため、有効なデータで全て詰まったブロックからデータの引っ越しをしても領域確保の効果がない。むしろ、前述したように、コンパクション元ブロックCmpSrcは、無効なデータ領域が多いほうが、フリーブロックを多く確保するためには、効率がよい。   The compaction process is to secure free blocks by organizing valid data and filling invalid data into free blocks to create invalid data areas. For this reason, even if data is moved from a block that is completely filled with valid data, there is no effect of securing the area. Rather, as described above, the compaction source block CmpSrc is more efficient in securing more free blocks when there are more invalid data areas.

比較例では、ステップS140におけるコンパクション先ブロックCmpDstへの書き込みが進まないと、ホストデータのブロックHostDstへの書き込みも進まないため、ホスト1から見るとライトコマンドに対する応答が遅くなるように見える。このように、コンパクション元ブロックCmpSrcに無効なデータが多くあるほうがフリーブロックの作成のためには効率的であるのにもかかわらず、比較例の手法では、コンパクション元ブロックCmpSrcに無効なデータが多く存在した場合、ライトコマンドの応答速度が低下するという問題がある。   In the comparative example, if the writing to the compaction destination block CmpDst in step S140 does not proceed, the writing of the host data to the block HostDst also does not proceed, so that it appears that the response to the write command is delayed when viewed from the host 1. In this way, despite the fact that a lot of invalid data in the compaction source block CmpSrc is more efficient for creating a free block, the comparison example method has a lot of invalid data in the compaction source block CmpSrc. If it exists, there is a problem that the response speed of the write command decreases.

そこで、本実施形態では、有効無効判定処理において、無効であるとする判定が所定回数K以上連続した場合は、有効無効判定処理のループ(ステップS110〜S130)を脱出させることで、ライトコマンドの応答速度が極端に低下しないようにする。   Therefore, in the present embodiment, in the validity / invalidity determination process, when the determination that it is invalid continues for a predetermined number K or more, the loop of the validity / invalidity determination process (steps S110 to S130) is escaped, thereby Make sure that the response speed does not drop drastically.

図10は、本実施形態の1:Nのコンパクション手順を示すものである。図10は、図8のフローチャートにステップS131,S132の手順を追加している。ブロック管理部31は、例えば現在のフリーブロックとアクティブブロックの個数割合からギア比Nを決め、このギア比Nをデータアクセス部32に与える。また、ブロック管理部31は、後述する無効判定の上限回数Kを決め、この上限回数Kをデータアクセス部32に与える。データアクセス部32は、与えられたギア比Nを管理下のライト制御部34および整理部35に通知する。また、データアクセス部32は、与えられた上限回数Kを整理部35に通知する。ライト制御部34および整理部35は、与えられたギア比Nに従って、NAND20への書き込み権限を相互に交替しながら、前述の1:Nコンパクションを行う。   FIG. 10 shows the 1: N compaction procedure of this embodiment. FIG. 10 adds steps S131 and S132 to the flowchart of FIG. The block management unit 31 determines the gear ratio N from the current ratio of the number of free blocks and active blocks, for example, and gives this gear ratio N to the data access unit 32. Further, the block management unit 31 determines an upper limit number K of invalidity determination described later, and gives this upper limit number K to the data access unit 32. The data access unit 32 notifies the managed gear control unit 34 and the organizing unit 35 of the given gear ratio N. Further, the data access unit 32 notifies the organizing unit 35 of the given upper limit number K. The write control unit 34 and the organizing unit 35 perform the above-described 1: N compaction while alternating the authority to write to the NAND 20 according to the given gear ratio N.

まず、ライト制御部34は、ホスト1からのライトデータを1ページ分(=1クラスタ分)だけブロックHostDstにライトする(ステップS100)。この1ページ分の書き込み処理が終了すると、ライト制御部34は、NAND10への書き込み権限を整理部35に渡す。   First, the write control unit 34 writes the write data from the host 1 to the block HostDst for one page (= 1 cluster) (step S100). When the writing process for one page is completed, the write control unit 34 passes the write authority to the NAND 10 to the organizing unit 35.

整理部35は、整理対象ブロックの一つであるコンパクション元ブロックCmpSrc内のデータを1ページ分読み出し(ステップS110)、この1ページ分のデータに対し前述の有効無効判定を実行する(ステップS120)。整理部35はこのデータが有効データであった場合(ステップS130:Yes)、この有効データをコンパクション先ブロックCmpDstに書き込む(ステップS140)。しかし、整理部35は、このデータを無効と判定した場合(ステップS130:No)、ステップS130での無効判定が所定回数K以上繰り返されたか否かを判定する(ステップS131)。このステップS131の判定がNoである場合は、整理部35は、手順をステップS110に移行させて、コンパクション元ブロックCmpSrc内の次のページのデータを読み出す。この後、整理部35は、同様の有効無効判定が行う(ステップS120)。このように、整理部35は、ステップS130、S131、S110、S120のループを最大K−1回繰り返すことで、有効なデータを発見できるまで有効無効判定が実行する。有効なデータが発見されると、整理部35によってこの有効な1ページ分のデータがコンパクション先ブロックCmpDstに書き込まれる(ステップS140)。   The organizing unit 35 reads one page of data in the compaction source block CmpSrc that is one of the organizing target blocks (step S110), and executes the above-described validity / invalidity determination on the data for one page (step S120). . If this data is valid data (step S130: Yes), the organizing unit 35 writes this valid data in the compaction destination block CmpDst (step S140). However, when it is determined that the data is invalid (step S130: No), the organizing unit 35 determines whether the invalidity determination in step S130 has been repeated a predetermined number of times K or more (step S131). If the determination in step S131 is No, the organizing unit 35 moves the procedure to step S110 and reads the data of the next page in the compaction source block CmpSrc. Thereafter, the organizing unit 35 performs the same validity / invalidity determination (step S120). As described above, the organizing unit 35 repeats the loop of steps S130, S131, S110, and S120 a maximum of K-1 times, thereby executing the validity / invalidity determination until valid data can be found. When valid data is found, the organizing unit 35 writes this valid data for one page into the compaction destination block CmpDst (step S140).

しかし、ステップS130、S131、S110,S120のループを繰り返している際に、ステップS131において、ステップS130での無効判定が所定回数K以上繰り返されたと判定されると、整理部35は、図11に示すように、無効なダミーデータをコンパクション先ブロックCmpDstに1ページ分、書き込む(ステップS132)。無効なダミーデータとは、当該データが無効であることを識別させる無効フラグを含むものであれば、任意のデータでよい。なお、ステップS131の判定は、Kページ分連続して無効判定結果が出た場合、あるいは、コンパクション先ブロックCmpDstへの有効データの書き込みを1ページでも行うとクリアされるカウンタによって実現可能である。   However, when the loop of steps S130, S131, S110, and S120 is being repeated, if it is determined in step S131 that the invalidity determination in step S130 has been repeated a predetermined number of times K or more, the organizing unit 35 is shown in FIG. As shown, one page of invalid dummy data is written in the compaction destination block CmpDst (step S132). The invalid dummy data may be any data as long as it includes an invalid flag for identifying that the data is invalid. The determination in step S131 can be realized by a counter that is cleared when invalid determination results are output for K pages continuously, or when valid data is written to the compaction destination block CmpDst even for one page.

つぎに、整理部35は、コンパクション先ブロックCmpDstへの1ページ書き込みがN回繰り返されたか否かを判定する(ステップS150)。コンパクション先ブロックCmpDstへの書き込み回数を計数するとき、ステップS132での無効ダミーデータの書き込みも1回として計数される。コンパクション先ブロックCmpDstへの書き込みがN回未満の場合は、手順がステップS110に移行される。このようにして、コンパクション先ブロックCmpDstへの書き込みがN回終了するまでは、データの有効無効判定と、コンパクション先ブロックCmpDstへの有効データまたは無効ダミーデータの書込みが繰り返される。   Next, the organizing unit 35 determines whether or not one page writing to the compaction destination block CmpDst has been repeated N times (step S150). When counting the number of times of writing to the compaction destination block CmpDst, writing of invalid dummy data in step S132 is also counted as one time. If writing to the compaction destination block CmpDst is less than N times, the procedure proceeds to step S110. In this way, until the writing to the compaction destination block CmpDst is completed N times, the data validity / invalidity determination and the writing of valid data or invalid dummy data to the compaction destination block CmpDst are repeated.

そして、コンパクション先ブロックCmpDstへのN回の書き込みが終了すると、整理部35は、今回のホストデータに関する1:Nのコンパクション手順が終了したか否かを判定し(ステップS160)、終了していない場合は、整理部35は、NAND10への書き込みの権限をライト制御部34に渡す。この結果、手順がステップS100に移行されて、今度は、ライト制御部34によって、ホスト1からのライトデータが次の1ページ分だけブロックHostDstにライトされる。このような処理が繰り返される。ステップS160において、今回のホストデータに関する1:Nのコンパクション手順が終了したと判定されると、今回のホストデータに関する1:Nのコンパクション手順が終了される。   When N times of writing to the compaction destination block CmpDst are completed, the organizing unit 35 determines whether or not the 1: N compaction procedure for the current host data has been completed (step S160), and has not been completed. In this case, the organizing unit 35 passes the authority to write to the NAND 10 to the write control unit 34. As a result, the procedure proceeds to step S100, and the write control unit 34 writes the write data from the host 1 to the block HostDst for the next one page. Such a process is repeated. If it is determined in step S160 that the 1: N compaction procedure for the current host data has been completed, the 1: N compaction procedure for the current host data is terminated.

このようにして、基本的には、ブロックHostDstへの1ページ書き込みと、コンパクション先ブロックCmpDstへのNページの有効データまたは無効ダミーデータの書き込みとが、ギア比に従って交互に行われる。   In this way, basically, one page write to the block HostDst and N page valid data or invalid dummy data write to the compaction destination block CmpDst are alternately performed according to the gear ratio.

本実施形態では、図11に示したように、Kページ分連続して無効判定結果が出た場合、無効なダミーデータをコンパクション先ブロックCmpDstに書き込むようにしているので、コンパクションタームのギア比が実質的には崩れることになるが、ホストデータ書込みのためのブロックHostDstとコンパクション先ブロックへの書き込みの進捗比率を守ることが可能となる。   In the present embodiment, as shown in FIG. 11, when invalid determination results are output continuously for K pages, invalid dummy data is written to the compaction destination block CmpDst, so that the gear ratio of the compaction term is Although it will be substantially collapsed, it becomes possible to keep the progress ratio of writing to the block HostDst for writing host data and the compaction destination block.

なお、上記実施形態では、ライト制御部34がホスト1からのデータ書込みを行い、整理部35がコンパクション処理全般を行うようにしたが、整理部35がコンパクション元ブロックからのデータ読み出しと、読み出したデータの無効判定処理を行い、ライト制御部34がホスト1からのデータ書込みと、コンパクション先ブロックへのデータ書込みを行うように、機能分担させたほうが望ましい。このような機能分担を行った場合、本実施形態では、次のような利点がある。本実施形態では、Kページ分連続して無効判定結果が出た場合、コンパクション先ブロックCmpDstへの書き込むをスキップせずに、無効なダミーデータをコンパクション先ブロックCmpDstに書き込むという機能を、比較例に対し追加しているが、この機能追加は、整理部35に対する機能追加のみで済み、ライト制御部34への機能変更を行わずに済む。すなわち、コンパクション先ブロックCmpDstへの書き込みをスキップさせる場合は、ライト制御部34への機能変更が必要となるが、無効なダミーデータをコンパクション先ブロックCmpDstに書き込むようにする場合は、整理部35から無効なダミーデータをライト制御部34に渡すようにすれば、ライト制御部34への機能変更は不要となり、ライト制御部34は、データの中身を知ることなく書く処理に専念することができる。   In the above embodiment, the write control unit 34 writes data from the host 1 and the organizing unit 35 performs the entire compaction process. However, the organizing unit 35 reads and reads data from the compaction source block. It is desirable that the data invalidity determination process is performed and the function is shared so that the write control unit 34 writes data from the host 1 and writes data to the compaction destination block. When such function sharing is performed, the present embodiment has the following advantages. In this embodiment, when an invalidity determination result is output continuously for K pages, a function of writing invalid dummy data to the compaction destination block CmpDst without skipping writing to the compaction destination block CmpDst is used as a comparative example. However, the addition of the function is only the addition of the function to the organizing unit 35, and the function change to the write control unit 34 is not required. That is, when writing to the compaction destination block CmpDst is skipped, it is necessary to change the function to the write control unit 34, but when invalid dummy data is to be written to the compaction destination block CmpDst, from the organizing unit 35 If invalid dummy data is passed to the write control unit 34, the function change to the write control unit 34 becomes unnecessary, and the write control unit 34 can concentrate on the writing process without knowing the contents of the data.

また、Kページ分連続して無効判定結果が出た場合、無効なダミーデータを書き込むようにしているので、そのデータを再度コンパクションするために読み出した時には、有効無効判定の処理時間が少なくなる。   In addition, when invalid determination results are output for K pages continuously, invalid dummy data is written. Therefore, when the data is read for compaction again, the processing time for valid / invalid determination is reduced.

このように本実施形態では、コンパクション元ブロックでのデータの有効無効判定処理において、Kページ分連続して無効判定結果が出た場合、今回の有効無効判定処理を終了し、無効なダミーデータをコンパクション先ブロックCmpDstに書き込むようにしているので、ギア比を守りつつライトコマンドへの応答速度を極端に低下させなくすることが可能となる。別言すれば、本実施形態では、上限値Kを設定することで、ライトコマンドへの応答遅延の上限を設定することが可能となり、長時間が経過してもフリーブロックを作成することができないというような状況に陥った場合に、コンパクションが延々と動作し続けることを回避することができる。   As described above, in this embodiment, in the data validity / invalidity determination process in the compaction source block, when invalidity determination results are continuously output for K pages, the current validity / invalidity determination process is terminated, and invalid dummy data is stored. Since writing is performed in the compaction destination block CmpDst, it is possible to prevent the response speed to the write command from being extremely lowered while maintaining the gear ratio. In other words, in this embodiment, by setting the upper limit value K, it is possible to set the upper limit of the response delay to the write command, and a free block cannot be created even if a long time elapses. In such a situation, the compaction can be prevented from continuing to operate endlessly.

なお、上記実施形態では、Kページ分連続して無効判定結果が出た場合、コンパクション先ブロックCmpDstへ無効なダミーデータを書き込むようにしているが、コンパクション先ブロックCmpDstへの書き込みを単純にスキップするようにしてもよい。   In the above embodiment, when invalid determination results are continuously output for K pages, invalid dummy data is written to the compaction destination block CmpDst. However, writing to the compaction destination block CmpDst is simply skipped. You may do it.

また、多値記録(MLC:Multi −Level Cell)モードと、二値記録(SLC:Single−Level Cell)モードでの記録が可能なSSDにおいて、SLCモードではMLCモードより高速書き込みが可能であるので、ホストからのデータの書き込みはSLCモードで行い、コンパクション先ブロックへの書き込みはMLCモードで行うようにしてもよい。この方式では、最初にSLCモードのブロックをコンパクション元のブロックとして、コンパクション先のブロックにMLCモードでの書き込みを行うコンパクションを行い、フリーブロックが十分に確保できなかった場合に、次に、MLCモードのブロックをコンパクション元のブロックとして、コンパクション先のブロックにMLCモードでの書き込みを行うコンパクションを行なう。   In addition, in an SSD capable of recording in a multi-level recording (MLC) mode and a single-level cell (SLC) mode, the SLC mode can write at a higher speed than the MLC mode. Data writing from the host may be performed in the SLC mode, and writing to the compaction destination block may be performed in the MLC mode. In this method, when the SLC mode block is first used as a compaction source block and the compaction destination block is written in the MLC mode, the free block cannot be sufficiently secured. The compaction block is used as a compaction source block, and compaction is performed for writing in the MLC mode to the compaction destination block.

また、上記実施形態では、逆引き情報GIは、データの論理アドレス(LBA)しか持たないようにしたが、逆引き情報GIに、データの有効無効を示す有効フラグを持たせるようにしてもよい。また、上記実施形態では、逆引き情報GIをデータに付加するようにしたが、逆引き情報を管理するテーブルを用意し、この逆引き管理テーブルを用いて逆引き検索を行うようにしてもよい。また、クラスタサイズをページサイズより小さく定義した場合、ページ内の所定のクラスタ内に、ページ内のクラスタデータの逆引き情報をまとめて記憶させるようにしてもよい。   In the above embodiment, the reverse lookup information GI has only the logical address (LBA) of the data. However, the reverse lookup information GI may have a validity flag indicating the validity / invalidity of the data. . In the above embodiment, the reverse lookup information GI is added to the data. However, a table for managing the reverse lookup information may be prepared, and the reverse lookup may be performed using the reverse lookup management table. . Further, when the cluster size is defined to be smaller than the page size, the reverse lookup information of the cluster data in the page may be collectively stored in a predetermined cluster in the page.

また、図10に示すフローチャートでは、簡単化のためにページ単位のデータの書き込み(S100、S132,S140)、読み出し(S110)を行っているが、書き込み、読み出しの単位は、ページに限らず、クラスタ単位(ページサイズ≠クラスタサイズ)にしてもよく、さらには他の単位を採用しても良い。   Further, in the flowchart shown in FIG. 10, data is written in units of pages (S100, S132, S140) and read (S110) for simplification, but the unit of writing and reading is not limited to a page. Cluster units (page size ≠ cluster size) may be used, and other units may be employed.

(第2の実施形態)
第2の実施形態においては、ギア比1:Nのコンパクションを行う際、コンパクションの処理時間を計測し、コンパクション処理時間が閾値Ta以上になった場合、コンパクション処理を強制的に中断させ、ホスト1からのデータ書き込みを実行させる。このような制御によっても、ライトコマンドへの応答速度を極端に低下させなくすることが可能となる。
(Second Embodiment)
In the second embodiment, when performing compaction with a gear ratio of 1: N, the compaction processing time is measured, and when the compaction processing time exceeds the threshold Ta, the compaction processing is forcibly interrupted, and the host 1 Write data from. Such control also makes it possible to prevent the response speed to the write command from being extremely reduced.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる。   Although several embodiments of the present invention have been described, these embodiments are presented by way of example and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the scope of the invention. These embodiments and modifications thereof are included in the scope and gist of the invention, and are included in the invention described in the claims and the equivalents thereof.

1 ホスト装置、2 ホストインタフェース、10 NAND、20 RAM、21 アドレス変換テーブル、22 ブロック管理テーブル、25 ライトバッファ、30 コントローラ、31 ブロック管理部、32 データアクセス部、33 リード制御部、34 ライト制御部、35 整理部。   1 host device, 2 host interface, 10 NAND, 20 RAM, 21 address conversion table, 22 block management table, 25 write buffer, 30 controller, 31 block management unit, 32 data access unit, 33 read control unit, 34 write control unit , 35 Organizing Department.

Claims (4)

ブロック単位で消去が行われる不揮発性半導体メモリと、
ホスト装置からのデータを前記不揮発性半導体メモリのブロックに書き込むライト制御部と、前記不揮発性半導体メモリの整理対象ブロックに記憶された各データが有効か無効かを判定し、有効と判定されたデータを順次選択して新たなブロックへ書き直すデータ整理を行う整理部とを有し、前記ライト制御部による書き込み処理と前記整理部による新たなブロックへ書き直しを所定の比率をもって交互に実行するコントローラと、
を備え、
前記整理部は、前記所定の比率に対応する前記データ整理の最中に、無効である有効無効判定の結果が所定の設定回数連続した場合、今回の有効無効判定処理を終了させる
ことを特徴とする半導体記憶装置。
A nonvolatile semiconductor memory that is erased in units of blocks;
A write control unit that writes data from the host device to the block of the nonvolatile semiconductor memory, and determines whether each data stored in the organization target block of the nonvolatile semiconductor memory is valid or invalid. A controller that sequentially selects and rewrites data into a new block, and a controller that alternately executes write processing by the write control unit and rewrite to a new block by the organizer at a predetermined ratio;
With
The organizing unit terminates the current valid / invalid determination process if the invalid / valid determination result continues for a predetermined number of times during the data reduction corresponding to the predetermined ratio. A semiconductor memory device.
前記整理部は、無効である有効無効判定の結果が所定の設定回数連続した場合、無効なダミーデータを前記新たなブロックに書き込むことを特徴とする請求項1に記載の半導体記憶装置。   2. The semiconductor memory device according to claim 1, wherein the organizing unit writes invalid dummy data to the new block when the invalid / invalid determination result is invalid for a predetermined set number of times. ホスト装置から指定された論理アドレスを前記不揮発性半導体メモリでの記憶位置に対応付ける正引き情報を管理するためアドレス変換テーブルを更に備え、
ライト制御部は、データの論理アドレスを含む逆引き情報が付加されたデータを前記不揮発性半導体メモリのブロックに書き込み、
前記整理部は、各データに付加された逆引き情報と前記アドレス変換テーブルの正引き情報とを照合することにより、各データが有効か無効かを判定する
ことを特徴とする請求項1または2に記載の半導体記憶装置。
An address conversion table for managing forward lookup information for associating a logical address designated by a host device with a storage position in the nonvolatile semiconductor memory;
The write control unit writes the data with reverse lookup information including the logical address of the data added to the block of the nonvolatile semiconductor memory,
3. The organizing unit determines whether each data is valid or invalid by comparing the reverse lookup information added to each data with the forward lookup information of the address conversion table. The semiconductor memory device described in 1.
ブロック単位で消去が行われる不揮発性半導体メモリと、
ホスト装置からのデータを前記不揮発性半導体メモリのブロックに書き込むライト制御部と、前記不揮発性半導体メモリの整理対象ブロックに記憶された各データが有効か無効かを判定し、有効と判定されたデータを順次選択して新たなブロックへ書き直すデータ整理を行う整理部とを有し、前記ライト制御部による書き込み処理と前記整理部による新たなブロックへ書き直しを所定の比率をもって交互に実行するコントローラと、
を備え、
前記整理部は、前記データ整理が所定時間以上連続した場合、データ整理を中断して前記ライト制御部による書き込み処理を実行させる
ことを特徴とする半導体記憶装置。
A nonvolatile semiconductor memory that is erased in units of blocks;
A write control unit that writes data from the host device to the block of the nonvolatile semiconductor memory, and determines whether each data stored in the organization target block of the nonvolatile semiconductor memory is valid or invalid. A controller that sequentially selects and rewrites data into a new block, and a controller that alternately executes write processing by the write control unit and rewrite to a new block by the organizer at a predetermined ratio;
With
The organizing unit interrupts data organizing and executes write processing by the write control unit when the data organizing is continued for a predetermined time or longer.
JP2012068868A 2012-02-23 2012-03-26 Semiconductor memory Pending JP2013200726A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2012068868A JP2013200726A (en) 2012-03-26 2012-03-26 Semiconductor memory
US13/599,087 US9251055B2 (en) 2012-02-23 2012-08-30 Memory system and control method of memory system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012068868A JP2013200726A (en) 2012-03-26 2012-03-26 Semiconductor memory

Publications (1)

Publication Number Publication Date
JP2013200726A true JP2013200726A (en) 2013-10-03

Family

ID=49520917

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012068868A Pending JP2013200726A (en) 2012-02-23 2012-03-26 Semiconductor memory

Country Status (1)

Country Link
JP (1) JP2013200726A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017162067A (en) * 2016-03-08 2017-09-14 東芝メモリ株式会社 Storage system, information processing system, and control method
US11526436B2 (en) 2019-10-17 2022-12-13 Kioxia Corporation Memory system and garbage collection control method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017162067A (en) * 2016-03-08 2017-09-14 東芝メモリ株式会社 Storage system, information processing system, and control method
US11526436B2 (en) 2019-10-17 2022-12-13 Kioxia Corporation Memory system and garbage collection control method
US11853204B2 (en) 2019-10-17 2023-12-26 Kioxia Corporation Memory system and garbage collection control method

Similar Documents

Publication Publication Date Title
US10754769B2 (en) Memory system having persistent garbage collection
US9251055B2 (en) Memory system and control method of memory system
US10761780B2 (en) Memory system
JP6016137B2 (en) Solid state drive and method of operation thereof
JP4844639B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
US8108589B2 (en) Wear leveling method and controller using the same
US7882300B2 (en) Apparatus and method for managing nonvolatile memory
US9367451B2 (en) Storage device management device and method for managing storage device
US11573717B2 (en) Storage device having a controller configured to select modes as write modes based on received instructions, storage system, and control method
JP4666080B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
US9201784B2 (en) Semiconductor storage device and method for controlling nonvolatile semiconductor memory
US20170160953A1 (en) Data storage device that stabilizes write latency
JP4666081B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP5687649B2 (en) Method for controlling semiconductor memory device
JP2018160189A (en) Memory system
US9304906B2 (en) Memory system, controller and control method of memory
US20190317694A1 (en) Memory management method, memory storage device and memory control circuit unit
JP4737223B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
TWI805445B (en) Method for performing access control of memory device with aid of additional physical address information, memory device, and controller of memory device
JP2013200726A (en) Semiconductor memory
JP2012068765A (en) Memory controller, flash memory system with memory controller, and control method of flash memory
JP4434171B2 (en) Memory controller and flash memory system
JP2013196155A (en) Memory system
JP4952741B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2009301491A (en) Memory controller, flash memory system equipped with memory controller, and control method for flash memory