JP2013061791A - Storage controller, storage device, and write caching method - Google Patents

Storage controller, storage device, and write caching method Download PDF

Info

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
Application number
JP2011199700A
Other languages
Japanese (ja)
Inventor
Kiyotaka Iwasaki
清隆 岩崎
Yoshimasa Aoyama
能正 青山
Yoko Masuo
容子 増尾
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 JP2011199700A priority Critical patent/JP2013061791A/en
Publication of JP2013061791A publication Critical patent/JP2013061791A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PROBLEM TO BE SOLVED: To set a write caching size corresponding to an exhaustion degree of a backup power supply.SOLUTION: A data buffer stores data transferred from a host device. Discharge capacity detection means detects a discharge capacity of a backup power supply charged by power supplied from a main power supply. Time calculation means calculates a first time in which write caching can be performed with power supply from the backup power supply on the basis of the detected discharge capacity, and also calculates a second time required for writing data which is stored in the data buffer and is unwritten in a medium, in the medium. Determination means determines whether it is possible to write the unwritten data in the medium within the first time on the basis of the first time and the second time, and when it is possible to write the unwritten data in the medium within the first time, transmits a response indicating writing completion to the host device. A media controller writes the unwritten data stored in the data buffer in the medium after the response indicating writing completion is transmitted.

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.

特開平4−287108号公報JP-A-4-287108

従来技術では、バックアップ電源の電圧が所定電圧を超えていることをもって、前記所定時間を、主電源の遮断時における動作可能時間として保証している。しかし、バックアップ電源の電圧(例えば充電電圧)は、必ずしも動作可能時間に対応しているとは限らない。その要因は、バックアップ電源の疲弊度にある。   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 is a block diagram showing a typical configuration of an electronic device according to an embodiment. 同実施形態で適用されるストレージコントローラの制御によるライトキャッシングを説明するためのシーケンスチャート。6 is a sequence chart for explaining write caching by control of a storage controller applied in the embodiment. 同実施形態で適用されるライトキャッシング判別処理の典型的な手順を説明するためのフローチャート。6 is a flowchart for explaining a typical procedure of write caching determination processing applied in the embodiment.

以下、実施の形態につき図面を参照して説明する。
図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 storage device 10 and a host device (host) 20 that uses the storage device 10. In the present embodiment, the electronic device is a personal computer. However, the electronic device need not be a personal computer, and may be an electronic device other than a personal computer, such as a video camera, a music player, a portable terminal, a cellular phone, or a printer device. The host 20 is connected to the storage apparatus 10 via the host interface 21.

ストレージ装置10は、メディア100及びストレージコントローラ110から構成される。メディア100は、データを格納するのに用いられる書き換えが可能な不揮発性の記憶媒体である。本実施形態において、メディア100はフラッシュメモリに代表される不揮発性メモリであり、ストレージ装置10はソリッドステートドライブ(SSD)であるものとする。しかし、メディア100が、例えば磁気ディスクであり、ストレージ装置10がハードディスクドライブ(HDD)であっても構わない。   The storage device 10 includes a medium 100 and a storage controller 110. The medium 100 is a rewritable nonvolatile storage medium used to store data. In the present embodiment, it is assumed that the medium 100 is a non-volatile memory typified by a flash memory, and the storage device 10 is a solid state drive (SSD). However, the medium 100 may be a magnetic disk, for example, and the storage device 10 may be a hard disk drive (HDD).

ストレージコントローラ110は、ホスト20からの要求に応じてメディア100へのアクセスを制御する。ストレージコントローラ110は、ホストインタフェースコントローラ111と、データバッファ112と、メディアコントローラ113と、キャパシタ114と、バッファコントローラ115とを備えている。ホストインタフェースコントローラ111、データバッファ112、メディアコントローラ113、キャパシタ114、バッファコントローラ115及びメディア100は、内部バス120によって相互接続されている。   The storage controller 110 controls access to the medium 100 in response to a request from the host 20. The storage controller 110 includes a host interface controller 111, a data buffer 112, a media controller 113, a capacitor 114, and a buffer controller 115. The host interface controller 111, data buffer 112, media controller 113, capacitor 114, buffer controller 115, and media 100 are interconnected by an internal bus 120.

ホストインタフェースコントローラ111は、ホストインタフェース21を介してホスト20と通信する。データバッファ112は、ホスト20から受け取ったデータ(ライトデータ)を一時的に格納するのに用いられる。データバッファ112はまた、メディア100から読み出されたデータ(リードデータ)を一時的に格納するのにも用いられる。メディアコントローラ113は、バッファコントローラ115内の後述するライト制御部117からの要求に応じてメディア100にアクセスする。   The host interface controller 111 communicates with the host 20 via the host interface 21. The data buffer 112 is used to temporarily store data (write data) received from the host 20. The data buffer 112 is also used for temporarily storing data read from the medium 100 (read data). The media controller 113 accesses the medium 100 in response to a request from a write control unit 117 (described later) in the buffer controller 115.

キャパシタ114は、ストレージ装置10のための主電源の電圧が規定電圧よりも低下した場合に当該主電源をバックアップして、当該ストレージ装置10内のデータバッファ112及びメディア100を含む要素群に一時的に電源を供給するのに用いられるバックアップ電源である。前記主電源の電圧が規定電圧よりも低下する例として、前記主電源が遮断した場合が挙げられる。以下の説明では、簡略化のために、主電源の遮断を前提とする。キャパシタ114(つまり、バックアップ電源)は、通常状態において前記主電源から供給される電力によって充電される。前記主電源は、例えばAC−DC電源である。   The capacitor 114 backs up the main power supply when the voltage of the main power supply for the storage apparatus 10 falls below a specified voltage, and temporarily stores the data in the element group including the data buffer 112 and the medium 100 in the storage apparatus 10. This is a backup power source used to supply power to the power source. As an example in which the voltage of the main power supply is lower than a specified voltage, there is a case where the main power supply is cut off. In the following description, for the sake of simplicity, it is assumed that the main power supply is shut off. The capacitor 114 (that is, the backup power source) is charged by the electric power supplied from the main power source in a normal state. The main power source is, for example, an AC-DC power source.

キャパシタ114は、例えば電気二重層キャパシタである。しかし、キャパシタ114が、電気二重層キャパシタである必要はない。また、キャパシタ114に代えて、例えばリチウムイオン電池のような二次電池を用いてもよい。つまり、バックアップ電源として、二次電池を用いてもよい。また、キャパシタ114がストレージコントローラ110の外部に設けられていてもよい。   The capacitor 114 is, for example, an electric double layer capacitor. However, the capacitor 114 does not have to be an electric double layer capacitor. Further, a secondary battery such as a lithium ion battery may be used instead of the capacitor 114. That is, a secondary battery may be used as a backup power source. Further, the capacitor 114 may be provided outside the storage controller 110.

バッファコントローラ115は、ホスト20からのメディア100へのアクセスの要求に応じて、データバッファ112を制御する。バッファコントローラ115は、リード制御部116と、ライト制御部117と、ライトキャッシング判別部118と、キャパシタ放電容量検出部119とを備えている。   The buffer controller 115 controls the data buffer 112 in response to a request for access to the medium 100 from the host 20. The buffer controller 115 includes a read control unit 116, a write control unit 117, a write caching determination unit 118, and a capacitor discharge capacity detection unit 119.

リード制御部116は、データバッファ112からのデータのリードを制御する。ライト制御部117は、データバッファ112へのデータのライトを制御する。ライト制御部117は、データバッファ112にライト(格納)されたデータを周知のバッファ管理テーブル(図示せず)により管理する。バッファ管理テーブルは、DRAMのようなメモリに保持される。バッファ管理テーブルは、データバッファ112に格納されたデータの、当該データバッファ112内の位置を示すバッファアドレスと、当該データがライトされるべき例えば論理アドレスとの対応を示す情報を保持する。またバッファ管理テーブルは、データバッファ112に格納されたデータが、メディア100に未書き込みであるかを示す情報も保持する。バッファ管理テーブルは更に、データバッファ112に格納されていて且つメディア100に未書き込みのデータ全体のサイズ(データサイズ)を示す情報も保持する。   The read control unit 116 controls reading of data from the data buffer 112. The write control unit 117 controls data writing to the data buffer 112. The write control unit 117 manages data written (stored) in the data buffer 112 using a known buffer management table (not shown). The buffer management table is held in a memory such as a DRAM. The buffer management table holds information indicating a correspondence between a buffer address indicating the position in the data buffer 112 of the data stored in the data buffer 112 and, for example, a logical address to which the data is to be written. The buffer management table also holds information indicating whether the data stored in the data buffer 112 has not been written to the medium 100. The buffer management table further holds information indicating the size (data size) of the entire data stored in the data buffer 112 and not written to the medium 100.

ライトキャッシング判別部118は時間算出部118aを備えている。時間算出部118aは、キャパシタ114の放電容量(mAh)(より詳細には、キャパシタ114の放電容量及びライトキャッシングに要する単位時間当たりの電力)に基づいてキャパシタ駆動可能時間(第1の時間)TIMEdを算出する。キャパシタ駆動可能時間TIMEdは、主電源が遮断された際に、キャパシタ114からの電力の供給によってライトキャッシングが可能な時間を示す。つまりキャパシタ駆動可能時間TIMEdは、主電源が遮断されたとしても、データバッファ112に格納されていて且つメディア100に未書き込みのデータ(つまりデータバッファ112内の未書き込みデータ)を当該データバッファに保持することが保証される時間である。このキャパシタ駆動可能時間TIMEd内に、データバッファ内の未書き込みデータをメディア100にライトできるならば、主電源が遮断されたとしても、当該未書き込みデータが喪失するおそれはない。   The write caching determination unit 118 includes a time calculation unit 118a. The time calculation unit 118a uses the discharge capacity (mAh) of the capacitor 114 (more specifically, the discharge capacity of the capacitor 114 and the power per unit time required for the write caching) TIMEd Is calculated. Capacitor driveable time TIMEd indicates a time during which write caching can be performed by supplying power from the capacitor 114 when the main power supply is shut off. In other words, the capacitor driveable time TIMEd is stored in the data buffer 112 and unwritten data in the medium 100 (that is, unwritten data in the data buffer 112) is held in the data buffer even when the main power supply is shut off. It is time that is guaranteed to do. If unwritten data in the data buffer can be written to the medium 100 within the capacitor driveable time TIMEd, there is no possibility that the unwritten data will be lost even if the main power supply is shut off.

