CN100456253C - Protection method for caching data of memory system - Google Patents

Protection method for caching data of memory system Download PDF

Info

Publication number
CN100456253C
CN100456253C CNB200510048804XA CN200510048804A CN100456253C CN 100456253 C CN100456253 C CN 100456253C CN B200510048804X A CNB200510048804X A CN B200510048804XA CN 200510048804 A CN200510048804 A CN 200510048804A CN 100456253 C CN100456253 C CN 100456253C
Authority
CN
China
Prior art keywords
random access
access memory
disk cache
description entry
storage system
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.)
Expired - Fee Related
Application number
CNB200510048804XA
Other languages
Chinese (zh)
Other versions
CN1991775A (en
Inventor
王兴家
郭建锋
曹苍眸
陈怡�
陈玄同
刘文涵
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.)
XUZHOU LIFANG ELECTROMECHANICAL EQUIPMENT MANUFACTURING CO., LTD.
Original Assignee
Inventec 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 Inventec Corp filed Critical Inventec Corp
Priority to CNB200510048804XA priority Critical patent/CN100456253C/en
Publication of CN1991775A publication Critical patent/CN1991775A/en
Application granted granted Critical
Publication of CN100456253C publication Critical patent/CN100456253C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

A data protecting method of high-speed memory of storing system is used to protect data of high-speed memory which possess function of supplying power. The invention reserves an area in system random access memory to record information of describing item of disk high-speed memory. When the storing system is power off, the data in system random access memory is protect by function of supplying power by battery. When the storing system is restarted, the data in system random access memory is protected by reserving area. And when the storing system is restarted, the data in system random access memory is written into corresponding block equipment, and realize the power off protect function for data in system random access memory.

Description

