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 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 a kind of cache management system for RAID, 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 for receiving 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 the input and output request after encapsulation is split into some characteristic bars, and judge one by one according to read-write type whether the data of described some characteristic bar correspondences 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 for receiving 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 the described characteristic bar that hits successively, 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, described cache management system for RAID also comprises: interconnective configurating terminal module and global configuration module,
Described configurating terminal module is used for showing at described main frame the duty of described global configuration module, and receives the control command from described main frame;
Described global configuration module, it is described for other modules on the cache management system of RAID to be used for load or unload, and described external interface for other modules on the cache management system of RAID is provided.
The invention also discloses a kind of management method of utilizing described cache management system for RAID, may further comprise the steps:
S1: receive the input and output request from main frame, and this input and output request is encapsulated;
S2: the input and output request after encapsulation is split into some characteristic bars, and judge one by one according to read-write type whether the data of described some characteristic bar correspondences 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 the then data of the described characteristic bar corresponding address section data of storing for reading, and described characteristic bar corresponding address section are 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 for explanation the present invention, but are not used for limiting the scope of the invention.
The object of the present invention is to provide a kind of system of the cache management for RAID, 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 for receiving 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 the input and output request after encapsulation is split into some characteristic bars, and judge one by one according to read-write type whether the data of described some characteristic bar correspondences 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 for receiving 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 the described characteristic bar that hits successively, 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 refers to detect host operating system after the free time, utilizes free time that dirty data is written to operation in the disk.Force godet to refer 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 for preserving 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 again, 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 organizational 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 at 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 mapping relations decision, described data mapping relations refer to the mapping relations 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, described cache management system for RAID also comprises: interconnective configurating terminal module 6 and global configuration module 7,
Described configurating terminal module 6 is used for showing at described main frame the duty of described global configuration module 7, and receives the control command from described main frame;
Described global configuration module 7, it is described for other modules on the cache management system of RAID (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) to be used for load or unload, and provide described external interface for other modules on the cache management system of RAID, described external interface to refer to be used between described other modules the interface of data interaction.
The invention also discloses a kind of management method based on described cache management system for RAID, may further comprise the steps:
S1: receive the input and output request from main frame, and this input and output request is encapsulated;
S2: the input and output request after encapsulation is split into some characteristic bars, and judge one by one according to read-write type whether the data of described some characteristic bar correspondences 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 the then data of the described characteristic bar corresponding address section data of storing for reading, and described characteristic bar corresponding address section are 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 for explanation 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 a variety of changes 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.