JP2006172355A - Magnetic disk device and control method - Google Patents

Magnetic disk device and control method Download PDF

Info

Publication number
JP2006172355A
JP2006172355A JP2004367249A JP2004367249A JP2006172355A JP 2006172355 A JP2006172355 A JP 2006172355A JP 2004367249 A JP2004367249 A JP 2004367249A JP 2004367249 A JP2004367249 A JP 2004367249A JP 2006172355 A JP2006172355 A JP 2006172355A
Authority
JP
Japan
Prior art keywords
cache
data
cache memory
power supply
read
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2004367249A
Other languages
Japanese (ja)
Other versions
JP4349274B2 (en
Inventor
Hirobumi Takigami
博文 瀧上
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP2004367249A priority Critical patent/JP4349274B2/en
Publication of JP2006172355A publication Critical patent/JP2006172355A/en
Application granted granted Critical
Publication of JP4349274B2 publication Critical patent/JP4349274B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To reduce cache memory modules to be powered at a power failure by defragging a cache memory, and to suppress consumption of a battery power supply to extend its duration by gradually saving necessary data to hard disk devices in accordance with a battery capacity while quickly reconfiguring cache data in recovery from the power failure. <P>SOLUTION: The magnetic disk device provided with one or more hard disk devices, a plurality of cache memory modules to which write data from a host device and read data from the hard disk devices are registered, and a battery power supply for supplying a power at an external power failure, concentrates cache data by defragmentation of the cache memory module and/or rearrangement of the cache data, and stops power supply to the cache memory modules having no data to be backed up when driven by the battery power supply. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、磁気ディスク装置およびその制御方法に関し、特に、障害による外部電源遮断時にキャッシュメモリ内のデータ種別やバッテリ残量に合わせた制御を行うことによりキャッシュデータを保護しつつバッテリ電源の電力消費を低減させる技術に関する。   The present invention relates to a magnetic disk device and a control method thereof, and more particularly to power consumption of a battery power supply while protecting cache data by performing control according to the data type in the cache memory and the remaining battery level when external power is cut off due to a failure. It is related with the technology which reduces.

例えばディスクアレイ装置等の磁気ディスク装置はキャッシュメモリを備えており、データ書き込み時には書き込みデータを一旦キャッシュメモリに取り込んでから磁気ディスクへの書き込みを行い、データ読み出し時には読み出しデータをキャッシュメモリに保存しておき、次に同じデータへの読み出し要求を受けた場合の高速アクセスを可能としている。キャッシュメモリは揮発性であり、電源が遮断された場合には保持しているデータが消去されてしまうため、この種の装置ではバックアップ電源を備えて予期せぬ電源遮断時などにキャッシュメモリの内容を保持するようにしている。   For example, a magnetic disk device such as a disk array device has a cache memory. When writing data, the write data is once taken into the cache memory and then written to the magnetic disk. When reading data, the read data is stored in the cache memory. Next, high-speed access is possible when a read request for the same data is received next. Since the cache memory is volatile and the stored data will be erased when the power is cut off, this type of device has a backup power supply and the contents of the cache memory when the power is unexpectedly cut off. To keep.

この磁気ディスク装置の構成を図6に示す。この装置は複数のハードディスク装置100−1〜100−nをRAID方式で制御しており、HDD制御回路107と、外部商用電源(図示せず)に接続された外部電源回路120と、上位回路101と、バッテリ回路102と、電源制御回路103と、複数のキャッシュメモリ105−1〜105−nとを備えている。外部電力が供給されている通常状態において、各要素には外部電源回路120から得た電力が供給される。障害により外部電源回路120からの供給電力が途絶えると、電源制御回路103はキャッシュメモリ105−1〜105−nへの電源ラインをバッテリ回路102へと切り替え、すべてのキャッシュメモリ105の内容を保持するよう構成されている。   The configuration of this magnetic disk device is shown in FIG. This apparatus controls a plurality of hard disk devices 100-1 to 100-n by a RAID system, and includes an HDD control circuit 107, an external power supply circuit 120 connected to an external commercial power supply (not shown), and an upper circuit 101. A battery circuit 102, a power supply control circuit 103, and a plurality of cache memories 105-1 to 105-n. In a normal state in which external power is supplied, power obtained from the external power supply circuit 120 is supplied to each element. When the power supplied from the external power supply circuit 120 is interrupted due to a failure, the power supply control circuit 103 switches the power supply line to the cache memories 105-1 to 105-n to the battery circuit 102 and holds the contents of all the cache memories 105. It is configured as follows.

このため、キャッシュメモリの数が多いとバッテリ回路102の消耗が早く、長時間のキャッシュデータの保持が難しいという問題があった。換言すれば、多数のキャッシュメモリの内容を長時間保持しようとするとバッテリ回路102を大容量化する必要があった。   Therefore, when the number of cache memories is large, there is a problem that the battery circuit 102 is consumed quickly and it is difficult to hold cache data for a long time. In other words, it is necessary to increase the capacity of the battery circuit 102 in order to hold the contents of a large number of cache memories for a long time.

また、停電時にバッテリ電源を用いてキャッシュメモリの内容をハードディスク装置に書き込み、その内容を後で復旧できるようにした装置がある(例えば、特許文献1)。この種のディスクアレイ装置の構成を図7に示す。本図に示すように、この装置ではハードディスク装置200−1〜200−nも電源制御回路203に接続されており、障害により外部電源回路220からの電力供給が途絶えたときにキャッシュメモリ内のデータをハードディスク装置200−1〜200−nに書き込む。しかしながら、RAID方式でハードディスク装置200−1〜200−nにキャッシュメモリ205−1〜205−n内のデータを書き込む構成では、すべてのハードディスク装置200−1〜200−nを駆動する必要があるためバッテリ電力の消費が激しくなるという問題がある。また、外部電源からの電力供給が再開されたときにハードディスク装置200−1〜200−nから必要なデータを読み出してキャッシュメモリの状態を停電前と同じ状態に戻す必要があるため、停電時間が短くてもキャッシュメモリの内容の復旧に時間がかかってしまうという問題もある。   In addition, there is an apparatus in which the contents of a cache memory are written into a hard disk device using a battery power source in the event of a power failure so that the contents can be restored later (for example, Patent Document 1). The configuration of this type of disk array device is shown in FIG. As shown in the figure, in this device, the hard disk devices 200-1 to 200-n are also connected to the power supply control circuit 203, and the data in the cache memory when the power supply from the external power supply circuit 220 is interrupted due to a failure. Are written to the hard disk devices 200-1 to 200-n. However, in the configuration in which data in the cache memories 205-1 to 205-n is written to the hard disk devices 200-1 to 200-n by the RAID method, it is necessary to drive all the hard disk devices 200-1 to 200-n. There is a problem that battery power consumption becomes intense. Further, when the power supply from the external power supply is resumed, it is necessary to read out necessary data from the hard disk devices 200-1 to 200-n and return the cache memory to the same state as before the power failure. There is also a problem that it takes time to restore the contents of the cache memory even if it is short.

また、この特許文献1の実施例では、ライトキャッシュとリードキャッシュで書き込むメモリモジュールを分けており、停電時にはライトキャッシュデータを書き込むモジュールのみをバックアップ対象として通電する一方、リードキャッシュデータのメモリモジュールへの電源供給を遮断し、バッテリ電源の電力消費を抑えることが開示されている。また、別の文献では、停電時にキャッシュメモリのデータをバックアップディスクへ書き込み待避する際、一部のハードディスクのみを使用するようにして、非バックアップディスクの電力供給を停止させることで補助電源の電力消費を抑える提案がなされている(例えば、特許文献2)。   In the embodiment of Patent Document 1, the write cache and the read cache are divided into memory modules. In the event of a power failure, only the write cache data write module is energized as a backup target, while the read cache data is transferred to the memory module. It is disclosed that the power supply is cut off to reduce the power consumption of the battery power supply. In another document, when saving the cache memory data to the backup disk in the event of a power failure, only some hard disks are used, and the power supply of the non-backup disk is stopped to stop the power consumption of the auxiliary power supply. The proposal which suppresses is made | formed (for example, patent document 2).

特開2004−78963号公報JP 2004-78963 A 特開平11−327811号公報Japanese Patent Laid-Open No. 11-327811

上記特許文献1のように、停電時にバックアップ対象データの存在するメモリモジュールだけにバックアップ電力を供給することでバックアップ電源の消耗を抑えることができる。しかしながら、バックアップの必要なデータの量は少ないが、そのデータがフラグメント化されて複数のキャッシュメモリモジュールに点在しているような場合は、これら総てのキャッシュメモリにバックアップ電力を供給する必要があり、バックアップ電源の消耗が抑えられないという問題がある。   As described in Patent Document 1, it is possible to suppress the consumption of the backup power source by supplying the backup power only to the memory module in which the backup target data exists at the time of a power failure. However, if the amount of data that needs to be backed up is small but the data is fragmented and scattered across multiple cache memory modules, it is necessary to supply backup power to all of these cache memories. There is a problem that the consumption of the backup power source cannot be suppressed.

また、外部電源からの電力が停止したときにリードキャッシュが破棄されてしまうため、例えば停電が短時間で復旧した場合にもリードキャッシュがない状態となりその後の読み出し動作に時間がかかるという不都合も生ずる。   In addition, since the read cache is discarded when the power from the external power supply is stopped, for example, even when a power failure is restored in a short time, there is no inconvenience that there is no read cache, and the subsequent read operation takes time. .

本発明は、キャッシュメモリへのアクセスがないときには常にデフラグメントを実行して保持すべきキャッシュメモリを少なくするとともに、バッテリ容量に応じてハードディスク装置へ必要なデータを待避させることにより、バッテリ電源の消耗を抑えて保持期間を延伸させるとともに停電復旧時のキャッシュメモリ再構成を迅速に行えるようにした磁気ディスク装置を提供することを目的とする。   The present invention reduces the amount of cache memory to be retained by executing defragmentation whenever there is no access to the cache memory, and saving necessary data to the hard disk device according to the battery capacity, thereby depleting battery power. An object of the present invention is to provide a magnetic disk device that extends the retention period while suppressing the occurrence of a failure and that can quickly perform cache memory reconfiguration when the power failure is restored.

本発明は、1以上のハードディスクと、上位装置からの書き込みデータおよび前記ハードディスク装置からの読み出しデータが登録される複数のキャッシュメモリモジュールと、外部電源の障害時に代わって電力を供給するバッテリ電源とを備える磁気ディスク装置の制御方法において、前記キャッシュメモリモジュールのデフラグおよび/または並べ替えを行ってキャッシュデータを集中化し、前記バッテリ電源での駆動時にバックアップ対象データのないキャッシュメモリモジュールへの電力供給を停止することを最も主要な特徴とする。   The present invention includes at least one hard disk, a plurality of cache memory modules in which write data from a host device and read data from the hard disk device are registered, and a battery power source that supplies power in the event of an external power failure. In the method of controlling a magnetic disk device provided, the cache memory modules are defragmented and / or rearranged to centralize cache data, and power supply to the cache memory modules without backup target data is stopped when driven by the battery power supply Doing is the main feature.

前記キャッシュメモリモジュールのデフラグおよび/または並べ替えは、前記キャッシュメモリモジュールへのアクセスがないときに実行されることが有効である。   It is effective that the defragmentation and / or rearrangement of the cache memory module is executed when there is no access to the cache memory module.

実施例において、前記バッテリ電源での駆動時にその残量が所定の第1の値以下となった場合に、前記キャッシュメモリモジュールから読み出しキャッシュデータを古い方から削除するステップを含むことが有効である。   In an embodiment, it is effective to include a step of deleting cache data read out from the cache memory module from the oldest when the remaining amount becomes equal to or less than a predetermined first value when driven by the battery power source. .

また、前記バッテリ電源での駆動時にその残量が所定の第2の値以下となった場合に、前記キャッシュメモリモジュールから、読み出しキャッシュデータに加え読み出しキャッシュ制御情報を削除するステップを含むことが有効である。   Further, it is effective to include a step of deleting read cache control information in addition to read cache data from the cache memory module when the remaining amount becomes equal to or less than a predetermined second value when driven by the battery power source. It is.

この場合、前記読み出しキャッシュ制御情報を削除するステップは、前記ハードディスクの1つに電力を供給して前記読み出しキャッシュ制御情報を書き込んでから前記キャッシュメモリモジュールから削除することが有効である。   In this case, in the step of deleting the read cache control information, it is effective to supply power to one of the hard disks to write the read cache control information and then delete it from the cache memory module.

また、前記バッテリ電源での駆動時にその残量が所定の第3の値以下となった場合に、書き込みキャッシュデータおよび書き込みキャッシュ制御情報を前記ハードディスクに書き込むことが有効である。   Further, it is effective to write the write cache data and the write cache control information to the hard disk when the remaining amount becomes equal to or less than a predetermined third value when driven by the battery power source.

複数のキャッシュメモリモジュールを備える環境において、デフラグおよび並べ替えにより使用するキャッシュメモリモジュールの数を可能な限り減らすことにより、停電時にデータを保持させるためにバッテリ電源を投入すべきモジュールの数を減らすことができる。不要なモジュールへの電力供給を停止させることにより、停電時にバッテリ電源の消耗を可能な限り減らして電源バックアップ期間を長期化することができる。このデフラグおよび並べ替えは、キャッシュメモリへのアクセスがないときは常に行うようにすると、不意の停電にもデフラグの時間をかけることなく迅速に電力節約を図ることができる。   In an environment with multiple cache memory modules, reduce the number of cache memory modules used by defragmentation and rearrangement as much as possible, thereby reducing the number of modules that should be powered on to retain data during a power outage Can do. By stopping power supply to unnecessary modules, it is possible to reduce battery power consumption as much as possible in the event of a power outage and extend the power backup period. If this defragmentation and rearrangement are always performed when there is no access to the cache memory, it is possible to save power quickly without defragmentation time even if a sudden power failure occurs.

また、読み出しキャッシュデータは消去されても装置動作に問題は生じないため、外部電力の停止が継続する場合にはこれを削除してキャッシュメモリモジュールの電源を切るようにすると、バッテリ電源の消耗をさらに抑えることができる。なお、この場合に読み出しキャッシュ制御情報をハードディスク装置に待避させておけば、ハードディスクから読み出しキャッシュデータが復旧可能となり、外部電力復旧時にキャッシュデータを復旧させることができる。   In addition, even if the read cache data is erased, there is no problem with the operation of the device. Therefore, if the external power supply continues to be stopped, deleting it and turning off the cache memory module will consume battery power. It can be further suppressed. In this case, if the read cache control information is saved in the hard disk device, the read cache data can be restored from the hard disk, and the cache data can be restored when the external power is restored.

さらに外部電力の停止が継続した場合、書き込みキャッシュデータおよび書き込みキャッシュ制御情報を前記ハードディスクに待避させるようにすれば、復旧後に支障が生じるのを確実に回避することができる。   Further, when the external power is continuously stopped, if the write cache data and the write cache control information are saved in the hard disk, it is possible to reliably avoid a trouble after the recovery.

本発明を実施するための最良の実施形態について、図面を参照しながら以下に詳細に説明する。   The best mode for carrying out the present invention will be described in detail below with reference to the drawings.

図1は、本発明に係る磁気ディスク装置の構成を示すブロック図である。図1に示すように、磁気ディスク装置は複数のハードディスク装置10−1、10−2・・・10−nをRAID方式で制御しており、HDD制御回路7と、外部商用電源に接続された外部電源回路20と、上位回路1と、バッテリ回路2と、電源制御回路3と、複数のキャッシュメモリモジュール5−1〜5−nと、これらキャッシュメモリモジュール5および第1のハードディスク装置10−1への電力供給やキャッシュデータの待避を制御する制御部4とを備え、上位装置21に接続されている。   FIG. 1 is a block diagram showing the configuration of a magnetic disk apparatus according to the present invention. As shown in FIG. 1, the magnetic disk device controls a plurality of hard disk devices 10-1, 10-2... 10-n by a RAID system, and is connected to an HDD control circuit 7 and an external commercial power source. The external power supply circuit 20, the upper circuit 1, the battery circuit 2, the power supply control circuit 3, the plurality of cache memory modules 5-1 to 5-n, the cache memory module 5 and the first hard disk device 10-1 And a control unit 4 that controls the supply of power to and the saving of cache data, and is connected to the host device 21.

上位回路1は上位装置21との通信を行い、上位装置21から送られてくる書き込みデータを制御回路4に送付し、また制御回路4から読み出しデータを受け取って上位装置21に送出する。また外部電源回路20からの電力を、電源制御回路3および2番目以降のハードディスク装置10−2〜10−nに供給する。この上位回路1は通常動作時には外部電源回路20からの電力で動作するが、外部電源回路20からの電力供給が停止した場合は電源制御回路3を介して供給されるバッテリ電源2によって内部の必要な一部の回路のみが動作し、上位装置21に外部電源が切断された旨を連絡する。   The host circuit 1 communicates with the host device 21, sends write data sent from the host device 21 to the control circuit 4, receives read data from the control circuit 4, and sends it to the host device 21. The power from the external power supply circuit 20 is supplied to the power supply control circuit 3 and the second and subsequent hard disk devices 10-2 to 10-n. The upper circuit 1 operates with power from the external power supply circuit 20 during normal operation. However, when power supply from the external power supply circuit 20 is stopped, the internal circuit 1 is required by the battery power supply 2 supplied via the power control circuit 3. Only some of the circuits operate, and the host device 21 is notified that the external power supply has been disconnected.

バッテリ回路2は蓄電池などで構成されており、通常動作時には外部電源により充電され、停電時には電源制御回路3を経由して必要な要素に電力を供給する。電源制御回路3は、上位回路1からの外部電力とバッテリ回路2からのバッテリ電力との切替を行い、バッテリ回路2の充電状態を管理するとともに放電時のバッテリ残量を検出して、制御回路4や上位回路1に通知する回路である。通常動作時には、上位回路1を経由した外部電源回路20からの供給電力を、制御回路4、各キャッシュメモリモジュール5−1〜5−n、HDD制御回路7、1番目のハードディスク装置10−1などに供給し、バッテリ回路2を充電する。外部電源回路20からの供給電力が閾値以下となると制御部4に通知し、制御部4の指令により電源供給元をバッテリ回路2に切り替えて上記要素にバッテリ電力を供給する。   The battery circuit 2 is composed of a storage battery or the like, and is charged by an external power source during normal operation, and supplies power to necessary elements via the power control circuit 3 during a power failure. The power supply control circuit 3 switches between external power from the upper circuit 1 and battery power from the battery circuit 2, manages the charge state of the battery circuit 2 and detects the remaining battery level at the time of discharge. 4 and a circuit that notifies the upper circuit 1. During normal operation, power supplied from the external power supply circuit 20 via the upper circuit 1 is supplied to the control circuit 4, the cache memory modules 5-1 to 5-n, the HDD control circuit 7, the first hard disk device 10-1, and the like. To charge the battery circuit 2. When the supply power from the external power supply circuit 20 becomes equal to or less than the threshold, the control unit 4 is notified, and the power supply source is switched to the battery circuit 2 according to a command from the control unit 4 to supply battery power to the above elements.

ハードディスク装置10−1〜10−nは、HDD制御回路7によりRAID制御される磁気ディスクドライブであり、通常動作時には通常のディスクアレイ動作を行ってデータの読み書きを実行する。上述のように、ハードディスク装置10のうち2番目以降のハードディスク装置10−2〜10−nは上位回路1からの外部供給電力で駆動され、外部電源の障害時には電力供給が絶たれ動作を停止する。これに対し、1番目のハードディスク装置10−1は電源制御回路3から電力を受けており、停電時にもバッテリ回路2の電力で動作し得るよう構成されている。このハードディスク装置10−1にはキャッシュデータ待避領域8が確保されており、必要に応じて停電時にこのハードディスク装置10−1を起動してこの領域8に必要なキャッシュデータを書き込むことができる。   The hard disk devices 10-1 to 10-n are magnetic disk drives that are RAID-controlled by the HDD control circuit 7, and perform normal disk array operations and read / write data during normal operation. As described above, the second and subsequent hard disk devices 10-2 to 10-n among the hard disk devices 10 are driven by the externally supplied power from the upper circuit 1, and the power supply is cut off and the operation is stopped when the external power supply fails. . On the other hand, the first hard disk device 10-1 receives power from the power supply control circuit 3, and is configured to operate with the power of the battery circuit 2 even in the event of a power failure. A cache data saving area 8 is secured in the hard disk device 10-1, and the hard disk device 10-1 can be activated at the time of a power failure and necessary cache data can be written in the hard disk device 10-1.

キャッシュメモリモジュール5−1〜5−nは揮発性のメモリ回路であり、制御部4の制御下で、上位回路1から送られる書き込みキャッシュデータや書き込みキャッシュ制御情報、HDD制御回路7からの読み出しキャッシュデータや読み出しキャッシュ制御情報を保持する。ここで、書き込みキャッシュ制御情報とはキャッシングしている書き込みアドレスなどの制御情報であり、読み出しキャッシュ制御情報とは先読みキャッシュする予定のアドレスや現在キャッシングしているアドレスなどの制御情報などである。これらのキャッシュメモリモジュール5−1〜5−nは、それぞれ個別に電源制御回路3から電力供給を受けており、個別に電源オン/オフの制御が可能である。電源制御回路3は、外部電源の障害時にバッテリ回路2の電力をキャッシュメモリ5に供給する。   The cache memory modules 5-1 to 5 -n are volatile memory circuits, and write cache data and write cache control information sent from the upper circuit 1 and read cache from the HDD control circuit 7 under the control of the control unit 4. Holds data and read cache control information. Here, the write cache control information is control information such as a cached write address, and the read cache control information is control information such as an address scheduled to be prefetched and an address currently cached. These cache memory modules 5-1 to 5-n are individually supplied with power from the power supply control circuit 3, and can be individually controlled to be turned on / off. The power supply control circuit 3 supplies the power of the battery circuit 2 to the cache memory 5 when the external power supply fails.

制御回路4は、キャッシュメモリ5およびハードディスク装置10の動作を管理し、外部電源の障害時に電源制御回路3を制御して必要な要素への電力供給元をバッテリ回路2に切り替える。この制御回路4は電源制御回路3を介して外部電源回路20からの電力供給状況を監視しており、外部電源回路20が停止したときにはバッテリ回路2からの供給電力に切り替えるよう電源制御回路3へ指示を出し、以降にバッテリ回路2の状況や残量を監視する。また、外部電力が供給されている通常動作時は、キャッシュメモリ5の状態を監視し、キャッシュメモリ5のデフラグ、データ書き込み、読み出し、並べ替えを行い、またHDD制御部7に対し書き込み/読み出しデータの送受信を行う。外部電源回路20からの電力供給が停止すると、バッテリ回路2の残量に応じてバッテリ電力の供給先を決定し、キャッシュメモリ5のデフラグ、データ書き込み、読み出し、並べ替えを行い、必要に応じてハードディスク装置10−1にキャッシュデータを書き込み、また外部電源回路20の復旧時にキャッシュデータの復旧を行う。   The control circuit 4 manages the operation of the cache memory 5 and the hard disk device 10, and controls the power supply control circuit 3 when the external power supply fails, and switches the power supply source to the necessary elements to the battery circuit 2. The control circuit 4 monitors the power supply status from the external power supply circuit 20 via the power supply control circuit 3, and when the external power supply circuit 20 stops, the control circuit 4 switches to the power supply control circuit 3 to switch to the power supplied from the battery circuit 2. An instruction is issued, and the status and remaining amount of the battery circuit 2 are monitored thereafter. Further, during normal operation when external power is supplied, the state of the cache memory 5 is monitored, the cache memory 5 is defragmented, data is written, read, and rearranged, and the HDD controller 7 is read / written. Send and receive. When the power supply from the external power supply circuit 20 is stopped, the battery power supply destination is determined according to the remaining amount of the battery circuit 2, the cache memory 5 is defragmented, data is written, read, and rearranged. The cache data is written into the hard disk device 10-1, and the cache data is restored when the external power supply circuit 20 is restored.

制御回路4の機能を具体的に説明する。通常動作時は、制御回路4は上位回路1から送られる書き込みデータを書き込みキャッシュデータとしてキャッシュメモリモジュール5−1〜5−nへ書き込み、必要な段階でキャッシュメモリ5から書き込みキャッシュデータを読み出してHDD制御回路7に送出し、当該書き込みキャッシュデータをキャッシュメモリ上から削除する。また上位装置21からのデータ読み出し命令に応じて、HDD制御回路7を介してハードディスク10−1〜10−nからデータを読み出し、読み出しキャッシュデータとしてキャッシュメモリ5−1〜5−nへ書き込み、必要な段階でこれらの読み出しキャッシュデータをキャッシュメモリ5から読み出して上位回路1に送出する。この動作は従来の書き込み/読み出し動作と同様であり、詳細な説明は省略するが、例えば読み出し命令を受けたときに該当するデータが既にキャッシュメモリ5にあればハードディスク装置10から読み出すことなく当該キャッシュデータを上位回路1へ送出し、またハードディスク装置10に書き込まれていない書き込みキャッシュデータのアドレスへ更なる書き込み命令を受けたときには該当する書き込みキャッシュデータを更新するようにしてデータアクセスの高速性を実現する。   The function of the control circuit 4 will be specifically described. During normal operation, the control circuit 4 writes the write data sent from the upper circuit 1 as write cache data to the cache memory modules 5-1 to 5 -n, and reads the write cache data from the cache memory 5 when necessary to read out the HDD. The data is sent to the control circuit 7 and the write cache data is deleted from the cache memory. Also, in response to a data read command from the host device 21, data is read from the hard disks 10-1 to 10-n via the HDD control circuit 7, and written to the cache memories 5-1 to 5-n as read cache data. At this stage, the read cache data is read from the cache memory 5 and sent to the upper circuit 1. This operation is the same as the conventional write / read operation, and detailed description is omitted. For example, if the corresponding data is already in the cache memory 5 when the read command is received, the cache is not read from the hard disk device 10. Data is sent to the upper circuit 1, and when a further write command is received at the address of the write cache data that has not been written to the hard disk device 10, the corresponding write cache data is updated to realize high-speed data access. To do.

本発明において、制御回路4は常時キャッシュメモリ5におけるキャッシュデータの配置を監視し、キャッシュメモリ5へのアクセスがないとき、キャッシュデータのデフラグおよび並べ替えを行い、使用しているメモリ領域の集中化を図っている。このデフラグおよび並べ替えは、キャッシュメモリ5のアドレスの前の方から、(1)書き込みキャッシュ制御情報、(2)書き込みキャッシュデータ、(3)読み出しキャッシュ制御情報、(4)読み出しキャッシュデータの順に配置され、さらに読み出しキャッシュデータについては新しくキャッシングされたものから古いものへと順に配置される。本実施例では、外部電源回路20が停止した場合にもバッテリ電源2の電力を用いてこのデフラグおよび並べ替えが行われる。デフラグメント処理によりキャッシュ領域内でアドレスの前の方にキャッシュデータが集中化され、キャッシュ領域の後半部分に空き領域が生じることになる。   In the present invention, the control circuit 4 constantly monitors the arrangement of the cache data in the cache memory 5 and performs defragmentation and rearrangement of the cache data when there is no access to the cache memory 5, thereby concentrating the memory area used. I am trying. The defragmentation and rearrangement are arranged in the order of (1) write cache control information, (2) write cache data, (3) read cache control information, and (4) read cache data from the front of the cache memory 5 address. Further, the read cache data is arranged in order from the newly cached data to the old data. In this embodiment, even when the external power supply circuit 20 is stopped, the defragmentation and rearrangement are performed using the power of the battery power supply 2. Due to the defragment processing, the cache data is concentrated in front of the address in the cache area, and an empty area is generated in the latter half of the cache area.

外部電源回路20からの電力供給が停止した場合、制御回路4はキャッシュデータ保持のためキャッシュメモリ5にバッテリ電力を供給させるが、第1の段階として、キャッシュメモリ5を参照し電力供給不要なキャッシュメモリモジュールがあれば当該モジュールへの電力供給を停止するよう電源制御回路3に通知する。上記のように複数のキャッシュメモリモジュール5−1〜5−nを備える環境において、デフラグおよび並べ替えによりアドレスの前の方にデータが集中し後側に空きがある場合、データのないアドレス後側部分のメモリモジュールは通電させる必要がなく、このようなメモリモジュールへの電力供給を停止することでバッテリ回路2の消耗を軽減させ、停電時のデータ保持期間を延伸することができる。   When the power supply from the external power supply circuit 20 is stopped, the control circuit 4 supplies the battery power to the cache memory 5 in order to retain the cache data. If there is a memory module, the power supply control circuit 3 is notified to stop the power supply to the module. In an environment including a plurality of cache memory modules 5-1 to 5-n as described above, when data is concentrated on the front side of the address due to defragmentation and rearrangement and there is a space on the back side, the back side of the address without data It is not necessary to energize some memory modules, and by stopping the power supply to such memory modules, it is possible to reduce the consumption of the battery circuit 2 and extend the data retention period at the time of a power failure.

この第1段階の途中で外部電力が復旧すれば電源制御回路3から制御回路4へ通知され、制御部4は上位回路1を介して外部電源回路20からの電力を使用するよう電源制御回路3に指示を出す。これにより装置は停電前と何ら変わらない状態で通常動作を継続することができる。   If the external power is restored during the first stage, the power supply control circuit 3 notifies the control circuit 4 that the power supply control circuit 3 uses the power from the external power supply circuit 20 via the host circuit 1. Give instructions. This allows the device to continue normal operation with no change from before the power failure.

停電が続き、バッテリ回路2のバッテリ残量がある閾値より少なくなった場合、制御回路4は第2の段階として、キャッシュメモリ5上の読み出しキャッシュデータを古いものから削除し、不要となったキャッシュメモリモジュールがあれば電力供給を停止するよう指示を出す。上述のように、デフラグ及び並べ替えによりキャッシュメモリモジュール5−1〜5−nにおいてアドレスの後側に古い読み出しキャッシュデータが配置されるため、制御手段4が読み出しキャッシュ制御情報を参照して古い読み出しキャッシュデータを削除すると、キャッシュメモリ5の後側がさらに空くことになる。これによりキャッシュメモリ5においてこのキャッシュデータが書き込まれていたキャッシュメモリモジュールへの通電が不要となるため、この電力を遮断することによりバッテリ回路2の消耗を軽減することができる。なお、古い読み出しキャッシュデータの削除は、キャッシュメモリ5への書き込みから所定期間経たものをすべて削除するようにしてもよいし、例えば前記閾値からバッテリ残量が5%減るごとにキャッシュメモリ容量の10%分を削除するというように、段階的に行うようにしてもよい。また、古い読み出しキャッシュデータを電気的に削除してからこれが格納されていたキャッシュメモリモジュールの電源を切るのではなく、制御部4が読み出しキャッシュ制御情報を参照して、古い読み出しキャッシュデータが登録されているキャッシュメモリモジュールの電源をそのまま切るよう指示を出してもよい。電源を切ると当該キャッシュメモリモジュールが保持している読み出しキャッシュデータは消去されるため、当該キャッシュデータを削除してからキャッシュメモリモジュールの電源を切断するのと同じ結果となる。この場合の制御もバッテリ残量に応じて段階的にキャッシュメモリモジュールの電源を1つずつ切るようにしてもよい。   When the power failure continues and the remaining battery level of the battery circuit 2 becomes less than a certain threshold value, the control circuit 4 deletes the read cache data on the cache memory 5 from the old one as a second stage, and the cache becomes unnecessary If there is a memory module, issue an instruction to stop the power supply. As described above, since the old read cache data is arranged behind the address in the cache memory modules 5-1 to 5-n by defragmentation and rearrangement, the control unit 4 refers to the read cache control information to read the old read data. When the cache data is deleted, the rear side of the cache memory 5 is further vacated. This eliminates the need to energize the cache memory module in which the cache data has been written in the cache memory 5, so that the consumption of the battery circuit 2 can be reduced by cutting off the power. The old read cache data may be deleted after a predetermined period from writing to the cache memory 5, for example, every time the remaining battery level decreases by 5% from the threshold, the cache memory capacity of 10 is deleted. You may make it carry out in steps, such as deleting% part. Also, the old read cache data is registered by referring to the read cache control information instead of turning off the power of the cache memory module in which the old read cache data is stored after being electrically deleted. An instruction may be issued to turn off the power of the cache memory module. When the power is turned off, the read cache data held by the cache memory module is erased. Therefore, the result is the same as when the cache memory module is turned off after the cache data is deleted. In this case, the cache memory module may be turned off step by step in accordance with the remaining battery level.

この第2段階の途中で外部電力が復旧した場合、制御部4は読み出しキャッシュ制御情報を参照し、削除された読み出しキャッシュデータの復旧を指示する。すなわち、読み出しキャッシュ制御情報にはキャッシングしていた読み出しデータのアドレス等が登録されているため、これに基づき該当データをハードディスク装置10から読み出してキャッシュメモリ5に再び格納する。これによりキャッシュメモリ5の登録内容を停電前の状態に復旧することができる。   When the external power is recovered during the second stage, the control unit 4 refers to the read cache control information and instructs the recovery of the deleted read cache data. That is, since the address of the read data that has been cached is registered in the read cache control information, the corresponding data is read from the hard disk device 10 based on this and stored again in the cache memory 5. Thereby, the registered contents of the cache memory 5 can be restored to the state before the power failure.

さらに電源障害が続いてバッテリ残量が少なくなった場合、制御部4は第3段階として、読み出しキャッシュデータのすべてを削除し、不要となったキャッシュメモリモジュールの電源を切るよう電源制御回路3に指示を出す。これにより通電させるキャッシュメモリモジュールが減りバッテリ電源の消耗が抑えられる。なお、この処理は上記第2段階の行程を継続した結果のものであってもよいし、第2段階の処理とは別個に、バッテリ残量がある閾値以下となったら優先的に割り込み実行するようにしてもよい。   Further, when the power failure continues and the remaining battery level becomes low, the control unit 4 deletes all of the read cache data and turns off the power of the cache memory module that is no longer needed as a third step. Give instructions. This reduces the number of cache memory modules to be energized and suppresses battery power consumption. Note that this process may be a result of continuing the above-described second-stage process, or, separately from the second-stage process, when the remaining battery level falls below a certain threshold value, the interrupt is preferentially executed. You may do it.

さらに電源障害が続いてバッテリ残量が少なくなった場合、制御部4は第4段階として、読み出しキャッシュ制御情報をハードディスクに待避させてからキャッシュメモリ5から削除し、不要となったキャッシュメモリモジュールの通電を停止するよう電源制御回路3に指示する。すなわち、制御部4はHDD制御回路7および1番目のハードディスク装置10−1に電力を供給させて起動し、キャッシュメモリ5から読み出しキャッシュ制御情報を読み出して、ハードディスク装置10−1のキャッシュデータ待避領域8に書き込むようHDD制御部7に送出し、書き込み終了後にハードディスク装置10−1、HDD制御部7、および他に必要なデータが格納されていなければ読み出しキャッシュ制御情報が格納されていたキャッシュメモリモジュールへの電源供給を停止させる。なお、この場合は後に復旧できるように読み出しキャッシュ制御情報を待避させた旨を記憶しておく。   Further, when the remaining battery level is low due to power failure, the control unit 4 saves the read cache control information from the hard disk 5 after saving the read cache control information to the hard disk as a fourth step, and deletes the cache memory module that is no longer needed. The power supply control circuit 3 is instructed to stop energization. That is, the control unit 4 is activated by supplying power to the HDD control circuit 7 and the first hard disk device 10-1, reads the read cache control information from the cache memory 5, and stores the cache data saving area of the hard disk device 10-1. 8 is sent to the HDD control unit 7 to write data to the hard disk device 10-1, the HDD control unit 7, and the cache memory module in which read cache control information is stored if necessary data is not stored. Stop power supply to. In this case, the fact that the read cache control information has been saved is stored so that it can be recovered later.

この第4段階の途中で外部電源が復旧した場合、制御部4はハードディスク装置10−1に待避させた読み出しキャッシュ制御情報を読み出してキャッシュメモリ上に登録し、さらにこの読み出しキャッシュ制御情報に基づいて読み出しキャッシュデータをハードディスク装置10−1〜10−5から読み出し、キャッシュメモリ上に復元する。これにより停電前と同じ状態を復元することができる。   When the external power supply is restored during the fourth stage, the control unit 4 reads the read cache control information saved in the hard disk device 10-1 and registers it in the cache memory, and further, based on the read cache control information. Read cache data is read from the hard disk devices 10-1 to 10-5 and restored on the cache memory. As a result, the same state as before the power failure can be restored.

なお、他の実施例では読み出しキャッシュ制御情報をハードディスク装置10−1に待避させずにキャッシュメモリ上から削除するようにしてもよい。実際、読み出しキャッシュデータはデータ読み出し処理を高速化させるためのものであり、なければないでハードディスクから読み出せばよいため、復旧できなくてもシステムエラー等が生じるものではない。読み出しキャッシュ制御情報をそのまま削除する構成とすると、ハードディスク装置に待避させるための電力が不要となり、バッテリ電源の消耗を抑えることができる。   In another embodiment, the read cache control information may be deleted from the cache memory without saving the hard disk device 10-1. Actually, the read cache data is for accelerating the data read process, and since it only has to be read from the hard disk, a system error or the like does not occur even if it cannot be recovered. If the configuration is such that the read cache control information is deleted as it is, no power is required to save the hard disk device, and consumption of battery power can be suppressed.

さらに電源障害が続いてバッテリ残量が少なくなった場合、制御部4は第5段階として、キャッシュメモリ上の書き込みキャッシュデータおよび書き込みキャッシュ制御情報をハードディスク装置10−1に待避させ、その旨を記憶する。すなわち、HDD制御回路7およびハードディスク装置10−1に電力を供給させて起動し、キャッシュメモリ5から書き込みキャッシュデータおよび書き込みキャッシュ制御情報を読み出し、ハードディスク装置10−1のキャッシュデータ待避領域8に書き込むようHDD制御部7に送出し、書き込み終了後にハードディスク装置10−1、HDD制御部7への電源供給を停止させる。上記の読み出しキャッシュデータとは異なり、書き込みキャッシュデータおよび制御情報はデータ書き込み途中のキャッシュデータであり消去されると不整合が生じるため、これらについてはすべてハードディスクに待避させるようにしている。この場合にもハードディスク装置10−1のみを駆動してキャッシュデータ待避領域8に待避させるようにしているため、すべてのハードディスク装置10−1〜10−nを起動して書き込むより消費電力が少なくてすむ。したがって、バッテリ電源によるバックアップ時間を延伸してデータ保持性能を向上させることができる。   Further, when the remaining battery level is low due to a power failure, the control unit 4 saves the write cache data and the write cache control information in the cache memory in the hard disk device 10-1 as the fifth stage, and stores that fact. To do. That is, the HDD control circuit 7 and the hard disk device 10-1 are activated by supplying power, and the write cache data and the write cache control information are read from the cache memory 5 and written to the cache data saving area 8 of the hard disk device 10-1. The data is sent to the HDD control unit 7, and the power supply to the hard disk device 10-1 and the HDD control unit 7 is stopped after the writing is completed. Unlike the read cache data described above, the write cache data and the control information are cache data in the middle of data writing and are inconsistent when erased. Therefore, all of them are saved in the hard disk. Also in this case, since only the hard disk device 10-1 is driven and saved in the cache data saving area 8, less power is consumed than when all the hard disk devices 10-1 to 10-n are activated and written. I'm sorry. Therefore, the data retention performance can be improved by extending the backup time by the battery power source.

この後に外部電源が復旧した場合、制御部4はハードディスク装置10−1のキャッシュデータ待避領域8に待避させた書き込みキャッシュ制御情報、書き込みキャッシュデータ、読み出しキャッシュ制御情報を読み出してキャッシュメモリ上に登録する。また、上記第4段階と同様に読み出しキャッシュ制御情報に基づいて読み出しキャッシュデータをハードディスク装置10−1〜10−5から読み出し、キャッシュメモリ上に復元する。これにより停電前と同じ状態を復元することができる。なお、第5段階の途中で外部電源が復旧した場合は、書き込みキャッシュデータおよび制御情報はキャッシュメモリ5上に残っている状態であるため、読み出しキャッシュ制御情報のみを読み出して読み出しキャッシュデータを復元すれば足りる。データ復旧後は、ハードディスク装置10−1のキャッシュデータ待避領域8の内容を消去する。   Thereafter, when the external power supply is restored, the control unit 4 reads out the write cache control information, write cache data, and read cache control information saved in the cache data save area 8 of the hard disk device 10-1 and registers them in the cache memory. . Similarly to the fourth stage, the read cache data is read from the hard disk devices 10-1 to 10-5 based on the read cache control information, and restored on the cache memory. As a result, the same state as before the power failure can be restored. Note that when the external power supply is restored during the fifth stage, the write cache data and control information remain in the cache memory 5, so that only the read cache control information is read to restore the read cache data. It's enough. After data recovery, the contents of the cache data saving area 8 of the hard disk device 10-1 are erased.

図2〜図5を用いて、この磁気ディスク装置の具体的な動作を説明する。図2はキャッシュメモリ5の登録内容を示す図であり、図3〜図5は磁気ディスク装置の動作を説明するフローチャートである。前提として、外部電源から電力供給を受けている通常動作時、電源制御回路3は制御回路4、キャッシュメモリ5、HDD制御回路7、1番目のハードディスク装置10−1に対し、上位回路1を経由した外部電源回路20からの電力を供給している。また、外部電力でバッテリ回路2を充電し、充電状態や外部電源回路20の状態を制御回路4に通知している。2番目以降のハードディスク装置10−2〜10−nは上位回路1からの電力供給を受け動作している。   The specific operation of this magnetic disk apparatus will be described with reference to FIGS. FIG. 2 is a diagram showing the registered contents of the cache memory 5, and FIGS. 3 to 5 are flowcharts for explaining the operation of the magnetic disk device. As a premise, during a normal operation in which power is supplied from an external power supply, the power supply control circuit 3 passes through the upper circuit 1 to the control circuit 4, the cache memory 5, the HDD control circuit 7, and the first hard disk device 10-1. The power from the external power supply circuit 20 is supplied. Further, the battery circuit 2 is charged with external power, and the control circuit 4 is notified of the state of charge and the state of the external power supply circuit 20. The second and subsequent hard disk devices 10-2 to 10-n operate by receiving power from the upper circuit 1.

制御回路4は上位回路1から伝達されるリード/ライト命令に対し通常のキャッシュ動作を行うとともに、キャッシュメモリ5へのアクセスがないときには、キャッシュメモリ5のデフラグメントおよび並べ替えを行う。図2(a)に示すように、通常のキャッシュ動作においてキャッシュデータはキャッシュメモリ5の全域にフラグメント(断片)化されて格納されており、これをデフラグおよび並べ替えすることによって、図2(b)に示す状態となる。本実施例では5つのキャッシュメモリモジュール5−1〜5−5を備えており、アドレスの前の方から、書き込みキャッシュ制御情報、書き込みキャッシュデータ、読み出しキャッシュ制御情報、読み出しキャッシュデータの順に配置され、さらに読み出しキャッシュデータは新しく登録されたものが前側に配置されている。   The control circuit 4 performs a normal cache operation for the read / write instruction transmitted from the upper circuit 1, and performs defragmentation and rearrangement of the cache memory 5 when there is no access to the cache memory 5. As shown in FIG. 2A, in normal cache operation, the cache data is fragmented and stored in the entire area of the cache memory 5. By defragmenting and rearranging the cache data, FIG. ). In this embodiment, five cache memory modules 5-1 to 5-5 are provided, and are arranged in the order of write cache control information, write cache data, read cache control information, and read cache data from the front of the address. Further, newly registered read cache data is arranged on the front side.

