CN103823636B - I O scheduling method and device - Google Patents

I O scheduling method and device Download PDF

Info

Publication number
CN103823636B
CN103823636B CN201210469189.XA CN201210469189A CN103823636B CN 103823636 B CN103823636 B CN 103823636B CN 201210469189 A CN201210469189 A CN 201210469189A CN 103823636 B CN103823636 B CN 103823636B
Authority
CN
China
Prior art keywords
request
fifo queue
conflict
chained list
call back
Prior art date
Application number
CN201210469189.XA
Other languages
Chinese (zh)
Other versions
CN103823636A (en
Inventor
裴金干
王术
刘虹越
王旭光
Original Assignee
苏州捷泰科信息技术有限公司
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 苏州捷泰科信息技术有限公司 filed Critical 苏州捷泰科信息技术有限公司
Priority to CN201210469189.XA priority Critical patent/CN103823636B/en
Publication of CN103823636A publication Critical patent/CN103823636A/en
Application granted granted Critical
Publication of CN103823636B publication Critical patent/CN103823636B/en

Links

Abstract

The invention discloses a kind of I O scheduling method and device, wherein method comprises the steps:When storage system is initialized, it is that each physical disk in storage system sets up an one-to-one fifo queue;Each I/O request to insert in fifo queue sets up the conflict chained list of an one-to-one I/O request;Perform insert each I/O request to fifo queue, start scanning from the head I/O request of the queue, judge queue conflict, and by recording the conflict chained list of I/O request, pending event is prepared to get up, other I/O request conflicts being sent to using conflict chained list in chained list release notice.Which obviate with solid state hard disc as a large amount of IO conflicts caused during caching process, effectively improve I/O read-write speed and transfer rate.

Description

I O scheduling method and device

Technical field

The present invention relates to computer realm, more particularly to a kind of I O scheduling method and device.

Background technology

IO (InputOutput, the input and output) type of block device is broadly divided into reading and writes two classes, and disk I O process energy Power is far below CPU disposal abilities, causes in certain special time, have multiple I/O requests to pile up in systems, waits dispatch deal, It is directed to traditional magnetic disk, current dispatching algorithm mainly there are two classes, one, first in first out service (First Input First Output, FIFO);2nd, elevator algorithm, namely nearby principle serviced.

But in the case of with solid state hard disc (Solid State Disk, SSD) as caching, above-mentioned dispatching algorithm is equal There is its shortcoming:First, FIFO can not reduce performance well using the low latency of SSD, however elevator algorithm for with It is again unnecessary for the SSD of machine access characteristics.The characteristic that simply can not all give full play to SSD using both dispatching algorithms is carried out Process.The presence of caching is additionally, since, the process logic of IO is changed, new problem is introduced, such as IO conflicts probability is significantly Increase, needs are solved.

In prior art, for the enterprise of storage system, especially with solid state hard disc caching process during, such as How efficiently, reasonably to carrying out I O scheduling, so as to the read or write speed for improving storage system is a very scabrous problem.

The content of the invention

Based on the problems referred to above, the invention provides a kind of I O scheduling method and device, reasonably, efficiently to set to block Standby storage carries out I O scheduling, so as to improve the read or write speed of storage system.

A kind of I O scheduling method that the present invention is provided, the I O scheduling method specifically include following step:

Step S100, when storage system is initialized, be that each physical disk in storage system sets up one one by one Corresponding fifo queue;

The I/O request that topmost paper system sends is received, according to the I/O request, the disk letter included in request is obtained Breath, and I/O request is inserted in fifo queue corresponding with target physical disk according to the disc information, it is fifo queue Each I/O request of middle insertion sets up the conflict chained list of an one-to-one I/O request, and the conflict chained list of the I/O request is used It is all in the corresponding fifo queue of record physical disk to have the I/O request for conflicting with described each I/O request for having existed;

Step S200, perform insert each I/O request to fifo queue, from the beginning of the head I/O request of the queue Scanning, judges that the already present I/O request in the queue whether there is with the I/O request being currently inserted into and conflicts, if judged result It is yes, execution step S300;If judged result is no, execution step S400;

Step S300, at once stopping scanning, arrange the first call back function, the I/O request being currently inserted into are added in queue Exist in the conflict chained list corresponding to the I/O request of conflict, and the I/O request that mark is currently inserted into, the IO for treating and being currently inserted into please After the completion of asking the I/O request of conflict to process, start scanning from the head I/O request of queue again, judge depositing in the queue I/O request and the I/O request being currently inserted into the presence or absence of conflict, sort in the I/O request being currently inserted into up in waiting list It is before on position and be currently inserted into after I/O request has an I/O request that IO conflicts all process terminates with described, further according to described The event that first call back function is arranged, performs the event of the I/O request of insertion;

Step S400, the asynchronous I/O operation for directly performing insertion I/O request, and using should at the block device of underlying services Front I/O request, arranges the second call back function;After the completion of I/O request is processed by the block device of underlying services, the second readjustment letter is called Number, the notice arranged further according to second call back function are scheduled process.

Further, it is as a kind of embodiment, in step S400, described according to second call back function The notice of setting, is scheduled process, comprises the following steps:

Step S410, I/O request after process is removed from the queue;

In conflict chained list after step S420, the detection process corresponding to I/O request, if there is IO to be handled please Ask and do not conflict with the I/O request before sorting in waiting list;

Step S430, if so, then wake up pending I/O request and can perform asynchronous I/O operation;

Step S440, if it is not, then by pending I/O request, performing and starting scanning from the head I/O request of queue again, sentence Already present I/O request in disconnected current queue, is arranged up in waiting list with the presence or absence of conflicting with currently pending I/O request Sequence before pending I/O request on position and there is the I/O request that IO conflicts with the pending I/O request and all locate Reason terminates, and the pending I/O request in the conflict chained list after processing corresponding to I/O request please with the IO before sequence in waiting list Ask after not conflicting, further according to the notice that second call back function is arranged, wake up pending I/O request and can perform asynchronous IO Operation.

It is preferred that used as a kind of embodiment, the I/O request performs asynchronous I/O operation and comprises the following steps:

Execution underlying services write the operation of cache memory and index zooms to internal memory operation.

It is preferred that as a kind of embodiment, set up conflict chain when each I/O request is inserted in the fifo queue The original state of table is sky.

It is preferred that as a kind of embodiment, first call back function point in including I/O request because IO conflicts and The event action that cannot temporarily process;Second call back function points to the notice that I/O request has been completed in including I/O request.

It is preferred that used as a kind of embodiment, the block device of the underlying services includes internal memory, solid state hard disc, disk And cache memory.

It is preferred that used as a kind of embodiment, the disc information includes the numbering of target physical disk, disk sector Initial address and length.

Correspondingly, present invention also offers a kind of I O scheduling device, including initial module, judge module, first process mould Block and Second processing module, wherein:

The initial module, for when storage system is initialized, being that each physical disk in storage system is set up One one-to-one fifo queue;The I/O request that topmost paper system sends is received, according to the I/O request, is obtained in request Comprising disc information, and I/O request is inserted into by fifo queue corresponding with target physical disk according to the disc information In, it is conflict chained list that each I/O request inserted in fifo queue sets up an one-to-one I/O request, the IO please The conflict chained list asked is used to recording all with described each I/O request for having existed in the corresponding fifo queue of physical disk There is the I/O request of conflict;

The judge module, for inserting each I/O request to fifo queue, from the head IO of the queue in execution Request starts scanning, judges that the already present I/O request in the queue whether there is with the I/O request being currently inserted into and conflicts, if Judged result is yes, then redirect first processing module and perform corresponding operating;If judged result is no, Second processing module is redirected Perform corresponding operating;

The first processing module, for stopping scanning at once, arranges the first call back function, by the I/O request being currently inserted into Exist in being added to queue in the conflict chained list corresponding to the I/O request of conflict, and the I/O request that mark is currently inserted into, treat and work as After the completion of the I/O request of the I/O request conflict of front insertion is processed, start scanning from the head I/O request of queue again, judge described Already present I/O request in queue, is sorted current up in waiting list with the presence or absence of conflicting with the I/O request being currently inserted into It is before the I/O request on position of insertion and with it is described be currently inserted into I/O request and there is I/O request all process that IO conflicts terminate Afterwards, the event for arranging further according to first call back function, performs the event of the I/O request of insertion;

The Second processing module, for the asynchronous I/O operation for directly performing insertion I/O request, and using underlying services The current I/O request of block device process, arranges the second call back function;After the completion of I/O request is processed by the block device of underlying services, adjust The second call back function is used, the notice arranged further according to second call back function is scheduled process.

Further, as a kind of embodiment, the Second processing module includes removing submodule, chained list detection Module, first wake up submodule and second and wake up submodule, wherein:

The removal submodule, for I/O request after process is removed from the queue;

The chained list detection sub-module, for detecting in the conflict chained list after the process corresponding to I/O request, if deposit Do not conflict in I/O request to be handled and with the I/O request before sorting in waiting list;

Described first wakes up submodule, is yes for judged result, then wakes up pending I/O request and can perform asynchronous IO Operation;

Described second wakes up submodule, is no for judged result, then by pending I/O request, perform again from queue Head I/O request starts scanning, judges that the already present I/O request in current queue whether there is with currently pending I/O request Conflict, until sorting before pending I/O request on position in waiting list and depositing with the pending I/O request Terminate in I/O request all process of IO conflicts, and the pending I/O request in the conflict chained list after processing corresponding to I/O request with etc. After the I/O request before sequence in queue does not conflict, further according to the notice that second call back function is arranged, wake up pending I/O request can perform asynchronous I/O operation.

Beneficial effects of the present invention include:

A kind of I O scheduling method and device that the present invention is provided, wherein method comprise the steps:It is initial in storage system During change, it is that each physical disk in storage system sets up an one-to-one fifo queue;To insert in fifo queue Each I/O request set up the conflict chained list of an one-to-one I/O request;Each I/O request is inserted to FIFO teams performing After row, start scanning from the head I/O request of the queue, judge queue conflict, and by recording the conflict chained list of I/O request, Realize preparing to get up by pending event, other I/O request conflicts being sent to using conflict chained list in chained list are released Notify, so as to avoid with solid state hard disc as a large amount of IO conflicts caused during caching process, will so effectively improve I/O Read-write speed and transfer rate.The I O scheduling method and device that the present invention is provided is ensureing data consistency, the base of integrity On plinth, with reference to the characteristic of SDD cachings, the optimum of I O process ability is reached, so as to improve the read or write speed of storage system.

Description of the drawings

Schematic flow sheets of the Fig. 1 for a specific embodiment of present invention I O dispatching method;

Fig. 2 a are the corresponding fifo queue of 2 physical disks for the numbering of a specific embodiment of present invention I O dispatching method;

Fig. 2 b remove the fifo queue after the I/O request that numbering is 1 and 2 for fifo queue in Fig. 2 a;

Fig. 2 c remove the fifo queue after the I/O request that numbering is 3 for fifo queue in Fig. 2 b;

Fig. 3 a are that the fifo queue in Fig. 2 a removes the fifo queue after the I/O request that numbering is 7;

Fig. 3 b are to rush after the fifo queue in Fig. 3 a removes the I/O request that numbering is 7 and with the I/O request that numbering is 7 The fifo queue of prominent chained list;

Structural representations of the Fig. 4 for one embodiment of present invention I O dispatching device;

Fig. 5 illustrates for the memory system architecture at the I O scheduling device place of one embodiment of present invention I O dispatching device Figure.

Specific embodiment

With reference to Figure of description, the specific embodiment of present invention I O dispatching method and device is illustrated.

The embodiment of the present invention is for as a example by the I O scheduling method of solid state hard disc, the present invention will be described, but is not limited to This.In whole storage system, the process of IO is stored by the process of stratification, normally referred to as stack, SSD caching process is used as stack One layer of centre and exist, it can receive I/O request from upper strata, be serve upper layers, while also can be provided using lower floor Service.

A kind of I O scheduling method provided in an embodiment of the present invention, as shown in figure 1, the I O scheduling method specifically include it is following Step:

Step S100, when storage system is initialized, be that each physical disk in storage system sets up one one by one Corresponding fifo queue;

The I/O request that topmost paper system sends is received, according to the I/O request, the disk letter included in request is obtained Breath, and I/O request is inserted in fifo queue corresponding with target physical disk according to the disc information, it is fifo queue Each I/O request of middle insertion sets up the conflict chained list of an one-to-one I/O request, and the conflict chained list of the I/O request is used It is all in the corresponding fifo queue of record physical disk to have the I/O request for conflicting with described each I/O request for having existed;

Step S200, perform insert each I/O request to fifo queue, from the beginning of the head I/O request of the queue Scanning, judges that the already present I/O request in the queue whether there is with the I/O request being currently inserted into and conflicts, if judged result It is yes, execution step S300;If judged result is no, execution step S400;

Step S300, at once stopping scanning, arrange the first call back function, the I/O request being currently inserted into are added in queue Exist in the conflict chained list corresponding to the I/O request of conflict, and the I/O request that mark is currently inserted into, the IO for treating and being currently inserted into please After the completion of asking the I/O request of conflict to process, start scanning from the head I/O request of queue again, judge depositing in the queue I/O request and the I/O request being currently inserted into the presence or absence of conflict, sort in the I/O request being currently inserted into up in waiting list It is before on position and be currently inserted into after I/O request has an I/O request that IO conflicts all process terminates with described, further according to described The event that first call back function is arranged, performs the event of the I/O request of insertion;

Step S400, the asynchronous I/O operation for directly performing insertion I/O request, and using should at the block device of underlying services Front I/O request, arranges the second call back function;After the completion of I/O request is processed by the block device of underlying services, the second readjustment letter is called Number, the notice arranged further according to second call back function are scheduled process.

Further, it is as a kind of embodiment, in step S400, described according to second call back function The notice of setting, is scheduled process, comprises the following steps:

Step S410, I/O request after process is removed from the queue;

In conflict chained list after step S420, the detection process corresponding to I/O request, if there is IO to be handled please Ask and do not conflict with the I/O request before sorting in waiting list;

Step S430, if so, then wake up pending I/O request and can perform asynchronous I/O operation;

Step S440, if it is not, then by pending I/O request, performing and starting scanning from the head I/O request of queue again, sentence Already present I/O request in disconnected current queue, is arranged up in waiting list with the presence or absence of conflicting with currently pending I/O request Sequence before pending I/O request on position and there is the I/O request that IO conflicts with the pending I/O request and all locate Reason terminates, and the pending I/O request in the conflict chained list after processing corresponding to I/O request please with the IO before sequence in waiting list Ask after not conflicting, further according to the notice that second call back function is arranged, wake up pending I/O request and can perform asynchronous IO Operation.

It is preferred that used as a kind of embodiment, the I/O request performs asynchronous I/O operation and comprises the following steps:

Execution underlying services write the operation of cache memory and index zooms to internal memory operation.

It is preferred that as a kind of embodiment, set up conflict chain when each I/O request is inserted in the fifo queue The original state of table is sky.

It is preferred that as a kind of embodiment, first call back function point in including I/O request because IO conflicts and The event action that cannot temporarily process;Second call back function points to the notice that I/O request has been completed in including I/O request.

It is preferred that used as a kind of embodiment, the block device of the underlying services includes internal memory, solid state hard disc, disk And cache memory.

It is preferred that used as a kind of embodiment, the disc information includes the numbering of target physical disk, disk sector Initial address and length.

It will be understood by those skilled in the art that the method for I O scheduling provided by the embodiment of the present invention, its essence is Pass through:I/O request establishes conflict chained list when inserting, due to being asynchronous I/O operation during scheduling, so processing each I/O request Queue conflict should be detected, in the current I/O request of the post processing that do not conflict, after having processed current I/O request, is called out under suitable conditions Other I/O requests in awake its conflict chained list;Wherein, suitable condition is that queue does not conflict.

During enforcement, said process is realized by two call back functions:First call back function is used for current IO The event action that cannot temporarily process because IO conflicts is asked, and waits current I/O request above-mentioned event not to be processed in conflict.Second The current I/O request of other I/O requests that call back function is used to notify current I/O request to conflict in chained list is over, and suitable Under the conditions of its wake up conflict chained list in other I/O requests perform asynchronous I/O operations;Wherein, suitable condition is that queue does not conflict.Letter Concentrate the talk of, the first call back function is the event to be done in order to prepare current I/O request.Second call back function is to wake up conflict chain Other I/O requests (notifying to have relieved conflict) of table.

Method in order to I O scheduling provided in an embodiment of the present invention is better described, the example for a reality are illustrated I O scheduling realizes process.

After certain hour after storage system initialization, physical disk (numbering is 2) the corresponding FIFO in storage system Queue;There is the I/O request that numbering is 1,2,3,4,5,6,7 in former queue, as shown in Figure 2 a, the I/O request being currently inserted into is Numbering is 7 I/O request;(it should be noted that after certain hour, wherein 1 and 2 process of numbering terminates and removes Above-mentioned queue.) as shown in Figure 2 b, in figure, each circle represents the I/O request for having removed from the queue, single underscore is represented The I/O request for processing, double underline represent the I/O request being inserted into.

Step 301, execution insert I/O request (numbering is 7 I/O request) to fifo queue, from the head of the queue IO (numbering is 3 I/O request) requests start scanning, judge already present I/O request and the IO being currently inserted in the queue Request is with the presence or absence of conflict (numbering is the I/O request of 3-6), if the determination result is YES, execution step S302;If judged result is It is no, then execution step S303;

Step S302, at once stopping scanning, arrange the first call back function, and by the I/O request being currently inserted into, (numbering is 7 IO Request) be added to queue in there is the I/O request (assuming with the I/O request that numbering is 7 with to number be that 3 I/O request conflicts) of conflict In corresponding conflict chained list, and the I/O request that mark is currently inserted into, treat that the I/O request conflicted with the I/O request being currently inserted into (is compiled Number for 3 I/O request) process after the completion of, as shown in Figure 2 c, again from the head I/O request of queue start scanning, judge the team Already present I/O request in row with the presence or absence of conflicting, is sorted up in waiting list and is inserted currently with the I/O request being currently inserted into It is before the I/O request on position for entering and be currently inserted into after I/O request has an I/O request that IO conflicts all process terminates with described, Further according to the event that first call back function is arranged, the event of the I/O request of insertion is performed;

In above-mentioned steps S302, when No. 3 IO in queue are conflicted with No. 7 No. IO, No. 7 requests at this moment wouldn't be processed, After waiting No. 3 process to terminate, start scanning from the head I/O request of queue again, judge that the already present IO in the queue please Ask (numbering is the I/O request of 4-6, and as shown in Figure 2 c, Fig. 2 b illustrate that the queue after removing No. 3 I/O requests) and be currently inserted into I/O request (numbering is 7 I/O request) with the presence or absence of conflict, as long as until waiting list in sort the IO being currently inserted into please It is before seeking on position and with it is described be currently inserted into I/O request and exist after I/O request all process that IO conflicts terminate (assume current Queue 4,5,6 does not all conflict with 7), the event of the I/O request (numbering is 7 I/O request) for performing insertion is at this moment directly processed, Wherein, the event for being arranged according to first call back function, performs the operation of above-mentioned event;

Certainly, in former queue numbering be the I/O request of 3-6 may be that 7 I/O request not conflict with numbering, will so hold Row step S400:

Step S400, the asynchronous I/O operation for directly performing insertion I/O request (numbering is 7 I/O request), and taken using lower floor The block device of business processes current I/O request, arranges the second call back function;Processed by the block device of underlying services in I/O request and completed Afterwards, the second call back function is called, the notice arranged further according to second call back function is scheduled process.

In above-mentioned steps S400, then the I/O request that numbering is 7 is first processed, during execution, needs setting to call the second readjustment letter Number, wait number be 7 I/O request process terminate after, call the second call back function, process and remove from former queue (numbering is 3-7) Numbering is 7 I/O request, new queue as shown in Figure 3 a, propulsion over time, as the foundation of this storage system is asynchronous I/O operation, so the I/O request for processing can be multiple, at this moment queue there may be various situations, and situations below is only to crowd Many situations carry out several being analyzed:

May insert new IO (such as 8,9,10) in situation one, at this moment queue, at this moment queue there will be (3,4,5,6, 8th, 9,10), as shown in Figure 3 b, due to the I/O request for processing can be it is multiple, at this moment can treatable numbering 3 I/O request And the I/O request that numbering is 8,9, the conflict chained list after so detecting the process corresponding to I/O request (numbering is 7 I/O request) (in the conflict chained list for assuming the request that numbering is 7, being identified with 8 and 9), if there is I/O request to be handled and and waiting list I/O request before middle sequence does not conflict.

Obvious numbering is that 3 I/O request can not possibly be conflicted (it is determined that mistake) with 7 presence, and at this moment No. 3 requests can be with IO Process;But the process of No. 8 I/O requests, while needing to detect that again queue IO conflicts, will also detect that the numbering of firm removal is 7 I/O request conflict chained list (form of the vertical lower section of No. 7 I/O requests illustrates the conflict chained list of No. 7 I/O requests in Fig. 3 b), it is false If without the I/O request that No. 8 are constituted with conflict in queue, it is clear that in above-mentioned hypothesized model, having No. 8 in No. 7 I/O request correspondence chained lists I/O request, then the second call back function of No. 7 I/O request settings will wake up No. 8 requests, and No. 7 have removed, and can perform 8 Number;

If assuming only No. 9 I/O requests in No. 7 I/O request correspondence chained lists, when performing No. 9, queue is equally detected again While IO conflicts (including 3,4,5,6, No. 8 I/O requests of detection), to also detect that the numbering of firm removal is the conflict of 7 I/O request Chained list, at this moment only has No. 9 I/O requests in obvious No. 7 I/O requests correspondence chained list, but No. 7 I/O requests has moved out, please in No. 8 IO Ask in the case of not conflicting with No. 9 I/O requests, the second call back function of No. 7 I/O request settings will wake up No. 9 I/O requests and can hold Line asynchronous I/O operation.Therefore above-mentioned condition meets:Until sorting before pending I/O request on position in waiting list And there is I/O request all process that IO conflicts with the pending I/O request and terminate, and rushing corresponding to I/O request after processing After pending I/O request in prominent chained list is not conflicted with the I/O request before sequence in waiting list, further according to the described second readjustment The notice of function setup, wakes up pending I/O request and can perform asynchronous I/O operation.

It will be understood by those skilled in the art that in above-mentioned steps, by arranging call back function and reasonable profit twice Processed with the characteristic of solid state hard disc, so prepare to get up by pending event, be sent in chained list using conflict chained list Other I/O request conflicts release notices, it is a large amount of as what is caused during caching process with solid state hard disc so as to avoid IO conflicts, and will so effectively improve I/O read-write speed and transfer rate.

Based on same inventive concept, the embodiment of the present invention additionally provides a kind of I O scheduling device, as this device solves to ask The principle of topic is similar to a kind of aforementioned I O scheduling method, therefore the enforcement of the device may refer to the enforcement of preceding method, repeats Part is repeated no more.

Correspondingly, the embodiment of the present invention additionally provides a kind of I O scheduling device, as shown in figure 4, the I O scheduling device 40, Including initial module 401, judge module 402, first processing module 403 and Second processing module 404, Fig. 5 illustrates this enforcement In the storage system that the I O scheduling device of example is located, topmost paper system 10, cache20, the block device 30, IO of underlying services are adjusted The structural relation schematic diagram of degree device 40, wherein:

The initial module 401, for when storage system 1 is initialized, being each physical disk in storage system Set up an one-to-one fifo queue;The I/O request that topmost paper system 10 sends is received, according to the I/O request, is obtained Disc information included in request, and I/O request is inserted into according to the disc information corresponding with target physical disk In fifo queue, it is conflict chained list that each I/O request inserted in fifo queue sets up an one-to-one I/O request, The conflict chained list of the I/O request be used to recording in the corresponding fifo queue of physical disk it is all with it is described existed it is each Individual I/O request has the I/O request of conflict;

The judge module 402, for inserting each I/O request to fifo queue, from the head of the queue in execution I/O request starts scanning, judges that the already present I/O request in the queue whether there is with the I/O request being currently inserted into and conflicts, If the determination result is YES, then redirect first processing module and perform corresponding operating;If judged result is no, second processing mould is redirected Block performs corresponding operating;

The first processing module 403, for stopping scanning at once, arranges the first call back function, by the IO being currently inserted into Request is present in being added to queue in the conflict chained list corresponding to the I/O request of conflict, and the I/O request that mark is currently inserted into, and treats After the completion of the I/O request conflicted with the I/O request being currently inserted into is processed, start scanning from the head I/O request of queue again, judge Already present I/O request in the queue, is sorted up in waiting list with the presence or absence of conflicting with the I/O request being currently inserted into It is before the I/O request on position being currently inserted into and with it is described be currently inserted into I/O request and there is the I/O request that IO conflicts all process After end, further according to the event that first call back function is arranged, the event of the I/O request of insertion is performed;

The Second processing module 404, for the asynchronous I/O operation for directly performing insertion I/O request, and uses underlying services Block device 30 process current I/O request, the second call back function is set;Processed by the block device of underlying services in I/O request and completed Afterwards, the second call back function is called, the notice arranged further according to second call back function is scheduled process.

Further, as a kind of embodiment, the Second processing module includes removing submodule, chained list detection Module, first wake up submodule and second and wake up submodule, wherein:

The removal submodule, for I/O request after process is removed from the queue;

The chained list detection sub-module, for detecting in the conflict chained list after the process corresponding to I/O request, if deposit Do not conflict in I/O request to be handled and with the I/O request before sorting in waiting list;

Described first wakes up submodule, is yes for judged result, then wakes up pending I/O request and can perform asynchronous IO Operation;

Described second wakes up submodule, is no for judged result, then by pending I/O request, perform again from queue Head I/O request starts scanning, judges that the already present I/O request in current queue whether there is with currently pending I/O request Conflict, until sorting before pending I/O request on position in waiting list and depositing with the pending I/O request Terminate in I/O request all process of IO conflicts, and the pending I/O request in the conflict chained list after processing corresponding to I/O request with etc. After the I/O request before sequence in queue does not conflict, further according to the notice that second call back function is arranged, wake up pending I/O request can perform asynchronous I/O operation.

A kind of I O scheduling method and device provided in an embodiment of the present invention, wherein method comprise the steps:In storage system During system initialization, it is that each physical disk in storage system sets up an one-to-one fifo queue;For fifo queue Each I/O request of middle insertion sets up the conflict chained list of an one-to-one I/O request;Each I/O request is inserted extremely performing After fifo queue, start scanning from the head I/O request of the queue, judge queue conflict, and by recording the conflict of I/O request Chained list, realizes preparing to get up by pending event, and other I/O request conflicts being sent to using conflict chained list in chained list are released Notice, so as to avoid with solid state hard disc as a large amount of IO conflicts caused during caching process, so will effectively Improve I/O read-write speed and transfer rate.I O scheduling method and device provided in an embodiment of the present invention is ensureing that data are consistent Property, on the basis of integrity, with reference to the characteristic of SDD cachings, the optimum of I O process ability is reached, so as to improve the reading of storage system Writing rate.

Embodiment described above only expresses the several embodiments of the present invention, and its description is more concrete and detailed, but and Therefore the restriction to the scope of the claims of the present invention can not be interpreted as.It should be pointed out that for one of ordinary skill in the art For, without departing from the inventive concept of the premise, some deformations and improvement can also be made, these belong to the guarantor of the present invention Shield scope.Therefore, the protection domain of patent of the present invention should be defined by claims.

Claims (9)

1. a kind of I O scheduling method, it is characterised in that comprise the steps:
Step S100, when storage system is initialized, be that each physical disk in storage system sets up an one-to-one corresponding Fifo queue;
The I/O request that topmost paper system sends is received, according to the I/O request, the disc information included in I/O request is obtained, And I/O request is inserted in fifo queue corresponding with target physical disk according to the disc information, it is to insert in fifo queue Each I/O request for entering sets up the conflict chained list of an one-to-one I/O request, and the conflict chained list of the I/O request is used to remember It is all in the corresponding fifo queue of record physical disk to have the I/O request for conflicting with each I/O request that is having existed;
Step S200, perform insert each I/O request to fifo queue, from the beginning of the head I/O request of the fifo queue Scanning, judge the already present I/O request in the fifo queue with the I/O request being currently inserted into the presence or absence of conflicting, if judgement As a result it is yes, execution step S300;If judged result is no, execution step S400;
Step S300, at once stopping scanning, arrange the first call back function, the I/O request being currently inserted into are added in fifo queue Exist in the conflict chained list corresponding to the I/O request of conflict, and the I/O request that mark is currently inserted into, the IO for treating and being currently inserted into please After the completion of asking the I/O request of conflict to process, start scanning from the head I/O request of fifo queue again, judge the fifo queue In already present I/O request and the I/O request being currently inserted into the presence or absence of conflict, sort up in fifo queue and be currently inserted into I/O request on position before and after there is the I/O request that IO conflicts all process terminate with the I/O request being currently inserted into, Further according to the event that first call back function is arranged, the event of the I/O request of insertion is performed;
Step S400, the asynchronous I/O operation for directly performing insertion I/O request, and the block device using underlying services processes current IO Request, arranges the second call back function;After the completion of I/O request is processed by the block device of underlying services, the second call back function is called, The notice arranged further according to second call back function is scheduled process.
2. I O scheduling method according to claim 1, it is characterised in that in step S400, described in the basis The notice that second call back function is arranged, is scheduled process, comprises the following steps:
Step S410, I/O request after process is removed from the fifo queue;
In step S420, the conflict chained list for detecting after the process corresponding to I/O request, if exist I/O request to be handled and Do not conflict with the I/O request before sorting in fifo queue;
Step S430, if so, then wake up pending I/O request and can perform asynchronous I/O operation;
Step S440, if it is not, then by pending I/O request, performing and starting scanning from the head I/O request of fifo queue again, sentence Already present I/O request and the currently pending I/O request broken in current fifo queue with the presence or absence of conflict, up to fifo queue It is middle sequence before pending I/O request on position and there is the I/O request that IO conflicts with the pending I/O request All process terminate, and before sorting in the pending I/O request and fifo queue in the conflict chained list after processing corresponding to I/O request After I/O request does not conflict, further according to the notice that second call back function is arranged, the pending I/O request of wake-up can perform different Step I/O operation.
3. I O scheduling method according to claim 1 and 2, it is characterised in that the I/O request performs asynchronous I/O operation bag Include following steps:
Execution underlying services write the operation of cache memory and index zooms to internal memory operation.
4. I O scheduling method according to claim 1, it is characterised in that when each I/O request is inserted in the fifo queue The original state of set up conflict chained list is sky.
5. the I O scheduling method according to claim 1 or 4, it is characterised in that first call back function includes I/O request It is middle to point to the event action that temporarily process because IO conflicts;Second call back function points to I/O request in including I/O request The notice for having completed.
6. the I O scheduling method according to claim 1 or 4, it is characterised in that in the block device of the underlying services includes Deposit, solid state hard disc, disk and cache memory.
7. the I O scheduling method according to claim 1 or 4, it is characterised in that the disc information includes target physical magnetic The numbering of disk, the initial address of disk sector and length.
8. a kind of I O scheduling device, it is characterised in that including initial module, judge module, first processing module and second processing Module, wherein:
The initial module, for when storage system is initialized, being that each physical disk in storage system sets up one One-to-one fifo queue;The I/O request that topmost paper system sends is received, according to the I/O request, institute in I/O request is obtained Comprising disc information, and I/O request is inserted into by fifo queue corresponding with target physical disk according to the disc information In, it is conflict chained list that each I/O request inserted in fifo queue sets up an one-to-one I/O request, the IO please During the conflict chained list asked is used to record the corresponding fifo queue of physical disk, all and each I/O request that is having existed has punching Prominent I/O request;
The judge module, for inserting each I/O request to fifo queue, from the head I/O request of fifo queue in execution Start scanning, judge the already present I/O request in fifo queue with the I/O request being currently inserted into the presence or absence of conflicting, if judgement As a result it is yes, then redirects first processing module and perform corresponding operating;If judged result is no, Second processing module execution is redirected Corresponding operating;
The first processing module, for stopping scanning at once, arranges the first call back function, the I/O request being currently inserted into is added Exist in fifo queue in the conflict chained list corresponding to the I/O request of conflict, and the I/O request that mark is currently inserted into, treat and work as After the completion of the I/O request of the I/O request conflict of front insertion is processed, start scanning from the head I/O request of fifo queue again, judge Already present I/O request in fifo queue, is sorted up in fifo queue with the presence or absence of conflicting with the I/O request being currently inserted into It is before the I/O request on position being currently inserted into and there is the I/O request that IO conflicts with the I/O request being currently inserted into and all locate After reason terminates, further according to the event that first call back function is arranged, the event of the I/O request of insertion is performed;
The Second processing module, sets for the asynchronous I/O operation for directly performing insertion I/O request, and the block using underlying services It is standby to process current I/O request, the second call back function is set;After the completion of I/O request is processed by the block device of underlying services, the is called Two call back functions, the notice arranged further according to second call back function are scheduled process.
9. I O scheduling device according to claim 8, it is characterised in that the Second processing module includes removing submodule Block, chained list detection sub-module, first wake up submodule and second and wake up submodule, wherein:
The removal submodule, for I/O request after process is removed from fifo queue;
The chained list detection sub-module, for detecting in the conflict chained list after the process corresponding to I/O request, if there are Pending I/O request and with fifo queue sort before I/O request do not conflict;
Described first wakes up submodule, is yes for judged result, then wakes up pending I/O request and can perform asynchronous I/O operation;
Described second wakes up submodule, is no for judged result, then by pending I/O request, perform again from fifo queue Head I/O request starts scanning, judges whether are already present I/O request in current fifo queue and currently pending I/O request There is conflict, until sorting before pending I/O request on position in fifo queue and asking with the pending IO The I/O request all process conflicted in IO of seeking survival terminate, and the pending I/O request in the conflict chained list after processing corresponding to I/O request After not conflicting with the I/O request before sequence in fifo queue, further according to the notice that second call back function is arranged, wake-up is treated Process I/O request and can perform asynchronous I/O operation.
CN201210469189.XA 2012-11-19 2012-11-19 I O scheduling method and device CN103823636B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210469189.XA CN103823636B (en) 2012-11-19 2012-11-19 I O scheduling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210469189.XA CN103823636B (en) 2012-11-19 2012-11-19 I O scheduling method and device

Publications (2)

Publication Number Publication Date
CN103823636A CN103823636A (en) 2014-05-28
CN103823636B true CN103823636B (en) 2017-04-05

Family

ID=50758726

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210469189.XA CN103823636B (en) 2012-11-19 2012-11-19 I O scheduling method and device

Country Status (1)

Country Link
CN (1) CN103823636B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317656B (en) 2014-10-14 2018-01-16 深圳市锐明技术股份有限公司 A kind of method and device of block device input-output request scheduling
CN104360966B (en) * 2014-11-21 2017-12-12 浪潮(北京)电子信息产业有限公司 To block number according to the method and apparatus for carrying out input-output operation
CN105159609A (en) * 2015-08-31 2015-12-16 北京神州云科数据技术有限公司 IO (Input/Output) flow control method and device based on virtual disk layer
CN105138471B (en) * 2015-09-01 2018-04-13 浪潮(北京)电子信息产业有限公司 Mirrored procedure treating method and apparatus
CN106527959B (en) * 2015-09-10 2019-07-26 阿里巴巴集团控股有限公司 Refresh the processing method and equipment of disk input output request
CN105549910B (en) * 2015-12-14 2018-09-07 浪潮(北京)电子信息产业有限公司 A kind of I O scheduling method and device
CN107153566A (en) * 2016-03-04 2017-09-12 中移(苏州)软件技术有限公司 Virtual machine I/O performance optimization methods and device
CN107678680A (en) * 2017-07-27 2018-02-09 深圳市云舒网络技术有限公司 The concurrent IO of correcting and eleting codes method and storage device in distributed block storage system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1991733A (en) * 2005-12-31 2007-07-04 英业达股份有限公司 Data automatic classification access method expanding virtual hand disk

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040205297A1 (en) * 2003-04-14 2004-10-14 Bearden Brian S. Method of cache collision avoidance in the presence of a periodic cache aging algorithm
JP4686305B2 (en) * 2005-08-26 2011-05-25 株式会社日立製作所 Storage management system and method
US9053032B2 (en) * 2010-05-05 2015-06-09 Microsoft Technology Licensing, Llc Fast and low-RAM-footprint indexing for data deduplication

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1991733A (en) * 2005-12-31 2007-07-04 英业达股份有限公司 Data automatic classification access method expanding virtual hand disk

Also Published As

Publication number Publication date
CN103823636A (en) 2014-05-28

Similar Documents

Publication Publication Date Title
US9767140B2 (en) Deduplicating storage with enhanced frequent-block detection
US9904489B2 (en) Processing systems, memory controllers and methods for controlling memory access operations
US8984085B2 (en) Apparatus and method for controlling distributed memory cluster
EP2780799B1 (en) Throttle disk i/o using disk drive simulation model
US8521985B2 (en) Storage subsystem
US9122401B2 (en) Efficient enforcement of command execution order in solid state drives
EP2361404B1 (en) Method and system for queuing transfers of multiple non-contiguous address ranges with a single command
Xie et al. Three-dimensional integrated circuit design
CN103262030B (en) Via dynamic aggregation operation fast and the concurrent priority query of linearization
CN102750130B (en) Method and system for allocating counters to track mappings
US20120317371A1 (en) Usage Aware NUMA Process Scheduling
CN103605615B (en) Block-level-data-based directional allocation method for hierarchical storage
US9122606B2 (en) Method and system for distributing tiered cache processing across multiple processors
US8832333B2 (en) Memory system and data transfer method
US7707337B2 (en) Object-based storage device with low process load and control method thereof
US20140298304A1 (en) Transmission Point Pattern Extraction from Executable Code in Message Passing Environments
CN103562878B (en) Memory check point in mirror image dummy machine system is set
US9262357B2 (en) Associating process priority with I/O queuing
EP1450270B1 (en) System and method of distributing replication commands
CN101088075B (en) System and method for non-uniform cache in a multi-core processor
US9043923B2 (en) Virtual machine monitor (VMM) extension for time shared accelerator management and side-channel vulnerability prevention
CN103383672B (en) High-speed cache control is to reduce transaction rollback
WO2013191721A1 (en) Allocating heaps in numa systems
US7788435B2 (en) Interrupt redirection with coalescing
JP2012212391A (en) System, method and program for protection against unauthorized access

Legal Events

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

Effective date of registration: 20181228

Address after: 100010 No. 301, East Crossing Building, 3rd Floor, 28 Longtan Road, Dongcheng District, Beijing

Patentee after: Beijing Artest Technology Co., Ltd.

Address before: 215021 Room 505, A4 Floor, Nanotechnology Park, 218 Xinghu Street, Suzhou Industrial Park, Jiangsu Province

Patentee before: Suzhou Ejitec Co., Ltd.