The guard method of the cached data of storage system
Technical field
The present invention relates to a kind of data guard method, particularly a kind of Data Protection method of high-speed cache of storage system.
Background technology
In computer system, the arithmetic speed of CPU (central processing unit) (CPU) is exceedingly fast, but its direct read block equipment (as, hard disk, SCSI hard disk, disk array etc.) especially chronic to the addressing of block equipment.Originally, CPU adopts PIO (Programmed I/O) mode writable area block device, that is, CPU just can continue to carry out follow-up work after must waiting for always the read-write operation of block equipment being finished, and has greatly wasted the time of CPU, has reduced the resource of CPU.In order to address this problem, adopted the mode of interrupting, promptly, CPU can carry out other task when the writable area block device, when block equipment read-write operation finishes, trigger interruption by external unit, allow CPU continue execution task just now, improved the service efficiency of CPU like this.Yet this mode does not make full use of read or write speed random access memory (Random Access Memory, characteristic RAM) faster.Therefore, the mode that adopts a kind of disk cache (Disk Cache) promptly, is utilized the disk cache of a part of system random access internal memory as block equipment read-write operation with further raising system effectiveness.When equipment is carried out write operation, the data that needs are write, device name and at the location records of this equipment in disk cache, and CPU thinks that promptly write operation finishes, regularly or when the system random access memory source is not enough finish the write operation that is stored in the disk cache by the task of the special read-write equipment of system then, but the data in the disk cache continue to keep; When equipment is carried out read operation, judge whether store the data that need read in the disk cache,, then directly read earlier if having.Otherwise CPU sends the task of a fetch equipment, and current task can be retained, CPU can carry out other task, and after the data slave unit was read, the data that read can be added in the disk cache, and sending a look-at-me to CPU, CPU can continue to carry out the read operation to equipment.In order to improve the read-write efficiency to block equipment, the driving of block equipment (Driver) has all adopted some to improve the method for read-write efficiencies, as the elevator algorithm, in advance read algorithm, postpone to write algorithm etc.
Each description entry of disk cache description entry in the operating system (Disk Cache Item) is represented a physical memory page (Page) or block (Block).Adopt following method to the management of disk cache is general: disk cache generally is stored in three on dirty (dirty), clean (clean) and lock (locked), and least recently used (Least Recently Use LRU) links in the serial.Wherein, dirty link serial comprises all disk cache description entrys that need the write area block device, the serial of chain knot comprises all just at the disk cache description entry of write area block device, totally links serial and comprises the up-to-date data that are stored in the block equipment in the disk cache.Therefore, the disk cache description entry can migration between these three link serials.When CPU carries out the write operation of block equipment, whether can search from clean link serial earlier has corresponding disk cache description entry, if have, then the disk cache description entry of correspondence is deleted from clean link serial, the data in the change disk cache description entry also add dirty link serial with this disk cache description entry; If no, then from the system random access internal memory, distribute the disk cache description entry, revise in the disk cache description entry data and this disk cache description entry is added dirty link serial.Then, at certain time intervals, system random access memory source deficiency, when the shared random access memory of disk cache reaches the upper limit that the user sets or user's Compulsory Removal disk cache, the task of CPU meeting call area block device write operation, part disk cache description entry in the dirty link serial is added the serial of chain knot, with the write area block device, write the disk cache description entry that finishes and add clean link serial, and least-recently-used disk cache description entry in the clean link of the deletion serial, the disk cache description entry of deletion are recovered in the free random access memory of system and use for system.In the system based on store tasks, a large amount of random access memorys are used as disk cache.
Yet, the disk cache description entry added dirty link serial and be asynchronous, and it is very fast often the disk cache description entry to be added the process of dirty link serial the process that the disk cache description entry of write area block device adds clean link serial.Therefore, storing data in the disk cache does not write in the real block equipment.If during system cut-off, the data in the disk cache can be lost.Thereby, some storage class products higher to data integrality, security requirement (as, SAN, NAS, disk array) in, need protection and handle this part data.A lot of manufacturers provide the solution of powered battery random access memory.
Common powered battery solution comprises RAID Adapter, Smart Array and powered battery random access memory adapter.The equipment that it is computer system provides oneself device driver, can accelerate the speed and the data throughout of write data.Its data with disk cache in the computer system random access memory are transferred to own inner buffer zone, then by the equipment self deal with data.Wherein, RAID Adapter, Smart Array write the memory device that links to each other with oneself with the data of self buffer, and powered battery random access memory adapter r only stores data.It can protect the data of own internal buffer not lose in a period of time behind system cut-off all because of having the powered battery function, can be with the data write storage device of own buffer zone after system recovery is normal.
Yet this way of known technology can only be protected the data that are delivered to own internal buffer from the random access memory of storage system when system cut-off, can not protect the data of disk cache storage in the computer system random access memory.
Summary of the invention
In order to solve problem and the defective in the above-mentioned known technology; the object of the present invention is to provide a kind of Data Protection method of high-speed cache of storage system; in order to when computer system is cut off the power supply, protect the data of the high-speed cache of a storage system with powered battery (Battery Backed) function.
The Data Protection method of the high-speed cache of a kind of storage system provided by the present invention comprises following steps: when storage system starts, keep the reserve area of suitable length in the suitable starting position of the random access memory of storage system; After storage system started, monitoring was to the operation of dirty link serial and clean link serial; When system increases a disk cache description entry to dirty link serial, go out the sequence number of an inlet (Entry) of reserve area in the position calculation of random access memory according to the disk cache description entry; Storing this disk cache description entry so far enters the mouth in the positional information of block equipment at the position of random access memory, the random access memory size of disk cache description entry, block device name and the disk cache description entry that the disk cache description entry writes; When system increases a disk cache description entry to clean link serial, go out the sequence number of an inlet of reserve area according to the disk cache description entry in the position calculation of random access memory, remove this inlet canned data; When storage system is cut off the power supply, provide power supply for random access memory by the powered battery function; When storage system restarts, read the position and the size information of disk cache description entry of a plurality of inlets storage of this reserve area, keep the data of the random access memory storage of correspondence position according to position of reading and size information; After storage system restarts, read the information of disk cache description entry of a plurality of inlets storage of reserve area, according to the information that reads the data of the random access memory storage of correspondence position are write corresponding block equipment; And the space that discharges disk cache in the random access memory that keeps when storage system starts, and the value that each inlet of reserve area is set is zero.
Wherein, the suitable starting position of reserve area is required random access memory position of the operating system initialization of storage system and the position of hardware beyond the position of random access memory mapping, and suitable length calculates by following formula: ((random access memory size)/(high-speed cache description entry size)+1) * (the inlet size of reserve area)+(UUID size), UUID are general unique identifier (Universal Unique IDentifier).The inlet sequence number of reserve area is calculated by following formula: (the high-speed cache description entry is in the position of random access memory)/(high-speed cache description entry size).
The Data Protection method of the high-speed cache of storage system of the present invention wherein keeps in the administrative mechanism in internal storage access zone of self needs of starting the operating system that this reserve area sets up by the starting position of adding this reserve area and length information to the operating system of this storage system and realizes.
The Data Protection method of the high-speed cache of storage system of the present invention, wherein the information of this disk cache description entry comprises: this disk cache description entry is in the position of random access memory and the size information of this disk cache description entry.
The Data Protection method of the high-speed cache of storage system of the present invention, wherein this inlet sequence number is calculated by following formula: (the disk cache description entry is in the position of random access memory)/(disk cache description entry size).
In sum, the invention has the advantages that the powered battery function of utilizing computer system has realized the power-off protection function to the data of disk cache storage in the random access memory of computer system.
Description of drawings
Fig. 1 is a method flow diagram of the present invention.
Wherein, description of reference numerals is as follows:
When S100 starts when storage system, keep a reserve area of suitable length in the suitable starting position of the random access memory of storage system
S110 is after storage system starts, and monitoring is to the operation of dirty link serial and clean link serial
S120 goes out the sequence number of an inlet of reserve area in the position calculation of random access memory according to the disk cache description entry when increasing a disk cache description entry to dirty link serial
S130 memory disk high-speed cache description entry so far enters the mouth in the position of random access memory and the size information of disk cache description entry
S140 goes out the sequence number of an inlet of reserve area according to the high-speed cache description entry in the position calculation of random access memory when increasing a high-speed cache description entry to clean link serial, remove this inlet canned data
When S150 cuts off the power supply when storage system, provide power supply for random access memory by the powered battery function
When S160 restarts when storage system, read the position and the size information of high-speed cache description entry of a plurality of inlets storage of reserve area, keep the data of the random access memory storage of correspondence position according to position of reading and size information
S170 reads the information of high-speed cache description entry of a plurality of inlets storage of reserve area after storage system restarts, according to the information that reads the data of the random access memory storage of correspondence position are write corresponding block equipment
The space of the random access memory that S180 discharge to keep, and the value that each inlet of reserve area is set is zero
Embodiment
Below, will partly elaborate in conjunction with the accompanying drawings to better embodiment of the present invention.
Please refer to Fig. 1, this figure is the method flow diagram of Data Protection method of the high-speed cache of a kind of storage system of the present invention, and as shown in the figure, the method comprises following steps:
When storage system starts, a reserve area (S100) that keeps suitable length in the suitable starting position of the random access memory of storage system, wherein, the suitable starting position of reserve area is required random access memory position of the operating system initialization of storage system and the position of hardware beyond the position of random access memory mapping, and suitable length calculates by following formula: ((random access memory size)/(high-speed cache description entry size)+1) * (the inlet size of reserve area)+(UUID size), UUID is general unique identifier.When the operating system of storage system is set up the administrative mechanism in the internal storage access zone that self needs of starting the operating system, the starting position and the length data of reserve area added, to reach the purpose that keeps this reserve area.
After storage system started, supervisory system was to the operation (S110) of dirty link serial and clean link serial.When the system that detects increases a disk cache description entry to dirty link serial, according to formula: (the high-speed cache description entry is in the position of random access memory)/(high-speed cache description entry size), utilize the disk cache description entry to go out the sequence number (S120) of an inlet of reserve area in the position calculation of random access memory, and according to the inlet sequence number memory disk high-speed cache description entry that calculates in the position of random access memory and the random access memory size information of disk cache description entry so far enter the mouth (S130).When the system that detects increases a disk cache description entry to clean link serial, according to formula: (the high-speed cache description entry is in the position of random access memory)/(high-speed cache description entry size), utilize the disk cache description entry to go out the sequence number of an inlet of reserve area, and remove this inlet canned data (S140) according to the inlet sequence number of calculating in the position calculation of random access memory.
When storage system is cut off the power supply, provide power supply by the powered battery function for the random access memory of system, with the data of protection system random access memory storage.And for the CPU of storage system provides the power supply of short period, to allow CPU finish the cached data of CPU synchronously to the task (S150) of the random access memory of system.
When storage system restarts, by come all data of protection system random access memory storage in the basic input/output (BIOS) of revising storage system about the parameter setting of random access memory self check.Repeat the retention process of S100.And the position and the size information of the disk cache description entry of a plurality of inlets of the S100 reserve area of reading system random access memory storage, keep the data (S160) of the random access memory storage of correspondence position according to position of reading and size information.
After storage system restarts, read the information of disk cache description entry of each inlet storage of reserve area, according to the random access memory of the information searching that reads to correspondence position, the data that need write from the random access memory reading disk high-speed cache description entry of correspondence position, the block device name that the disk cache description entry need write and disk cache description entry are in the position of block equipment.And write corresponding block equipment according to the data that the information that reads writes needs, to realize Data Protection (S170) to disk cache storage in the random access memory of system.
After the data of all disk cache storages in the random access memory of system are written into corresponding block equipment, discharge the space of disk cache in the random access memory that keeps when storage system starts, and the value that each inlet in the reserve area of random access memory is set is zero (S180).
Though the present invention with aforesaid better embodiment openly as above, so it is not in order to limit the present invention.Those skilled in the art should recognize under the situation of the scope and spirit of the present invention that do not break away from appending claims of the present invention and disclosed, change of being done and modification, all belong to scope of patent protection of the present invention in.Please refer to appending claims about the protection domain that the present invention defined.