図3に示すように、制御回路4は電源制御回路3からの信号を受け、外部電源回路20の状態を常時監視している(ステップS1)。外部電源20が停止すると(ステップS2)、電源制御回路3は制御回路4に外部電源回路20が停止したことを連絡し、電力供給元をバッテリ回路2に切り替え、上位回路1、制御回路4、キャッシュメモリ5−1〜5−nに供給する。また、制御回路4は上位回路1を介して外部電源回路20が停止したことを上位装置21に連絡し(ステップS3)、その後、上位回路1への電力供給を停止させる。この状態でハードディスク装置10−1〜10−n、HDD制御装置7への電力供給は停止している。なお、このときも制御回路4はキャッシュメモリ5のデフラグおよび並べ替えを行い、データを最小数のキャッシュメモリモジュール上に集中させる。   As shown in FIG. 3, the control circuit 4 receives a signal from the power supply control circuit 3 and constantly monitors the state of the external power supply circuit 20 (step S1). When the external power supply 20 is stopped (step S2), the power supply control circuit 3 notifies the control circuit 4 that the external power supply circuit 20 has been stopped, the power supply source is switched to the battery circuit 2, and the upper circuit 1, the control circuit 4, This is supplied to the cache memories 5-1 to 5-n. Further, the control circuit 4 informs the host device 21 that the external power supply circuit 20 has stopped via the host circuit 1 (step S3), and then stops the power supply to the host circuit 1. In this state, power supply to the hard disk devices 10-1 to 10-n and the HDD control device 7 is stopped. Also at this time, the control circuit 4 performs defragmentation and rearrangement of the cache memory 5 to concentrate data on the minimum number of cache memory modules.

