CN107368364A - Reading/writing method and device based on Linux noop dispatching algorithms - Google Patents

Reading/writing method and device based on Linux noop dispatching algorithms Download PDF

Info

Publication number
CN107368364A
CN107368364A CN201710607051.4A CN201710607051A CN107368364A CN 107368364 A CN107368364 A CN 107368364A CN 201710607051 A CN201710607051 A CN 201710607051A CN 107368364 A CN107368364 A CN 107368364A
Authority
CN
China
Prior art keywords
data
reading
read
noop
buffer area
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.)
Pending
Application number
CN201710607051.4A
Other languages
Chinese (zh)
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710607051.4A priority Critical patent/CN107368364A/en
Publication of CN107368364A publication Critical patent/CN107368364A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of reading/writing method and device based on Linux noop dispatching algorithms, passes through the reading number of the first process statistics each data preset time period of queue;Second process will read number every preset time period and be more than or equal to the data storage of predetermined threshold value to buffer area;Receive the read request for the data that continue;Judge buffer area with the presence or absence of the data that continue;If so, the data that continue then are read from buffer area, if it is not, then reading the data that continue from queue.The higher data of reading frequency are moved to buffer area by the application, when needing the higher data of reading frequency, data needed for being obtained directly from buffer area, without being obtained again from queue, when in only caching without required data, just obtained from queue, can so reduce the probability that noop dispatching algorithms die of hunger read request, and then improve system read-write efficiency so that systematic function maximizes.

Description