Claims (8)

1, a kind of Data Protection method of high-speed cache of storage system has the data of high-speed cache of the storage system of powered battery function in order to protection, the method includes the steps of:
When this storage system starts, keep the reserve area of a length in a starting position of the random access memory of this storage system;
After this storage system starts, monitoring is to the operation of dirty link serial and clean link serial, when monitoring when increasing the disk cache description entry to dirty link serial, the information of the corresponding disk cache description entry of storage in this reserve area, when monitoring when increasing the disk cache description entry information of the corresponding disk cache description entry of deletion in this reserve area to clean link serial;
When this storage system outage, provide power supply by the powered battery function for random access memory, in order to the data of protection random access memory storage;
When this storage system restarts, read the information of the disk cache description entry of this reserve area storage, keep the data of corresponding random access memory storage according to the information that reads; And
After this storage system restarts, read the information of the disk cache description entry of this reserve area storage, the data of the random access memory storage of correspondence are write the block equipment of correspondence according to the information that reads.
2, the Data Protection method of the high-speed cache of storage system as claimed in claim 1; it also comprises following steps: discharge the space of disk cache in the random access memory that keeps when storage system starts, and the value that a plurality of inlets of this reserve area are set is zero.
3, the Data Protection method of the high-speed cache of storage system as claimed in claim 1, wherein this starting position is the required random access memory position and the position of hardware beyond the position of random access memory mapping of operating system initialization of this storage system.
4, the Data Protection method of the high-speed cache of storage system as claimed in claim 1; wherein this length system is calculated by following formula: ((random access memory size)/(disk cache description entry size)+1) * (the inlet size of reserve area)+(UUID size); wherein, UUID is general unique identifier.
5, the Data Protection method of the high-speed cache of storage system as claimed in claim 1 wherein keeps in the administrative mechanism in internal storage access zone of self needs of starting the operating system that this reserve area sets up by the starting position of adding this reserve area and length information to the operating system of this storage system and realizes.
6, the Data Protection method of the high-speed cache of storage system as claimed in claim 1, wherein the information of this disk cache description entry comprises: this disk cache description entry is in the position of random access memory and the size information of this disk cache description entry.
7, the Data Protection method of the high-speed cache of storage system as claimed in claim 1, wherein according to the operation of monitoring, the storage or the step of information of deleting the description entry of corresponding disk cache also further comprise following steps in this reserve area:
When monitoring when increasing the disk cache description entry, go out the sequence number of the inlet of this reserve area in the position calculation of random access memory according to this disk cache description entry to dirty link serial;
Storing this disk cache description entry enters the mouth to this in the position of random access memory and the size information of this disk cache description entry; And
When monitoring when increasing the disk cache description entry to clean link serial, go out the sequence number of the inlet of this reserve area according to this disk cache description entry in the position calculation of random access memory, remove this inlet canned data.
8, the Data Protection method of the high-speed cache of storage system as claimed in claim 7, wherein this inlet sequence number is calculated by following formula: (the disk cache description entry is in the position of random access memory)/(disk cache description entry size).
CNB200510048804XA 2005-12-28 2005-12-28 Protection method for caching data of memory system Expired - Fee Related CN100456253C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB200510048804XA CN100456253C (en) 2005-12-28 2005-12-28 Protection method for caching data of memory system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB200510048804XA CN100456253C (en) 2005-12-28 2005-12-28 Protection method for caching data of memory system