時間算出部118aはまた、データバッファ112内の未書き込みデータを全てメディア100にライトするのに要する総メディアライト時間(第2の時間)TIMEtotalを、当該未書き込みデータのサイズSIZEtotalに基づいて算出する。なお、時間算出部118aがライトキャッシング判別部118から独立して設けられていてもよい。   The time calculation unit 118a also calculates the total media write time (second time) TIMEtotal required to write all unwritten data in the data buffer 112 to the medium 100 based on the size SIZEtotal of the unwritten data. . Note that the time calculation unit 118a may be provided independently of the write caching determination unit 118.

ライトキャッシング判別部118は、総メディアライト時間TIMEtotalとキャパシタ駆動可能時間TIMEdとを比較する。ライトキャッシング判別部118は、この比較の結果に基づき、データサイズがSIZEtotalの未書き込みデータのためのライトキャッシングを、主電源の遮断の有無に無関係に実行することが可能かを判別する。   The write caching determination unit 118 compares the total media write time TIMEtotal with the capacitor driveable time TIMEd. Based on the result of this comparison, the write caching determination unit 118 determines whether or not write caching for unwritten data whose data size is SIZEtotal can be executed regardless of whether or not the main power supply is shut off.

キャパシタ放電容量検出部119は、キャパシタ114の放電容量を検出する。キャパシタ114の放電容量は、当該キャパシタ114の放電によって当該キャパシタ114から供給可能な電気量を表す。キャパシタ114の放電容量を検出する手法は、従来から種々知られている。本実施形態では、キャパシタ放電容量検出部119は、キャパシタ114の放電容量を次のように検出する。まずキャパシタ放電容量検出部119は、キャパシタ114をフル放電した後、当該キャパシタ114をフル充電する。キャパシタ放電容量検出部119は、キャパシタ114をフル充電するのに要する時間(充電時間)を測定する。キャパシタ114の充電時間は、当該キャパシタ114の放電容量に対応する。そこでキャパシタ放電容量検出部119は、キャパシタ114の充電時間毎に、当該充電時間と当該キャパシタ114の放電容量とを関連付けたテーブルを参照することにより、測定された充電時間に関連付けられた当該キャパシタ114の放電容量を検出する。   The capacitor discharge capacity detector 119 detects the discharge capacity of the capacitor 114. The discharge capacity of the capacitor 114 represents the amount of electricity that can be supplied from the capacitor 114 by the discharge of the capacitor 114. Various methods for detecting the discharge capacity of the capacitor 114 are conventionally known. In the present embodiment, the capacitor discharge capacity detector 119 detects the discharge capacity of the capacitor 114 as follows. First, the capacitor discharge capacity detector 119 fully discharges the capacitor 114 and then fully charges the capacitor 114. The capacitor discharge capacity detector 119 measures the time (charge time) required to fully charge the capacitor 114. The charging time of the capacitor 114 corresponds to the discharge capacity of the capacitor 114. Therefore, the capacitor discharge capacity detection unit 119 refers to a table that associates the charge time with the discharge capacity of the capacitor 114 for each charge time of the capacitor 114, so that the capacitor 114 associated with the measured charge time is obtained. The discharge capacity of is detected.

なお、他の周知の手法によってキャパシタ114の放電容量を検出することも可能である。例えば、キャパシタ114の最小保障電圧が定められている場合、キャパシタ放電容量検出部119が、当該最小保障電圧まで当該キャパシタ114を放電した後、当該キャパシタ114をフル充電し、そのフル充電に要する充電時間を測定してもよい。この場合も、キャパシタ放電容量検出部119は、キャパシタ114の充電時間毎に、当該充電時間と当該キャパシタ114の放電容量とを関連付けたテーブルを参照することにより、測定された充電時間に関連付けられた当該キャパシタ114の放電容量を検出することができる。   It is also possible to detect the discharge capacity of the capacitor 114 by another known method. For example, when the minimum guaranteed voltage of the capacitor 114 is determined, the capacitor discharge capacity detection unit 119 discharges the capacitor 114 to the minimum guaranteed voltage, and then fully charges the capacitor 114, and charging required for the full charge. Time may be measured. Also in this case, the capacitor discharge capacity detection unit 119 is associated with the measured charging time by referring to a table in which the charging time and the discharging capacity of the capacitor 114 are associated with each charging time of the capacitor 114. The discharge capacity of the capacitor 114 can be detected.

次に、本実施形態で適用されるストレージコントローラ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 storage controller 110 applied in this embodiment will be described with reference to the sequence chart of FIG.
First, it is assumed that the host 20 transmits a write command (hereinafter referred to as a write request) instructing to write data to the medium 100 to the storage controller 110 of the storage apparatus 10 via the host interface 21 ( Step 201). This write request includes information indicating the size (transfer size) of write data requested by the host 20 and a logical address. In the present embodiment, the host interface 21 is a serial ATA (SATA) or a serial attached SCSI (SAS) adopted in a general storage apparatus represented by an SSD or an HDD. When the host interface 21 is SATA or SAS, the host 20 transmits a write request including the transfer size to the storage controller 110 before transmitting (transferring) the write data as described above.

ストレージコントローラ110のホストインタフェースコントローラ111は、ホスト20から転送されたライト要求を受信すると、バッファコントローラ115のライト制御部117に対し、受信可能なライトデータのサイズを問い合わせる(ステップ202)。受信可能なライトデータのサイズは、データバッファ112にライト可能なライトデータのサイズ(ライト可能サイズ)を表す。   When receiving the write request transferred from the host 20, the host interface controller 111 of the storage controller 110 inquires the write control unit 117 of the buffer controller 115 about the size of receivable write data (step 202). The size of write data that can be received represents the size of write data that can be written to the data buffer 112 (writeable size).