Reading/writing method and device based on Linux noop dispatching algorithms
Technical field
The present invention relates to I/O technology field, more particularly to a kind of reading/writing method and dress based on Linux noop dispatching algorithms Put.
Background technology
At present, Linux I O schedulings algorithm has four kinds, and respectively elevator algorithm (no operation, noop), the time limit calculates Method (deadline), expected algorithm (anticipatory), complete fair queuing algorithm (complete fair queuing, CFQ)。
Wherein, noop algorithms realize a fifo queue, and it carries out group as the method for work of elevator to I/O request Knit, when there is a new request to arrive, it will ensure to ask same Jie after request is merged into nearest request with this Matter.
But noop algorithms tendency is died of hunger and read beneficial to writing, i.e. write request passes through file system cache, it is not necessary to waits one It is secondary to write complete, so that it may which that, to start write operation next time, write request is stacked into IO queues by merging.And read request needs All read operations are completed before to it, could carry out read operation next time.There are several milliseconds of times between read operation, please when writing Ask in interval time and arrive, cause read request below hungry to death.
The content of the invention
It is an object of the invention to provide a kind of reading/writing method and device based on Linux noop dispatching algorithms, it is therefore intended that Solve the problems, such as that existing Linux noop dispatching algorithm read-write efficiencies are relatively low.
In order to solve the above technical problems, the present invention provides a kind of reading/writing method based on Linux noop dispatching algorithms, should Method includes:
First process counts the reading number of each data preset time period of queue;
The reading number is more than or equal to the data storage of predetermined threshold value extremely by the second process every the preset time period Buffer area;
Receive the read request for the data that continue;
Judge the buffer area with the presence or absence of the data that continue;
If so, then from the data that continued described in buffer area reading, if it is not, then treating reading from described in queue reading According to.
Alternatively, in addition to:
Receive timing statisticses adjust instruction;
According to the timing statisticses adjust instruction, the numerical value of the preset time period is adjusted to the first numerical value.
Alternatively, in addition to:
Receive adjusting thresholds instruction;
Instructed according to the adjusting thresholds, the predetermined threshold value is adjusted to second value.
In addition, present invention also offers a kind of read-write equipment based on Linux noop dispatching algorithms, the device includes:
Frequency statistics module is read, the reading number for the first process statistics each data preset time period of queue;
Memory module, the reading number is more than or equal to predetermined threshold value every the preset time period for the second process Data storage to buffer area;
Read request receiving module, for receiving the read request for the data that continue;
Judge module, for judging the buffer area with the presence or absence of the data that continue;
Read module, for if so, then from the data that continued described in buffer area reading, if it is not, then being read from the queue Take the data that continue.
Alternatively, in addition to:
Time adjust instruction receiving module, for receiving timing statisticses adjust instruction;
Time regulating module, for according to the timing statisticses adjust instruction, the numerical value of the preset time period to be adjusted For the first numerical value.
Alternatively, in addition to:
Adjusting thresholds command reception module, for receiving adjusting thresholds instruction;
Threshold adjustment module, for being instructed according to the adjusting thresholds, the predetermined threshold value is adjusted to second value.
Reading/writing method and device provided by the present invention based on Linux noop dispatching algorithms, counted by the first process The reading number of each data preset time period of queue;Second process will read number every preset time period and be more than or equal to default threshold The data storage of value is to buffer area;Receive the read request for the data that continue;Judge buffer area with the presence or absence of the data that continue;If so, then The data that continue are read from buffer area, if it is not, then reading the data that continue from queue.The application moves to the higher data of reading frequency Buffer area, when needing the higher data of reading frequency, can be obtained directly from buffer area needed for data, without again from queue Middle acquisition, just obtained in only caching without needed for during data from queue, can so reduce the reading hungry to death of noop dispatching algorithms The probability of request, and then improve system read-write efficiency so that systematic function maximizes.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this The embodiment of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is a kind of specific implementation of the reading/writing method provided in an embodiment of the present invention based on Linux noop dispatching algorithms The schematic flow sheet of mode;
Fig. 2 is process works process schematic provided in an embodiment of the present invention;
Fig. 3 is the structural representation frame of the read-write equipment provided in an embodiment of the present invention based on Linux noop dispatching algorithms Figure.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is Part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Fig. 1 is refer to, Fig. 1 is the one of the reading/writing method provided in an embodiment of the present invention based on Linux noop dispatching algorithms The schematic flow sheet of kind embodiment, this method comprise the following steps:
Step 101:First process counts the reading number of each data preset time period of queue.
It is to be appreciated that above-mentioned first process and the second process hereafter are two processes set up another on the basis of original.
Above-mentioned reading number can refer to each data in preset time period by reading number, it may also be said to be to read frequency, example Such as, in T time, it is 3 to count A data by reading number.
It is appreciated that the size of above-mentioned preset time period can be configured according to actual conditions, for example, working as read-write operation When more frequent, the scope of preset time period is expanded, and when current read-write operating pressure is smaller, the scope at preset time end is contracted It is small.
In some embodiments of the invention, this method can also include:Receive timing statisticses adjust instruction;According to statistics Time adjust instruction, the numerical value of preset time period is adjusted to the first numerical value.Statistical interval can be adjusted in real time according to demand, And the setting value of preset time period can be the empirical value determined after repeatedly adjustment.
Step 102:Second process is more than or equal to the data storage of predetermined threshold value extremely every preset time period by number is read Buffer area.
After the reading frequency for counting each data, qualified data are moved into buffer area using the second process, that is, sentenced The data when more than or equal to predetermined threshold value, are moved to buffer area by the reading frequency for each data of breaking and the size of predetermined threshold value, When less than predetermined threshold value, buffer area is not moved to.
Above-mentioned predetermined threshold value can be manually set according to actual conditions, demand, for example, predetermined threshold value is set to 3, will be pre- If move to buffer area by data of the reading number more than or equal to 3 in the period.
Therefore in some embodiments of the invention, this method also includes:Receive adjusting thresholds instruction;Referred to according to adjusting thresholds Order, second value is adjusted to by predetermined threshold value.The predetermined threshold value can be the empirical value determined after repeatedly setting adjustment.
Rational preset time period and predetermined threshold value are set, the defects of can evading noop dispatching algorithms, to reach best Read-write efficiency requirement.
Specifically to introduce the course of work of the first process and the second process, it is introduced below in conjunction with Fig. 2, Fig. 2 is this The process works process schematic that inventive embodiments provide.
As shown in Fig. 2 T is a period, T0 is first T time section, T1 be second T time section by that analogy; It is read buffer area that predetermined threshold value N, which is set to 3, C1, and P1 is the first process, and P2 is the second process.In T0-T3, repeatedly counted And corresponding operating, it is respectively:
T0-T1:Only enter row write i1, i2, i3;
T1-T2:Read i1 and i3;Write i7, i8, i9;Read i1, i3, i8;Write i11, i12, i13;Read i1 and i3;Write i15, i16、i17。
T2-T3:Read i1;Write i27, i28, i29;Read i3;Write i31, i32, i33;Read i8;Write i35, i36, i37.
Within T1-T2 time points, P1 statistical results, i1 is read 3 times, and i3 is read 3 times, and i8 is read 1 time.Therefore P2 will be greater than Moved into the data of 3 times in C1 cachings.
Within T2-T3 time points, P1 statistical results, i1, i3, i8 have been read 1 time respectively.It is not more than or equal to by reading number 3 data, P2 do not do any operation.
Step 103:Receive the read request for the data that continue.
Step 104:Judge buffer area with the presence or absence of the data that continue;If so, the data that continue then are read from buffer area, if it is not, Then the data that continue are read from queue.The queue refers to IO queues.
The reading/writing method based on Linux noop dispatching algorithms that the present embodiment is provided, queue is counted by the first process The reading number of each data preset time period;Second process is more than or equal to predetermined threshold value every preset time period by number is read Data storage is to buffer area;Receive the read request for the data that continue;Judge buffer area with the presence or absence of the data that continue;If so, then postpone Deposit area and read the data that continue, if it is not, then reading the data that continue from queue.The higher data of reading frequency are moved to caching by this method Area, when needing the higher data of reading frequency, can be obtained directly from buffer area needed for data, without being obtained again from queue Take, just obtained in only caching without needed for during data from queue, can so reduce noop dispatching algorithms and die of hunger read request Probability, and then improve system read-write efficiency so that systematic function maximizes.
The read-write equipment provided in an embodiment of the present invention based on Linux noop dispatching algorithms is introduced below, hereafter The read-write equipment based on Linux noop dispatching algorithms of description and the above-described reading based on Linux noop dispatching algorithms Write method can be mutually to should refer to.
Fig. 3 is refer to, Fig. 3 is the knot of the read-write equipment provided in an embodiment of the present invention based on Linux noop dispatching algorithms Structure schematic block diagram, the device include:
Frequency statistics module 31 is read, the reading number for the first process statistics each data preset time period of queue;
Memory module 32, data of the number more than or equal to predetermined threshold value will be read every preset time period for the second process Store to buffer area;
Read request receiving module 33, for receiving the read request for the data that continue;
Judge module 34, for judging buffer area with the presence or absence of the data that continue;
Read module 35, for if so, then the data that continue are read from buffer area, if it is not, then reading the data that continue from queue.
Alternatively, in addition to:
Time adjust instruction receiving module, for receiving timing statisticses adjust instruction;
Time regulating module, for according to timing statisticses adjust instruction, the numerical value of preset time period to be adjusted into the first number Value.
Alternatively, in addition to:
Adjusting thresholds command reception module, for receiving adjusting thresholds instruction;
Threshold adjustment module, for being instructed according to adjusting thresholds, predetermined threshold value is adjusted to second value.
The read-write equipment based on Linux noop dispatching algorithms that the present embodiment is provided, by the way that reading frequency is higher Data move to buffer area, when needing the higher data of reading frequency, can be obtained directly from buffer area needed for data, do not have to Obtain from queue, just obtained in only caching without needed for during data from queue again, can so reduce noop scheduling and calculate Method dies of hunger the probability of read request, and then improves system read-write efficiency so that systematic function maximizes.
Each embodiment is described by the way of progressive in specification, and what each embodiment stressed is and other realities Apply the difference of example, between each embodiment identical similar portion mutually referring to.For device disclosed in embodiment Speech, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is referring to method part illustration .
Professional further appreciates that, with reference to the unit of each example of the embodiments described herein description And algorithm steps, can be realized with electronic hardware, computer software or the combination of the two, in order to clearly demonstrate hardware and The interchangeability of software, the composition and step of each example are generally described according to function in the above description.These Function is performed with hardware or software mode actually, application-specific and design constraint depending on technical scheme.Specialty Technical staff can realize described function using distinct methods to each specific application, but this realization should not Think beyond the scope of this invention.
Directly it can be held with reference to the step of method or algorithm that the embodiments described herein describes with hardware, processor Capable software module, or the two combination are implemented.Software module can be placed in random access memory (RAM), internal memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In any other form of storage medium well known in field.
The reading/writing method provided by the present invention based on Linux noop dispatching algorithms and device have been carried out in detail above Introduce.Specific case used herein is set forth to the principle and embodiment of the present invention, the explanation of above example It is only intended to help the method and its core concept for understanding the present invention.It should be pointed out that the ordinary skill people for the art For member, under the premise without departing from the principles of the invention, some improvement and modification can also be carried out to the present invention, these improve and Modification is also fallen into the protection domain of the claims in the present invention.