Publications (2)

Publication Number Publication Date
CN1991775A CN1991775A (en) 2007-07-04
CN100456253C true CN100456253C (en) 2009-01-28

Family

ID=38214046

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB200510048804XA Expired - Fee Related CN100456253C (en) 2005-12-28 2005-12-28 Protection method for caching data of memory system

Country Status (1)

Country Link
CN (1) CN100456253C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102971716A (en) * 2010-03-03 2013-03-13 Ati科技无限责任公司 Cache with reload capability after power restoration

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101499313B (en) * 2009-01-06 2012-03-21 成都市华为赛门铁克科技有限公司 Method, equipment and memory system for guaranteeing data security
CN102117184B (en) * 2010-01-05 2017-06-27 联想(北京)有限公司 Controller, terminal device and its startup and access method for multi-memory
US9003103B2 (en) 2011-09-12 2015-04-07 Microsoft Technology Licensing, Llc Nonvolatile media dirty region tracking
JP5803614B2 (en) * 2011-11-29 2015-11-04 ソニー株式会社 Nonvolatile cache memory, processing method of nonvolatile cache memory, and computer system
CN104219207B (en) * 2013-05-31 2017-10-17 杭州迪普科技股份有限公司 A kind of safe consultation device and method
CN109918228B (en) * 2019-01-28 2021-01-12 浙江中控技术股份有限公司 Data power failure maintaining method and system
CN111752851B (en) * 2019-03-27 2023-08-18 厦门网宿有限公司 Memory recycling method and device
CN112379844A (en) * 2020-11-25 2021-02-19 深圳市华宝电子科技有限公司 Data protection method and device, electronic terminal and storage medium
CN115599607B (en) * 2022-11-29 2023-06-16 苏州浪潮智能科技有限公司 Data recovery method and related device of RAID array

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1060729A (en) * 1990-10-07 1992-04-29 深圳华德电子有限公司 The computer circuit breaking field data is preserved and restoration methods
US5448719A (en) * 1992-06-05 1995-09-05 Compaq Computer Corp. Method and apparatus for maintaining and retrieving live data in a posted write cache in case of power failure
US5519831A (en) * 1991-06-12 1996-05-21 Intel Corporation Non-volatile disk cache
EP0778526A1 (en) * 1995-12-07 1997-06-11 Hitachi, Ltd. Magnetic disk controller for backing up cache memory
US20030212921A1 (en) * 2002-05-08 2003-11-13 Howe Steven M. Write cache recovery after loss of power

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1060729A (en) * 1990-10-07 1992-04-29 深圳华德电子有限公司 The computer circuit breaking field data is preserved and restoration methods
US5519831A (en) * 1991-06-12 1996-05-21 Intel Corporation Non-volatile disk cache
US5448719A (en) * 1992-06-05 1995-09-05 Compaq Computer Corp. Method and apparatus for maintaining and retrieving live data in a posted write cache in case of power failure
EP0778526A1 (en) * 1995-12-07 1997-06-11 Hitachi, Ltd. Magnetic disk controller for backing up cache memory
US20030212921A1 (en) * 2002-05-08 2003-11-13 Howe Steven M. Write cache recovery after loss of power

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102971716A (en) * 2010-03-03 2013-03-13 Ati科技无限责任公司 Cache with reload capability after power restoration
CN102971716B (en) * 2010-03-03 2015-06-17 Ati科技无限责任公司 Cache with reload capability after power restoration