デフラグ終了後、制御部4はキャッシュメモリ5を参照して、キャッシュデータがなく電力供給が不要となったキャッシュメモリモジュールがないかを確認し(ステップS4)、ある場合に当該モジュールへの電力供給を停止させ(ステップS5)、その旨を不揮発記憶する。図2(b)に示す例では、デフラグおよび並べ替えによりキャッシュメモリモジュール5−5が空となっており、このモジュール5−5の電力供給が切断される。これにより、キャッシュメモリモジュール5−1〜5−5すべての電力供給を継続するよりもバッテリ電力を節約でき、データ保持期間を長期化することができる。   After completion of the defragmentation, the control unit 4 refers to the cache memory 5 to check whether there is a cache memory module that has no cache data and no longer requires power supply (step S4). If there is, supply power to the module. Is stopped (step S5), and a message to that effect is stored in a nonvolatile manner. In the example shown in FIG. 2B, the cache memory module 5-5 is empty due to defragmentation and rearrangement, and the power supply to the module 5-5 is cut off. As a result, battery power can be saved and the data retention period can be prolonged as compared with the case where the power supply of all the cache memory modules 5-1 to 5-5 is continued.

このとき外部電源回路20が復旧すると(ステップS6)、電源制御回路3はバッテリ回路2から外部電源回路20からの供給電力に切り替え、上位回路1、制御回路4、キャッシュメモリ5、HDD制御回路7、ハードディスク装置10−1などに電力を供給する。またハードディスク装置10−2〜10−nも上位回路1から電力を得て復旧する。このときキャッシュメモリ5の内容は停電前の状態を保っているため、磁気ディスク装置は即時に停電前の状態に復旧することができる。停電が復旧しない場合は工程Aへと進む。   When the external power supply circuit 20 is restored at this time (step S6), the power supply control circuit 3 switches from the battery circuit 2 to the power supplied from the external power supply circuit 20, and the upper circuit 1, the control circuit 4, the cache memory 5, and the HDD control circuit 7 are switched. Then, power is supplied to the hard disk device 10-1. Further, the hard disk devices 10-2 to 10-n are also recovered by obtaining power from the upper circuit 1. At this time, since the contents of the cache memory 5 maintain the state before the power failure, the magnetic disk device can be immediately restored to the state before the power failure. If the power failure does not recover, proceed to step A.