Claims (6)

  1. A kind of 1. reading/writing method based on Linux noop dispatching algorithms, it is characterised in that including:
    First process counts the reading number of each data preset time period of queue;
    The reading number is more than or equal to the data storage extremely caching of predetermined threshold value every the preset time period by the second process Area;
    Receive the read request for the data that continue;
    Judge the buffer area with the presence or absence of the data that continue;
    If so, then from the data that continued described in buffer area reading, if it is not, then from the data that continued described in queue reading.
  2. 2. the reading/writing method as claimed in claim 1 based on Linux noop dispatching algorithms, it is characterised in that also include:
    Receive timing statisticses adjust instruction;
    According to the timing statisticses adjust instruction, the numerical value of the preset time period is adjusted to the first numerical value.
  3. 3. the reading/writing method as claimed in claim 1 based on Linux noop dispatching algorithms, it is characterised in that also include:
    Receive adjusting thresholds instruction;
    Instructed according to the adjusting thresholds, the predetermined threshold value is adjusted to second value.
  4. A kind of 4. read-write equipment based on Linux noop dispatching algorithms, it is characterised in that including:
    Frequency statistics module is read, the reading number for the first process statistics each data preset time period of queue;
    Memory module, the reading number is more than or equal to the number of predetermined threshold value for the second process every the preset time period According to storing to buffer area;
    Read request receiving module, for receiving the read request for the data that continue;
    Judge module, for judging the buffer area with the presence or absence of the data that continue;
    Read module, for if so, then from the data that continued described in buffer area reading, if it is not, then reading institute from the queue State the data that continue.
  5. 5. the read-write equipment as claimed in claim 4 based on Linux noop dispatching algorithms, it is characterised in that also include:
    Time adjust instruction receiving module, for receiving timing statisticses adjust instruction;
    Time regulating module, for according to the timing statisticses adjust instruction, the numerical value of the preset time period to be adjusted into One numerical value.
  6. 6. the read-write equipment as claimed in claim 4 based on Linux noop dispatching algorithms, it is characterised in that also include:
    Adjusting thresholds command reception module, for receiving adjusting thresholds instruction;
    Threshold adjustment module, for being instructed according to the adjusting thresholds, the predetermined threshold value is adjusted to second value.