Also Published As

Publication number Publication date
CN1991775A (en) 2007-07-04

Similar Documents

Publication Publication Date Title
CN100456253C (en) Protection method for caching data of memory system
KR101717644B1 (en) Apparatus, system, and method for caching data on a solid-state storage device
TWI596480B (en) Memory storage system, and central control device, management method and recovery method
US20190369892A1 (en) Method and Apparatus for Facilitating a Trim Process Using Auxiliary Tables
CN101876949B (en) Date memorizing system and method thereof
US8504762B2 (en) Flash memory storage device with data interface
CN100487632C (en) Dual media storage device
CN100462944C (en) Power-fail protection method based on two continuous logical blocks for non-volatile memory
CN102511044B (en) Method for deleting the data and device thereof
US7587427B2 (en) Hierarchical storage system, and control method and program therefor
US8838918B2 (en) Information processing apparatus and data backup method
US20110208914A1 (en) Storage system and method of operating thereof
CN102508785B (en) A kind of abrasion equilibrium method and device
CN102779080B (en) Method for generating snapshot, method and device for data recovery by using snapshot
CN102737715B (en) For the method for power fail safeguard of data of NOR flash memory
CN101673243B (en) Data storage device and method
CN100426246C (en) Protection method for caching data of memory system
CN102591790B (en) Data based on solid state hard disc store snapshot implementing method and solid state hard disc
CN101923518A (en) Memory system and related method of loading code
US20080016274A1 (en) Method of protecting cache memory data in storage system
KR101114125B1 (en) Nand Flash File System And Method For Initialization And Crash Recovery Thereof
US7360016B2 (en) Method of protecting data in cache memory of storage system
US20170091048A1 (en) Storage method and device for solid-state drive
WO2010145967A1 (en) Memory device for managing the recovery of a non volatile memory
US11188511B2 (en) Offloading file-indexing to memory card firmware

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20191223

Address after: No. 99, University Road, high tech Zone, Xuzhou City, Jiangsu Province

Patentee after: XUZHOU LIFANG ELECTROMECHANICAL EQUIPMENT MANUFACTURING CO., LTD.

Address before: Taipei City, Taiwan, China

Patentee before: Yingda Co., Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090128

Termination date: 20191228

CF01 Termination of patent right due to non-payment of annual fee