図4に示すように、停電時に制御回路4は電源制御回路3から通知されるバッテリ残量を監視し、停電が復旧せずバッテリ残量がある閾値以下となったら(ステップS11)、キャッシュメモリ5を参照して古い読み出しキャッシュデータを削除し、不要となったキャッシュメモリモジュールへの電力供給を停止させる(ステップS12〜S13)。図2(c)に示すように、読み出しキャッシュデータはアドレスの前側から新しい順に配置されており、後側の古い読み出しキャッシュデータを削除するとキャッシュメモリモジュール5−4が空くため、このモジュール5−4への電力供給を停止させ、その旨を不揮発記憶する。外部電力が復旧しない場合は読み出しキャッシュデータがすべて無くなるまでこの工程を段階的に繰り返す(ステップS13)。この状態を図2(d)に示す。読み出しキャッシュデータがすべて無くなったら工程Bへと進む。この段階で外部電源回路20が復旧すると、電源制御回路3は電力供給元を外部電源回路20に切り替え、制御回路4は、必要に応じてキャッシュメモリ5に残っている読み出しキャッシュ制御情報を基に読み出しキャッシュデータをハードディスク装置10−1〜10−nから読み出してキャッシュメモリ5に登録する(ステップS14)。この場合、最後にアクセスを受けてから長時間経ったキャッシュデータはもう再アクセスが見込まれないものとして、復旧しないようにしてもよい。このようにしてキャッシュデータを復旧したら通常動作へ復帰する(C:図3ステップS1へ)。   As shown in FIG. 4, at the time of a power failure, the control circuit 4 monitors the remaining battery level notified from the power supply control circuit 3, and when the power failure is not restored and the remaining battery level falls below a certain threshold (step S11), the cache memory 5, the old read cache data is deleted, and the power supply to the cache memory module that is no longer needed is stopped (steps S12 to S13). As shown in FIG. 2C, the read cache data is arranged in the newest order from the front side of the address. When the old read cache data on the rear side is deleted, the cache memory module 5-4 becomes free. The power supply to is stopped and the fact is stored in a nonvolatile manner. If the external power is not restored, this process is repeated stepwise until all read cache data is exhausted (step S13). This state is shown in FIG. When all the read cache data is exhausted, the process proceeds to step B. When the external power supply circuit 20 is restored at this stage, the power supply control circuit 3 switches the power supply source to the external power supply circuit 20, and the control circuit 4 determines the read cache control information remaining in the cache memory 5 as necessary. The read cache data is read from the hard disk devices 10-1 to 10-n and registered in the cache memory 5 (step S14). In this case, the cache data that has passed for a long time since the last access may be assumed not to be accessed again and may not be recovered. When the cache data is restored in this way, the normal operation is resumed (C: go to step S1 in FIG. 3).