CN201710607051.4A 2017-07-24 2017-07-24 Reading/writing method and device based on Linux noop dispatching algorithms Pending CN107368364A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710607051.4A CN107368364A (en) 2017-07-24 2017-07-24 Reading/writing method and device based on Linux noop dispatching algorithms

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710607051.4A CN107368364A (en) 2017-07-24 2017-07-24 Reading/writing method and device based on Linux noop dispatching algorithms

Publications (1)

Publication Number Publication Date
CN107368364A true CN107368364A (en) 2017-11-21

Family

ID=60307626

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710607051.4A Pending CN107368364A (en) 2017-07-24 2017-07-24 Reading/writing method and device based on Linux noop dispatching algorithms

Country Status (1)

Country Link
CN (1) CN107368364A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035498A (en) * 2020-08-31 2020-12-04 北京奇艺世纪科技有限公司 Data block scheduling method and device, scheduling layer node and storage layer node

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708060A (en) * 2012-05-14 2012-10-03 华为技术有限公司 Method, device and system for accessing image files
CN103473335A (en) * 2013-09-18 2013-12-25 浪潮(北京)电子信息产业有限公司 Hot spot data detection method and device
CN103559145A (en) * 2013-10-22 2014-02-05 华为技术有限公司 Data reading and writing method and electronic equipment
CN103631528A (en) * 2012-08-21 2014-03-12 苏州捷泰科信息技术有限公司 Read-write method and system with solid state disk as cache and read-write controller
CN105159604A (en) * 2015-08-20 2015-12-16 浪潮(北京)电子信息产业有限公司 Disk data read-write method and system
CN106681668A (en) * 2017-01-12 2017-05-17 郑州云海信息技术有限公司 Hybrid storage system and storage method based on solid state disk caching

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708060A (en) * 2012-05-14 2012-10-03 华为技术有限公司 Method, device and system for accessing image files
CN103631528A (en) * 2012-08-21 2014-03-12 苏州捷泰科信息技术有限公司 Read-write method and system with solid state disk as cache and read-write controller
CN103473335A (en) * 2013-09-18 2013-12-25 浪潮(北京)电子信息产业有限公司 Hot spot data detection method and device
CN103559145A (en) * 2013-10-22 2014-02-05 华为技术有限公司 Data reading and writing method and electronic equipment
CN105159604A (en) * 2015-08-20 2015-12-16 浪潮(北京)电子信息产业有限公司 Disk data read-write method and system
CN106681668A (en) * 2017-01-12 2017-05-17 郑州云海信息技术有限公司 Hybrid storage system and storage method based on solid state disk caching

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035498A (en) * 2020-08-31 2020-12-04 北京奇艺世纪科技有限公司 Data block scheduling method and device, scheduling layer node and storage layer node
CN112035498B (en) * 2020-08-31 2023-09-05 北京奇艺世纪科技有限公司 Data block scheduling method and device, scheduling layer node and storage layer node