ライト制御部117は、ホストインタフェースコントローラ111からの問い合わせに応じて、データバッファ112の空き領域のサイズを検出する(ステップ203)。ライト制御部117は、検出されたサイズを、ホスト20からのライトが許可されるデータのサイズ(ライト許可サイズ)としてホストインタフェースコントローラ111に通知する(ステップ204)。するとホストインタフェースコントローラ111は、ホスト20に対してライト許可を通知する(ステップ205)。このライト許可は、ライト許可サイズ(つまりホスト20からの転送が許されるデータのサイズ)を示す情報を含む。   The write control unit 117 detects the size of the free area of the data buffer 112 in response to the inquiry from the host interface controller 111 (step 203). The write control unit 117 notifies the detected size to the host interface controller 111 as the size of data that is permitted to be written from the host 20 (write permission size) (step 204). Then, the host interface controller 111 notifies the host 20 of write permission (step 205). This write permission includes information indicating the write permission size (that is, the size of data permitted to be transferred from the host 20).

ホスト20は、ホストインタフェースコントローラ111から通知されたライト許可を受け取ると、当該ライト許可で許可されたサイズのライトデータを、ホストインタフェース21及びホストインタフェースコントローラ111を介してデータバッファ112に送信(転送)する(ステップ206)。なお、ホストインタフェース21が本実施形態のようにSATA或いはSASの場合、ホスト20は、前記許可されたサイズのライトデータを分割して送信してもよい。   When the host 20 receives the write permission notified from the host interface controller 111, the host 20 transmits (transfers) write data of a size permitted by the write permission to the data buffer 112 via the host interface 21 and the host interface controller 111. (Step 206). When the host interface 21 is SATA or SAS as in the present embodiment, the host 20 may divide and transmit the write data of the permitted size.

データバッファ112は、ホスト20から送信されたライトデータをデータバッファ112の空き領域に格納する。データバッファ112は、ホスト20から前記許可されたサイズのライトデータを受信(格納)し終えると、ライト制御部117に対してデータ受信完了を通知する(ステップ207)。ライト制御部117は、このデータ受信完了の通知に応じて、データバッファ112で受信されたライトデータのサイズをデータサイズSIZEtotalとしてライトキャッシング判別部118に通知する(ステップ208)。本実施形態において、ステップ208で通知されるデータサイズSIZEtotalは、データバッファ112に格納されていて、且つメディア100に未だ書かれていないライトデータのサイズに一致する。   The data buffer 112 stores the write data transmitted from the host 20 in an empty area of the data buffer 112. When the data buffer 112 has received (stored) the write data of the permitted size from the host 20, the data buffer 112 notifies the write control unit 117 of the completion of data reception (step 207). In response to this data reception completion notification, the write control unit 117 notifies the write caching determination unit 118 of the size of the write data received by the data buffer 112 as the data size SIZEtotal (step 208). In this embodiment, the data size SIZEtotal notified in step 208 matches the size of the write data stored in the data buffer 112 and not yet written on the medium 100.

一方、キャパシタ放電容量検出部119は、ホスト20からのライト要求に応じたライト動作とは非同期に、キャパシタ114の放電容量を検出する。本実施形態では、キャパシタ放電容量検出部119は、予め定められたタイミングでキャパシタ114の放電容量を検出する。本実施形態では、この予め定められたタイミングは、毎日1回定時に到来する。しかし、キャパシタ放電容量検出部119がキャパシタ114の放電容量を検出するタイミングが、他のタイミングであっても構わない。キャパシタ放電容量検出部119は、キャパシタ114の放電容量を検出すると、その検出された静電容量(キャパシタ静電容量)をライトキャッシング判別部118に通知する(ステップ221)。   On the other hand, the capacitor discharge capacity detector 119 detects the discharge capacity of the capacitor 114 asynchronously with the write operation in response to the write request from the host 20. In the present embodiment, the capacitor discharge capacity detection unit 119 detects the discharge capacity of the capacitor 114 at a predetermined timing. In this embodiment, this predetermined timing arrives at a fixed time once a day. However, the timing at which the capacitor discharge capacity detector 119 detects the discharge capacity of the capacitor 114 may be another timing. When the capacitor discharge capacity detection unit 119 detects the discharge capacity of the capacitor 114, the capacitor discharge capacity detection unit 119 notifies the detected capacitance (capacitor capacitance) to the write caching determination unit 118 (step 221).

ライトキャッシング判別部118の時間算出部118aは、キャパシタ放電容量検出部119から通知されたキャパシタ114の放電容量に基づいてキャパシタ駆動可能時間TIMEdを算出する(ステップ222)。キャパシタ駆動可能時間TIMEdは、主電源が遮断された際に、キャパシタ114からの電力の供給によってライトキャッシングが可能な時間を示す。本実施形態では、時間算出部118aは、キャパシタ114の放電容量を、ライトキャッシングで消費される電流で除することにより、キャパシタ駆動可能時間TIMEdを算出する。   The time calculation unit 118a of the write caching determination unit 118 calculates the capacitor drivable time TIMEd based on the discharge capacity of the capacitor 114 notified from the capacitor discharge capacity detection unit 119 (step 222). Capacitor driveable time TIMEd indicates a time during which write caching can be performed by supplying power from the capacitor 114 when the main power supply is shut off. In the present embodiment, the time calculation unit 118a calculates the capacitor drivable time TIMEd by dividing the discharge capacity of the capacitor 114 by the current consumed by write caching.