さらに図5に示すように、外部電力が復旧せず(ステップS21)、バッテリ残量がさらに少なくなったら(ステップS22)、制御部4はHDD制御回路7およびハードディスク装置10−1に電源を投入し、読み出しキャッシュ制御情報をハードディスク装置10−1へ待避させてからキャッシュメモリ5上から削除し、不要となったメモリモジュールへの電源供給を停止させ、その旨を不揮発記憶する(ステップS23)。この状態が図2(e)である。この後に外部電力が復旧した場合(ステップS24)、待避させた読み出し制御情報をハードディスク装置10−1から読み出し(ステップS27)、これに基づいて読み出しキャッシュ情報を復旧させる(D:図4ステップS15へ)。   Further, as shown in FIG. 5, when the external power is not restored (step S21) and the remaining battery level is further reduced (step S22), the controller 4 turns on the HDD control circuit 7 and the hard disk device 10-1. Then, the read cache control information is saved in the hard disk device 10-1 and then deleted from the cache memory 5, the power supply to the memory modules that are no longer needed is stopped, and this is stored in a nonvolatile manner (step S23). This state is shown in FIG. Thereafter, when the external power is restored (step S24), the saved read control information is read from the hard disk device 10-1 (step S27), and the read cache information is restored based on the read control information (D: go to step S15 in FIG. 4). ).

