CN106775438A - A kind of I/O dispatching methods based on solid-state disk read write attribute - Google Patents

A kind of I/O dispatching methods based on solid-state disk read write attribute Download PDF

Info

Publication number
CN106775438A
CN106775438A CN201510827493.0A CN201510827493A CN106775438A CN 106775438 A CN106775438 A CN 106775438A CN 201510827493 A CN201510827493 A CN 201510827493A CN 106775438 A CN106775438 A CN 106775438A
Authority
CN
China
Prior art keywords
request
write
read
merging
jump
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.)
Granted
Application number
CN201510827493.0A
Other languages
Chinese (zh)
Other versions
CN106775438B (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 CN201510827493.0A priority Critical patent/CN106775438B/en
Publication of CN106775438A publication Critical patent/CN106775438A/en
Application granted granted Critical
Publication of CN106775438B publication Critical patent/CN106775438B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of I/O dispatching methods based on solid-state disk difference read write attribute.The optimal merging in solid-state disk inside is obtained by way of Black-box Testing and asks page size that clusters;Read-write requests are separated, processes read request and write request in bulk respectively to avoid reading and writing in composite mode interfering in solid-state disk;Performance in view of read request under ordered mode is significantly larger than the performance of read request under stochastic model, the time that read request not only arrives according to request is queued up in chained list, sorted in RBTree according further to the initial reference address of read request, to construct the succession of read request, to merging and merging backward before read request after sequence is carried out, the largest amount asked after merging is no more than page size that clusters;Performance in view of write request under the performance and stochastic model of write request under ordered mode is essentially identical, and the time that write request only needs to be arrived according to request queues up in chained list, it is not necessary to the succession of the construction write request that sorted in RBTree.

Description

A kind of I/O dispatching methods based on solid-state disk read write attribute
Technical field
The invention belongs to solid-state disk technical field of memory, solid-state disk is based on not more particularly, to one kind With the I/O dispatching methods of read write attribute.
Background technology
Solid-state disk (Solid state disk, abbreviation SSD) be it is a kind of by the use of nand flash memory chip as The hard disk that data are permanently stored, the production cost with nand flash memory chip declines, the price of SSD Also increasingly received by people, SSD sets in data center, PC, various types of movements Standby upper use is more and more extensive.But, because the equipment for building storage system for a long time is all hard Disk drive (Hard disk drive, abbreviation HDD), most of existing systems soft ware be towards HDD is designed and optimizes, and directly using SSD replacing HDD can not send out to greatest extent Wave the high-performance of SSD.Therefore, systems soft ware optimization tool is carried out for SSD to be of great significance.
HDD is a kind of hard disk of machinery rotating type, and its read-write operation mainly has following steps:
1st, seek:All of magnetic head is moved to cylinder to be visited by magnetic head transmission device, and acquisition is worked as Before the head number that needs to use;2nd, rotational latency:After navigating to corresponding card and magnetic track, card is just Can rotate, during rotation, magnetic head can be read in the sector leader in the sector immediately below it Information, compares with the sector number of read/write is needed, and card may proceed to rotation if mismatching, If matching if since this sector read/write data;3rd, reading and writing data is completed.HDD read-write operations are very Big portion of time consumption is on tracking and rotational latency, and the I O scheduling algorithm institute in linux kernel The optimization done is main also for the time loss for reducing tracking and rotational latency.
In linux system, existing I O scheduling algorithm is mainly Noop algorithms, CFQ algorithms Deadline algorithms and Anticipatory algorithms.Wherein CFQ, Deadline and Anticipatory are calculated Method is long for the HDD tracking times, takes the continuous read-write requests of merging, thus can be in tracking Continuously read and write after end.Noop algorithms are refused read-write requests to merge, and only insert new request Enter tail of the queue.
However, there is following aspect in above-mentioned I O scheduling algorithm:1st, in SSD, order Write essentially identical with random write performance, so write request is merged, and the speed of SSD can not be improved Rate, can influence the performance of system on the contrary;2nd, in SSD, on the premise of no more than page size that clusters Merging read request can just improve reading efficiency, and read request size can't improve reading after exceeding page size that clusters Efficiency.
The content of the invention
For the disadvantages described above or Improvement requirement of prior art, solid-state disk is based on the invention provides one kind The I/O dispatching methods of different read write attributes, it is intended that solving to exist in existing I O scheduling method Continuous read request merge after it is excessive or can not be merged and write request has unnecessary merging Technical problem.
To achieve the above object, according to one aspect of the present invention, there is provided a kind of to be read based on solid-state disk The I O scheduling method of write attribute, comprises the following steps:
(1) receive from upper layer application and by the bio requests after file system treatment, and judge the bio The type of request is read request or write request, if read request is then transferred to step (2), if Write request is then transferred to step (3);
(2) judge the read request whether can read request adjacent thereto merge, if can not merge, Then directly it is transferred to step (4);If the size after can merging and merging is no more than the size of the page that clusters, Then it is merged with neighbouring read request, the read request after merging still can be with reading adjacent thereto Request is merged, and should be ensured that the size after merging is no more than the size of the page that clusters.Will be final Read request after merging is put into reading queue and reading RBTree, so that system reads data.Then it is transferred to Step (4).
(3) judge whether the write request can merge with the write request in caching, if can if Merge, and by the write request insertion dispatcher queue end after merging, and it is transferred to step (4); Otherwise judge that can it merge with the write request in Hash table, if can if merge, and Write request insertion dispatcher queue end after just merging, and it is transferred to step (4);
(4) request in dispatcher queue is distributed in the request queue of device driver.
Preferably, step (2) includes following sub-step:
(2.1) for the read request, the read request of last time merging is judged whether, if in the presence of, Jump to step (2.2);Otherwise jump to step (2.3);
(2.2) judge the read request merged with last time after read request can merge.If can not Merge, then jump to step (2.3), if preceding step (2.4) can be jumped to merging, if Can backward merge, then jump to step (2.5);
(2.3) judge that can the read request be merged backward with the request in ltsh chain table, if energy Then jump to step (2.5);Otherwise jump to step (2.6);
(2.4) complete can the forward direction read request Rfrq and the read request that merge merge, and judge it is preceding to Can the read request Rfrq after merging continue and read to be visited according to the starting of request in RBTree in scheduler Ask the previous read request Rprev of the Rfrq of address sort before proceeding to merging.Step can then be jumped to Suddenly (2.7), step (2.8) is otherwise jumped to;
(2.5) merging for the request Rbrq that can merge backward and the read request is completed, and judges conjunction backward And can request Rbrq afterwards continue and the initial access in reading RBTree in scheduler according to request The latter request Rnext of the Rbrq of location sequence proceeds backward merging.Step can then be jumped to (2.9) step (2.10), is otherwise jumped to;
(2.6) to merging before judging the read request and being carried out with the request read in scheduler in RBTree, If can if jump to step (2.4), otherwise jump to step (2.11);
(2.7) read request Rfrq is completed to merge with the forward direction of read request Rperv, deletion scheduler reading queue, Read the Rfrq requests in RBTree and generic block layer ltsh chain table;Simultaneously according to the read request being merged Size changes positions of the Rprev in ltsh chain table;And by merging after service time the latest be set to Less one in the service time the latest of Rfrq and Rprev;The read request mark that finally last time was merged It is Rfrq.
(2.8) read request that last time merges is set to Rfrq, and updates Rfrq's in RBTree is read Initial address;
(2.9) complete request Rbrq to merge with request the backward of Rnext, reading queue, reading in scheduler Rnext requests are deleted in the ltsh chain table of RBTree and generic block layer, Rbrq requests is updated in hash chain Position in table, by service time is set to the clothes of the read request after merging earlier in Rbrq and Rnext The business time, the read request that Rbrq was merged labeled as last time, and jump to step (2.14);
(2.10) read request for merging Rbrq labeled as last time, and Rbrq requests are updated in ltsh chain table In position, terminate conversion;
(2.11) it is one request Rnrq of bio requests distribution, and initialization Rnrq is asked with the bio, And judge whether Rnrq has merging attribute, if then jumping to step (2.12);Otherwise jump to Step (2.13);
(2.12) Rnrq requests are added into ltsh chain table, and judges whether the read request of last time merging. If it is present jumping directly to step (2.13);The reading for otherwise first merging Rnrq labeled as last time Request, and jump to step (2.13);
(2.13) will Rnrq request add scheduler in read queue end and read RBTree in.
Preferably, step (3) includes following sub-step:
(3.1) for the write request, the write request of last time merging is judged whether, if it does, Jump to step (3.2);Otherwise jump to step (3.3);
(3.2) judge whether the write request that can merge with last time is merged for bio requests, if energy To merging before enough, step (3.4) is jumped to;If can be merged backward, step (3.5) is jumped to; If can not merge that step (3.3) is jumped to;
(3.3) judge that can bio requests be merged backward with the request in ltsh chain table, if energy Then jump to step (3.5);Otherwise jump to step (3.6);
(3.4) to merging before the write request that bio requests merged with last time is carried out, and merging is judged Can also continue afterwards with chained list is write in scheduler in its previous request Wprev proceed to merge.If Can merge with Wprev, then jump to step (3.7), otherwise jump to step (3.8);
(3.5) the backward merging of bio requests and the request Wbrq that can merge backward is completed, and judges to merge Next request Wnext that can Wbrq afterwards write Wbrq in chained list with scheduler proceeds to close And.Step (3.9) can then be jumped to;Otherwise jump to step (3.10);
(3.6) it is one new request Wnrq of bio requests distribution, and initialization Wnrq is asked with the bio. Then judge whether Wnrq has and merge attribute.Have, jump to step (3.11);Otherwise jump to step Suddenly (3.12);
(3.7) complete merging for Wfrq and Wprev, and chained list, ltsh chain table are write in scheduler Wfrq is deleted, then needs to adjust positions of the Wprev in ltsh chain table, be finally labeled as Wprev The write request that last time merges, terminates this conversion by bio request conversions for write request;
(3.8) write request for merging Wfrq labeled as last time, by bio request conversions in order to write Request, terminates this conversion;
(3.9) complete merging for Wbrq and Wnext, and write chained list, ltsh chain table in scheduler is deleted Except Wnext, then need to adjust positions of the Wbrq in ltsh chain table, finally by Wbrq labeled as upper The write request of secondary merging, terminates this conversion by bio request conversions for write request;
(3.10) positions of the adjustment Wbrq in ltsh chain table, and by Wbrq labeled as last time merging Write request, terminates this conversion by bio request conversions for write request;
(3.11) by Wnrq add ltsh chain table in, and judge last time merge write request whether there is. If not existing, the write request that Wnrq was merged labeled as last time, and jump to step (3.12);It is no Then, step (3.12) is leapt to;
(3.12) Wnrq addition schedulers are write into the afterbody of chained list, so as to by the bio ask conversion in order to Write request.
Preferably, step (4) includes following sub-step:
(4.1) judge that the stage distributed at present residing for request in dispatcher queue is in reading batch processing rank Section still writes batch phase, if in batch phase is read, jumping to step (4.2);If In batch phase is write, then step (4.3) is jumped to,
(4.2) judge whether the request sum for reading batch phase distribution has exceeded threshold value.If having exceeded Threshold value, then jump to step (4.4), otherwise jumps to step (4.5);
(4.3) judge whether the request sum for writing batch phase distribution has reached the upper limit, if having reached the upper limit, Step (4.4) is jumped to, step (4.6) is otherwise jumped to;
(4.4) batch phase is created, and determines to whether there is corresponding reading in dispatcher queue Request, if in the presence of jumping to step (4.9);Otherwise jump to step (4.10);
(4.5) request Drq to be distributed in scheduler is set to next_rq [read], and jumps to step Suddenly (4.7);
(4.6) request Drq to be distributed in scheduler is set to next_rq [write], and jumps to step Suddenly (4.8);
(4.7) Drq is distributed in the request queue of device drive layer, from the reading chained list of scheduler and reading Delete the Drq in RBTree, and next_rq [read] is set to Drq and read RBTree in scheduler Next request, finally counts to the operation, terminates this request distribution procedure;
(4.8) Drq is distributed in the request queue of device drive layer, from scheduler write chained list in delete Except Drq, it is next requests of the Drq in scheduler writes chained list to set next_rq [write], finally to this Operation is counted, and terminates this request distribution procedure;
(4.9) writing with the presence or absence of request in chained list, if it does not exist, then jumping to for scheduler is judged Step (4.11);If it is present continuing to determine whether the write request or write request quilt that there is time-out Hungry number of times has reached the upper limit, if it is decided that result is true, then jump to step (4.12);Otherwise jump Go to step (4.11);
(4.10) writing with the presence or absence of request in chained list for scheduler is judged, if in the presence of jumping to step (4.12);Do not exist request to be distributed otherwise in scheduler, terminate this request distribution procedure;
(4.11) judge that next_rq [read] whether there is.If in the presence of jumping to step (4.13);It is no Then jump to step (4.14);
(4.12) write request is set to 0 by hungry number of times.Then the write request of time-out is judged whether Or whether next_rq [write] is empty.If it is determined that result is true, step (4.15) is jumped to;It is no Person jumps to step (4.16);
(4.13) request Drq to be distributed is set to next_rq [read], batching=0 is set, started A reading batch phase is created, step (4.7) is jumped to;
(4.14) request Drq to be distributed is set to first request in scheduler reading chained list, is set Batching=0, starts to create a reading batch phase, jumps to step (4.7);
(4.15) request Drq to be distributed is set to scheduler and writes first in chained list request, set Batching=0, starts establishment one and writes batch phase, jumps to step (4.8);
(4.16) request Drq to be distributed is set to next_rq [write], batching=0 is set, Start establishment one and write batch phase, jump to step (4.8).
In general, by the contemplated above technical scheme of the present invention compared with prior art, can Obtain following beneficial effect:
(1) present invention can solve the problem that continuous read request present in existing method is excessive after merging or not The problem of merging:As a result of step (2.2) step (2.4) step (2.5) and step (2.7), Therefore can solve in existing Noop algorithms to read request nonjoinder, and CFQ, Deadline, Excessive problem is merged to read request in Anticipatory algorithms.
(2) present invention can solve the problem that merging unnecessary to continuous write request present in existing method Problem:As a result of step (3.4) step (3.5) step (3.7) and step (3.9), Therefore can solve the problems, such as to merge continuous write request in existing I O scheduling algorithm.
(3) present invention makes full use of solid-state disk readwrite performance under different access pattern:In view of SSD The performance of read request is significantly larger than the performance of read request under stochastic model under middle ordered mode, to read request The time for not only being arrived according to request queues up in chained list, and the initial reference address according further to read request exists Sorted in RBTree, to construct the succession of read request, to conjunction before being carried out to the read request after sequence And and backward merging;In view of the property of write request under the performance and stochastic model of write request under ordered mode Can be essentially identical, the time that write request only needs to be arrived according to request queues up in chained list, it is not necessary to The succession of the construction write request that sorted in RBTree, is also only merged backward to write request.
(4) present invention makes full use of the abundant concurrency of solid-state disk:When merging read-write requests, it is contemplated that Minimum read-write operation unit is page in SSD, and in order to using the concurrency inside SSD, read-write behaviour It is likely to be with the page as minimum operation unit that clusters, the page that clusters is obtained by way of Black-box Testing Size, and when merging request, it is ensured that size of the request no more than the page that clusters after merging.Work as request Size is reached when clustering page size, continues to merge request, will not bring the lifting of performance, can be made on the contrary Into SSD equipment idle waitings, performance is reduced.
Brief description of the drawings
Fig. 1 is the I/O paths that (SuSE) Linux OS solid-state disk is accessed.
Fig. 2 is the flow chart of I/O dispatching method of the present invention based on solid-state disk difference read write attribute.
Fig. 3 is the transformation of reading bio requests to request in this dispatching method.
Fig. 4 is the transformation that bio requests to request are write in this dispatching method.
Fig. 5 is to distribute request to device drive layer in this dispatching method.
Specific embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, below in conjunction with accompanying drawing And embodiment, the present invention will be described in further detail.It should be appreciated that described herein specific Embodiment is only used to explain the present invention, is not intended to limit the present invention.Additionally, disclosed below As long as in each implementation method of the invention involved technical characteristic do not constitute conflict each other can To be mutually combined.
As shown in figure 1, upper layer application calls the I/O Request of module for reading and writing initiation by system, first can Truly need to visit by virtual file system (Virtual file system, abbreviation VFS), and arrival The file system layer asked, then can finally reach scsi device by generic block layer and I O scheduling layer Layer is driven, could be to bottom disk requests data.I/O of the present invention based on solid-state disk difference read write attribute Dispatching method is operated in I/O dispatch layers.Specifically complete following two functions:
1st, the bio requests for coordinating generic block layer to issue file system layer are packaged into according to certain strategy Request, and add the request queue of dispatch layer;
2nd, by I O scheduling layer request queue in request according to certain strategy distribution to lower floor SCSI In the request queue of device drive layer.So that the read request for reaching solid-state disk is presented stronger succession, Can appropriateness ground be using the concurrency inside solid-state disk and avoids mutually dry between read-write requests Disturb such that it is able to improve the I/O performances of whole solid-state disc system.
Integral Thought of the invention is, it has taken into full account interfering for read-write requests in solid-state disk, Read-write requests are separated, batch processing read request and write request;In view of read request under ordered mode Performance is significantly larger than the performance of read request under stochastic model, to read request not only according to request arrive when Between in chained list queue up, sort in RBTree according further to the initial reference address of read request, with construction The succession of read request, to merging and backward merging before being carried out to the read request after sequence;Consider The performance of write request is essentially identical under the performance and stochastic model of write request under ordered mode, and write request is only The time arrived according to request is needed to be queued up in chained list, it is not necessary to which the construction that sorted in RBTree is write please The succession asked, is also only merged backward to write request;It is available in view of being existed in solid-state disk Optimal Parallel degree, when merge request reach cluster page size when, do not go on merging, request reaches To cluster page size when can make full use of the concurrency enriched in solid-state disk, continue to merge request, Performance boost will not be brought, SSD equipment idle waitings can be caused on the contrary, reduce performance.
The present invention specifically completes following two functions in the I/O dispatch layers realization of linux kernel:1、 The bio requests for coordinating generic block layer to issue file system layer are packaged into request according to certain strategy, and Add the request queue of dispatch layer;2nd, by the request in I O scheduling layer request queue according to certain plan Slightly it is distributed in the request queue that the scsi device of lower floor drives layer.So that reaching the read request of solid-state disk Stronger succession is presented, can appropriateness ground be using the concurrency inside solid-state disk and avoids reading Interfering between write request such that it is able to improve the I/O performances of whole solid-state disc system.
As shown in Fig. 2 I O scheduling method of the present invention based on solid-state disk read write attribute is comprised the following steps:
(1) receive from upper layer application and by file system (in the present embodiment, this document system System is ext4 file system) treatment after bio request, and judge the bio request type be read request also It is write request, if read request is then transferred to step (2), if write request is then transferred to step (3);
(2) judge the read request whether can read request adjacent thereto merge, if can not merge, Then directly it is transferred to step (4);If the size after can merging and merging is no more than the size of the page that clusters, Then it is merged with neighbouring read request, the read request after merging still can be with reading adjacent thereto Request is merged, and should be ensured that the size after merging is no more than the size of the page that clusters.Will be final Read request after merging is put into reading queue and reading RBTree, so that system reads data.Then it is transferred to Step (4).
(3) judge whether the write request can merge with the write request in caching, if can if Merge, and by the write request insertion dispatcher queue end after merging, and it is transferred to step (4); Otherwise judge that can it merge with the write request in Hash table, if can if merge, and Write request insertion dispatcher queue end after just merging, and it is transferred to step (4);
(4) request in dispatcher queue is distributed in the request queue of device driver, process knot Beam.
As shown in figure 3, the step (2) in the inventive method includes following sub-step:
(2.1) for the read request, the read request of last time merging is judged whether, if in the presence of, Jump to step (2.2);Otherwise jump to step (2.3);
(2.2) judge the read request merged with last time after read request can merge.If can not Merge, then jump to step (2.3), if preceding step (2.4) can be jumped to merging, if Can backward merge, then jump to step (2.5);Specifically, if the read request and previous read request It is continuous on address, and request size after merging is no more than clustering a page size, then it represents that energy To merging before enough, if the address of the read request is continuous on address with latter read request, and close And after read request size no more than clustering a page size, then it represents that can merge backward;
The advantage of this step is:By caching the last request for merging, hardly increasing expense In the case of can greatly shorten the time delay of request searched and can merge with current read request, improve merging The efficiency of request, increases performance;The size asked after merging in addition, can no more than page size that clusters With the concurrency for making full use of SSD inside abundant, it is unlikely to excessively to merge again and causes SSD equipment free time etc. Treat, can further improve performance;
(2.3) judge that can the read request be merged backward with the request in ltsh chain table, if energy Then jump to step (2.5);Otherwise jump to step (2.6);
(2.4) complete can the forward direction read request Rfrq and the read request that merge merge, and judge it is preceding to Can the read request Rfrq after merging continue and read to be visited according to the starting of request in RBTree in scheduler Ask the previous read request Rprev of the Rfrq of address sort before proceeding to merging.Step can then be jumped to Suddenly (2.7);Otherwise jump to step (2.8);
(2.5) merging for the request Rbrq that can merge backward and the read request is completed, and judges conjunction backward And can request Rbrq afterwards continue and the initial access in reading RBTree in scheduler according to request The latter request Rnext of the Rbrq of location sequence proceeds backward merging.Step can then be jumped to (2.9) step (2.10), is otherwise jumped to;
(2.6) to merging before judging the read request and being carried out with the request read in scheduler in RBTree, If can if jump to step (2.4), otherwise jump to step (2.11);
(2.7) read request Rfrq is completed to merge with the forward direction of read request Rperv, deletion scheduler reading queue, Read the Rfrq requests in RBTree and generic block layer ltsh chain table;Simultaneously according to the read request being merged Size changes positions of the Rprev in ltsh chain table;And by merging after service time the latest be set to Less one in the service time the latest of Rfrq and Rprev;The read request mark that finally last time was merged It is Rfrq, this EOC.Specifically, above step is exactly to delete the pair for being merged rear read request This, and the service time of the read request after merging and the position in ltsh chain table are adjusted, and record The address of the read request that last time merges;
The advantage of this step is:By preceding to merging, small request can be aggregated into big request, can To greatly improve the handling capacity of system;
(2.8) read request that last time merges is set to Rfrq, and updates Rfrq's in RBTree is read Initial address;
(2.9) complete request Rbrq to merge with request the backward of Rnext, reading queue, reading in scheduler Rnext requests are deleted in the ltsh chain table of RBTree and generic block layer, Rbrq requests is updated in hash chain Position in table, by service time is set to the clothes of the read request after merging earlier in Rbrq and Rnext The business time, the read request that Rbrq was merged labeled as last time, and jump to step (2.14);
The advantage of this step is:By backward merging, small request can be aggregated into big request, can To greatly improve the handling capacity of system;
(2.10) read request for merging Rbrq labeled as last time, and Rbrq requests are updated in ltsh chain table In position;Terminate conversion;
(2.11) it is one request Rnrq of bio requests distribution, and initialization Rnrq is asked with the bio, And judge whether Rnrq has merging attribute, if then jumping to step (2.12);Otherwise jump to Step (2.13);
(2.12) Rnrq requests are added into ltsh chain table, and judges whether the read request of last time merging. If it is present jumping directly to step (2.13);The reading for otherwise first merging Rnrq labeled as last time Request, and jump to step (2.13);
(2.13) will Rnrq request add scheduler in read queue end and read RBTree in;
The advantage of this step is:Set read request needs the being serviced time the latest, and Priority Service surpasses When read request, it is to avoid a certain read request cannot be serviced for a long time;In addition to read request not only according to please Ask the time of arrival to be queued up in chained list, arranged in RBTree according further to the initial reference address of read request Sequence, to construct the succession of read request, with making full use of under ordered mode far superior to stochastic model Reading performance;
As shown in figure 4, the step (3) in the inventive method includes following sub-step:
(3.1) for the write request, the write request of last time merging is judged whether, if it does, Jump to step (3.2);Otherwise jump to step (3.3);
(3.2) judge whether the write request that can merge with last time is merged for bio requests, if energy To merging before enough, step (3.4) is jumped to;If can be merged backward, step (3.5) is jumped to; If can not merge that step (3.3) is jumped to;
The advantage of this step is:By caching the last request for merging, hardly increasing expense In the case of can greatly shorten the time delay of request searched and can merge with current bio requests, improve merging The efficiency of request, increases performance;The size asked after merging in addition, can no more than page size that clusters With the concurrency for making full use of SSD inside abundant, it is unlikely to excessively to merge again and causes SSD equipment free time etc. Treat, can further improve performance;
(3.3) judge that can bio requests be merged backward with the request in ltsh chain table, if energy Then jump to step (3.5);Otherwise jump to step (3.6);
(3.4) to merging before the write request that bio requests merged with last time is carried out, and merging is judged Can also continue afterwards with chained list is write in scheduler in its previous request Wprev proceed to merge.If Can merge with Wprev, then jump to step (3.7), otherwise jump to step (3.8);
(3.5) the backward merging of bio requests and the request Wbrq that can merge backward is completed, and judges to merge Next request Wnext that can Wbrq afterwards write Wbrq in chained list with scheduler proceeds to close And.Step (3.9) can then be jumped to;Otherwise jump to step (3.10);
The advantage of this step is:By backward merging, small request can be aggregated into big request, can To greatly improve the handling capacity of system;
(3.6) it is one new request Wnrq of bio requests distribution, and initialization Wnrq is asked with the bio. Then judge whether Wnrq has and merge attribute.Have, jump to step (3.11);Otherwise jump to step Suddenly (3.12);
(3.7) complete merging for Wfrq and Wprev, and chained list, ltsh chain table are write in scheduler Wfrq is deleted, then needs to adjust positions of the Wprev in ltsh chain table, be finally labeled as Wprev The write request that last time merges, terminates this conversion by bio request conversions for write request;
(3.8) write request for merging Wfrq labeled as last time, by bio request conversions in order to write Request, terminates this conversion;
(3.9) complete merging for Wbrq and Wnext, and write chained list, ltsh chain table in scheduler is deleted Except Wnext, then need to adjust positions of the Wbrq in ltsh chain table, finally by Wbrq labeled as upper The write request of secondary merging, terminates this conversion by bio request conversions for write request;
(3.10) positions of the adjustment Wbrq in ltsh chain table, and by Wbrq labeled as last time merging Write request, terminates this conversion by bio request conversions for write request;
(3.11) by Wnrq add ltsh chain table in, and judge last time merge write request whether there is. If not existing, the write request that Wnrq was merged labeled as last time, and jump to step (3.12);It is no Then, step (3.12) is leapt to;
(3.12) Wnrq addition schedulers are write into the afterbody of chained list, so as to by the bio ask conversion in order to Write request;
The advantage of this step is:Fully take into account the performance and random write request of order write request in SSD Performance it is essentially identical, write request is queued up only according to the time of arrival in chained list, it is not necessary to according to writing The initial reference address of request sorts in RBTree, constructs the succession of write request, eliminates sequence Performance cost, improve performance;
As shown in figure 5, the step (4) in the inventive method includes following sub-step:
(4.1) judge that the stage distributed at present residing for request in dispatcher queue is in reading batch processing rank Section still writes batch phase.If in batch phase is read, jumping to step (4.2);If In batch phase is write, then step (4.3) is jumped to;Specifically, exactly transported by obtaining program The value of next_rq [dir] variable is come to judge distribution request be at reading batch phase or writing batch during row The reason stage.The advantage of this step is:Batch distribution read request or write request, it is to avoid read-write please in SSD The hydraulic performance decline that interfering between asking is caused;
(4.2) judge whether the request sum for reading batch phase distribution has exceeded threshold value.If having exceeded Threshold value, then jump to step (4.4), otherwise jumps to step (4.5);In the present invention, the threshold value Span be (0,16].
(4.3) judge whether the request sum for writing batch phase distribution has reached the upper limit, if having reached the upper limit, Jump to step (4.4);Otherwise jump to step (4.6);
(4.4) batch phase is created, and determines to whether there is corresponding reading in dispatcher queue Request, if in the presence of jumping to step (4.9);Otherwise jump to step (4.10);
(4.5) request Drq to be distributed in scheduler is set to next_rq [read], and jumps to step Suddenly (4.7);
(4.6) request Drq to be distributed in scheduler is set to next_rq [write], and jumps to step Suddenly (4.8);
(4.7) Drq is distributed in the request queue of device drive layer, from the reading chained list of scheduler and reading Delete the Drq in RBTree, and next_rq [read] is set to Drq and read RBTree in scheduler Next request, finally counts to the operation, terminates this request distribution procedure;
The advantage of this step is:Batch distribution read request phase, next reading is obtained from red-black seeds Request, using the ranking function of RBTree, to construct the succession of read request, makes full use of suitable in SSD The performance that sequence is read is significantly larger than the performance of random write;
(4.8) Drq is distributed in the request queue of device drive layer, from scheduler write chained list in delete Except Drq, it is next requests of the Drq in scheduler writes chained list to set next_rq [write], finally to this Operation is counted, and terminates this request distribution procedure;
The advantage of this step is:In the batch distribution write request stage, next writing is obtained from chained list please Ask, it is not necessary to construct the succession of write request, so as to eliminate the expense of sequence, make full use of SSD Performance of the performance of middle random write substantially with sequential write is identical;
(4.9) writing with the presence or absence of request in chained list, if it does not exist, then jumping to for scheduler is judged Step (4.11);If it is present continuing to determine whether the write request or write request quilt that there is time-out Hungry number of times has reached the upper limit.If it is determined that result is true, then step (4.12) is jumped to;Otherwise jump Go to step (4.11);
The advantage of this step is:The preferential batch distribution procedure for creating read request, assign read request compared with Priority high, has met user's demand stricter to read request response time requirement, in addition for Prevent write request from being died of hunger, to be also provided with write request need the time of being serviced the latest, please when writing When seeking time-out, the write request of preferential distribution time-out;
(4.10) writing in chained list with the presence or absence of request for scheduler is judged.If in the presence of jumping to step (4.12);Do not exist request to be distributed otherwise in scheduler, terminate this request distribution procedure;
(4.11) judge that next_rq [read] whether there is.If in the presence of jumping to step (4.13);It is no Then jump to step (4.14);
(4.12) the batch processing stage of write request is ready for, write request is set to 0 by hungry number of times. Whether the write request or next_rq [write] for then judging whether time-out are empty.If it is determined that result It is true, jumps to step (4.15);No person jumps to step (4.16);
(4.13) request Drq to be distributed is set to next_rq [read], batching=0 is set, started A reading batch phase is created, step (4.7) is jumped to;
(4.14) request Drq to be distributed is set to first request in scheduler reading chained list, is set Batching=0, starts to create a reading batch phase, jumps to step (4.7);
(4.15) request Drq to be distributed is set to scheduler and writes first in chained list request, set Batching=0, starts establishment one and writes batch phase, jumps to step (4.8);
(4.16) request Drq to be distributed is set to next_rq [write], batching=0 is set, Start establishment one and write batch phase, jump to step (4.8).
As it will be easily appreciated by one skilled in the art that presently preferred embodiments of the present invention is the foregoing is only, It is not intended to limit the invention, all any modifications made within the spirit and principles in the present invention, etc. With replacement and improvement etc., should be included within the scope of the present invention.

Claims (4)

1. a kind of I O scheduling method based on solid-state disk read write attribute, it is characterised in that including following step Suddenly:
(1) receive from upper layer application and by the bio requests after file system treatment, and judge the bio The type of request is read request or write request, if read request is then transferred to step (2), if Write request is then transferred to step (3);
(2) judge the read request whether can read request adjacent thereto merge, if can not merge, Then directly it is transferred to step (4);If the size after can merging and merging is no more than the size of the page that clusters, Then it is merged with neighbouring read request, the read request after merging still can be with reading adjacent thereto Request is merged, and should be ensured that the size after merging is no more than the size of the page that clusters.Will be final Read request after merging is put into reading queue and reading RBTree, so that system reads data.Then it is transferred to Step (4).
(3) judge whether the write request can merge with the write request in caching, if can if Merge, and by the write request insertion dispatcher queue end after merging, and it is transferred to step (4); Otherwise judge that can it merge with the write request in Hash table, if can if merge, and Write request insertion dispatcher queue end after just merging, and it is transferred to step (4);
(4) request in dispatcher queue is distributed in the request queue of device driver.
2. I O scheduling method according to claim 1, it is characterised in that step (2) including with Lower sub-step:
(2.1) for the read request, the read request of last time merging is judged whether, if in the presence of, Jump to step (2.2);Otherwise jump to step (2.3);
(2.2) judge the read request merged with last time after read request can merge.If can not Merge, then jump to step (2.3), if preceding step (2.4) can be jumped to merging, if Can backward merge, then jump to step (2.5);
(2.3) judge that can the read request be merged backward with the request in ltsh chain table, if energy Then jump to step (2.5);Otherwise jump to step (2.6);
(2.4) complete can the forward direction read request Rfrq and the read request that merge merge, and judge it is preceding to Can the read request Rfrq after merging continue and read to be visited according to the starting of request in RBTree in scheduler Ask the previous read request Rprev of the Rfrq of address sort before proceeding to merging.Step can then be jumped to Suddenly (2.7), step (2.8) is otherwise jumped to;
(2.5) merging for the request Rbrq that can merge backward and the read request is completed, and judges conjunction backward And can request Rbrq afterwards continue and the initial access in reading RBTree in scheduler according to request The latter request Rnext of the Rbrq of location sequence proceeds backward merging.Step can then be jumped to (2.9) step (2.10), is otherwise jumped to;
(2.6) to merging before judging the read request and being carried out with the request read in scheduler in RBTree, If can if jump to step (2.4), otherwise jump to step (2.11);
(2.7) read request Rfrq is completed to merge with the forward direction of read request Rperv, deletion scheduler reading queue, Read the Rfrq requests in RBTree and generic block layer ltsh chain table;Simultaneously according to the read request being merged Size changes positions of the Rprev in ltsh chain table;And by merging after service time the latest be set to Less one in the service time the latest of Rfrq and Rprev;The read request mark that finally last time was merged It is Rfrq.
(2.8) read request that last time merges is set to Rfrq, and updates Rfrq's in RBTree is read Initial address;
(2.9) complete request Rbrq to merge with request the backward of Rnext, reading queue, reading in scheduler Rnext requests are deleted in the ltsh chain table of RBTree and generic block layer, Rbrq requests is updated in hash chain Position in table, by service time is set to the clothes of the read request after merging earlier in Rbrq and Rnext The business time, the read request that Rbrq was merged labeled as last time, and jump to step (2.14);
(2.10) read request for merging Rbrq labeled as last time, and Rbrq requests are updated in ltsh chain table In position, terminate conversion;
(2.11) it is one request Rnrq of bio requests distribution, and initialization Rnrq is asked with the bio, And judge whether Rnrq has merging attribute, if then jumping to step (2.12);Otherwise jump to Step (2.13);
(2.12) Rnrq requests are added into ltsh chain table, and judges whether the read request of last time merging. If it is present jumping directly to step (2.13);The reading for otherwise first merging Rnrq labeled as last time Request, and jump to step (2.13);
(2.13) will Rnrq request add scheduler in read queue end and read RBTree in.
3. I O scheduling method according to claim 2, it is characterised in that step (3) including with Lower sub-step:
(3.1) for the write request, the write request of last time merging is judged whether, if it does, Jump to step (3.2);Otherwise jump to step (3.3);
(3.2) judge whether the write request that can merge with last time is merged for bio requests, if energy To merging before enough, step (3.4) is jumped to;If can be merged backward, step (3.5) is jumped to; If can not merge that step (3.3) is jumped to;
(3.3) judge that can bio requests be merged backward with the request in ltsh chain table, if energy Then jump to step (3.5);Otherwise jump to step (3.6);
(3.4) to merging before the write request that bio requests merged with last time is carried out, and merging is judged Can also continue afterwards with chained list is write in scheduler in its previous request Wprev proceed to merge.If Can merge with Wprev, then jump to step (3.7), otherwise jump to step (3.8);
(3.5) the backward merging of bio requests and the request Wbrq that can merge backward is completed, and judges to merge Next request Wnext that can Wbrq afterwards write Wbrq in chained list with scheduler proceeds to close And.Step (3.9) can then be jumped to;Otherwise jump to step (3.10);
(3.6) it is one new request Wnrq of bio requests distribution, and initialization Wnrq is asked with the bio. Then judge whether Wnrq has and merge attribute.Have, jump to step (3.11);Otherwise jump to step Suddenly (3.12);
(3.7) complete merging for Wfrq and Wprev, and chained list, ltsh chain table are write in scheduler Wfrq is deleted, then needs to adjust positions of the Wprev in ltsh chain table, be finally labeled as Wprev The write request that last time merges, terminates this conversion by bio request conversions for write request;
(3.8) write request for merging Wfrq labeled as last time, by bio request conversions in order to write Request, terminates this conversion;
(3.9) complete merging for Wbrq and Wnext, and write chained list, ltsh chain table in scheduler is deleted Except Wnext, then need to adjust positions of the Wbrq in ltsh chain table, finally by Wbrq labeled as upper The write request of secondary merging, terminates this conversion by bio request conversions for write request;
(3.10) positions of the adjustment Wbrq in ltsh chain table, and by Wbrq labeled as last time merging Write request, terminates this conversion by bio request conversions for write request;
(3.11) by Wnrq add ltsh chain table in, and judge last time merge write request whether there is. If not existing, the write request that Wnrq was merged labeled as last time, and jump to step (3.12);It is no Then, step (3.12) is leapt to;
(3.12) Wnrq addition schedulers are write into the afterbody of chained list, so as to by the bio ask conversion in order to Write request.
4. I O scheduling method according to claim 3, it is characterised in that step (4) including with Lower sub-step:
(4.1) judge that the stage distributed at present residing for request in dispatcher queue is in reading batch processing rank Section still writes batch phase, if in batch phase is read, jumping to step (4.2);If In batch phase is write, then step (4.3) is jumped to,
(4.2) judge whether the request sum for reading batch phase distribution has exceeded threshold value.If having exceeded Threshold value, then jump to step (4.4), otherwise jumps to step (4.5);
(4.3) judge whether the request sum for writing batch phase distribution has reached the upper limit, if having reached the upper limit, Step (4.4) is jumped to, step (4.6) is otherwise jumped to;
(4.4) batch phase is created, and determines to whether there is corresponding reading in dispatcher queue Request, if in the presence of jumping to step (4.9);Otherwise jump to step (4.10);
(4.5) request Drq to be distributed in scheduler is set to next_rq [read], and jumps to step Suddenly (4.7);
(4.6) request Drq to be distributed in scheduler is set to next_rq [write], and jumps to step Suddenly (4.8);
(4.7) Drq is distributed in the request queue of device drive layer, from the reading chained list of scheduler and reading Delete the Drq in RBTree, and next_rq [read] is set to Drq and read RBTree in scheduler Next request, finally counts to the operation, terminates this request distribution procedure;
(4.8) Drq is distributed in the request queue of device drive layer, from scheduler write chained list in delete Except Drq, it is next requests of the Drq in scheduler writes chained list to set next_rq [write], finally to this Operation is counted, and terminates this request distribution procedure;
(4.9) writing with the presence or absence of request in chained list, if it does not exist, then jumping to for scheduler is judged Step (4.11);If it is present continuing to determine whether the write request or write request quilt that there is time-out Hungry number of times has reached the upper limit, if it is decided that result is true, then jump to step (4.12);Otherwise jump Go to step (4.11);
(4.10) writing with the presence or absence of request in chained list for scheduler is judged, if in the presence of jumping to step (4.12);Do not exist request to be distributed otherwise in scheduler, terminate this request distribution procedure;
(4.11) judge that next_rq [read] whether there is.If in the presence of jumping to step (4.13);It is no Then jump to step (4.14);
(4.12) write request is set to 0 by hungry number of times.Then the write request of time-out is judged whether Or whether next_rq [write] is empty.If it is determined that result is true, step (4.15) is jumped to;It is no Person jumps to step (4.16);
(4.13) request Drq to be distributed is set to next_rq [read], batching=0 is set, started A reading batch phase is created, step (4.7) is jumped to;
(4.14) request Drq to be distributed is set to first request in scheduler reading chained list, is set Batching=0, starts to create a reading batch phase, jumps to step (4.7);
(4.15) request Drq to be distributed is set to scheduler and writes first in chained list request, set Batching=0, starts establishment one and writes batch phase, jumps to step (4.8);
(4.16) request Drq to be distributed is set to next_rq [write], batching=0 is set, Start establishment one and write batch phase, jump to step (4.8).
CN201510827493.0A 2015-11-25 2015-11-25 A kind of I/O dispatching method based on solid-state disk read write attribute Active CN106775438B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510827493.0A CN106775438B (en) 2015-11-25 2015-11-25 A kind of I/O dispatching method based on solid-state disk read write attribute

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510827493.0A CN106775438B (en) 2015-11-25 2015-11-25 A kind of I/O dispatching method based on solid-state disk read write attribute

Publications (2)

Publication Number Publication Date
CN106775438A true CN106775438A (en) 2017-05-31
CN106775438B CN106775438B (en) 2019-08-30

Family

ID=58963938

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510827493.0A Active CN106775438B (en) 2015-11-25 2015-11-25 A kind of I/O dispatching method based on solid-state disk read write attribute

Country Status (1)

Country Link
CN (1) CN106775438B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107943413A (en) * 2017-10-12 2018-04-20 记忆科技(深圳)有限公司 A kind of method of solid state hard disc lifting reading performance
CN108108130A (en) * 2017-12-22 2018-06-01 深圳忆联信息系统有限公司 A kind of method and solid state disk for promoting solid state disk read-write performance

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005149276A (en) * 2003-11-18 2005-06-09 Hitachi Ltd Information processing system, information processor and control method therefor, and program
CN101639763A (en) * 2009-08-27 2010-02-03 中兴通讯股份有限公司 IO dispatching method and device
US20100262730A1 (en) * 2009-04-14 2010-10-14 Jibbe Mahmoud K System for handling parallel input/output threads with cache coherency in a multi-core based storage array
CN102831014A (en) * 2012-07-30 2012-12-19 华中科技大学 Method for prompting IO (input/output) parallelism and reducing small IO delay by utilizing multiple request queues
CN103336669A (en) * 2013-05-21 2013-10-02 华中科技大学 I/O scheduling method based on internal parallelism of solid state disk and scheduler
US20150220278A1 (en) * 2014-02-05 2015-08-06 Apple Inc. Dynamic io operation timeout assignment for a solid state drive

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005149276A (en) * 2003-11-18 2005-06-09 Hitachi Ltd Information processing system, information processor and control method therefor, and program
US20100262730A1 (en) * 2009-04-14 2010-10-14 Jibbe Mahmoud K System for handling parallel input/output threads with cache coherency in a multi-core based storage array
CN101639763A (en) * 2009-08-27 2010-02-03 中兴通讯股份有限公司 IO dispatching method and device
CN102831014A (en) * 2012-07-30 2012-12-19 华中科技大学 Method for prompting IO (input/output) parallelism and reducing small IO delay by utilizing multiple request queues
CN103336669A (en) * 2013-05-21 2013-10-02 华中科技大学 I/O scheduling method based on internal parallelism of solid state disk and scheduler
US20150220278A1 (en) * 2014-02-05 2015-08-06 Apple Inc. Dynamic io operation timeout assignment for a solid state drive

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107943413A (en) * 2017-10-12 2018-04-20 记忆科技(深圳)有限公司 A kind of method of solid state hard disc lifting reading performance
CN108108130A (en) * 2017-12-22 2018-06-01 深圳忆联信息系统有限公司 A kind of method and solid state disk for promoting solid state disk read-write performance

Also Published As

Publication number Publication date
CN106775438B (en) 2019-08-30

Similar Documents

Publication Publication Date Title
CN103186350B (en) The moving method of mixing storage system and hot spot data block
US10019196B2 (en) Efficient enforcement of command execution order in solid state drives
US20080276037A1 (en) Method to Access Storage Device Through Universal Serial Bus
CN105243033B (en) Data processing method and electronic equipment
CN102651009B (en) Method and equipment for retrieving data in storage system
CN105095287B (en) LSM data ordering by merging method and apparatus
US9053019B2 (en) Non-volatile memory device, a data processing device using the same, and a swapping method used by the data processing and non-volatile memory devices
CN103336669B (en) A kind of I/O dispatching method based on solid-state disk internal concurrency and scheduler
CN110321066A (en) Electronic equipment, computer system and their control method
US20180081379A1 (en) Low cost storage for rarely read data
CN100428209C (en) Adaptive external storage IO performance optimization method
US20090259791A1 (en) Adjustment number of expanders in storage system
CN107885456A (en) Reduce the conflict that I/O command accesses NVM
TW201133487A (en) Memory system
US20110023033A1 (en) Scheduling of threads by batch scheduling
TW201028859A (en) Method and system for dynamic storage tiering using allocate-on-write snapshots
CN107291889A (en) A kind of date storage method and system
TW201104440A (en) Memory controllers, memory systems, solid state drives and methods for processing a number of commands
CN103049396B (en) The method of writing with a brush dipped in Chinese ink of data and device
CN106445405A (en) Flash storage-oriented data access method and apparatus
CN104798063A (en) Memory device and host device
CN103345451A (en) Data buffering method in multi-core processor
US20220179585A1 (en) Management of Idle Time Compute Tasks in Storage Systems
JP3617631B2 (en) Storage control apparatus and control method thereof
US20150074360A1 (en) Scheduler for memory

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant