JP2013061791A - Storage controller, storage device, and write caching method - Google Patents
Storage controller, storage device, and write caching method Download PDFInfo
- Publication number
- JP2013061791A JP2013061791A JP2011199700A JP2011199700A JP2013061791A JP 2013061791 A JP2013061791 A JP 2013061791A JP 2011199700 A JP2011199700 A JP 2011199700A JP 2011199700 A JP2011199700 A JP 2011199700A JP 2013061791 A JP2013061791 A JP 2013061791A
- Authority
- JP
- Japan
- Prior art keywords
- write
- data
- time
- medium
- size
- 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.)
- Withdrawn
Links
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
本発明の実施形態は、ライトデータをデータバッファに格納した後に、当該データバッファに格納されたデータをメディアにライトする、ストレージコントローラ、ストレージ装置及びライトキャッシング方法に関する。 Embodiments described herein relate generally to a storage controller, a storage apparatus, and a write caching method that write data stored in a data buffer and then write the data stored in the data buffer to a medium.
一般にストレージ装置は、メモリ或いはディスクのようなメディアと、当該メディアへのアクセスを制御するストレージコントローラとを備えている。ストレージコントローラは、メディアへ効率的にデータを書き込むために、ホスト(ホスト装置)から転送されたデータを一時的に格納するデータバッファを備えているのが一般的である。 Generally, a storage apparatus includes a medium such as a memory or a disk, and a storage controller that controls access to the medium. The storage controller generally includes a data buffer for temporarily storing data transferred from the host (host device) in order to efficiently write data to the medium.
ストレージコントローラは、ホストから転送されたライトデータをデータバッファに格納する。その後、ストレージコントローラはデータバッファに格納されたデータをメディアにライトする。 The storage controller stores the write data transferred from the host in the data buffer. Thereafter, the storage controller writes the data stored in the data buffer to the medium.
ここで、ストレージコントローラがデータバッファにデータをライトしている最中に、ストレージ装置のための電源(以下、主電源と称する)が遮断されたものとする。この場合、データバッファに格納されていて且つメディアに未書き込みのデータ(以下、データバッファ内の未書き込みデータと称する)が失われる。 Here, it is assumed that the power supply for the storage apparatus (hereinafter referred to as main power supply) is shut off while the storage controller is writing data to the data buffer. In this case, data stored in the data buffer and not written to the medium (hereinafter referred to as unwritten data in the data buffer) is lost.
そこで、主電源の遮断時にデータバッファ内の未書き込みデータが喪失するのを防止するため、ストレージ装置は、キャパシタのようなバックアップ電源を備えている。バックアップ電源は、主電源から供給される電力によって充電される。 Therefore, in order to prevent the unwritten data in the data buffer from being lost when the main power supply is shut off, the storage apparatus includes a backup power supply such as a capacitor. The backup power source is charged with power supplied from the main power source.
メディアコントローラはデータバッファ内の未書き込みデータをメディアにライトする際に、当該未書き込みデータを全てメディアにライトするのに必要な時間(以下、総メディアライト時間と称する)が所定の時間を超えているかを判定する。この所定の時間は、主電源が遮断したとしても、バックアップ電源からの電力の供給によって動作の継続が保証される時間であり、データバッファ内の未書き込みデータを当該データバッファに保持可能な時間である。 When the media controller writes unwritten data in the data buffer to the media, the time required to write all the unwritten data to the media (hereinafter referred to as total media write time) exceeds a predetermined time. It is determined whether or not. Even if the main power supply is shut off, this predetermined time is a time during which operation is guaranteed by supplying power from the backup power supply, and is a time during which unwritten data in the data buffer can be held in the data buffer. is there.
もし、総メディアライト時間が所定の時間未満であるならば、メディアコントローラは、ライト完了をホストに通知し、しかる後にデータバッファ内の未書き込みデータを全てメディアにライトする。この一連の動作をライトキャッシングと呼ぶ、一方、総メディアライト時間が所定の時間を超えているならば、メディアコントローラは、ライト完了をホストに通知することなくデータバッファ内の未書き込みデータをメディアにライトする。このメディアライト動作が進んで、データバッファに残されている未書き込みデータのサイズが小さくなって、総メディアライト時間を確保できるようになると、メディアコントローラはライトキャッシングを実行する。 If the total media write time is less than the predetermined time, the media controller notifies the host of the completion of writing, and then writes all unwritten data in the data buffer to the media. This series of operations is called write caching. On the other hand, if the total media write time exceeds the predetermined time, the media controller sends unwritten data in the data buffer to the media without notifying the host of the write completion. Write. When this media write operation proceeds and the size of the unwritten data remaining in the data buffer is reduced, and the total media write time can be secured, the media controller executes write caching.
従来技術では、バックアップ電源の電圧が所定電圧を超えていることをもって、前記所定時間を、主電源の遮断時における動作可能時間として保証している。しかし、バックアップ電源の電圧(例えば充電電圧)は、必ずしも動作可能時間に対応しているとは限らない。その要因は、バックアップ電源の疲弊度にある。 In the prior art, the predetermined time is guaranteed as the operable time when the main power supply is shut off, because the voltage of the backup power supply exceeds the predetermined voltage. However, the voltage (for example, charging voltage) of the backup power supply does not necessarily correspond to the operable time. The factor is the degree of exhaustion of the backup power supply.
このため従来技術では、疲弊度の高いバックアップ電源に合わせて前記所定時間が設定される。この場合、主電源が遮断した際にライトキャッシングによってメディアにライトすることが可能なデータのサイズ(以下、ライトキャッシュサイズと称する)は短くなる。つまり、ライトキャッシュサイズは、バックアップ電源が疲弊している状態を基準としたサイズに制限されてしまう。 For this reason, in the prior art, the predetermined time is set in accordance with a backup power source having a high degree of fatigue. In this case, the size of data that can be written to the medium by write caching (hereinafter referred to as the write cache size) is shortened when the main power supply is shut off. That is, the write cache size is limited to a size based on the state where the backup power supply is exhausted.
本発明の目的は、バックアップ電源の疲弊度に適合したライトキャッシュサイズを設定することができるストレージコントローラ、ストレージ装置及びライトキャッシング方法を提供することにある。 An object of the present invention is to provide a storage controller, a storage apparatus, and a write caching method capable of setting a write cache size suitable for the degree of exhaustion of a backup power supply.
実施形態によれば、ストレージコントローラは、データバッファと、放電容量検出手段と、時間算出手段と、判別手段と、メディアコントローラとを具備する。前記データバッファは、ホスト装置から送信される、不揮発性のメディアにデータをライトすることを指示するライトコマンドに応じて、前記ホスト装置から転送されるデータを格納する。前記放電容量検出手段は、主電源から供給される電力によって充電されるバックアップ電源の放電容量を検出する。前記バックアップ電源は、前記主電源の電圧が規定電圧よりも低下した場合に前記主電源をバックアップする。前記時間算出手段は、前記検出された放電容量に基づき、前記バックアップ電源からの電力の供給によってライトキャッシングが可能な第1の時間を算出する。前記時間算出手段は更に、前記データバッファに格納されていて且つ前記メディアに未書き込みのデータのサイズに基づいて、前記未書き込みデータを前記メディアにライトするのに要する第2の時間を算出する。前記判別手段は、前記第1の時間と前記第2の時間とを比較することにより、前記第1の時間内に前記未書き込みデータを前記メディアにライトすることが可能であるかを判別する。ライト可能であるならば、前記判別手段は、前記ホストにライト完了のレスポンスを送信する。前記メディアコントローラは、前記ライト完了のレスポンスが送信された後、前記データバッファに格納されている前記未書き込みデータを前記メディアにライトする。 According to the embodiment, the storage controller includes a data buffer, a discharge capacity detection unit, a time calculation unit, a determination unit, and a media controller. The data buffer stores data transferred from the host device in response to a write command transmitted from the host device and instructing to write data to a nonvolatile medium. The discharge capacity detecting means detects a discharge capacity of a backup power source that is charged by power supplied from a main power source. The backup power supply backs up the main power supply when the voltage of the main power supply drops below a specified voltage. The time calculation means calculates a first time during which write caching can be performed by supplying power from the backup power source based on the detected discharge capacity. The time calculation means further calculates a second time required to write the unwritten data to the medium based on the size of the data stored in the data buffer and not written to the medium. The determination unit determines whether the unwritten data can be written to the medium within the first time by comparing the first time and the second time. If writing is possible, the determination means transmits a write completion response to the host. After the write completion response is transmitted, the media controller writes the unwritten data stored in the data buffer to the media.
以下、実施の形態につき図面を参照して説明する。
図1は一つの実施形態に係る電子機器の典型的な構成を示すブロック図である。図1に示す電子機器は、ストレージ装置10と、当該ストレージ装置10を利用するホスト装置(ホスト)20とから構成される。本実施形態において、電子機器はパーソナルコンピュータである。しかし、電子機器がパーソナルコンピュータである必要はなく、パーソナルコンピュータ以外の電子機器、例えばビデオカメラ、音楽プレーヤー、携帯端末、携帯電話機、或いはプリンタ装置であってもよい。ホスト20はホストインタフェース21を介してストレージ装置10と接続されている。
Hereinafter, embodiments will be described with reference to the drawings.
FIG. 1 is a block diagram showing a typical configuration of an electronic apparatus according to one embodiment. The electronic apparatus shown in FIG. 1 includes a
ストレージ装置10は、メディア100及びストレージコントローラ110から構成される。メディア100は、データを格納するのに用いられる書き換えが可能な不揮発性の記憶媒体である。本実施形態において、メディア100はフラッシュメモリに代表される不揮発性メモリであり、ストレージ装置10はソリッドステートドライブ(SSD)であるものとする。しかし、メディア100が、例えば磁気ディスクであり、ストレージ装置10がハードディスクドライブ(HDD)であっても構わない。
The
ストレージコントローラ110は、ホスト20からの要求に応じてメディア100へのアクセスを制御する。ストレージコントローラ110は、ホストインタフェースコントローラ111と、データバッファ112と、メディアコントローラ113と、キャパシタ114と、バッファコントローラ115とを備えている。ホストインタフェースコントローラ111、データバッファ112、メディアコントローラ113、キャパシタ114、バッファコントローラ115及びメディア100は、内部バス120によって相互接続されている。
The
ホストインタフェースコントローラ111は、ホストインタフェース21を介してホスト20と通信する。データバッファ112は、ホスト20から受け取ったデータ(ライトデータ)を一時的に格納するのに用いられる。データバッファ112はまた、メディア100から読み出されたデータ(リードデータ)を一時的に格納するのにも用いられる。メディアコントローラ113は、バッファコントローラ115内の後述するライト制御部117からの要求に応じてメディア100にアクセスする。
The
キャパシタ114は、ストレージ装置10のための主電源の電圧が規定電圧よりも低下した場合に当該主電源をバックアップして、当該ストレージ装置10内のデータバッファ112及びメディア100を含む要素群に一時的に電源を供給するのに用いられるバックアップ電源である。前記主電源の電圧が規定電圧よりも低下する例として、前記主電源が遮断した場合が挙げられる。以下の説明では、簡略化のために、主電源の遮断を前提とする。キャパシタ114(つまり、バックアップ電源)は、通常状態において前記主電源から供給される電力によって充電される。前記主電源は、例えばAC−DC電源である。
The
キャパシタ114は、例えば電気二重層キャパシタである。しかし、キャパシタ114が、電気二重層キャパシタである必要はない。また、キャパシタ114に代えて、例えばリチウムイオン電池のような二次電池を用いてもよい。つまり、バックアップ電源として、二次電池を用いてもよい。また、キャパシタ114がストレージコントローラ110の外部に設けられていてもよい。
The
バッファコントローラ115は、ホスト20からのメディア100へのアクセスの要求に応じて、データバッファ112を制御する。バッファコントローラ115は、リード制御部116と、ライト制御部117と、ライトキャッシング判別部118と、キャパシタ放電容量検出部119とを備えている。
The buffer controller 115 controls the
リード制御部116は、データバッファ112からのデータのリードを制御する。ライト制御部117は、データバッファ112へのデータのライトを制御する。ライト制御部117は、データバッファ112にライト(格納)されたデータを周知のバッファ管理テーブル(図示せず)により管理する。バッファ管理テーブルは、DRAMのようなメモリに保持される。バッファ管理テーブルは、データバッファ112に格納されたデータの、当該データバッファ112内の位置を示すバッファアドレスと、当該データがライトされるべき例えば論理アドレスとの対応を示す情報を保持する。またバッファ管理テーブルは、データバッファ112に格納されたデータが、メディア100に未書き込みであるかを示す情報も保持する。バッファ管理テーブルは更に、データバッファ112に格納されていて且つメディア100に未書き込みのデータ全体のサイズ(データサイズ)を示す情報も保持する。
The
ライトキャッシング判別部118は時間算出部118aを備えている。時間算出部118aは、キャパシタ114の放電容量(mAh)(より詳細には、キャパシタ114の放電容量及びライトキャッシングに要する単位時間当たりの電力)に基づいてキャパシタ駆動可能時間(第1の時間)TIMEdを算出する。キャパシタ駆動可能時間TIMEdは、主電源が遮断された際に、キャパシタ114からの電力の供給によってライトキャッシングが可能な時間を示す。つまりキャパシタ駆動可能時間TIMEdは、主電源が遮断されたとしても、データバッファ112に格納されていて且つメディア100に未書き込みのデータ(つまりデータバッファ112内の未書き込みデータ)を当該データバッファに保持することが保証される時間である。このキャパシタ駆動可能時間TIMEd内に、データバッファ内の未書き込みデータをメディア100にライトできるならば、主電源が遮断されたとしても、当該未書き込みデータが喪失するおそれはない。
The write
時間算出部118aはまた、データバッファ112内の未書き込みデータを全てメディア100にライトするのに要する総メディアライト時間(第2の時間)TIMEtotalを、当該未書き込みデータのサイズSIZEtotalに基づいて算出する。なお、時間算出部118aがライトキャッシング判別部118から独立して設けられていてもよい。
The
ライトキャッシング判別部118は、総メディアライト時間TIMEtotalとキャパシタ駆動可能時間TIMEdとを比較する。ライトキャッシング判別部118は、この比較の結果に基づき、データサイズがSIZEtotalの未書き込みデータのためのライトキャッシングを、主電源の遮断の有無に無関係に実行することが可能かを判別する。
The write
キャパシタ放電容量検出部119は、キャパシタ114の放電容量を検出する。キャパシタ114の放電容量は、当該キャパシタ114の放電によって当該キャパシタ114から供給可能な電気量を表す。キャパシタ114の放電容量を検出する手法は、従来から種々知られている。本実施形態では、キャパシタ放電容量検出部119は、キャパシタ114の放電容量を次のように検出する。まずキャパシタ放電容量検出部119は、キャパシタ114をフル放電した後、当該キャパシタ114をフル充電する。キャパシタ放電容量検出部119は、キャパシタ114をフル充電するのに要する時間(充電時間)を測定する。キャパシタ114の充電時間は、当該キャパシタ114の放電容量に対応する。そこでキャパシタ放電容量検出部119は、キャパシタ114の充電時間毎に、当該充電時間と当該キャパシタ114の放電容量とを関連付けたテーブルを参照することにより、測定された充電時間に関連付けられた当該キャパシタ114の放電容量を検出する。
The capacitor
なお、他の周知の手法によってキャパシタ114の放電容量を検出することも可能である。例えば、キャパシタ114の最小保障電圧が定められている場合、キャパシタ放電容量検出部119が、当該最小保障電圧まで当該キャパシタ114を放電した後、当該キャパシタ114をフル充電し、そのフル充電に要する充電時間を測定してもよい。この場合も、キャパシタ放電容量検出部119は、キャパシタ114の充電時間毎に、当該充電時間と当該キャパシタ114の放電容量とを関連付けたテーブルを参照することにより、測定された充電時間に関連付けられた当該キャパシタ114の放電容量を検出することができる。
It is also possible to detect the discharge capacity of the
次に、本実施形態で適用されるストレージコントローラ110の制御によるライトキャッシングについて、図2のシーケンスチャートを参照して説明する。
まず、ホスト20がストレージ装置10のストレージコントローラ110に対し、ホストインタフェース21を介して、メディア100にデータをライトすることを指示するライトコマンド(以下、ライト要求と称する)を送信したものとする(ステップ201)。このライト要求は、ホスト20が要求するライトデータのサイズ(転送サイズ)を示す情報と論理アドレスとを含む。本実施形態において、ホストインタフェース21は、SSD或いはHDDに代表される一般的なストレージ装置で採用されるシリアルATA(SATA)或いはシリアルアタッチドSCSI(SAS)である。ホストインタフェース21がSATA或いはSASの場合、ホスト20は上述のように、ライトデータを送信(転送)する前に、転送サイズを含むライト要求をストレージコントローラ110に送信する。
Next, write caching by the control of the
First, it is assumed that the
ストレージコントローラ110のホストインタフェースコントローラ111は、ホスト20から転送されたライト要求を受信すると、バッファコントローラ115のライト制御部117に対し、受信可能なライトデータのサイズを問い合わせる(ステップ202)。受信可能なライトデータのサイズは、データバッファ112にライト可能なライトデータのサイズ(ライト可能サイズ)を表す。
When receiving the write request transferred from the
ライト制御部117は、ホストインタフェースコントローラ111からの問い合わせに応じて、データバッファ112の空き領域のサイズを検出する(ステップ203)。ライト制御部117は、検出されたサイズを、ホスト20からのライトが許可されるデータのサイズ(ライト許可サイズ)としてホストインタフェースコントローラ111に通知する(ステップ204)。するとホストインタフェースコントローラ111は、ホスト20に対してライト許可を通知する(ステップ205)。このライト許可は、ライト許可サイズ(つまりホスト20からの転送が許されるデータのサイズ)を示す情報を含む。
The
ホスト20は、ホストインタフェースコントローラ111から通知されたライト許可を受け取ると、当該ライト許可で許可されたサイズのライトデータを、ホストインタフェース21及びホストインタフェースコントローラ111を介してデータバッファ112に送信(転送)する(ステップ206)。なお、ホストインタフェース21が本実施形態のようにSATA或いはSASの場合、ホスト20は、前記許可されたサイズのライトデータを分割して送信してもよい。
When the
データバッファ112は、ホスト20から送信されたライトデータをデータバッファ112の空き領域に格納する。データバッファ112は、ホスト20から前記許可されたサイズのライトデータを受信(格納)し終えると、ライト制御部117に対してデータ受信完了を通知する(ステップ207)。ライト制御部117は、このデータ受信完了の通知に応じて、データバッファ112で受信されたライトデータのサイズをデータサイズSIZEtotalとしてライトキャッシング判別部118に通知する(ステップ208)。本実施形態において、ステップ208で通知されるデータサイズSIZEtotalは、データバッファ112に格納されていて、且つメディア100に未だ書かれていないライトデータのサイズに一致する。
The
一方、キャパシタ放電容量検出部119は、ホスト20からのライト要求に応じたライト動作とは非同期に、キャパシタ114の放電容量を検出する。本実施形態では、キャパシタ放電容量検出部119は、予め定められたタイミングでキャパシタ114の放電容量を検出する。本実施形態では、この予め定められたタイミングは、毎日1回定時に到来する。しかし、キャパシタ放電容量検出部119がキャパシタ114の放電容量を検出するタイミングが、他のタイミングであっても構わない。キャパシタ放電容量検出部119は、キャパシタ114の放電容量を検出すると、その検出された静電容量(キャパシタ静電容量)をライトキャッシング判別部118に通知する(ステップ221)。
On the other hand, the capacitor
ライトキャッシング判別部118の時間算出部118aは、キャパシタ放電容量検出部119から通知されたキャパシタ114の放電容量に基づいてキャパシタ駆動可能時間TIMEdを算出する(ステップ222)。キャパシタ駆動可能時間TIMEdは、主電源が遮断された際に、キャパシタ114からの電力の供給によってライトキャッシングが可能な時間を示す。本実施形態では、時間算出部118aは、キャパシタ114の放電容量を、ライトキャッシングで消費される電流で除することにより、キャパシタ駆動可能時間TIMEdを算出する。
The
キャパシタ駆動可能時間TIMEdは、主電源が遮断したとしても、ライトキャッシングによってデータバッファ112からメディア100にライトすることが可能なデータのサイズ、つまりライトキャッシングが可能なライトキャッシュサイズに対応する。したがって時間算出部118aがキャパシタ駆動可能時間TIMEdを算出することは、ライトキャッシュサイズを算出することと等価である。
The capacitor driveable time TIMEd corresponds to the size of data that can be written from the
さて、ライトキャッシング判別部118の時間算出部118aが最新のキャパシタ駆動可能時間TIMEdを既に算出している状態で、上述のように、ライト制御部117から当該ライトキャッシング判別部118に対して、データサイズSIZEtotalが通知されたものとする(ステップ208)。するとライトキャッシング判別部118は、通知されたデータサイズSIZEtotalのライトデータのためのライトキャッシングを、キャパシタ駆動可能時間TIMEd内に実行することが可能であるかを判別する(ステップ209)。つまりライトキャッシング判別部118は、前記データサイズSIZEtotalのライトデータを、たとえ前記主電源が遮断したとしても、キャパシタ114から供給される電力でデータバッファ112からメディア100にライトすることが可能であるかを判別する。この判別処理(以下、ライトキャッシング判別処理と称する)の具体的な手順については後述する。
Now, with the
もし、ライトキャッシング可であるとステップ209において判別されたならば、ライトキャッシング判別部118は、ホスト20からのライト要求に対するレスポンスとしてライト完了のレスポンスをホストインタフェースコントローラ111を介して当該ホスト20に送信する。すると、メディアコントローラ113は、データバッファ112が受信(格納)したライトデータ、つまりライト制御部117からライトキャッシング判別部118に通知されたデータサイズSIZEtotalのライトデータをメディア100にライトする。このような、ライトキャッシング可であるとステップ209において判別された場合の動作は、図2のシーケンスチャートでは省略されている。
If it is determined in
本実施形態では、ライトキャッシング不可であるとステップ209において判別されたものとする。この場合、ライトキャッシング判別部118は、ホスト20からのライト要求で指定されたライトデータは全てデータバッファ112に格納されているにも拘わらず、当該ホスト20にライト完了のレスポンスを送信することを抑止する。その理由は、もし主電源が遮断したならば、前記通知されたデータサイズSIZEtotalのライトデータのためのライトキャッシングを、キャパシタ駆動可能時間TIMEd内に実行することは難しく、少なくとも一部のライトデータが喪失する可能性があるためである。
In this embodiment, it is assumed that it is determined in
一方、ライト制御部117は、ライトキャッシング不可であるとステップ209において判別された場合、データバッファ112に格納されていて且つメディア100に未書き込みのライトデータをメディア100にライトするために、メディアコントローラ113に対してライト要求を発行する(ステップ210)。メディアコントローラ113は、ライト制御部117からのライト要求に応じ、上記未書き込みのライトデータをメディア100にライトするための第1のメディアライト動作(ステップ211)を少なくとも1回実行する。この第1のメディアライト動作(ステップ211)は次のように実行される。
On the other hand, if it is determined in
まずメディアコントローラ113は、データバッファ112に対して、データ転送要求を発行する(ステップ211a)。このデータ転送要求に応じて、メディア100に固有のライト単位(メディアライト単位)のサイズSIZEunitのデータが、データバッファ112から当該メディア100に転送される。メディアライト単位は、メディア100に1回のアクセスでライト可能なデータのサイズである。つまり、メディア100へのデータライトは、このデータサイズがSIZEunitのメディアライト単位に実行される。
First, the
データバッファ112からメディア100に転送される、データサイズがSIZEunitのデータは、データバッファ112に格納されていて、且つ最も最近に通知されたデータサイズSIZEtotalのライトデータ(つまり、メディア100に未書き込みのライトデータ)に含まれている。メディアコントローラ113は、このデータバッファ112から転送されるライトデータをメディア100にライトする(ステップ211b)。
Data transferred from the
するとメディア100は、ライト単位のサイズのデータのライト完了を示すレスポンスをメディアコントローラ113に返す(ステップ211c)。メディアコントローラ113は、このメディア100からのレスポンスに応じて、データサイズSIZEtotalがメディアライト単位SIZEunitだけ減らされるように、次式
SIZEtotal = SIZEtotal - SIZEunit (1)
に従って、当該データサイズSIZEtotalを更新する。更新されたデータサイズSIZEtotalは、最新のメディアライトが完了した時点においてデータバッファ112に格納されていて、且つメディア100に未書き込みのライトデータのサイズを示す。メディアコントローラ113は、更新された最新のデータサイズSIZEtotalをライトキャッシング判別部118に通知する(ステップ211d)。
Then, the medium 100 returns a response indicating completion of writing of the data of the write unit size to the media controller 113 (
SIZEtotal = SIZEtotal-SIZEunit (1)
Then, the data size SIZEtotal is updated. The updated data size SIZEtotal indicates the size of write data that has been stored in the
するとライトキャッシング判別部118は、ライト制御部117からデータサイズSIZEtotalが通知された場合と同様に、メディアコントローラ113から通知された最新のデータサイズSIZEtotalに基づいてライトキャッシング可否を判別する(ステップ209)。つまり、ライトキャッシング判別部118は、メディアコントローラ113から通知された最新のデータサイズSIZEtotalのライトデータのためのライトキャッシングを、キャパシタ駆動可能時間TIMEd内に実行することが可能であるかを判別する。もし、ライトキャッシング不可であるならば、上述の第1のメディアライト動作(ステップ211)が再び実行される。このように、第1のメディアライト動作は、ライトキャッシング可が判別されるまで繰り返される。
Then, as in the case where the data size SIZEtotal is notified from the
やがて、ライトキャッシング可であるとステップ209において判別されたものとする。そこでライトキャッシング判別部118は、ホスト20からのライト要求に対するレスポンスとしてライト完了のレスポンスをホストインタフェースコントローラ111を介して当該ホスト20に送信する(ステップ212)。すると、メディアコントローラ113は、データバッファ112に格納されていて且つメディア100に未書き込みのライトデータをメディア100にライトするための第2のメディアライト動作(ステップ213)を少なくとも1回実行する。この第2のメディアライト動作(ステップ213)は次のように実行される。
Assume that it is determined in
まずメディアコントローラ113は、上記ステップ211aと同様に、データバッファ112に対して、データ転送要求を発行する(ステップ213a)。このデータ転送要求に応じて、サイズSIZEunitのデータが、データバッファ112からメディア100に転送される。このメディア100に転送されるデータサイズがSIZEunitのデータは、データバッファ112に格納されていて、且つメディア100に未書き込みのライトデータである。メディアコントローラ113は、このデータバッファ112から転送されるライトデータを、上記ステップ211bと同様に、メディア100にライトする(ステップ213b)。
First, the
するとメディア100は、ライト単位のサイズのデータのライト完了を示すレスポンスをメディアコントローラ113に返す(ステップ213c)。これにより、1回の第2のライト動作(ステップ213)が終了する。第2のライト動作は、データバッファ112に格納されていて、且つメディア100に未書き込みのライトデータが全て当該メディア100にライトされるまで繰り返される。この第2のライト動作が繰り返されている間に主電源が遮断したとしても、その時点でデータバッファ112に格納されていて、且つメディア100に未書き込みのライトデータは、全て当該メディア100にライトできることが保証されている。
Then, the medium 100 returns a response indicating completion of writing of the data of the write unit size to the media controller 113 (
やがて、データバッファ112に残されている最後の未書き込みデータを含むライト単位のサイズのデータがメディア100にライトされたものとする(ステップ214)。するとメディア100は、上記ステップ213cと同様に、ライト単位のサイズのデータのライト完了を示すレスポンスをメディアコントローラ113に返す(ステップ215)。このレスポンスを受けてメディアコントローラ113は、データバッファ112内の未書き込みデータが全てメディア100にライトされたことを示すメディアライト完了をライト制御部117に通知する(ステップ216)。これにより、ホスト20からのライト要求に対応するライト処理は完了する。
Eventually, it is assumed that the data of the write unit size including the last unwritten data remaining in the
次に上記ステップ209で実行されるライトキャッシング判別処理の典型的な手順について、図3のフローチャートを参照して説明する。
まず、ライトキャッシング判別部118は、ライト制御部117から通知されたデータサイズSIZEtotalを受け付ける(ステップ301)。データバッファ112がホスト20から転送されたライトデータを受信(格納)したことにより、1回目のライトキャッシング判別処理が実行される場合、ステップ301で受け付けられるデータサイズSIZEtotalは、当該データバッファ112で受信されたライトデータのサイズを表す。
Next, a typical procedure of the write caching determination process executed in
First, the write
ライトキャッシング判別部118の時間算出部118aは、データサイズSIZEtotalをメディアライト単位のデータサイズSIZEunitで除する(ステップ302)。即ち時間算出部118aは、次式
SIZEtotal ÷ SIZEunit = N + α (2)
で示される除算を実行する。ここでNは自然数である。一方、αは端数であり、ゼロまたは小数(0≦α<1)である。
The
SIZEtotal ÷ SIZEunit = N + α (2)
The division indicated by is executed. Here, N is a natural number. On the other hand, α is a fraction and is zero or decimal (0 ≦ α <1).
上記除算により、時間算出部118aは、データバッファ112に格納されていて且つメディア100に未書き込みのデータサイズがSIZEtotalのライトデータを、全てメディア100にライトするのに必要なメディアライト回数を算出する。ここで、メディアライト回数は、αがゼロの場合、つまり「SIZEtotal」が「SIZEunit」で割り切れる場合、Nとなる。これに対し、αが非ゼロの場合、つまり「SIZEtotal」が「SIZEunit」で割り切れないためにN×SIZEunit<SIZEtotal<(N + 1)×SIZEunitである場合、メディアライト回数はN+1となる。
By the above division, the
時間算出部118aは、ステップ302における除算の結果に基づいて、αが非ゼロ(α≠0)であるかを判別する(ステップ303)。もし、αが非ゼロ(α≠0)であるならば(ステップ303のYes)、つまりメディアライト回数がN+1であるならば、ライトキャッシング判別部118はステップ304に進む。
The
ステップ304において時間算出部118aは、メディアライト単位に満たない、サイズが「SIZEtotal - N×SIZEunit」のデータを、当該メディアライト単位のサイズに加工するのに要する時間βを算出する。ストレージ装置10では、一般に誤り訂正符号が付されたデータがメディア100にライトされる。このため、メディア100にデータをライトする際には、データサイズをメディアライト単位に揃える必要がある。
In
そこで、上述のようなメディアライト単位に満たないサイズのライトデータを、例えば主電源の遮断時に強制的にメディア100にライトする場合には、メディアライト単位に足りないサイズのデータとして、例えば予め定められたダミーデータ(例えば無効なデータ)が用いられる。このように、ダミーデータで補われたライトデータに基づいて誤り訂正符号を生成される。そして、生成された誤り訂正符号が付されたライトデータがメディア100にライトされる。上記ステップ304では、このようなデータの加工(処理)に要する時間βが算出される。
Therefore, when write data having a size less than the media write unit as described above is forcibly written to the medium 100 when the main power supply is shut off, for example, the data is determined in advance as data having a size insufficient for the media write unit. The dummy data (for example, invalid data) is used. Thus, an error correction code is generated based on the write data supplemented with dummy data. Then, the generated write data with the error correction code is written to the medium 100. In
時間算出部118aは時間βを算出すると、データバッファ112に格納されていて且つメディア100に未書き込みの、データサイズがSIZEtotalのデータを全てメディア100にライトするのに要する総メディアライト時間TIMEtotalを、次式
TIMEtotal = (N + 1)×TIMEunit + β (3)
に従って算出する(ステップ305)。ここで、「TIMEunit」は、メディア100にメディアライト単位にデータをライトするのに要する時間を示す。つまり時間算出部118aは、総メディアライト時間TIMEtotalを、メディアライト回数N+1、時間TIMEunit及び時間βに基づき算出する。
When the
TIMEtotal = (N + 1) x TIMEunit + β (3)
(Step 305). Here, “TIMEunit” indicates the time required to write data to the medium 100 in media write units. That is, the
一方、αが非ゼロ(α≠0)でないならば(ステップ303のNo)、つまりαがゼロのためにメディアライト回数がNであるならば、時間算出部118aはステップ306に進む。ステップ306において時間算出部118aは、総メディアライト時間TIMEtotalを、次式
TIMEtotal = N×TIMEunit (4)
に従って算出する。
On the other hand, if α is not non-zero (α ≠ 0) (No in step 303), that is, if α is zero and the number of media writes is N, the
TIMEtotal = N × TIMEunit (4)
Calculate according to
上述したように、データバッファ112がホスト20から転送されたライトデータを受信したことにより、1回目のライトキャッシング判別処理が実行される場合、当該1回目のライトキャッシング判別処理で用いられるデータサイズSIZEtotalは、当該データバッファ112で受信されたライトデータのサイズを表している。この場合、ステップ305または306で算出される総メディアライト時間TIMEtotalは、データバッファ112が受信(格納)したライトデータを全てメディア100にライトするのに要する時間を示す。また、n回目(nは1より大きい整数)のライトキャッシング判別処理が実行される場合、当該n回目のライトキャッシング判別処理で用いられるデータサイズSIZEtotalは、ステップ211のライト動作がn−1回実行された直後に、データバッファ112に格納されていて且つストレージコントローラ110に未書き込みのライトデータのサイズを示す。
As described above, when the first write caching determination process is executed when the
ライトキャッシング判別部118は、時間算出部118aによって前記総メディアライト時間TIMEtotalが算出されると(ステップ305または306)、当該総メディアライト時間TIMEtotalを、最新のキャパシタ駆動可能時間TIMEdと比較する(ステップ307)。このキャパシタ駆動可能時間TIMEdは、キャパシタ放電容量検出部119から通知された最新のキャパシタ114の放電容量に基づいて、上記ステップS222で算出されたものである。
When the total media write time TIMEtotal is calculated by the
ライトキャッシング判別部118は、ステップ307における比較の結果に基づいて、ライトキャッシングの可否を判別する(ステップ308)。ここでは、総メディアライト時間TIMEtotalがキャパシタ駆動可能時間TIMEd以下(TIMEtotal≦TIMEd)であるならば、ライトキャッシング判別部118はライトキャッシングが可であると判別する。これに対し、総メディアライト時間TIMEtotalがキャパシタ駆動可能時間TIMEdを超えている(TIMEtotal>TIMEd)であるならば、ライトキャッシング判別部118は、少なくとも一部の未書き込みデータについて、ライトキャッシングが不可であると判別する。なお、総メディアライト時間TIMEtotalがキャパシタ駆動可能時間に等しい場合も、ライトキャッシング判別部118はライトキャッシングが不可であると判別してもよい。ステップ308で、ライトキャッシングの可否が判別されると、ライトキャッシング判別処理(ステップ209)は終了する。
The write
ライトキャッシングが可であると判別された場合、前述したように、ライトキャッシングが実行される。つまり、ライトキャッシング判別部118からホスト20にライト完了のレスポンスが送信され(ステップ212)、しかる後にデータバッファ112内の未書き込みデータをメディア100にライトするための第2のメディアライト動作(ステップ213)が実行される。
When it is determined that write caching is possible, write caching is executed as described above. That is, a write completion response is transmitted from the write
本実施形態で適用されるキャパシタ駆動可能時間TIMEdは、従来技術における「所定時間」に対応する。しかし、従来技術における「所定時間」は、バックアップ電源が疲弊している状態を基準に予め設定される固定の時間である。このため、従来技術では、ストレージ装置の書き込み性能に大きく影響するライトキャッシュサイズがキャパシタ疲弊時の放電容量に制限されてしまう。 The capacitor driveable time TIMEd applied in the present embodiment corresponds to the “predetermined time” in the prior art. However, the “predetermined time” in the prior art is a fixed time set in advance on the basis of the state where the backup power supply is exhausted. For this reason, in the prior art, the write cache size that greatly affects the write performance of the storage device is limited to the discharge capacity when the capacitor is exhausted.
これに対して本実施形態では、キャパシタ放電容量検出部119によって検出されるキャパシタ114の最新の放電容量に基づき、キャパシタ駆動可能時間TIMEdが算出される。キャパシタ114が疲弊していない状態における当該キャパシタ114の放電容量は、当該キャパシタ114が疲弊している状態におけるそれと比べて大きい。つまりキャパシタ114の放電容量は、当該キャパシタ114の疲弊の程度に対応する。また、ライトキャッシュサイズはキャパシタ駆動可能時間TIMEdに対応し、キャパシタ駆動可能時間TIMEdが長いほど大きくなる。このように本実施形態では、キャパシタ114の最新の放電容量に基づき、当該キャパシタ114の疲弊度に適合したライトキャッシュサイズを動的に設定できる。このため本実施形態によれば、キャパシタ114が疲弊していない状態では、当該キャパシタ114が疲弊している状態に比べて、ストレージコントローラ110からホスト20に対して速やかにライト完了のレスポンスをホスト20送信でき、ストレージ装置10の書き込み性能を向上することができる。
In contrast, in the present embodiment, the capacitor driveable time TIMEd is calculated based on the latest discharge capacity of the
上記実施形態では、ストレージ装置10に単一のホスト20が接続されている場合を前提としている。しかし、ホスト20を含む複数のホストがストレージ装置10に接続されていても構わない。
In the above embodiment, it is assumed that a
以上説明した少なくとも1つの実施形態によれば、バックアップ電源の疲弊度に適合したライトキャッシュサイズを設定することができるストレージコントローラ、ストレージ装置及びライトキャッシング方法を提供することができる。」
本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる。
According to at least one embodiment described above, it is possible to provide a storage controller, a storage device, and a write caching method that can set a write cache size that is suitable for the degree of exhaustion of a backup power supply. "
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.
10…ストレージ装置、20…ホスト(ホスト装置)、100…メディア、110…ストレージコントローラ、111…ホストインタフェースコントローラ、112…データバッファ、113…メディアコントローラ、114…キャパシタ(バックアップ電源)、115…バッファコントローラ、117…ライト制御部、118…ライトキャッシング判別部、118a…時間算出部、119…キャパシタ放電容量検出部。
DESCRIPTION OF
Claims (7)
主電源から供給される電力によって充電されるバックアップ電源であって、前記主電源の電圧が規定電圧よりも低下した場合に前記主電源をバックアップするバックアップ電源の放電容量を検出する放電容量検出手段と、
前記検出された放電容量に基づき、前記バックアップ電源からの電力の供給によってライトキャッシングが可能な第1の時間を算出し、且つ前記データバッファに格納されていて且つ前記メディアに未書き込みのデータのサイズに基づいて、前記未書き込みデータを前記メディアにライトするのに要する第2の時間を算出する時間算出手段と、
前記第1の時間と前記第2の時間とを比較することにより、前記第1の時間内に前記未書き込みデータを前記メディアにライトすることが可能であるかを判別し、ライト可能であるならば、前記ホストにライト完了のレスポンスを送信する判別手段と、
前記ライト完了のレスポンスが送信された後、前記データバッファに格納されている前記未書き込みデータを前記メディアにライトするメディアコントローラと
を具備するストレージコントローラ。 A data buffer for storing data transferred from the host device in response to a write command transmitted from the host device and instructing to write data to a nonvolatile medium;
A backup power source charged by power supplied from the main power source, and a discharge capacity detecting means for detecting a discharge capacity of the backup power source that backs up the main power source when the voltage of the main power source falls below a specified voltage; ,
Based on the detected discharge capacity, a first time during which write caching can be performed by supplying power from the backup power supply is calculated, and the size of the data stored in the data buffer and not yet written to the medium A time calculating means for calculating a second time required to write the unwritten data to the medium, based on:
By comparing the first time and the second time, it is determined whether the unwritten data can be written to the medium within the first time. Determining means for transmitting a write completion response to the host;
A storage controller comprising: a media controller that writes the unwritten data stored in the data buffer to the medium after the write completion response is transmitted.
前記メディアコントローラは、前記ライト不可であると判別されたならば、前記データバッファに格納されている前記未書き込みデータを、所定のサイズを単位に前記メディアにライトし、前記所定のサイズのデータを前記メディアにライトする都度、前記データバッファに残されている未書き込みデータのサイズを前記時間算出手段に通知し、
前記時間算出手段は、前記通知されたサイズに基づいて、前記第2の時間を再度算出する
請求項1記載のストレージコントローラ。 If it is determined that the writing is impossible, the determination unit suppresses transmission of the write completion response to the host;
If it is determined that the writing is impossible, the media controller writes the unwritten data stored in the data buffer to the medium in units of a predetermined size, and stores the data of the predetermined size. Each time the medium is written, the time calculation means is notified of the size of unwritten data remaining in the data buffer,
The storage controller according to claim 1, wherein the time calculation unit calculates the second time again based on the notified size.
ホスト装置からの要求に応じて前記メディアへのアクセスを制御する、請求項1記載のストレージコントローラと
を具備するストレージ装置。 Rewritable non-volatile media,
A storage apparatus comprising: the storage controller according to claim 1, wherein access to the medium is controlled in response to a request from a host apparatus.
主電源から供給される電力によって充電されるバックアップ電源の放電容量を検出し、
前記検出された放電容量に基づき、前記バックアップ電源からの電力の供給によってライトキャッシングが可能な第1の時間を算出し、
前記データバッファに格納されていて且つ前記メディアに未書き込みのデータのサイズに基づいて、前記未書き込みデータを前記メディアにライトするのに要する第2の時間を算出し、
前記第1の時間と前記第2の時間とを比較することにより、前記第1の時間内に前記未書き込みデータを前記メディアにライトすることが可能であるかを判別し、
ライト可能であるならば、前記ホストにライト完了のレスポンスを送信し、
前記ライト完了のレスポンスが送信された後、前記データバッファに格納されている前記未書き込みデータを前記メディアにライトする
ライトキャッシング方法。 Write caching applied to a storage controller having a data buffer for storing data transferred from the host device in response to a write command sent from the host device to write data to a non-volatile medium A method,
Detect the discharge capacity of the backup power source charged by the power supplied from the main power source,
Based on the detected discharge capacity, a first time during which write caching can be performed by supplying power from the backup power source is calculated,
Calculating a second time required to write the unwritten data to the medium based on the size of the data stored in the data buffer and not yet written to the medium;
By comparing the first time and the second time, it is determined whether it is possible to write the unwritten data to the medium within the first time,
If write is possible, a write completion response is sent to the host,
A write caching method for writing the unwritten data stored in the data buffer to the medium after the write completion response is transmitted.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011199700A JP2013061791A (en) | 2011-09-13 | 2011-09-13 | Storage controller, storage device, and write caching method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011199700A JP2013061791A (en) | 2011-09-13 | 2011-09-13 | Storage controller, storage device, and write caching method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2013061791A true JP2013061791A (en) | 2013-04-04 |
Family
ID=48186417
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011199700A Withdrawn JP2013061791A (en) | 2011-09-13 | 2011-09-13 | Storage controller, storage device, and write caching method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2013061791A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10042575B2 (en) | 2015-03-06 | 2018-08-07 | Toshiba Memory Corporation | Memory system including a battery powered buffer with a storage capacity of that buffer dependent on the voltage level of the battery |
US10726879B2 (en) | 2017-12-08 | 2020-07-28 | Samsung Electronics Co., Ltd. | Low-power data transfer from buffer to flash memory |
CN113345476A (en) * | 2020-03-03 | 2021-09-03 | 株式会社东芝 | Magnetic disk device and storage management method for magnetic disk device |
CN114003176A (en) * | 2021-11-03 | 2022-02-01 | 杭州海康存储科技有限公司 | Data writing method and device and hard disk device |
-
2011
- 2011-09-13 JP JP2011199700A patent/JP2013061791A/en not_active Withdrawn
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10042575B2 (en) | 2015-03-06 | 2018-08-07 | Toshiba Memory Corporation | Memory system including a battery powered buffer with a storage capacity of that buffer dependent on the voltage level of the battery |
US10726879B2 (en) | 2017-12-08 | 2020-07-28 | Samsung Electronics Co., Ltd. | Low-power data transfer from buffer to flash memory |
CN113345476A (en) * | 2020-03-03 | 2021-09-03 | 株式会社东芝 | Magnetic disk device and storage management method for magnetic disk device |
CN113345476B (en) * | 2020-03-03 | 2022-12-23 | 株式会社东芝 | Magnetic disk device and storage management method for magnetic disk device |
CN114003176A (en) * | 2021-11-03 | 2022-02-01 | 杭州海康存储科技有限公司 | Data writing method and device and hard disk device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107346290B (en) | Replaying partition logical to physical data address translation tables using parallelized log lists | |
US9298534B2 (en) | Memory system and constructing method of logical block | |
KR101908581B1 (en) | Wear leveling in storage devices | |
US9875027B2 (en) | Data transmitting method, memory control circuit unit and memory storage device | |
US9268687B2 (en) | Data writing method, memory control circuit unit and memory storage apparatus | |
US9280460B2 (en) | Data writing method, memory control circuit unit and memory storage apparatus | |
US9946478B2 (en) | Memory managing method, memory control circuit unit and memory storage apparatus | |
US8930614B2 (en) | Data storage apparatus and method for compaction processing | |
US9336089B2 (en) | Processing apparatus, method, and non-transitory computer-readable storage medium | |
CN110114758A (en) | The specific aim of memory is removed | |
US20110113184A1 (en) | Data backup method for a flash memory and controller and storage system using the same | |
US9696922B2 (en) | Storage system | |
US20120159050A1 (en) | Memory system and data transfer method | |
AU2015258208A1 (en) | Resource allocation and deallocation for power management in devices | |
US10283196B2 (en) | Data writing method, memory control circuit unit and memory storage apparatus | |
US10620874B2 (en) | Memory management method, memory control circuit unit and memory storage apparatus | |
US10042575B2 (en) | Memory system including a battery powered buffer with a storage capacity of that buffer dependent on the voltage level of the battery | |
US10564899B2 (en) | Data writing method for rewritable non-volatile memory modules based on use information, memory storage device and memory control circuit unit | |
US11036429B2 (en) | Memory control method, memory storage device and memory control circuit unit to determine a source block using interleaving information | |
JP2012063884A (en) | Storage device, electronics and control method of storage device | |
AU2016225779A1 (en) | Wear management for flash memory devices | |
JP2013061791A (en) | Storage controller, storage device, and write caching method | |
US20190012260A1 (en) | Flash memory package and storage system including flash memory package | |
US20210182192A1 (en) | Storage device with enhanced time to ready performance | |
JP5579135B2 (en) | Data storage device, memory control device, and memory control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20131205 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20131212 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20131219 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20131226 |
|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20140109 |
|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20141202 |