キャパシタ駆動可能時間TIMEdは、主電源が遮断したとしても、ライトキャッシングによってデータバッファ112からメディア100にライトすることが可能なデータのサイズ、つまりライトキャッシングが可能なライトキャッシュサイズに対応する。したがって時間算出部118aがキャパシタ駆動可能時間TIMEdを算出することは、ライトキャッシュサイズを算出することと等価である。   The capacitor driveable time TIMEd corresponds to the size of data that can be written from the data buffer 112 to the medium 100 by write caching even when the main power supply is cut off, that is, the write cache size that allows write caching. Therefore, the time calculation unit 118a calculating the capacitor driveable time TIMEd is equivalent to calculating the write cache size.

さて、ライトキャッシング判別部118の時間算出部118aが最新のキャパシタ駆動可能時間TIMEdを既に算出している状態で、上述のように、ライト制御部117から当該ライトキャッシング判別部118に対して、データサイズSIZEtotalが通知されたものとする(ステップ208)。するとライトキャッシング判別部118は、通知されたデータサイズSIZEtotalのライトデータのためのライトキャッシングを、キャパシタ駆動可能時間TIMEd内に実行することが可能であるかを判別する(ステップ209)。つまりライトキャッシング判別部118は、前記データサイズSIZEtotalのライトデータを、たとえ前記主電源が遮断したとしても、キャパシタ114から供給される電力でデータバッファ112からメディア100にライトすることが可能であるかを判別する。この判別処理(以下、ライトキャッシング判別処理と称する)の具体的な手順については後述する。   Now, with the time calculation unit 118a of the write caching determination unit 118 already calculating the latest capacitor driveable time TIMEd, as described above, the write control unit 117 sends the data to the write caching determination unit 118. It is assumed that the size SIZEtotal has been notified (step 208). Then, the write caching determination unit 118 determines whether or not the write caching for the notified write data of the data size SIZEtotal can be executed within the capacitor driveable time TIMEd (step 209). That is, can the write caching discriminating unit 118 write the write data of the data size SIZEtotal from the data buffer 112 to the medium 100 with the power supplied from the capacitor 114 even if the main power supply is cut off? Is determined. A specific procedure of this determination processing (hereinafter referred to as write caching determination processing) will be described later.

もし、ライトキャッシング可であるとステップ209において判別されたならば、ライトキャッシング判別部118は、ホスト20からのライト要求に対するレスポンスとしてライト完了のレスポンスをホストインタフェースコントローラ111を介して当該ホスト20に送信する。すると、メディアコントローラ113は、データバッファ112が受信(格納)したライトデータ、つまりライト制御部117からライトキャッシング判別部118に通知されたデータサイズSIZEtotalのライトデータをメディア100にライトする。このような、ライトキャッシング可であるとステップ209において判別された場合の動作は、図2のシーケンスチャートでは省略されている。   If it is determined in step 209 that write caching is possible, the write caching determination unit 118 transmits a write completion response to the host 20 via the host interface controller 111 as a response to the write request from the host 20. To do. Then, the media controller 113 writes the write data received (stored) by the data buffer 112, that is, the write data of the data size SIZEtotal notified from the write control unit 117 to the write caching determination unit 118 to the medium 100. The operation when it is determined in step 209 that write caching is possible is omitted in the sequence chart of FIG.

本実施形態では、ライトキャッシング不可であるとステップ209において判別されたものとする。この場合、ライトキャッシング判別部118は、ホスト20からのライト要求で指定されたライトデータは全てデータバッファ112に格納されているにも拘わらず、当該ホスト20にライト完了のレスポンスを送信することを抑止する。その理由は、もし主電源が遮断したならば、前記通知されたデータサイズSIZEtotalのライトデータのためのライトキャッシングを、キャパシタ駆動可能時間TIMEd内に実行することは難しく、少なくとも一部のライトデータが喪失する可能性があるためである。   In this embodiment, it is assumed that it is determined in step 209 that write caching is not possible. In this case, the write caching determination unit 118 sends a write completion response to the host 20 even though all the write data specified by the write request from the host 20 is stored in the data buffer 112. Deter. The reason is that if the main power supply is cut off, it is difficult to execute write caching for the notified write data of the data size SIZEtotal within the capacitor driveable time TIMEd, and at least a part of the write data is stored. This is because it may be lost.

一方、ライト制御部117は、ライトキャッシング不可であるとステップ209において判別された場合、データバッファ112に格納されていて且つメディア100に未書き込みのライトデータをメディア100にライトするために、メディアコントローラ113に対してライト要求を発行する(ステップ210)。メディアコントローラ113は、ライト制御部117からのライト要求に応じ、上記未書き込みのライトデータをメディア100にライトするための第1のメディアライト動作(ステップ211)を少なくとも1回実行する。この第1のメディアライト動作(ステップ211)は次のように実行される。   On the other hand, if it is determined in step 209 that write caching is not possible, the write control unit 117 writes a write data stored in the data buffer 112 and not written in the medium 100 to the medium 100. A write request is issued to 113 (step 210). In response to a write request from the write control unit 117, the media controller 113 executes the first media write operation (step 211) for writing the unwritten write data to the medium 100 at least once. This first media write operation (step 211) is executed as follows.

まずメディアコントローラ113は、データバッファ112に対して、データ転送要求を発行する(ステップ211a)。このデータ転送要求に応じて、メディア100に固有のライト単位(メディアライト単位)のサイズSIZEunitのデータが、データバッファ112から当該メディア100に転送される。メディアライト単位は、メディア100に1回のアクセスでライト可能なデータのサイズである。つまり、メディア100へのデータライトは、このデータサイズがSIZEunitのメディアライト単位に実行される。   First, the media controller 113 issues a data transfer request to the data buffer 112 (step 211a). In response to this data transfer request, data having a size SIZE unit in a write unit (media write unit) unique to the medium 100 is transferred from the data buffer 112 to the medium 100. The media write unit is the size of data that can be written to the medium 100 by one access. That is, data write to the medium 100 is executed in units of media write whose data size is SIZE unit.

データバッファ112からメディア100に転送される、データサイズがSIZEunitのデータは、データバッファ112に格納されていて、且つ最も最近に通知されたデータサイズSIZEtotalのライトデータ(つまり、メディア100に未書き込みのライトデータ)に含まれている。メディアコントローラ113は、このデータバッファ112から転送されるライトデータをメディア100にライトする(ステップ211b)。   Data transferred from the data buffer 112 to the medium 100 and having a data size of SIZE unit is stored in the data buffer 112 and the most recently notified write data of the data size SIZEtotal (that is, unwritten to the medium 100) Write data). The media controller 113 writes the write data transferred from the data buffer 112 to the medium 100 (step 211b).

するとメディア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 (step 211c). In accordance with the response from the medium 100, the media controller 113 sets the following formula so that the data size SIZEtotal is reduced by the media write unit SIZEunit.
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 data buffer 112 at the time when the latest media write is completed and has not been written to the medium 100. The media controller 113 notifies the updated latest data size SIZEtotal to the write caching determination unit 118 (step 211d).

するとライトキャッシング判別部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 write control unit 117, the write caching determination unit 118 determines whether or not write caching is possible based on the latest data size SIZEtotal notified from the media controller 113 (step 209). . That is, the write caching determination unit 118 determines whether or not the write caching for the write data of the latest data size SIZEtotal notified from the media controller 113 can be executed within the capacitor driveable time TIMEd. If write caching is not possible, the first media write operation (step 211) described above is executed again. Thus, the first media write operation is repeated until it is determined that write caching is possible.

やがて、ライトキャッシング可であるとステップ209において判別されたものとする。そこでライトキャッシング判別部118は、ホスト20からのライト要求に対するレスポンスとしてライト完了のレスポンスをホストインタフェースコントローラ111を介して当該ホスト20に送信する(ステップ212)。すると、メディアコントローラ113は、データバッファ112に格納されていて且つメディア100に未書き込みのライトデータをメディア100にライトするための第2のメディアライト動作(ステップ213)を少なくとも1回実行する。この第2のメディアライト動作(ステップ213)は次のように実行される。   Assume that it is determined in step 209 that write caching is possible. Therefore, the write caching determination unit 118 transmits a write completion response as a response to the write request from the host 20 to the host 20 via the host interface controller 111 (step 212). Then, the media controller 113 executes at least one second media write operation (step 213) for writing the write data stored in the data buffer 112 and not written in the media 100 to the media 100. This second media write operation (step 213) is executed as follows.

まずメディアコントローラ113は、上記ステップ211aと同様に、データバッファ112に対して、データ転送要求を発行する(ステップ213a)。このデータ転送要求に応じて、サイズSIZEunitのデータが、データバッファ112からメディア100に転送される。このメディア100に転送されるデータサイズがSIZEunitのデータは、データバッファ112に格納されていて、且つメディア100に未書き込みのライトデータである。メディアコントローラ113は、このデータバッファ112から転送されるライトデータを、上記ステップ211bと同様に、メディア100にライトする(ステップ213b)。   First, the media controller 113 issues a data transfer request to the data buffer 112 as in step 211a (step 213a). In response to this data transfer request, data of size SIZE unit is transferred from the data buffer 112 to the medium 100. Data having a data size of SIZE unit transferred to the medium 100 is write data that is stored in the data buffer 112 and has not been written to the medium 100. The media controller 113 writes the write data transferred from the data buffer 112 to the medium 100 as in step 211b (step 213b).

するとメディア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 (step 213c). Thereby, one second write operation (step 213) is completed. The second write operation is repeated until all the write data that is stored in the data buffer 112 and has not been written to the medium 100 is written to the medium 100. Even if the main power supply is cut off while the second write operation is repeated, all write data stored in the data buffer 112 and not yet written to the medium 100 are written to the medium 100 at that time. It is guaranteed that you can.

やがて、データバッファ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 data buffer 112 is written to the medium 100 (step 214). Then, the medium 100 returns a response indicating the completion of writing of the data of the write unit size to the media controller 113 in the same manner as in step 213c (step 215). Upon receiving this response, the media controller 113 notifies the write control unit 117 of the completion of media writing indicating that all unwritten data in the data buffer 112 has been written to the media 100 (step 216). Thereby, the write process corresponding to the write request from the host 20 is completed.

次に上記ステップ209で実行されるライトキャッシング判別処理の典型的な手順について、図3のフローチャートを参照して説明する。
まず、ライトキャッシング判別部118は、ライト制御部117から通知されたデータサイズSIZEtotalを受け付ける(ステップ301)。データバッファ112がホスト20から転送されたライトデータを受信(格納)したことにより、1回目のライトキャッシング判別処理が実行される場合、ステップ301で受け付けられるデータサイズSIZEtotalは、当該データバッファ112で受信されたライトデータのサイズを表す。
Next, a typical procedure of the write caching determination process executed in step 209 will be described with reference to the flowchart of FIG.
First, the write caching determination unit 118 receives the data size SIZEtotal notified from the write control unit 117 (step 301). When the first write caching determination process is executed when the data buffer 112 receives (stores) the write data transferred from the host 20, the data size SIZEtotal received in step 301 is received by the data buffer 112. Represents the size of the written data.