また、読み出しキャッシュ制御情報をハードディスクに待避させずに削除する実施例の場合、外部電力が復旧しても読み出しキャッシュデータは復旧できなくなるが、書き込みキャッシュデータおよび書き込みキャッシュ制御情報はキャッシュメモリ5上に置かれているので、特に問題なく動作を再開することができる。   In the embodiment in which the read cache control information is deleted without being saved in the hard disk, the read cache data cannot be recovered even when the external power is restored, but the write cache data and the write cache control information are stored in the cache memory 5. Since it is placed, the operation can be resumed without any particular problem.

さらに停電が継続し(ステップS24)、バッテリ残量がさらに少なくなると(ステップS25)、制御回路4は電源制御回路3を介してHDD制御回路7およびハードディスク装置10−1の電源を投入し、書き込みキャッシュデータおよび書き込みキャッシュ制御情報をハードディスク装置10−1のキャッシュデータ待避領域8に待避させ、その旨を不揮発記憶する(ステップS26)。これにより、バッテリ残量がなくなってすべてのキャッシュメモリモジュールの電源が切れた場合でも、電源復旧時に書き込みキャッシュデータおよび制御情報をハードディスク装置10−1から読み出してキャッシュメモリ5上に置くことにより、特に問題なく動作を再開することができる。   When the power failure continues (step S24) and the remaining battery level further decreases (step S25), the control circuit 4 turns on the power of the HDD control circuit 7 and the hard disk device 10-1 via the power supply control circuit 3 to write data. The cache data and write cache control information are saved in the cache data save area 8 of the hard disk device 10-1, and the fact is stored in a nonvolatile manner (step S26). As a result, even when the remaining battery power runs out and all the cache memory modules are powered off, when the power is restored, the write cache data and control information are read from the hard disk device 10-1 and placed on the cache memory 5, in particular. The operation can be resumed without problems.

