CN102289354B - VDF (Victim Disk First) based cache memory replacement method - Google Patents

VDF (Victim Disk First) based cache memory replacement method Download PDF

Info

Publication number
CN102289354B
CN102289354B CN 201110164595 CN201110164595A CN102289354B CN 102289354 B CN102289354 B CN 102289354B CN 201110164595 CN201110164595 CN 201110164595 CN 201110164595 A CN201110164595 A CN 201110164595A CN 102289354 B CN102289354 B CN 102289354B
Authority
CN
China
Prior art keywords
memory block
data
disk
magnetic disk
storehouse
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.)
Active
Application number
CN 201110164595
Other languages
Chinese (zh)
Other versions
CN102289354A (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.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN 201110164595 priority Critical patent/CN102289354B/en
Publication of CN102289354A publication Critical patent/CN102289354A/en
Application granted granted Critical
Publication of CN102289354B publication Critical patent/CN102289354B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a VDF (Victim Disk First) based cache memory replacement method. The method comprises the following steps: calculating the weight of a bottom memory block in all local stacks, deleting memory blocks with the maximum /or minimum weight in all the local stacks, wherein the weight calculation methods are different for a victim disk and a non-victim disk; putting a disk block in an available memory block obtained after deletion. Since the probability that the weight of the memory block of the victim disk is maximum or minimum is high, the purpose of preferentially retaining the memory disk of the victim disk is reached. In the method, I/O (Input /Output) request frequency for the whole live disk is reduced by reducing the directing frequency of the cache to the victim disk, and less I/O requests can improve the performance of a disk array.

Description

A kind of preferential cache memory replacement method of dish that lost efficacy
Technical field
The invention belongs to the Computer Storage field, be specifically related to a kind of inefficacy dish preferential (Victim Disk First, cache memory VDF) (Cache) replacement method.This method is applicable to the failed disk in the disk array, can reduce I/O number for failed disk, improves performance and the reliability of disk array.
Background technology
Reliability and availability is the major criterion of weighing the online storage service quality.For the system that online service is provided for commercial and commercial Application, loss of data and the service that is interrupted often often mean economic loss.Redundancy array in disc RAID (Redundant Array of Independent Disk) is to provide the main flow of high reliability and high availability one of to select.In the RAID standard in early days, for example RAID-0 is to RAID-5, and it only provides the single-deck fault-tolerant ability.In recent years, the various RAID system with higher fault-tolerant ability begins to be used gradually, because it still can recover the data that all are lost when two or more disks lose efficacy simultaneously, meanwhile can also provide continual online service.
For storage system, the storage system of online service particularly is provided, with final user's position, the request average response time is the major criterion of estimating its service quality.But, in order when rebuilding the data of losing because of disk failure, to provide online service, the workflow that the read/write workflow that data reconstruction brings and user request brings will inevitably influence each other, thereby directly causes the decline of the service quality that the final user enjoys.A large amount of studies show that, with respect to non-fault mode, exists under the degraded mode when resuming work stream, and the read average response time can be subjected to very big influence, tends to increase several times to tens times and does not wait.Meanwhile, rebuild the prolongation that also can be the order of magnitude consuming time of online reconstruction with respect under the line.Therefore, the average response time of user's request when reducing on-line reorganization, and shorten reconstitution time, be to improve the most direct valid approach of service quality that the final user enjoys.At present existing many solutions at this problem are suggested, for example, and at the distribution optimization method of data, at the optimization of user job stream and at the optimization of reconstruct workflow.All be proved to be able to effectively improve the performance of on-line reorganization with upper type, comprised the average response time of user's request when reducing on-line reorganization or shorten reconstitution time.
Cache is used widely and a lot of Cache algorithm problem that disk postpones that solves, but Cache commonly used replaces algorithm and only considers under the error-free pattern, if in disk array, if some disk failure, this moment, RAID still worked under the pattern of this inefficacy, use amateurish reconstruct mode (Spare-rebuilding mode) and two kinds of methods of degradation modes (degraded mode), the disappearance cost that the disappearance cost of inefficacy this moment dish is compared the survival disk is different fully, if missing data resides in the failed disk, RAID controller access survival disk and carry out parity checking and rebuild fail data, this moment, the I/O request number of times was determined by the RAID structure, for LRU and LFU algorithm commonly used, the disappearance cost of a disk failure is n-1 (n for more than or equal to 2 positive integer) in n disk, this moment, a Cache disappearance for failed disk need be reconstructed to obtain this inefficacy dish data with n-1 remaining dish, should inefficacy dish data block join among the Cache again, this moment is when being full as if Cache, directly the memory block at the bottom of LRU global stack (this storehouse storage be all memory blocks of the whole disks) stack is rejected, do not consider whether this memory block belongs to the inefficacy dish, if the memory block of inefficacy dish is rejected, to still need to be reconstructed data when after this visiting the inefficacy dish, produce n-1 I/O request again, make I/O number increase greatly like this.
Summary of the invention
For solving above problem, the invention provides a kind of inefficacy dish preferential (Victim Disk First, Cache replacement method VDF).The memory block of this method priority cache inefficacy dish under the situation that disk array lost efficacy can reduce the I/O request number of times for the survival disk, has improved the performance based on the storage system of RAID.
The invention provides a kind of preferential cache memory replacement method of dish that lost efficacy, when disk sends the disk block of request to cache memory, carry out following steps:
(1) judges whether this disk block is arranged in the local storehouse of this disk block place dish of cache memory, if, then make timestamp and the length of a game of the memory block of this disk block correspondence stab and equate, and this disk block is put into the head of described local storehouse and overall storehouse, change step (6) over to; If not, judge then whether cache memory is full, if, then enter step (2), if not, then change step (4) over to;
(2) calculate the weight of the memory block of bottommost in all local storehouses, the computing method of weight are: if the memory block correspondence is the memory block of failed disk, and the weights W=GTS-TS of memory block then; Otherwise, the * (m-1) of the weights W of memory block=(GTS-TS); Wherein, GTS is that length of a game stabs, and TS is the timestamp of memory block, and m is the total number of memory block that the local storehouse at memory block place comprises;
(3) memory block with weight limit that calculates in the deletion step (2);
(4) obtain a free memory block;
(5) disk block is put into described free memory block, made timestamp and the length of a game of the memory block of this disk block correspondence stab and equate, and this disk block is put into the local storehouse at its place and the head of overall storehouse.
(6) make length of a game stab and add 1.
The present invention also provides a kind of preferential cache memory replacement method of dish that lost efficacy, and when disk sends the disk block of request to cache memory, carries out following steps:
(1) judges whether this disk block is arranged in the local storehouse of this disk block place dish of cache memory, if, then make the access times of the memory block of this disk block correspondence add 1, this disk block is put into local storehouse and the overall storehouse at its place, change step (6) over to; If not, judge then whether cache memory is full, if, execution in step (2) then, if not, execution in step (4) then;
(2) calculate the weight of the memory block of bottommost in all local storehouses, the computing method of weight are: if the memory block correspondence is the memory block of failed disk, weights W=the F* of memory block (m-1) then, otherwise, weights W=the F of memory block, wherein F is the access times of memory block, and m is the total number of memory block that the local storehouse at memory block place comprises;
(3) memory block with minimal weight that calculates in the deletion step (2);
(4) obtain a free memory block;
(5) disk block is put into described free memory block, the access times that make the memory block of this disk block correspondence are 1, this disk block are joined in the local storehouse and overall storehouse at its place;
(6) finish.
The memory block of Cache replacement method of the present invention priority cache inefficacy dish under the situation that disk array lost efficacy, thereby effective more handling failure disk, can reduce the number of times for the failed disk orientation, can also reduce simultaneously the I/O request number of times for the survival disk, this method can improve the performance of whole magnetic disk array, the process of rebuilding under the amateurish reconstruct mode be can accelerate, can the reliability that improves storage system under the pattern of load and the performance of system do not considered to rebuild.
Description of drawings
Fig. 1 is the executive mode synoptic diagram of two types of storehouses of VDF;
Fig. 2 replaces method flow diagram for VDF-LRU;
Fig. 3 replaces method flow diagram for VDF-LFU.
Embodiment
The invention provides preferential (the Victim Disk First of a kind of inefficacy dish, VDF) Cache replacement method, this method preferentially keeps the memory block in the inefficacy dish by calculating the weight of memory block, reduce the access times for the inefficacy dish, thereby reduced the I/O request number of times.
Below being example (n is more than or equal to 2) based on inefficacy of n disk in the RAID-5 system, with VDF method and least recently used page replacement algorithm (Least Recently Used, LFU) and least often (least frequently used, LRU) algorithm combines description concrete measure of the present invention to use the page displacedment algorithm.
In the algorithm of LRU type, the weight of memory block is by intermittently deciding storage time, the timestamp (timestamp) of the last storage of its expression, i.e. access sequence number.The access probability of memory block is by number decision of access sequence in interval time.In the algorithm of LFU type, the memory block weight is determined by access probability.VDF-LRU algorithm and VDF-LFU algorithm need keep the appraisal procedure of above-mentioned memory block weight among the present invention, determine which piece memory block with disallowable by weight.
Cache structure of the present invention comprises overall storehouse (Global Stack, GS) and local storehouse (Local Stack, LS), as shown in Figure 1, a local storehouse among the corresponding cache of each disk, what local storehouse was stored is the memory block of same disk, data in magnetic disk piece in the disk is put into Cache, again the memory block of same disk is stored with the data structure of local storehouse, during RAID controller access Cache, if the data that need read are arranged in Cache, expression Cache hits, illustrate that just the data block that need read this moment is arranged in the local storehouse of Cache, the memory block of local storehouse storage can be from failed disk and survival disk, and what overall storehouse was stored is the memory block of whole disks.
The invention provides a kind of inefficacy dish preferential (Victim Disk First, Cache replacement method VDF) are that example is described concrete steps of the present invention with the VDF-LRU algorithm below, as shown in Figure 3,
(A1) disk sends the data in magnetic disk piece of request to cache; Abbreviate the data in magnetic disk piece as disk block herein;
(A2) judge whether this disk block is arranged in the local storehouse of this disk block place dish, if, represent that then Cache hits, upgrade the timestamp (TS) of this disk block, make TS and length of a game stab (GTS) and equate TS=GTS, and this disk block is put into the local storehouse at its place and the head of GS, change step (A7) over to.Wherein, the initial value that (GTS) stabs in length of a game is access sequence number, and the initial value of the timestamp of disk block is the access sequence number of this disk block.
If not then expression Cache disappearance generation at this moment judges whether Cache is full, if Cache is full, then execution in step (A3) is not full as if Cache, then execution in step (A5) again.
(A3) calculate the weight of bottommost memory block in all local storehouses, if local storehouse correspondence is the inefficacy dish, then weight be length of a game stab GTS and this memory block time stamp T S difference namely: W=GTS-TS, if local storehouse correspondence is not the inefficacy dish, then weight is W=(GTS-TS) * (m-1), and m represents the number (m is more than or equal to 2) of memory block in the local storehouse;
(A4) memory block that will have weight limit is deleted; The weight of the memory block of inefficacy dish is not necessarily minimum, but the probability of the weight minimum of the memory block of inefficacy dish is bigger in the ordinary course of things, the difference of (GTS-TS) between W=(GTS-TS) * (m-1) and the W=GTS-TS is not very big, key factor is (m-1), then the weight of inefficacy dish is littler than survival dish weight in the ordinary course of things in the ordinary course of things, so this method can realize preferentially keeping the purpose of the memory block of inefficacy dish.
(A5) obtain a free memory block;
(A6) disk block is put into this free memory block, upgraded disk block time stamp T S=GTS, this memory block is joined the local stack LS at this memory block place and the head of the GS of global stack.
(A7) upgrade length of a game and stab GTS=GTS+1, continue to judge the disk block of next request.
Be that example is described concrete steps of the present invention with the VDF-LFU algorithm below, as shown in Figure 4,
(B1) disk sends the data in magnetic disk piece of request to cache; Abbreviate the data in magnetic disk piece as disk block herein;
(B2) judge whether this disk block is arranged in the local storehouse of this disk block place dish, if, represent that then Cache hits, upgrade the anti-memory block number of times F=F+1 that asks, the initial value of F is 1, upgrade this disk block timestamp, and this disk block is put into local storehouse and the overall storehouse at its place, change step (B7) over to.
If not then expression Cache disappearance generation at this moment judges whether Cache is full, if Cache is full, then execution in step (B3) is not full as if Cache, then execution in step (B5) again;
(B3) judge whether this part storehouse is the corresponding local storehouse of failed disk, calculate the weight of bottommost memory block in all local storehouses, if local storehouse correspondence is the inefficacy dish, then weigh W=F* (m-1) (m is more than or equal to 2), m represents the number of memory block in the local storehouse; If local storehouse correspondence is not the inefficacy dish, then weight is W=F;
(B4) memory block that will have minimal weight is deleted;
(B5) obtain a free memory block;
(B6) disk block is put into this free memory block, upgraded the access times F=1 of disk block time stamp T S=GTS and updating memory piece, this memory block is joined in overall storehouse and the local storehouse;
(B7) upgrade length of a game and stab GTS=GTS+1, continue to judge the disk block sequence of next request.
The present invention not only is confined to above-mentioned embodiment; persons skilled in the art are according to content disclosed by the invention; can adopt other multiple embodiment to implement the present invention; therefore; every employing project organization of the present invention and thinking; do some simple designs that change or change, all fall into the scope of protection of the invention.

Claims (2)

1. preferential cache memory method of replacementing of dish that lost efficacy, when disk sends the data in magnetic disk piece of request to cache memory, the execution following steps:
(1) judges whether this data in magnetic disk piece is arranged in the local storehouse of this data in magnetic disk piece place dish of cache memory, if, then making timestamp and the length of a game of the memory block of this data in magnetic disk piece correspondence stab equates, and this data in magnetic disk piece put into the head of described local storehouse and overall storehouse, change step (6) over to; If not, judge then whether cache memory is full, if, then enter step (2), if not, then change step (4) over to;
(2) calculate the weight of the memory block of bottommost in all local storehouses, the computing method of weight are: if the memory block correspondence is the memory block of failed disk, and the weights W=GTS-TS of memory block then; Otherwise, the * (m-1) of the weights W of memory block=(GTS-TS); Wherein, GTS is that length of a game stabs, and TS is the timestamp of memory block, and m is the total number of memory block that the local storehouse at memory block place comprises;
(3) memory block with weight limit that calculates in the deletion step (2);
(4) obtain a free memory block;
(5) the data in magnetic disk piece is put into described free memory block, make timestamp and the length of a game of the memory block of this data in magnetic disk piece correspondence stab and equate, and this data in magnetic disk piece is put into the local storehouse at its place and the head of overall storehouse.
(6) make length of a game stab and add 1.
2. preferential cache memory method of replacementing of dish that lost efficacy, when disk sends the data in magnetic disk piece of request to cache memory, the execution following steps:
(1) judges whether this data in magnetic disk piece is arranged in the local storehouse of this data in magnetic disk piece place dish of cache memory, if, then make the access times of the memory block of this data in magnetic disk piece correspondence add 1, this data in magnetic disk piece is put into local storehouse and the overall storehouse at its place, change step (6) over to; If not, judge then whether cache memory is full, if, execution in step (2) then, if not, execution in step (4) then;
(2) calculate the weight of the memory block of bottommost in all local storehouses, the computing method of weight are: if the memory block correspondence is the memory block of failed disk, the weights W of memory block=F*(m-1) then, otherwise, weights W=the F of memory block, wherein F is the access times of memory block, and m is the total number of memory block that the local storehouse at memory block place comprises;
(3) memory block with minimal weight that calculates in the deletion step (2);
(4) obtain a free memory block;
(5) the data in magnetic disk piece is put into described free memory block, the access times that make the memory block of this data in magnetic disk piece correspondence are 1, this data in magnetic disk piece are joined in the local storehouse and overall storehouse at its place;
(6) finish.
CN 201110164595 2011-06-17 2011-06-17 VDF (Victim Disk First) based cache memory replacement method Active CN102289354B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110164595 CN102289354B (en) 2011-06-17 2011-06-17 VDF (Victim Disk First) based cache memory replacement method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110164595 CN102289354B (en) 2011-06-17 2011-06-17 VDF (Victim Disk First) based cache memory replacement method

Publications (2)

Publication Number Publication Date
CN102289354A CN102289354A (en) 2011-12-21
CN102289354B true CN102289354B (en) 2013-07-10

Family

ID=45335818

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110164595 Active CN102289354B (en) 2011-06-17 2011-06-17 VDF (Victim Disk First) based cache memory replacement method

Country Status (1)

Country Link
CN (1) CN102289354B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107851068A (en) * 2015-07-30 2018-03-27 华为技术有限公司 The replacement method and alternative of data storage in a kind of cache memory

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5572659A (en) * 1992-05-12 1996-11-05 International Business Machines Corporation Adapter for constructing a redundant disk storage system
CN1213800A (en) * 1997-08-01 1999-04-14 国际商业机器公司 Determining how changes to underlying data affect cached objects

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5572659A (en) * 1992-05-12 1996-11-05 International Business Machines Corporation Adapter for constructing a redundant disk storage system
CN1213800A (en) * 1997-08-01 1999-04-14 国际商业机器公司 Determining how changes to underlying data affect cached objects

Also Published As

Publication number Publication date
CN102289354A (en) 2011-12-21

Similar Documents

Publication Publication Date Title
US8417989B2 (en) Method and system for extra redundancy in a raid system
US10452498B2 (en) Fault tolerance for persistent main memory
US8943357B2 (en) System and methods for RAID writing and asynchronous parity computation
Xin et al. Evaluation of distributed recovery in large-scale storage systems
US20170337107A1 (en) Data storage system and data storage method
US7890795B1 (en) Auto-adapting cache memory system and memory
CN102156727A (en) Method for deleting repeated data by using double-fingerprint hash check
CN107544862A (en) A kind of data storage reconstructing method and device, memory node based on correcting and eleting codes
CN103793182A (en) Scalable storage protection
Menon et al. Comparison of sparing alternatives for disk arrays
CN106227464B (en) It is a kind of bilayer redundant storage system and its data write-in, read and restoration methods
CN103763383A (en) Integrated cloud storage system and storage method thereof
US20120072767A1 (en) Recovery of failed disks in an array of disks
CN104503923A (en) Asymmetrical disk array caching dispatching method
CN103916459A (en) Big data filing and storing system
Curry et al. A lightweight, gpu-based software raid system
CN110196818A (en) Data cached method, buffer memory device and storage system
US20040250030A1 (en) Data redundancy using portal and host computer
US20140189424A1 (en) Apparatus and Method for Parity Resynchronization in Disk Arrays
CN109032513A (en) Based on the RAID framework of SSD and HDD and its backup, method for reconstructing
CN105204785B (en) A kind of disk array WriteMode selection method based on magnetic disc i/o queue
CN102289354B (en) VDF (Victim Disk First) based cache memory replacement method
US9858147B2 (en) Storage apparatus and method of controlling storage apparatus
CN102103533A (en) Method for reconstructing single disk in double-disk fault-tolerance disk array
US20230350611A1 (en) Flexible raid scheme allowing fast rebuild

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