ライトキャッシング判別部118の時間算出部118aは、データサイズSIZEtotalをメディアライト単位のデータサイズSIZEunitで除する(ステップ302)。即ち時間算出部118aは、次式
SIZEtotal ÷ SIZEunit = N + α (2)
で示される除算を実行する。ここでNは自然数である。一方、αは端数であり、ゼロまたは小数(0≦α<1)である。
The time calculation unit 118a of the write caching determination unit 118 divides the data size SIZEtotal by the data size SIZEunit in units of media write (step 302). That is, the time calculation unit 118a has the following formula:
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 time calculation unit 118a calculates the number of media writes required to write all the write data whose data size is SIZEtotal stored in the data buffer 112 and not written to the medium 100 to the medium 100. . Here, the number of media writes is N when α is zero, that is, when “SIZEtotal” is divisible by “SIZEunit”. On the other hand, when α is non-zero, that is, when N × SIZE unit <SIZEtotal <(N + 1) × SIZE unit because “SIZEtotal” cannot be divided by “SIZEunit”, the number of media writes is N + 1.

時間算出部118aは、ステップ302における除算の結果に基づいて、αが非ゼロ(α≠0)であるかを判別する(ステップ303)。もし、αが非ゼロ(α≠0)であるならば(ステップ303のYes)、つまりメディアライト回数がN+1であるならば、ライトキャッシング判別部118はステップ304に進む。   The time calculation unit 118a determines whether α is non-zero (α ≠ 0) based on the division result in step 302 (step 303). If α is non-zero (α ≠ 0) (Yes in Step 303), that is, if the number of media writes is N + 1, the write caching determination unit 118 proceeds to Step 304.

ステップ304において時間算出部118aは、メディアライト単位に満たない、サイズが「SIZEtotal - N×SIZEunit」のデータを、当該メディアライト単位のサイズに加工するのに要する時間βを算出する。ストレージ装置10では、一般に誤り訂正符号が付されたデータがメディア100にライトされる。このため、メディア100にデータをライトする際には、データサイズをメディアライト単位に揃える必要がある。   In step 304, the time calculation unit 118a calculates a time β required to process data of a size “SIZEtotal−N × SIZEunit” that is less than the media write unit into the size of the media write unit. In the storage apparatus 10, data with an error correction code is generally written to the medium 100. For this reason, when writing data to the medium 100, it is necessary to align the data size with the media write unit.

そこで、上述のようなメディアライト単位に満たないサイズのライトデータを、例えば主電源の遮断時に強制的にメディア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 step 304, the time β required to process (process) such data is calculated.

時間算出部118aは時間βを算出すると、データバッファ112に格納されていて且つメディア100に未書き込みの、データサイズがSIZEtotalのデータを全てメディア100にライトするのに要する総メディアライト時間TIMEtotalを、次式
TIMEtotal = (N + 1)×TIMEunit + β (3)
に従って算出する(ステップ305)。ここで、「TIMEunit」は、メディア100にメディアライト単位にデータをライトするのに要する時間を示す。つまり時間算出部118aは、総メディアライト時間TIMEtotalを、メディアライト回数N+1、時間TIMEunit及び時間βに基づき算出する。
When the time calculation unit 118a calculates the time β, the total media write time TIMEtotal required to write all the data having the data size SIZEtotal stored in the data buffer 112 and not written to the medium 100 to the medium 100 is calculated as follows: Next formula
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 time calculation unit 118a calculates the total media write time TIMEtotal based on the media write count N + 1, the time TIMEunit, and the time β.

