Background technology
In recent years, computer network is the fast development of multimedia technology especially, it is used and has expanded and be penetrated into the every field of economy, politics, social life, along with the continuous expansion and the raising of its range of application and level, to the also constantly higher requirement of proposition of memory capacity, read or write speed and error correction tolerance limit ability of computer data information.At this requirement, the RAID technology provides good solution, and has therefore obtained development rapidly and application widely.
RAID high-speed cache (Cache) technology is in recent years, in the disk storage technology field, and development very fast, as high-end storage, Cache has been the core place of whole storage, is exactly the low and middle-end storage, also has very big Cache to exist.
Cache can effectively improve the I/O performance of system, its principle is that the data that CPU will write disk are write earlier among the Cache that is made of RAM, write in the disk by Cache, perhaps earlier the data on the disk are read among the Cache, CPU reads data from Cache more then.In the RAID system, Cache is the part of Installed System Memory, and its speed is than fast many of the speed of hard disk.Therefore, the design of Cache part has great influence to the efficient of whole RAID system.
The Cache capacity is compared with the next stage storer, be very little, the just subclass of next stage memory content that it is preserved, content exchange between Cache and the next stage storer is unit with the piece generally, but in prior art storage block can't be efficiently in Cache with the next stage storer in data exchange.
Summary of the invention
(1) technical matters that will solve
The technical problem to be solved in the present invention is: storage block in Cache how organizing ability efficiently with the next stage storer in data exchange.
(2) technical scheme
For solving the problems of the technologies described above, the invention provides the cache management system of a kind of RAID of being used for, comprising: the object machine module of Lian Jieing, caching management module, RAID nucleus module, input/output scheduling module and starter module successively,
Described object machine module is used to receive the input and output request from main frame, and this input and output request is encapsulated, and is sent to described caching management module after the encapsulation;
Described caching management module, be used for and split into the certain characteristics data strip through the input and output request after the encapsulation, and judge one by one according to read-write type whether the data of described certain characteristics data strip correspondence hit, the characteristic bar that hits is sent to described RAID nucleus module, otherwise, the solution that must conflict by the time of miss characteristic bar;
Described RAID nucleus module is used to receive the described characteristic bar that hits, and calculates the RAID rank of the described characteristic bar that hits, and successively the described characteristic bar that hits is sent to described input/output scheduling module according to other height of described RAID level;
Described input/output scheduling module is used for receiving successively the described characteristic bar that hits, and successively the characteristic bar that receives is positioned over the tail of the queue of request queue, and is sent to described starter module from team's head taking-up characteristic bar successively;
Described starter module is used for according to the godet module on the described characteristic bar startup disk, to finish the read-write operation of physical hard disk.
Preferably, the cache management system of the described RAID of being used for also comprises: interconnective configurating terminal module and global configuration module,
Described configurating terminal module is used for showing the duty of described global configuration module on described main frame, and receives the control command from described main frame;
Described global configuration module is used for other modules on the cache management system of the described RAID of being used for of load or unload, and the external interface of other modules on the cache management system of the described RAID of being used for is provided.
The invention also discloses a kind of management method of utilizing the cache management system of the described RAID of being used for, may further comprise the steps:
S1: receive input and output request, and this input and output request is encapsulated from main frame;
S2: will split into the certain characteristics data strip through the input and output request after the encapsulation, and judge one by one according to read-write type whether the data of described certain characteristics data strip correspondence hit, the characteristic bar execution in step S3 that hits, otherwise, the solution that must conflict by the time of miss characteristic bar;
S3: the RAID rank of calculating the described characteristic bar that hits;
S4: successively the characteristic bar that receives is positioned over the tail of the queue of request queue according to other height of described RAID level, and takes out the characteristic bar from team's head successively;
S5: according to the godet module on the described characteristic bar startup disk, to finish the read-write operation of physical hard disk.
Preferably, the determination methods that judgment data is hit among the step S2 is specially:
If read request and data hit, the data that then described characteristic bar corresponding address section is stored are the data that need read, and the described characteristic bar corresponding address section data of being stored are not upgraded by write request or the read request data are not hit renewal;
If write request and data hit, then described characteristic bar corresponding address section exists and is unoccupied, and perhaps described characteristic bar corresponding address section does not exist.
Preferably, calculating other algorithm of RAID level among the step S3 comprises: RAID0, RAID1, RAID5, RAID6 and disk cluster.
Preferably, press described RAID rank from high to low among the step S4.
(3) beneficial effect
The present invention not only can manage each storage block among the Cache easily, and is convenient to exchange with the next stage data, and having preferably simultaneously, mechanism can reduce the read-write of disk to improve overall system efficiency and performance.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.Following examples are used to illustrate the present invention, but are not used for limiting the scope of the invention.
The object of the present invention is to provide the system of the cache management of a kind of RAID of being used for, this system can make Cache carry out data efficiently with the next stage storage system easily and exchange.
Fig. 1 is according to the process flow diagram of the cache management system that is used for RAID of one embodiment of the present invention, comprising: the object machine module 1 of Lian Jieing, caching management module 2, RAID nucleus module 3, input/output scheduling module 4 and starter module 5 successively,
Described object machine module 1 is used to receive the input and output request from main frame 8, and this input and output request is encapsulated, and is sent to described caching management module 2 after the encapsulation;
Described caching management module 2, be used for and split into the certain characteristics data strip through the input and output request after the encapsulation, and judge one by one according to read-write type whether the data of described certain characteristics data strip correspondence hit, the characteristic bar that hits is sent to described RAID nucleus module 3, otherwise, the solution that must conflict by the time of miss characteristic bar;
Described RAID nucleus module 3, be used to receive the described characteristic bar that hits, and calculate the RAID rank of the described characteristic bar that hits, successively the described characteristic bar that hits is sent to described input/output scheduling module 4 according to other height of described RAID level;
Described input/output scheduling module 4 is used for receiving successively the described characteristic bar that hits, and successively the characteristic bar that receives is positioned over the tail of the queue of request queue, and is sent to described starter module 5 from team's head taking-up characteristic bar successively;
Described starter module 5 is used for according to the godet module 9 on the described characteristic bar startup disk, to finish the read-write operation of physical hard disk 10.
The godet module is responsible for the dirty data among the Cache is written to disk immediately, keeps the consistance of Cache buffer zone and disk physical data.The godet operation is divided into idle godet, forces three kinds on godet, active godet.Idle godet is meant and detects host operating system after the free time, utilizes free time that dirty data is written to operation in the disk.Force godet to be meant at the Cache buffer zone full, or when producing the Cache conflict, in the time of can't distributing the Cache buffer zone for new read-write requests, the godet operation of host operating system force start forces dish will empty portion C ache buffer zone to satisfy new I/O request.Current I when forcing to coil/O request is forced to hang up, and this moment, the host operating system performance was very low, must avoid forcing the generation of godet as far as possible.And initiatively the purpose of godet is exactly for fear of the generation of forcing godet, and host operating system regularly detects the dirty data ratio, if ratio is higher than the high limit that sets in advance, just starts the godet operation, is reduced to the lower bound that sets in advance up to the dirty data ratio.
Described object machine module 1, caching management module 2, RAID nucleus module 3, input/output scheduling module 4 and starter module 5 all have separately independently kernel thread, and these thread parallel work are each other with asynchronous system delivery request and response.Each module is all safeguarded an internal queues, and this formation is used to preserve from higher level's module request that sends and the response of returning from subordinate's module.When formation when being empty, kernel thread changes sleep over to, is waken up when new request or response arrive and handles them.This asynchronous working method has guaranteed that each module all independently carries out work, handles with the form of streamline through each module successively from the I/O request that main frame sends.
Present embodiment adopts internal memory to cushion the data of read-write requests as Cache, can effectively improve the I/O performance of storage system like this.The data of looking ahead are put into read among the Cache, because time, the spatial locality of data access, these data probably can be utilized once more, at this moment just can directly from read Cache, take out data, need not to go to read on the memory device of reality, can shorten the response time of system so greatly.And after the data of write order are put into Cache, just finish to ST module report write operation, and then the godet operation is carried out with the actual disk that is written to of data in the backstage in suitable.Can improve the response speed of write request like this, repeatedly write operation may repeat to revise same place in addition, and Cache can reduce actual writing disk manipulation.
The data organization form of Cache is with SU (Stripe Unit, continuous memory cell on a Logical Disk, described Logical Disk refers to the logical memory blocks of dividing on internal memory) be base unit, a plurality of SU form a characteristic bar STRIPE, and (described characteristic bar is the set by the SU of data map relation decision, described data map is closed the mapping relations that mean between logic storage unit and the physical memory cell), the data of each Logical Disk are that unit organization becomes a Hash table with characteristic bar STRIPE then, and the hash function of use is: StripeId%HashSize.
Preferably, the cache management system of the described RAID of being used for also comprises: interconnective configurating terminal module 6 and global configuration module 7,
Described configurating terminal module 6 is used for showing the duty of described global configuration module 7 on described main frame, and receives the control command from described main frame;
Described global configuration module 7, be used for other modules (other modules comprise: described object machine module 1, caching management module 2, RAID nucleus module 3, input/output scheduling module 4, starter module 5 and configurating terminal module 6) on the cache management system of the described RAID of being used for of load or unload, and the external interface of other modules on the cache management system of the described RAID of being used for is provided, described external interface refers to be used between described other modules the interface of data interaction.
The invention also discloses a kind of management method of the cache management system based on the described RAID of being used for, may further comprise the steps:
S1: receive input and output request, and this input and output request is encapsulated from main frame;
S2: will split into the certain characteristics data strip through the input and output request after the encapsulation, and judge one by one according to read-write type whether the data of described certain characteristics data strip correspondence hit, the characteristic bar execution in step S3 that hits, otherwise, the solution that must conflict by the time of miss characteristic bar;
S3: the RAID rank of calculating the described characteristic bar that hits;
S4: successively the characteristic bar that receives is positioned over the tail of the queue of request queue according to other height of described RAID level, and takes out the characteristic bar from team's head successively;
S5: according to the godet module on the described characteristic bar startup disk, to finish the read-write operation of physical hard disk.
Preferably, the determination methods that judgment data is hit among the step S2 is specially:
If read request and data hit, the data that then described characteristic bar corresponding address section is stored are the data that need read, and the described characteristic bar corresponding address section data of being stored are not upgraded by write request or the read request data are not hit renewal;
If write request and data hit, then described characteristic bar corresponding address section exists and is unoccupied, and perhaps described characteristic bar corresponding address section does not exist.
Preferably, calculating other algorithm of RAID level among the step S3 comprises: RAID0, RAID1, RAID5, RAID6 and disk cluster.
Preferably, press described RAID rank from high to low among the step S4.
Above embodiment only is used to illustrate the present invention; and be not limitation of the present invention; the those of ordinary skill in relevant technologies field; under the situation that does not break away from the spirit and scope of the present invention; can also make various variations and modification; therefore all technical schemes that are equal to also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.