Similar Documents

Publication Publication Date Title
US20230004329A1 (en) Managed fetching and execution of commands from submission queues
US9639280B2 (en) Ordering memory commands in a computer system
CN106681661B (en) Read-write scheduling method and device in solid state disk
US11112998B2 (en) Operation instruction scheduling method and apparatus for nand flash memory device
US9146690B2 (en) Systems and methods for dynamic priority control
US8782295B2 (en) Method and apparatus for a multi-engine descriptor controller for distributing data processing tasks across the engines
CN105320608B (en) Memory controller and method for controlling a memory device to process access requests
CN104199790B (en) Data processing method and device
CN108710531B (en) Data writing method and device of circular queue, terminal equipment and storage medium
US20150253992A1 (en) Memory system and control method
US8954644B2 (en) Apparatus and method for controlling memory
US20230141986A1 (en) System and Method for Enhancing Flash Channel Utilization
WO2023045203A1 (en) Task scheduling method, chip, and electronic device
US6839817B2 (en) Priority management of a disk array
CN115357377A (en) Memory control scheduling method and device, computer equipment and storage medium
CN107368364A (en) Reading/writing method and device based on Linux noop dispatching algorithms
US9229885B2 (en) Adaptive scheduling queue control for memory controllers based upon page hit distance determinations
CN106407020A (en) Database processing method of mobile terminal and mobile terminal thereof
CN112840309B (en) Command scheduling method, device and storage medium
US20160246515A1 (en) Method and arrangement for controlling requests to a shared electronic resource
CN112767978B (en) DDR command scheduling method, device, equipment and medium
CN113821175B (en) SSD instruction scheduling method and system based on storage content priority
US12019909B2 (en) IO request pipeline processing device, method and system, and storage medium
CN112015527B (en) Managing fetching and executing commands from a commit queue
CN107506152B (en) Analysis device and method for improving parallelism of PM (particulate matter) memory access requests

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20171121