一方、αが非ゼロ(α≠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 time calculation unit 118a proceeds to step 306. In step 306, the time calculation unit 118a calculates the total media write time TIMEtotal by the following formula.
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 data buffer 112 receives the write data transferred from the host 20, the data size SIZEtotal used in the first write caching determination process is executed. Represents the size of the write data received by the data buffer 112. In this case, the total media write time TIMEtotal calculated in step 305 or 306 indicates the time required to write all the write data received (stored) by the data buffer 112 to the medium 100. Further, when the n-th (n is an integer greater than 1) write-caching determination process is executed, the data size SIZEtotal used in the n-th write-caching determination process is executed n-1 times for the write operation in step 211. Immediately after, the size of the write data stored in the data buffer 112 and not yet written to the storage controller 110 is shown.

ライトキャッシング判別部118は、時間算出部118aによって前記総メディアライト時間TIMEtotalが算出されると(ステップ305または306)、当該総メディアライト時間TIMEtotalを、最新のキャパシタ駆動可能時間TIMEdと比較する(ステップ307)。このキャパシタ駆動可能時間TIMEdは、キャパシタ放電容量検出部119から通知された最新のキャパシタ114の放電容量に基づいて、上記ステップS222で算出されたものである。   When the total media write time TIMEtotal is calculated by the time calculation unit 118a (step 305 or 306), the write caching determination unit 118 compares the total media write time TIMEtotal with the latest capacitor driveable time TIMEd (step 307). The capacitor drivable time TIMEd is calculated in step S222 based on the latest discharge capacity of the capacitor 114 notified from the capacitor discharge capacity detector 119.

ライトキャッシング判別部118は、ステップ307における比較の結果に基づいて、ライトキャッシングの可否を判別する(ステップ308)。ここでは、総メディアライト時間TIMEtotalがキャパシタ駆動可能時間TIMEd以下(TIMEtotal≦TIMEd)であるならば、ライトキャッシング判別部118はライトキャッシングが可であると判別する。これに対し、総メディアライト時間TIMEtotalがキャパシタ駆動可能時間TIMEdを超えている(TIMEtotal>TIMEd)であるならば、ライトキャッシング判別部118は、少なくとも一部の未書き込みデータについて、ライトキャッシングが不可であると判別する。なお、総メディアライト時間TIMEtotalがキャパシタ駆動可能時間に等しい場合も、ライトキャッシング判別部118はライトキャッシングが不可であると判別してもよい。ステップ308で、ライトキャッシングの可否が判別されると、ライトキャッシング判別処理(ステップ209)は終了する。   The write caching determination unit 118 determines whether or not write caching is possible based on the comparison result in step 307 (step 308). Here, if the total media write time TIMEtotal is equal to or shorter than the capacitor driveable time TIMEd (TIMEtotal ≦ TIMEd), the write caching determination unit 118 determines that write caching is possible. On the other hand, if the total media write time TIMEtotal exceeds the capacitor driveable time TIMEd (TIMEtotal> TIMEd), the write caching determination unit 118 cannot perform write caching for at least some unwritten data. Determine that there is. Note that even when the total media write time TIMEtotal is equal to the capacitor driveable time, the write caching determination unit 118 may determine that write caching is not possible. When it is determined in step 308 whether write caching is possible, the write caching determination process (step 209) ends.

ライトキャッシングが可であると判別された場合、前述したように、ライトキャッシングが実行される。つまり、ライトキャッシング判別部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 caching discriminating unit 118 to the host 20 (step 212), and then a second media write operation for writing unwritten data in the data buffer 112 to the medium 100 (step 213). ) Is executed.

本実施形態で適用されるキャパシタ駆動可能時間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 capacitor 114 detected by the capacitor discharge capacity detection unit 119. The discharge capacity of the capacitor 114 when the capacitor 114 is not exhausted is larger than that when the capacitor 114 is exhausted. That is, the discharge capacity of the capacitor 114 corresponds to the degree of exhaustion of the capacitor 114. The write cache size corresponds to the capacitor driveable time TIMEd, and increases as the capacitor driveable time TIMEd increases. As described above, in this embodiment, the write cache size suitable for the exhaustion degree of the capacitor 114 can be dynamically set based on the latest discharge capacity of the capacitor 114. Therefore, according to the present embodiment, when the capacitor 114 is not exhausted, the storage controller 110 promptly sends a write completion response to the host 20 as compared with the capacitor 114 being exhausted. The write performance of the storage apparatus 10 can be improved.

上記実施形態では、ストレージ装置10に単一のホスト20が接続されている場合を前提としている。しかし、ホスト20を含む複数のホストがストレージ装置10に接続されていても構わない。   In the above embodiment, it is assumed that a single host 20 is connected to the storage apparatus 10. However, a plurality of hosts including the host 20 may be connected to the storage apparatus 10.

以上説明した少なくとも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 SYMBOLS 10 ... Storage device, 20 ... Host (host device), 100 ... Media, 110 ... Storage controller, 111 ... Host interface controller, 112 ... Data buffer, 113 ... Media controller, 114 ... Capacitor (backup power supply), 115 ... Buffer controller 117: Write control unit 118: Write caching discrimination unit 118a Time calculation unit 119 Capacitor discharge capacity detection unit

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.
前記時間算出手段は、Nを自然数であるとすると、前記通知されたサイズが、前記所定のサイズのN倍より大きく前記所定のサイズのN+1倍より小さい場合、前記残されている未書き込みデータに含まれている前記所定のサイズに満たないデータを前記所定のサイズに加工するのに必要な加工時間を算出し、前記算出された加工時間を、前記所定のサイズを単位にN+1回前記メディアにデータをライトするのに要する時間に加算することにより、前記第2の時間を算出する請求項2記載のストレージコントローラ。   The time calculating means, assuming that N is a natural number, if the notified size is larger than N times the predetermined size and smaller than N + 1 times the predetermined size, The processing time required to process the included data less than the predetermined size into the predetermined size is calculated, and the calculated processing time is calculated N + 1 times for the predetermined size on the medium. The storage controller according to claim 2, wherein the second time is calculated by adding to a time required for writing data. 前記メディアが書き換え可能な不揮発性メモリである請求項1記載のストレージコントローラ。   The storage controller according to claim 1, wherein the medium is a rewritable nonvolatile memory. 前記放電容量検出手段は、前記ライト要求に応じたライト動作とは非同期に前記放電容量を検出する請求項1記載のストレージコントローラ。   The storage controller according to claim 1, wherein the discharge capacity detection unit detects the discharge capacity asynchronously with a write operation corresponding to the write request. 書き換えが可能な不揮発性のメディアと、
ホスト装置からの要求に応じて前記メディアへのアクセスを制御する、請求項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.
JP2011199700A 2011-09-13 2011-09-13 Storage controller, storage device, and write caching method Withdrawn JP2013061791A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (5)

* Cited by examiner, † Cited by third party
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