このように、フラグメント化されたキャッシュメモリ内のキャッシュデータや制御情報をデフラグメントおよび並べ替えにより集中させ、必要最小限のメモリモジュールへのみ電源を供給することでバッテリ回路によるデータ保持時間の長期化を図り、また外部電力障害の継続時間(すなわちバッテリ残量)に応じて、極力キャッシュメモリ内のデータを残すようにすることで、外部電力復旧時のキャッシュメモリ内容の復旧時間を短縮することができる。   In this way, cache data and control information in the fragmented cache memory is concentrated by defragmentation and rearrangement, and power is supplied only to the minimum necessary memory modules, thereby extending the data retention time by the battery circuit. In addition, it is possible to reduce the recovery time of the cache memory contents when the external power is restored by leaving the data in the cache memory as much as possible according to the duration of the external power failure (that is, the remaining battery level) it can.

以上に本発明の一実施例を詳細に説明したが、本発明は上記実施例に限られるものではなく、他の様々な実施例として実現することができる。例えば図2ではメモリモジュールを5つ備える装置について説明しているが、キャッシュメモリモジュールの数は4以下でも6以上でもよい。また、ハードディスク装置の数も1以上であれば任意に構成することができる。また、実施例のデフラグメント処理ではキャッシュメモリのアドレスの前側にキャッシュデータを集中化させているが、これは前側である必要はなく、制御部4が把握する限りにおいて任意のモジュールに集中させるようにしてもよい。   Although one embodiment of the present invention has been described in detail above, the present invention is not limited to the above embodiment, and can be realized as various other embodiments. For example, although FIG. 2 illustrates an apparatus having five memory modules, the number of cache memory modules may be four or less or six or more. Any number of hard disk devices can be used as long as the number is one or more. Further, in the defragmenting process of the embodiment, the cache data is concentrated on the front side of the address of the cache memory, but this need not be on the front side, and as long as the control unit 4 grasps it, it concentrates on any module. It may be.

本発明に係る磁気ディスク装置およびその制御方法は、外部電力が障害により停止した場合にキャッシュメモリの内容保持の長期化および復旧時間の短縮を実現するものであり、大容量記憶装置やインターネットサーバなどのコンピュータ産業に好適に利用することができる。   The magnetic disk device and the control method thereof according to the present invention realize a longer retention of cache memory contents and a shorter recovery time when external power is stopped due to a failure, such as a mass storage device or an Internet server. It can be suitably used in the computer industry.

本発明の実施形態に係る磁気ディスク装置の構成を示す図である。1 is a diagram showing a configuration of a magnetic disk device according to an embodiment of the present invention. キャッシュメモリの内容イメージを示す図である。It is a figure which shows the content image of a cache memory. 磁気ディスク装置の動作を説明するフローチャートである。4 is a flowchart for explaining the operation of the magnetic disk device. 磁気ディスク装置の動作を説明するフローチャートである。4 is a flowchart for explaining the operation of the magnetic disk device. 磁気ディスク装置の動作を説明するフローチャートである。4 is a flowchart for explaining the operation of the magnetic disk device. 従来の磁気ディスク装置の構成を示す図である。It is a figure which shows the structure of the conventional magnetic disk apparatus. 従来の磁気ディスク装置の構成を示す図である。It is a figure which shows the structure of the conventional magnetic disk apparatus.

符号の説明Explanation of symbols

1 上位回路
2 バッテリ回路
3 電源制御回路
4 制御回路
5−1〜5−n キャッシュメモリ
7 HDD制御回路
10−1〜10−n ハードディスク装置
20 外部電源回路
21 上位装置
DESCRIPTION OF SYMBOLS 1 High-order circuit 2 Battery circuit 3 Power supply control circuit 4 Control circuit 5-1 to 5-n Cache memory 7 HDD control circuit 10-1 to 10-n Hard disk device 20 External power supply circuit 21 High-order device

Claims (10)

1以上のハードディスク装置と、上位装置からの書き込みデータおよび前記ハードディスク装置からの読み出しデータが登録される複数のキャッシュメモリモジュールと、外部電源の障害時に代わって電力を供給するバッテリ電源とを備える磁気ディスク装置において、前記キャッシュメモリモジュールのデフラグメントおよび/またはキャッシュデータの並べ替えを行ってキャッシュデータを集中化するとともに、前記バッテリ電源での駆動時にバックアップ対象データのないキャッシュメモリモジュールへの電力供給を停止することを特徴とする磁気ディスク装置。   A magnetic disk comprising at least one hard disk device, a plurality of cache memory modules in which write data from the host device and read data from the hard disk device are registered, and a battery power source for supplying power in the event of an external power failure In the apparatus, the cache memory module is defragmented and / or the cache data is rearranged to concentrate the cache data, and power supply to the cache memory module having no backup target data is stopped when driven by the battery power supply. A magnetic disk device characterized in that: 請求項1に記載の磁気ディスク装置において、前記バッテリ電源での駆動時に前記バッテリ電源の残量が所定以下となった場合に、前記ハードディスクの1台を駆動してバックアップ対象データを書き込むことを特徴とする磁気ディスク装置。   2. The magnetic disk device according to claim 1, wherein when the remaining amount of the battery power source becomes a predetermined value or less when driven by the battery power source, one of the hard disks is driven to write backup target data. Magnetic disk unit. 請求項2に記載の磁気ディスク装置において、前記バックアップ対象データは、少なくとも書き込みキャッシュデータと書き込みキャッシュ制御情報を含み、好ましくはさらに読み出しキャッシュ制御情報を含むことを特徴とする磁気ディスク装置。   3. The magnetic disk apparatus according to claim 2, wherein the backup target data includes at least write cache data and write cache control information, and preferably further includes read cache control information. 1以上のハードディスクと、上位装置からの書き込みデータおよび前記ハードディスク装置からの読み出しデータが登録される複数のキャッシュメモリモジュールと、外部電源の障害時に代わって電力を供給するバッテリ電源とを備える磁気ディスク装置の制御方法であって、前記キャッシュメモリモジュールのデフラグおよび/または並べ替えを行ってキャッシュデータを集中化し、前記バッテリ電源での駆動時にバックアップ対象データのないキャッシュメモリモジュールへの電力供給を停止することを特徴とする磁気ディスク装置の制御方法。   A magnetic disk device comprising one or more hard disks, a plurality of cache memory modules in which write data from a host device and read data from the hard disk device are registered, and a battery power supply for supplying power in the event of an external power failure The cache memory modules are defragmented and / or rearranged to centralize cache data and stop power supply to the cache memory modules having no backup target data when driven by the battery power supply A method for controlling a magnetic disk device, comprising: 請求項4に記載の方法において、前記キャッシュメモリモジュールのデフラグおよび/または並べ替えは、前記キャッシュメモリモジュールへのアクセスがないときに実行されることを特徴とする磁気ディスク装置の制御方法。   5. The method of controlling a magnetic disk device according to claim 4, wherein the defragmentation and / or rearrangement of the cache memory module is executed when there is no access to the cache memory module. 請求項4または5に記載の方法において、前記バッテリ電源での駆動時にその残量が所定の第1の値以下となった場合に、前記キャッシュメモリモジュールから読み出しキャッシュデータを削除するステップを含むことを特徴とする磁気ディスク装置の制御方法。   6. The method according to claim 4, further comprising the step of deleting read cache data from the cache memory module when the remaining amount is not more than a predetermined first value when driven by the battery power source. A method for controlling a magnetic disk device, comprising: 請求項6に記載の方法において、前記読み出しキャッシュデータの削除は、先にキャッシングされたものから削除されることを特徴とする磁気ディスク装置の生業方法。   7. The method according to claim 6, wherein the read cache data is deleted from the previously cached data. 請求項4乃至7のいずれかに記載の方法において、前記バッテリ電源での駆動時にその残量が所定の第2の値以下となった場合に、前記キャッシュメモリモジュールから、読み出しキャッシュデータに加え読み出しキャッシュ制御情報を削除するステップを含むことを特徴とする磁気ディスク装置の制御方法。   8. The method according to claim 4, wherein when the remaining amount is not more than a predetermined second value when driven by the battery power source, reading is performed from the cache memory module in addition to read cache data. A method of controlling a magnetic disk device, comprising: deleting cache control information. 請求項8に記載の方法において、前記読み出しキャッシュ制御情報を削除するステップは、前記ハードディスクの1つに電力を供給して前記読み出しキャッシュ制御情報を書き込んでから削除することを特徴とする磁気ディスク装置の制御方法。   9. The magnetic disk device according to claim 8, wherein the step of deleting the read cache control information includes deleting the write cache control information after supplying power to one of the hard disks. Control method. 請求項4乃至9に記載の方法において、前記バッテリ電源での駆動時にその残量が所定の第3の値以下となった場合に、書き込みキャッシュデータおよび書き込みキャッシュ制御情報を前記ハードディスクに書き込むことを特徴とする磁気ディスク装置の制御方法。
10. The method according to any one of claims 4 to 9, wherein write cache data and write cache control information are written to the hard disk when the remaining amount is not more than a predetermined third value when driven by the battery power source. A method for controlling a magnetic disk drive, characterized in that:
JP2004367249A 2004-12-20 2004-12-20 Magnetic disk drive and control method Expired - Fee Related JP4349274B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004367249A JP4349274B2 (en) 2004-12-20 2004-12-20 Magnetic disk drive and control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004367249A JP4349274B2 (en) 2004-12-20 2004-12-20 Magnetic disk drive and control method

Publications (2)

Publication Number Publication Date
JP2006172355A true JP2006172355A (en) 2006-06-29
JP4349274B2 JP4349274B2 (en) 2009-10-21

Family

ID=36673016

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004367249A Expired - Fee Related JP4349274B2 (en) 2004-12-20 2004-12-20 Magnetic disk drive and control method

Country Status (1)

Country Link
JP (1) JP4349274B2 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006313407A (en) * 2005-05-06 2006-11-16 Fujitsu Ltd Dirty data processing method, dirty data processor and dirty data processing program
JP2008102667A (en) * 2006-10-18 2008-05-01 Hitachi Ltd Computer system managing power supply for every logical partition, storage device, and method for controlling them
GB2466264A (en) * 2008-12-17 2010-06-23 Symbian Software Ltd Memory defragmentation and compaction into high priority memory banks
CN102033826A (en) * 2010-12-03 2011-04-27 创新科存储技术有限公司 Power failure data protection device and method for internal memory
JP2011159124A (en) * 2010-02-01 2011-08-18 Fujitsu Ltd Disk array apparatus and method for controlling the same
JP2012150532A (en) * 2011-01-17 2012-08-09 Nec Corp Cache device, data management method, program and cache system
JP2013182283A (en) * 2012-02-29 2013-09-12 Mitsubishi Electric Corp Storage device and storage method
US9104397B2 (en) 2011-10-14 2015-08-11 Hitachi, Ltd. Computer and data saving method
JP2015172863A (en) * 2014-03-12 2015-10-01 日本電気株式会社 Storage device, control method for storage device, and program therefor

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006313407A (en) * 2005-05-06 2006-11-16 Fujitsu Ltd Dirty data processing method, dirty data processor and dirty data processing program
JP4561462B2 (en) * 2005-05-06 2010-10-13 富士通株式会社 Dirty data processing method, dirty data processing device, and dirty data processing program
JP2008102667A (en) * 2006-10-18 2008-05-01 Hitachi Ltd Computer system managing power supply for every logical partition, storage device, and method for controlling them
US8458432B2 (en) 2006-10-18 2013-06-04 Hitachi, Ltd. Computer system, storage system and method for controlling power supply based on logical partition
GB2466264A (en) * 2008-12-17 2010-06-23 Symbian Software Ltd Memory defragmentation and compaction into high priority memory banks
JP2011159124A (en) * 2010-02-01 2011-08-18 Fujitsu Ltd Disk array apparatus and method for controlling the same
CN102033826A (en) * 2010-12-03 2011-04-27 创新科存储技术有限公司 Power failure data protection device and method for internal memory
JP2012150532A (en) * 2011-01-17 2012-08-09 Nec Corp Cache device, data management method, program and cache system
US9104397B2 (en) 2011-10-14 2015-08-11 Hitachi, Ltd. Computer and data saving method
JP2013182283A (en) * 2012-02-29 2013-09-12 Mitsubishi Electric Corp Storage device and storage method
JP2015172863A (en) * 2014-03-12 2015-10-01 日本電気株式会社 Storage device, control method for storage device, and program therefor

Also Published As

Publication number Publication date
JP4349274B2 (en) 2009-10-21

Similar Documents

Publication Publication Date Title
JP5074601B2 (en) Storage system having volatile memory and nonvolatile memory
US10139884B2 (en) Power loss protection for solid state drives
US8200897B2 (en) Storage system and data management method
JP4930555B2 (en) Control device, control method, and storage system
US20150242151A1 (en) Solid-state drive device
JP2009075759A (en) Storage device, and method for managing data in storage device
JP2001166993A (en) Memory control unit and method for controlling cache memory
JP2009187062A (en) Information processor, control part for controlling data storage performed in information processor and control method for data storage
JP2002297320A (en) Disk array device
JPWO2009008084A1 (en) Disk array device, control method, and control program
JP2010211734A (en) Storage device using nonvolatile memory
JP2005301419A (en) Disk array device and data processing method for it
JP4349274B2 (en) Magnetic disk drive and control method
CN101796495A (en) Memory device and file system
JP2008225916A (en) Power reduction device in data backup
JP4564721B2 (en) Disk array system
JP2008077519A (en) Virtual tape device, data management method for virtual tape device, and data management program for virtual tape device
JPH09330277A (en) Service interruption processing system for disk cache system and method therefor
JP2000357059A (en) Disk array device
JP3541349B2 (en) Cache memory backup system
US8171324B2 (en) Information processing device, data writing method, and program for the same
JP2002099390A (en) Disk controller
JPH10187302A (en) Data storage system and method for saving power applied to the same system
JP2008059007A (en) Semiconductor storage device
JPH064228A (en) Semiconductor disk device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20081218

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090106

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090305

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20090630

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090713

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120731

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees