WO2026017050A1 - Io scheduling method, electronic device, storage medium, and program product - Google Patents
Io scheduling method, electronic device, storage medium, and program productInfo
- Publication number
- WO2026017050A1 WO2026017050A1 PCT/CN2025/108685 CN2025108685W WO2026017050A1 WO 2026017050 A1 WO2026017050 A1 WO 2026017050A1 CN 2025108685 W CN2025108685 W CN 2025108685W WO 2026017050 A1 WO2026017050 A1 WO 2026017050A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- request
- target
- data
- historical
- pending
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/061—Improving I/O performance
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
- G06F3/0659—Command handling arrangements, e.g. command buffers, queues, command scheduling
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
Definitions
- This application relates to the field of I/O scheduling technology, specifically to I/O scheduling methods, electronic devices, storage media, and program products.
- I/O Input/Output
- LUN Logical Unit Number
- byte ranges within the same LUN may pertain to the same byte range within the same LUN (Logical Unit Number), different byte ranges within the same LUN, or individual byte ranges within different LUNs.
- OBJs objects, the smallest data management unit in a distributed storage system
- LUN consists of several OBJs.
- pending I/O requests are usually placed in the same I/O request processing queue and then scheduled sequentially.
- the I/O scheduling methods in these technologies do not significantly improve the concurrency of I/O scheduling.
- this application provides an I/O scheduling method, electronic device, storage medium, and program product to solve the I/O scheduling problem.
- this application provides an IO scheduling method, the method comprising: obtaining a currently pending IO request; identifying the currently pending IO request and determining the target request data corresponding to the currently pending IO request; determining the request location of the target request data in the storage device and the corresponding request data volume of the target request data; and, based on the request location and request data volume corresponding to the target request data, placing the currently pending IO request into a target IO request processing queue and scheduling the currently pending IO request.
- the IO scheduling method obtains the currently pending IO requests; identifies the currently pending IO requests and determines the target request data corresponding to them, ensuring the accuracy of the determined target request data. It determines the request location of the target request data in the storage device and the corresponding request data volume. Based on the request location and request data volume, the currently pending IO requests are placed into a target IO request processing queue, and then scheduled. This ensures the accuracy of placing the currently pending IO requests into the target IO request processing queue. Furthermore, the method schedules the currently pending IO requests from the target IO request processing queue, ensuring the accuracy of scheduling. This allows for the simultaneous processing of pending IO requests in multiple IO request processing queues, eliminating the need to wait for the previous pending IO requests to complete before scheduling the next pending IO request, thereby further improving the overall IO request performance of the distributed storage system.
- the current pending IO request is placed into the target IO request processing queue, and the current pending IO request is scheduled, including: comparing the request data volume with a preset request data volume threshold; if the request data volume is less than or equal to the preset request data volume threshold, based on the request location, the current pending IO request is placed into the target IO request processing queue, and the current pending IO request is scheduled; if the request data volume is greater than the preset request data volume threshold, the current pending IO request is split into multiple sub-pending IO requests based on the target request data; based on the sub-request location corresponding to the sub-target data of each sub-pending IO request, each sub-pending IO request is placed into the target IO request processing queue corresponding to its respective sub-pending IO request, and the multiple sub-pending IO requests are scheduled.
- the current pending IO request is placed into the target IO request processing queue according to the request location and request data volume corresponding to the target request data, including: determining the number of target data management units corresponding to the target request data according to the request location and request data volume corresponding to the target request data; if the number of target data management units is 1, then the current pending IO request is placed into the target IO request processing queue corresponding to the target data management unit according to the target data management unit.
- the IO scheduling method provided in this application determines the number of target data management units corresponding to the target request data based on the request location and the amount of request data, ensuring the accuracy of the determined number of target data management units. If the number of target data management units is 1, the currently pending IO request is placed into the target IO request processing queue corresponding to the target data management unit, ensuring the accuracy of placing the currently pending IO request into the target IO request processing queue corresponding to the target data management unit.
- determining the number of target data management units corresponding to the target request data based on the request location and the amount of request data includes: determining the target logical unit corresponding to the target request data and the offset of the request location within the target logical unit based on the request location corresponding to the target request data, thereby obtaining the data management unit corresponding to the start address of the target request data; determining the data management unit corresponding to the end address of the target request data based on the amount of request data; if the data management unit corresponding to the start address and the data management unit corresponding to the end address are the same data management unit, determining the number of target data management units to be 1; if the data management unit corresponding to the start address and the data management unit corresponding to the end address are different data management units, determining the number of target data management units to be greater than 1.
- the current pending IO request is placed into the target IO request processing queue according to the request location and the amount of request data corresponding to the target request data.
- the method further includes: if the number of target data management units is greater than 1, the current pending IO request is split into multiple sub-pending IO requests according to the number of target data management units; the number of sub-pending IO requests is consistent with the number of target data management units; and each sub-pending IO request is placed into the corresponding target IO request processing queue according to the target data management unit corresponding to each sub-pending IO request, so as to schedule each sub-pending IO request.
- the IO scheduling method provided in this application, if the number of target data management units is greater than 1, splits the current pending IO request into multiple sub-pending IO requests based on the number of target data management units, ensuring the accuracy of splitting the current pending IO request into multiple sub-pending IO requests. Based on the target data management unit corresponding to each sub-pending IO request, each sub-pending IO request is placed into the corresponding target IO request processing queue for scheduling, ensuring the accuracy of placing each sub-pending IO request into the corresponding target IO request processing queue, thereby further improving the overall IO request performance of the distributed storage system.
- Placing the currently pending IO request into a target IO request processing queue includes: obtaining the queue number corresponding to the IO request processing queue; obtaining the identification information of the target data management unit corresponding to the currently pending IO request; and placing the currently pending IO request into the target IO request processing queue according to the queue number and the identification information.
- the IO scheduling method provided in this application embodiment obtains the queue number corresponding to the IO request processing queue; obtains the identification information of the target data management unit corresponding to the current IO request to be processed; and puts the current IO request to be processed into the target IO request processing queue according to the queue number and the identification information, thereby ensuring the accuracy of putting the current IO request to be processed into the target IO request processing queue.
- obtaining the number of queues corresponding to the IO request processing queue includes: calculating the number of queues based on the number of logical units and the number of data management units included in each logical unit.
- the identification information of the target data management unit is the positional order identifier of the target data management unit in the corresponding logical unit. Based on the queue number and the identification information, the current IO request to be processed is placed into the target IO request processing queue, including: performing a modulo calculation on the queue number using the positional order identifier; determining the target IO request processing queue corresponding to the current IO request to be processed from each IO request processing queue based on the calculation result; and placing the current IO request to be processed into the target IO request processing queue.
- the IO scheduling method provided in this application uses a positional order identifier to perform a modulo calculation on the number of queues. Based on the calculation result, the target IO request processing queue corresponding to the current IO request to be processed is determined from each IO request processing queue, ensuring the accuracy of the determined target IO request processing queue. The current IO request to be processed is then placed into the target IO request processing queue, ensuring the accuracy of placing the current IO request to be processed into the target IO request processing queue.
- placing the current pending IO request into the target IO request processing queue includes: obtaining historical request data corresponding to each historical pending IO request in the target IO request processing queue; determining from the target IO request processing queue that the historical request data belongs to each first historical IO request to be compared in the target data management unit; comparing the target request data with the first historical request data corresponding to each first historical IO request to be compared; and placing the current pending IO request into the target IO request processing queue based on the comparison result.
- the IO scheduling method obtains historical request data corresponding to each historical IO request to be processed in the target IO request processing queue; determines each first historical IO request to be compared whose historical request data is located in the target data management unit from the target IO request processing queue, ensuring that the historical request data corresponding to each first historical IO request to be compared and the target request data are both located in the target data management unit, thereby ensuring that there may be overlapping data between the historical request data corresponding to each first historical IO request to be compared and the target request data.
- the target request data is compared with the first historical request data to be compared corresponding to each first historical IO request to be compared, ensuring the accuracy of the comparison result. Based on the comparison result, the current IO request to be processed is placed into the target IO request processing queue, ensuring the accuracy of placing the current IO request to be processed into the target IO request processing queue.
- obtaining historical request data corresponding to each historical pending IO request in the target IO request processing queue includes: obtaining each historical pending IO request in the target IO request processing queue; identifying each historical pending IO request to obtain historical request data corresponding to each historical pending IO request and a historical data management unit corresponding to the historical request data.
- the current IO request to be processed is placed into the target IO request processing queue according to the comparison result, including: if there is no overlapping data between the target request data and each of the first historical request data to be compared, then the current IO request to be processed is placed into the target IO request processing queue.
- the IO scheduling method provided in this application embodiment, if there is no overlapping data between the target request data and each first historical request data to be compared, then the current IO request to be processed is placed in the target IO request processing queue, thereby ensuring that when processing each first historical request data to be compared, there is no IO request to be processed that overlaps with each first historical IO request to be compared, thus avoiding the problem of data inconsistency caused by the frequent occurrence of additional IO request operations for an address before the IO request for a certain address has been completed.
- the current pending IO request is placed into the target IO request processing queue, and the method further includes: if there is overlapping data between the target request data and each of the first historical request data to be compared, then the first historical IO request to be compared that has overlapping data with the target request data is determined as the target historical IO request; the current pending IO request is placed into the first target mutex list corresponding to the target historical IO request; when the target historical IO request is processed, the current pending IO request is placed into the target IO request processing queue.
- the IO scheduling method provided in this application determines the first historical IO request to be compared that has overlapping data as the target historical IO request, thus ensuring the accuracy of the determined target historical IO request.
- the current IO request to be processed is placed in the first target mutex linked list corresponding to the target historical IO request, thereby avoiding data inconsistency caused by adding the current IO request to be processed while processing the target historical IO request.
- the target historical IO request is processed, the current IO request to be processed is placed in the target IO request processing queue, thereby avoiding data inconsistency.
- the current pending IO request is placed into the target IO request processing queue, including: temporarily storing the first target mutex list using a temporary linked list head; removing the target historical IO request from the first target mutex list; removing the target historical IO request from the target IO request processing queue; traversing the temporarily stored first target mutex list through the temporary linked list head, and sequentially performing the following steps on each other pending IO request on the first target mutex list other than the target historical IO request: removing the other pending IO requests from the first target mutex list, and putting the other pending IO requests back into the target IO request processing queue.
- the current pending IO request is placed into the target IO request processing queue, including: after the target historical IO request is processed, retrieving each second historical IO request to be compared from the target IO request processing queue; the historical request data corresponding to the second historical IO request to be compared is located in the target data management unit; comparing the target request data with the second historical request data corresponding to the second historical IO request to be compared; if there is no overlapping data between the target request data and each second historical request data to be compared, then placing the current pending IO request into the target IO request processing queue; if there is overlapping data between the target request data and each second historical request data to be compared, then placing the current pending IO request into a second target mutex list, wherein the second target mutex list is the mutex list corresponding to the second historical request data to be compared that has overlapping data with the target request data.
- the IO scheduling method after the target historical IO request has been processed, retrieves each second historical IO request to be compared from the target IO request processing queue, ensuring that the second historical request data corresponding to each second historical IO request to be compared and the target request data are both in the target data management unit.
- the target request data is compared with the second historical request data corresponding to the second historical IO requests to be compared; if there is no overlapping data between the target request data and each second historical request data to be compared, the current IO request to be processed is placed in the target IO request processing queue. If there is overlapping data between the target request data and each second historical request data to be compared, the current IO request to be processed is placed in the second target mutex list. This avoids the problem of data inconsistency caused by frequent additional IO request operations for a certain address before an IO request for that address has been completed.
- comparing the target request data with the first historical request data corresponding to each first historical IO request to be compared includes: determining the target position offset of the target request data in the target data management unit based on the request position corresponding to the target request data; obtaining the historical position offset and historical data volume of the first historical request data to be compared in the target data management unit; and comparing the target request data with the first historical request data corresponding to each first historical IO request to be compared based on the relationship between the target position offset, the request data volume, the historical position offset, and the historical data volume.
- the IO scheduling method provided in this application determines the target position offset of the target request data in the target data management unit based on the request position corresponding to the target request data, ensuring the accuracy of the determined target position offset. It obtains the historical position offset and historical data volume of the first historical request data to be compared in the target data management unit; based on the relationship between the target position offset, request data volume, historical position offset, and historical data volume, it compares the target request data with the first historical request data corresponding to each first historical IO request to be compared, ensuring the accuracy of the obtained comparison results.
- the target requested data is compared with the first historical request data corresponding to each first historical IO request to be compared.
- This includes: calculating the sum of the historical position offset and the historical data volume to obtain a first total offset; calculating the sum of the target position offset and the requested data volume to obtain a second total offset; comparing the target position offset with the first total offset; comparing the historical position offset with the second total offset; if the target position offset is greater than the first total offset, or the historical position offset is greater than the second total offset, then it is determined that there is no overlapping data between the target requested data and each first historical request data to be compared.
- the IO scheduling method provided in this application calculates the sum of historical position offsets and historical data volumes to obtain a first total offset, ensuring the accuracy of the calculated first total offset. It also calculates the sum of target position offsets and requested data volumes to obtain a second total offset, ensuring the accuracy of the calculated second total offset.
- the target position offset is compared with the first total offset; the historical position offset is compared with the second total offset. If the target position offset is greater than the first total offset, or if the historical position offset is greater than the second total offset, then it is determined that there is no overlapping data between the target requested data and each of the first historical requested data to be compared, ensuring the accuracy of the determined non-overlapping data between the target requested data and each of the first historical requested data to be compared.
- scheduling the currently pending I/O requests includes: scheduling the currently pending I/O requests in the target I/O request processing queue using a target processing thread; the target processing thread is any one of a plurality of processing threads.
- the IO scheduling method provided in this application uses a target processing thread to schedule the current pending IO requests in the target IO request processing queue.
- the target processing thread can be any one of multiple processing threads, thereby ensuring the accuracy of scheduling the current pending IO requests and realizing the parallel scheduling of multiple pending IO requests, further improving the overall IO request performance of the distributed storage system.
- this application provides an electronic device, including: a memory and a processor, which are communicatively connected to each other.
- the memory stores computer instructions
- the processor executes the computer instructions to perform the IO scheduling method of the first aspect or any corresponding embodiment described above.
- this application provides a computer non-transitory readable storage medium storing computer instructions, which are used to cause a computer to execute the IO scheduling method of the first aspect or any corresponding embodiment described above.
- this application provides a computer program product, including computer instructions for causing a computer to execute the I/O scheduling method of the first aspect or any corresponding embodiment thereof.
- Figure 1 is a schematic diagram of the architecture of a distributed storage system according to an embodiment of this application.
- Figure 2 is a flowchart illustrating a first IO scheduling method according to an embodiment of this application
- Figure 3 is a flowchart illustrating a second IO scheduling method according to an embodiment of this application.
- Figure 4 is a flowchart illustrating a third IO scheduling method according to an embodiment of this application.
- Figure 5 is a flowchart illustrating that there is no overlap between the first type of target request data and each first historical request data to be compared according to an embodiment of this application.
- Figure 6 is a flowchart illustrating that there is no overlap between the second type of target request data and each of the first historical request data to be compared according to an embodiment of this application;
- Figure 7 is a schematic diagram of placing the current pending IO request into the target IO request processing queue according to an embodiment of this application;
- Figure 8 is a flowchart illustrating the overlapping data between the first type of target request data and each first historical request data to be compared according to an embodiment of this application.
- Figure 9 is a flowchart illustrating the overlapping data between the second type of target request data and each of the first historical request data to be compared, according to an embodiment of this application.
- Figure 10 is a flowchart of the mutex list addition logic according to an embodiment of this application.
- Figure 11 is a flowchart of the mutex list removal logic according to an embodiment of this application.
- Figure 12 is a schematic diagram showing that there is overlap between the current pending IO request and multiple target historical IO requests according to an embodiment of this application;
- Figure 13 is a schematic diagram of splitting the current pending IO request according to an embodiment of this application.
- Figure 14 is a schematic diagram of optimizing the IO request processing queue according to an embodiment of this application.
- Figure 15 is a schematic diagram illustrating a fourth IO scheduling method according to an embodiment of this application.
- Figure 16 is a structural block diagram of an IO scheduling device according to an embodiment of this application.
- Figure 17 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application.
- the distributed storage system provides iSCSI (Internet Small Computer System Interface, a network standard protocol) target service, supporting multiple iSCSI clients to simultaneously initiate connection requests. This means that the storage resources of the distributed storage system are shared by all clients. Consequently, the distributed storage system receives IO requests from different clients. These IO requests may pertain to the same byte range within the same logical unit, different byte ranges within the same logical unit, or individual byte ranges within different logical units.
- DMUs data management units
- a logical unit consists of several DMUs.
- the DMU in a distributed storage system is similar to the concept of a sector on a physical disk. Smaller DMUs result in finer granularity of storage resource management and higher I/O concurrency, but also higher disk loss (each DMU corresponds to metadata; for the same disk capacity, smaller DMUs result in more DMUs, more metadata, more disk space occupied, and less usable disk space), and lower management efficiency. Conversely, larger DMUs result in finer granularity of storage resource management, lower I/O concurrency, but lower disk loss and higher management efficiency.
- the industry typically sets the DMU to 4MB (Megabyte).
- IO requests from different logical units and IO requests from different regions of the same logical unit can be processed concurrently because the storage resources are independent of each other, thereby increasing IO concurrency.
- IO requests with overlapping storage resources all IO requests are executed in the request processing queue in a FIFO (First In First Out) manner for the sake of data consistency.
- the IO request data block is used as the granularity of IO scheduling. This execution method does solve the data consistency problem at the IO scheduling level, but it is not friendly to the overall performance of the distributed storage system. This is because different IO requests of the same logical unit may not have read-write or write-write dependencies. These requests can be scheduled and executed earlier without waiting for the requests that arrived earlier to be executed.
- this application provides an IO scheduling method applied to a distributed storage system, as shown in Figure 1.
- the architecture of the distributed storage system from top to bottom, consists of a protocol layer, an IO scheduling layer, a storage engine layer, a device driver layer, and physical disks.
- the protocol layer is used to receive and parse connection requests and IO requests initiated by various clients. Since mutual exclusion of storage resources is not involved, concurrency can be maximized here.
- the IO scheduling layer no longer uses the entire IO request as the smallest scheduling unit, but rather processes IO requests using a data management unit as the smallest scheduling unit.
- the processing flow of the IO scheduling method is as follows: Obtain the current pending IO request; identify the current pending IO request and determine the target request data corresponding to it, ensuring the accuracy of the determined target request data. Determine the request location of the target request data in the storage device and the corresponding request data volume.
- the data length of an IO request is greater than the length of a data management unit or spans two adjacent data management units aligned to 4MB (the size of a data management unit)
- the requested data length is divided into multiple different data management units aligned to 4MB and processed concurrently. Specific implementation details are described later.
- the storage engine layer manages the physical disk (data from multiple logical units may be distributed across multiple disks).
- the device driver layer connects the physical disk and the software operating system. The physical disk stores user data.
- the IO scheduling method provided in this application embodiment can be executed by an IO scheduling device.
- This IO scheduling device can be implemented as part or all of an electronic device through software, hardware, or a combination of both.
- the electronic device can be a server or a terminal.
- the server can be a single server or a server cluster composed of multiple servers.
- the terminal in this application embodiment can be a smartphone, personal computer, tablet computer, wearable device, or other intelligent hardware device such as an intelligent robot.
- the following method embodiments will all use an electronic device as an example for explanation.
- an IO scheduling method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
- FIG. 3 is a flowchart of the I/O scheduling method according to an embodiment of this application. As shown in Figure 3, the process includes the following steps:
- Step S101 Obtain the currently pending IO requests.
- the electronic device can receive currently pending I/O requests input by the user, or it can receive currently pending I/O requests sent by other devices. This application does not specifically limit the method by which the electronic device obtains currently pending I/O requests.
- Step S102 Identify the current pending IO request and determine the target request data corresponding to the current pending IO request.
- the electronic device can identify the currently pending I/O request and determine the target request data corresponding to the currently pending I/O request.
- Step S103 Determine the request location of the target request data in the storage device and the corresponding request data volume of the target request data.
- the electronic device identifies the target request data corresponding to the current pending IO request, determines the request location of the target request data in the storage device, and the corresponding request data volume of the target request data.
- Step S104 Based on the request location and request data volume corresponding to the target request data, the current pending IO request is placed into the target IO request processing queue, and the current pending IO request is scheduled.
- the electronic device may compare the amount of request data corresponding to the target request data with a preset request data amount threshold.
- the current pending IO request is placed into the target IO request processing queue, and the current pending IO request is scheduled.
- the current pending IO request is split into multiple sub-pending IO requests based on the target request data. Then, based on the sub-request position corresponding to the sub-target data of each sub-pending IO request, each sub-pending IO request is placed into its corresponding target IO request processing queue, and the multiple sub-pending IO requests are scheduled.
- the IO scheduling method obtains the currently pending IO requests; identifies the currently pending IO requests and determines the target request data corresponding to them, ensuring the accuracy of the determined target request data. It determines the request location of the target request data in the storage device and the corresponding request data volume. Based on the request location and request data volume, the currently pending IO requests are placed into a target IO request processing queue, and then scheduled. This ensures the accuracy of placing the currently pending IO requests into the target IO request processing queue. Furthermore, the method schedules the currently pending IO requests from the target IO request processing queue, ensuring the accuracy of scheduling. This allows for the simultaneous processing of pending IO requests in multiple IO request processing queues, eliminating the need to wait for the previous pending IO requests to complete before scheduling the next pending IO request, thereby further improving the overall IO request performance of the distributed storage system.
- FIG. 4 is a flowchart of the I/O scheduling method according to an embodiment of this application. As shown in Figure 4, the process includes the following steps:
- Step S201 Obtain the currently pending IO requests.
- step S101 Please refer to Figure 3 for a description of step S101; it will not be repeated here.
- Step S202 Identify the current pending IO request and determine the target request data corresponding to the current pending IO request.
- step S102 Please refer to Figure 3 for a description of step S102; it will not be repeated here.
- Step S203 Determine the request location of the target request data in the storage device and the corresponding request data volume of the target request data.
- step S103 Please refer to Figure 3 for a description of step S103; it will not be repeated here.
- Step S204 Based on the request location and request data volume corresponding to the target request data, the current pending IO request is placed into the target IO request processing queue, and the current pending IO request is scheduled.
- step S204 above "placing the current pending IO request into the target IO request processing queue according to the request location and request data volume corresponding to the target request data,” may include the following steps:
- Step S2041 Determine the number of target data management units corresponding to the target request data based on the request location and the amount of request data corresponding to the target request data.
- the electronic device may determine the number of target data management units corresponding to the target request data based on the request location and the amount of request data.
- the target data management unit is the smallest data management unit, and each target data management unit has a unique identifier.
- the distributed storage system can include multiple logical units, and each logical unit includes multiple data management units.
- the data storage capacity corresponding to each data management unit can be 4MB, 3MB, or other storage capacities. This embodiment does not specifically limit the data storage capacity corresponding to each data management unit.
- the electronic device can determine the target logic unit corresponding to the target request data and the offset of the target request position within the target logic unit based on the request position corresponding to the target request data, thereby determining the data management unit corresponding to the start address of the target request data. Then, it determines the data management unit corresponding to the end address of the target request data based on the data volume corresponding to the target request data. If they correspond to the same data management unit, the number of target data management units is 1. If the start address and end address of the target request data correspond to different data management units, the number of target data management units is not 1.
- Step S2042 If the number of target data management units is 1, then according to the target data management unit, the current unprocessed IO request is placed into the target IO request processing queue corresponding to the target data management unit.
- step S2042 above may include the following steps:
- Step a1 Obtain the number of queues corresponding to the IO request processing queue.
- the electronic device can receive the number of queues corresponding to the IO request processing queue set by the user, or it can receive the number of queues corresponding to the IO request processing queue sent by other devices.
- the electronic device can also calculate the number of queues corresponding to the IO request processing queue based on the number of logical units in the distributed storage system and the number of data management units included in each logical unit.
- the number of queues corresponding to the IO request processing queue is obtained by dividing the number of data management units included in each logical unit by 3.
- Step a2 Obtain the identification information of the target data management unit corresponding to the current pending IO request.
- the electronic device can determine the target data management unit and its identification information based on the start and end addresses of the target request data.
- Step a3 Based on the queue number and identification information, place the currently pending IO request into the target IO request processing queue.
- the identification information of the target data management unit is the positional identifier of the target data management unit in the corresponding logical unit, and step a3 above may include the following steps:
- Step a31 Calculate the queue size using the positional order identifier modulo operation.
- the electronic device uses the positional sequence identifier to perform a modulo calculation on the queue size.
- Step a32 Based on the calculation results, determine the target IO request processing queue corresponding to the current IO request to be processed from each IO request processing queue.
- the electronic device determines the target IO request processing queue corresponding to the current IO request to be processed from each IO request processing queue based on the calculation results.
- the electronic device divides the position sequence identifier of the target data management unit in the corresponding logical unit by 3 and takes the remainder. If the remainder is 0, the target IO request processing queue corresponding to the current IO request to be processed is determined as IO request processing queue 0; if the remainder is 1, the target IO request processing queue corresponding to the current IO request to be processed is determined as IO request processing queue 1; if the remainder is 2, the target IO request processing queue corresponding to the current IO request to be processed is determined as IO request processing queue 2.
- Step a33 Place the currently pending IO request into the target IO request processing queue.
- the current IO request to be processed can be placed into the target IO request processing queue.
- step a33 above may include the following steps:
- Step a331 Obtain the historical request data corresponding to each historical pending IO request in the target IO request processing queue.
- the electronic device can obtain each historical pending IO request from the target IO request processing queue, identify each historical pending IO request, and determine the historical request data corresponding to each historical pending IO request and the historical data management unit corresponding to the historical request data.
- Step a332 Determine from the target IO request processing queue each of the first historical IO requests to be compared in the target data management unit.
- the electronic device compares the historical data management unit corresponding to the historical request data of each historical pending IO request with the target data management unit. Then, it determines from the target IO request processing queue each first historical IO request to be compared whose historical request data is located in the target data management unit. That is, the historical data management unit corresponding to the historical request data of each first historical IO request to be compared is consistent with the target data management unit corresponding to the target request data.
- Step a333 Compare the target request data with the first historical request data corresponding to each first historical IO request to be compared.
- step a333 above may include the following steps:
- Step a3331 Determine the target position offset of the target request data in the target data management unit based on the request position corresponding to the target request data.
- the electronic device can determine the target position offset of the target request data in the target data management unit based on the request position corresponding to the target request data.
- Step a3332 Obtain the historical position offset and historical data volume of the first historical request data to be compared in the target data management unit.
- the electronic device can identify the first historical request data to be compared corresponding to the first historical IO request to be compared, and determine the historical position offset and historical data volume of the first historical request data to be compared in the target data management unit.
- Step a3333 Based on the relationship between the target position offset, the requested data volume, the historical position offset, and the historical data volume, compare the target requested data with the first historical request data corresponding to each first historical IO request to be compared.
- step a3333 described above may include the following steps:
- Step a33331 Calculate the sum of the historical position offset and the historical data volume to obtain the first total offset.
- the electronic device calculates the sum of the historical location offset and the amount of historical data to obtain a first total offset.
- Step a33332 Calculate the sum of the target position offset and the requested data amount to obtain the second total offset.
- the electronic device calculates the sum of the target location offset and the requested data amount to obtain a second total offset.
- Step a33333 Compare the target position offset with the first total offset.
- Step a33334 Compare the historical position offset with the second total offset.
- Step a33335 If the target position offset is greater than the first total offset, or the historical position offset is greater than the second total offset, then it is determined that there is no overlapping data between the target request data and each of the first historical request data to be compared.
- the electronic device compares the target position offset with a first total offset and compares the historical position offset with a second total offset.
- the target location offset is greater than the first total offset, or the historical location offset is greater than the second total offset, then it is determined that there is no overlapping data between the target request data and each of the first historical request data to be compared.
- Figure 5 illustrates the case where the historical position offset is greater than the second total offset.
- the top represents the current IO request to be processed, and the bottom represents the first historical IO request to be compared.
- the end position of the target data corresponding to the current IO request to be processed is smaller than the start position of the first historical request data to be compared in the first historical IO request to be compared, i.e., a_offset + a_len ⁇ b_offset, then it is determined that there is no overlapping data between the target request data and each of the first historical request data to be compared.
- Figure 6 illustrates the case where the target position offset is greater than the first total offset.
- the top represents the current I/O request to be processed, and the bottom represents the first set of historical I/O requests to be compared. If the starting position of the target data corresponding to the current I/O request to be processed is greater than the ending position of the first set of historical I/O requests to be compared (i.e., a_offset > b_offset + b_len), then it is determined that there is no overlapping data between the target request data and each of the first set of historical I/O requests to be compared.
- Step a334 Based on the comparison results, put the current pending IO request into the target IO request processing queue.
- step a334 above may include the following steps:
- Step a3341 If there is no overlapping data between the target request data and each of the first historical request data to be compared, then the current IO request to be processed is placed into the target IO request processing queue.
- the current IO request to be processed is placed in the target IO request processing queue.
- Step a3342 If there is overlapping data between the target request data and each of the first historical request data to be compared, then the first historical IO request to be compared that has overlapping data with the target request data is determined as the target historical IO request.
- the first historical IO request to be compared that has overlapping data with the target request data is determined as the target historical IO request.
- Step a3343 Place the current pending IO request into the first target mutex linked list corresponding to the target historical IO request.
- the electronic device places the current pending IO request into the first target mutex list corresponding to the target historical IO request based on the identification information corresponding to the target historical IO request.
- obj_1c is the current pending IO request
- obj_1a is the target historical IO request. Since the target request data of the current pending IO request overlaps with the data range of the first historical IO request to be compared in the target data management unit in the target IO request processing queue, i.e., there is storage resource contention and mutual exclusion, it is necessary to first add the current pending IO request to the mutex list of the first historical IO request to be compared with the overlapping data range. After that is processed, the current pending IO request on the mutex list is then re-attempted to be added to the target IO request processing queue.
- obj_1c is the current pending IO request
- obj_1b is the target historical IO request. Since the target request data of the current pending IO request overlaps with the data range of the first first historical IO request to be compared in the target data management unit within the target IO request processing queue, meaning there is no storage resource contention, the two can be processed concurrently. However, the data range of the second first historical IO request to be compared in the target data management unit within the target IO request processing queue overlaps, meaning there is storage resource contention. Therefore, the current pending IO request needs to be added to the mutex list of the second first historical IO request with overlapping data ranges. After that second request is processed, the current pending IO request on the mutex list can be re-added to the target IO request processing queue.
- a flowchart of the logic for adding logic to the mutex linked list is presented.
- the type of the OBJ request is determined. If the OBJ request is not a read/write IO request, the process ends directly, because other IO requests such as management or query IO requests do not require actual IO read/write processing, and therefore do not need to execute the relevant logic involved in this method. If the OBJ request is a read/write IO request, it is determined whether the target IO request processing queue is empty. If the target IO request processing queue is empty, it is directly added to the tail of the queue and the process ends.
- the target IO request processing queue is not empty, it needs to be traversed from the head to the tail of the queue. If a target historical IO request with the same OID (Object Identifier) as the current pending IO request (i.e., both are within the target data management unit) and overlapping data ranges is found in the target IO request processing queue, then it is determined whether the linked list of the target historical IO request has been initialized. If the linked list has not been initialized, it is initialized and used as the head of a mutex linked list. Then, the current pending IO request is added to the tail of the mutex linked list, and the process ends. If no target historical IO request with the same OID and overlapping data ranges as the current pending IO request is found in the target IO request processing queue, the current pending IO request is added to the tail of the IO request processing queue, and the process ends.
- OID Object Identifier
- the mutex linked list supports multiple pending requests to be attached simultaneously. Requests must be attached to the tail of the list in chronological order, and requests cannot be inserted in the middle of the list.
- a target historical IO request when a target historical IO request is processed, it needs to be removed from the target IO request processing queue. Simultaneously, the currently pending IO requests with overlapping data ranges are removed from the mutex list corresponding to the target historical IO request and attempted to be re-added to the target IO request processing queue.
- the specific implementation logic is shown in Figure 11.
- Figure 11 is a flowchart of the mutex list removal logic. For a target historical IO request about to be dequeued, it is first determined whether the mutex list of the target historical IO request has been initialized and is not empty.
- the mutex list on the target historical IO request is not initialized, it means that the target historical IO request has never had a history of overlapping data regions, and the target historical IO request can be directly removed from the target IO request processing queue. If the mutex list on the target historical IO request has been initialized but the list is empty, it means that the target historical IO request has had a history of overlapping data regions, but currently there is no storage resource mutual exclusion, and it can be directly removed from the target IO request processing queue. If the mutex list on the target historical IO request has been initialized and is not empty, the following processing is required.
- a temporary linked list head is used to temporarily store the mutex list on the target historical IO request (to prevent the loss of IO mutex list information on the target historical IO request). Then, the target historical IO request is removed from the mutex list and then removed from the target IO request processing queue. Then, the previously stored mutex list is traversed through the temporary linked list head, and the following operations are performed on other pending IO requests on the mutex list in order: the other pending IO requests are removed from the mutex list, and the mutex list addition logic described above is used to try to add them back to the target IO request processing queue.
- step a3344 above may include the following steps:
- Step a33441 After the target historical IO request is processed, retrieve each second historical IO request to be compared from the target IO request processing queue again.
- the historical request data corresponding to the second historical IO request to be compared is located in the target data management unit.
- each second historical IO request to be compared is retrieved again from the target IO request processing queue.
- Step a33442 Compare the target request data with the second historical request data corresponding to the second historical IO request to be compared.
- the electronic device compares the target request data with the second historical request data corresponding to the second historical IO request to be compared.
- Step a33443 If there is no overlapping data between the target request data and each of the second historical request data to be compared, then the current IO request to be processed is placed into the target IO request processing queue.
- the electronic device places the current pending IO request into the target IO request processing queue.
- Step a33444 If there is overlapping data between the target request data and each of the second historical request data to be compared, then the current IO request to be processed is placed into the second target mutex list.
- the second target mutex list is the mutex list corresponding to the second historical request data to be compared that has overlapping data with the target request data.
- the current IO request to be processed is placed into the second target mutex list.
- this diagram illustrates overlapping data between the current pending IO request and multiple target historical IO requests. Since the target request data of the current pending IO request overlaps with the data range of the first historical IO request to be compared in the target data management unit within the target IO request processing queue, meaning there is storage resource contention and mutual exclusion, the current pending IO request needs to be added to the mutex list of the first historical IO request to be compared with overlapping data ranges. After that request is processed, the current pending IO request on the mutex list is then re-added to the target IO request processing queue. The reason for choosing to add it to the first historical IO request to be compared is that when traversing the target IO request processing queue, following the traversal order from beginning to end, if overlap is found, there is no need to continue traversing, thus improving performance.
- each second historical I/O request to be compared is retrieved from the target I/O request processing queue.
- the target request data is compared with the second historical I/O request data corresponding to the second historical I/O requests to be compared. If there is overlapping data between the target request data and each of the second historical I/O requests to be compared, the current I/O request to be processed is placed into the second target mutex list.
- Step S2043 If the number of target data management units is greater than 1, then the current pending IO request is split according to the number of target data management units to obtain multiple sub-pending IO requests.
- the number of sub-IO requests to be processed is consistent with the number of target data management units.
- a logical unit consists of several data management units. If the target request data is a data block with an offset of offset and length of len on this logical unit, and this data block is divided according to 4MB alignment and falls on 3 data management units, then the current pending IO request is split into requests to 3 different data management units, which can participate in the IO scheduling strategy of the distributed storage system respectively. Therefore, the number of target data management units is 3.
- Step S2044 Based on the target data management unit corresponding to each sub-IO request to be processed, place each sub-IO request to be processed into the corresponding target IO request processing queue in order to schedule each sub-IO request to be processed.
- the process of placing each sub-IO request to be processed into the corresponding target IO request processing queue can be referred to in the above embodiment of "if the number of target data management units is 1, then according to the target data management unit, the current IO request to be processed is placed into the target IO request processing queue corresponding to the target data management unit", which will not be elaborated here.
- the "scheduling of the current pending IO requests" in step S204 above may include the following steps:
- the target processing thread can be any one of multiple processing threads.
- Figure 14 illustrates the optimization of the IO request processing queue.
- Each IO request processing queue is managed by a single thread (not a worker thread in the thread pool), primarily responsible for traversing the IO request processing queue, enqueuing and dequeuing data management unit requests, and managing the mutex linked list.
- OID is moduloed (i.e., the remainder when the OID is divided by 3). If the result is 0, the data management unit request is placed in the first IO request processing queue; if the result is 1, it is placed in the second IO request processing queue; and if the result is 2, it is placed in the third IO request processing queue. This splits the IO request processing queue from one to three, shortening the queue length and reducing the time spent traversing the queue, thereby improving the efficiency of IO request processing queue management.
- the management method for each IO request processing queue is consistent, as described above.
- worker threads in the thread pool are evenly distributed across various I/O request processing queues to handle data management unit requests.
- the worker threads in the thread pool can dynamically balance the load across multiple I/O request processing queues to maximize the concurrent processing capacity of the thread pool and ensure the processing speed of each queue as much as possible.
- the IO scheduling method determines the number of target data management units corresponding to the target request data based on the request location and request data volume, ensuring the accuracy of the determined number of target data management units. If the number of target data management units is 1, the method obtains the queue number corresponding to the IO request processing queue; obtains the identification information of the target data management unit corresponding to the currently pending IO request; calculates the queue number modulo using the position order identifier; and determines the target IO request processing queue corresponding to the currently pending IO request from each IO request processing queue based on the calculation result, ensuring the accuracy of the determined target IO request processing queue.
- the process involves: acquiring historical request data corresponding to each historical pending IO request in the target IO request processing queue; determining the first comparison historical IO requests whose historical request data is located in the target data management unit, ensuring that both the historical request data and the target request data for each of the first comparison historical IO requests are located in the target data management unit, thus preventing potential overlap between the historical request data and the target request data; determining the target position offset of the target request data in the target data management unit based on the request position corresponding to the target request data, ensuring the accuracy of the determined target position offset; acquiring the historical position offset and historical data volume of the first comparison historical request data in the target data management unit; calculating the sum of the historical position offset and the historical data volume to obtain the first total offset, ensuring the accuracy of the calculated first total offset; and calculating the sum of the target position offset and the request data volume to obtain the second total offset, ensuring the accuracy of the calculated second total offset.
- the target position offset is compared with the first total offset; the historical position offset is compared with the second total offset; if the target position offset is greater than the first total offset, or the historical position offset is greater than the second total offset, then it is determined that there is no overlapping data between the target request data and each of the first historical request data to be compared, thus ensuring the accuracy of the determination that there is no overlapping data between the target request data and each of the first historical request data to be compared.
- the current pending IO request is placed in the target IO request processing queue. This ensures that when processing each of the first historical request data to be compared, there are no pending IO requests with overlapping data with each of the first historical IO requests to be compared. This avoids the problem of data inconsistency caused by IO requests to a certain address being added before the IO request to that address has been completed.
- the first historical IO request with overlapping data is identified as the target historical IO request, ensuring the accuracy of the identified target historical IO request.
- the current pending IO request is placed in the first target mutex linked list corresponding to the target historical IO request, thus preventing data inconsistency caused by adding the current pending IO request while processing the target historical IO request.
- the current pending IO request is placed in the target IO request processing queue, further preventing data inconsistency.
- the second historical I/O requests to be compared are retrieved from the target I/O request processing queue. This ensures that the second historical request data corresponding to each retrieved second historical I/O request to be compared, along with the target request data, are both within the target data management unit.
- the target request data is compared with the second historical request data corresponding to the second historical I/O requests to be compared. If there is no overlapping data between the target request data and the second historical request data to be compared, the current I/O request to be processed is placed in the target I/O request processing queue. If there is overlapping data between the target request data and the second historical request data to be compared, the current I/O request to be processed is placed in the second target mutex list. This avoids the problem of data inconsistency caused by additional I/O requests to a certain address occurring before an I/O request to that address has been completed.
- the current pending IO request is split into multiple sub-pending IO requests based on the number of target data management units. This ensures the accuracy of splitting the current pending IO request into multiple sub-pending IO requests.
- Each sub-pending IO request is then placed into its corresponding target IO request processing queue based on the target data management unit it corresponds to, enabling scheduling of each sub-pending IO request. This ensures the accuracy of placing each sub-pending IO request into its corresponding target IO request processing queue, thereby further improving the overall IO request performance of the distributed storage system.
- the target processing thread is used to schedule the currently pending IO requests in the target IO request processing queue.
- the target processing thread can be any one of multiple processing threads, which ensures the accuracy of scheduling the currently pending IO requests and enables the parallel scheduling of multiple pending IO requests, thereby further improving the overall IO request performance of the distributed storage system.
- this application provides a specific implementation method for a concurrent IO scheduling method based on data interval mutual exclusion. Taking Figure 15 as an example, the implementation of the technology of this application is explained in detail.
- the total capacity of the target logical unit to be accessed is 12MB, consisting of three 4MB (obj_size) data management units (numbered sequentially from 0), namely obj_0, obj_1, and obj_2, with corresponding OIDs of 0x0000123400000000, 0x0000123400000001, and 0x0000123400000002, respectively.
- Two consecutive IO read/write requests, IO_req1 and IO_req2 are made.
- the offset_1 of IO_req1 is 3MB and the length len_1 is 3MB.
- the offset_2 of IO_req2 is 5MB and the length len_2 is 4MB.
- the first threshold ⁇ worker_num ⁇ is configured to be 3, meaning the maximum number of worker threads in the thread pool is 3, numbered starting from 0.
- the multi-IO request processing queue feature is enabled, and the second threshold ⁇ queue_num ⁇ is configured to be 3, meaning there are 3 IO request processing queues simultaneously, numbered starting from 0.
- Thread pool load balancing is also enabled by default, meaning the 3 worker threads ( ⁇ worker_num ⁇ ) are evenly distributed across the 3 IO request processing queues to handle IO requests.
- the distributed storage system receives the IO write request IO_req1. Upon inspection, it finds that the requested data range spans two data management units and needs to be split.
- the inspection and splitting methods are as follows:
- the starting address is located in the 0th data management unit, i.e., obj_0.
- the end address is located in the first data management unit, namely obj_1.
- the first sub-IO_req1 request is obj_0a_p1, which requests an offset_a_p1 of 3MB and a length len_a_p1 of 1MB in obj_0.
- the second sub-IO_req1 request is obj_1a_p2, which requests that the offset_a_p2 in obj_1 is 0 and the length len_a_p2 is 2MB;
- the first sub-IO_req1 request, obj_0a_p1 should be placed in the 0th IO request processing queue. Since this sub-IO_req1 is a read/write IO request and the IO request processing queue 0 is currently empty, it can be directly enqueued.
- the second sub-IO_req1obj_1a_p2 should be placed in the first IO request processing queue. Since this sub-IO_req1 request is a read/write IO request and the IO request processing queue 1 is currently empty, it can be directly enqueued.
- the sub-IO_req1 request is scheduled by IO, and the worker threads in the thread pool begin to process the IO.
- the distributed storage system Before the IO write request IO_req1 is completed, the distributed storage system concurrently receives the IO read request IO_req2. Upon inspection, it is found that the requested data range spans two data management units and needs to be split.
- the inspection and splitting methods are as follows:
- the starting address is located in the first data management unit, namely obj_1.
- the end address is located in the second data management unit, namely obj_2.
- the first sub-IO_req2 request is obj_1b_p1, which requests an offset_b_p1 of 1MB and a length len_b_p1 of 3MB in obj_1.
- the second sub-IO_req2 request is obj_2b_p2, which requests an offset_b_p2 of 0 and a length len_b_p2 of 1MB in obj_2.
- the first data management unit request, obj_1b_p1 should be placed in the first IO request processing queue.
- This data management unit request is a read-write IO request. Since IO request processing queue 1 is not empty, it's necessary to first traverse IO request processing queue 1 to check if there is already a data management unit request in the target IO request processing queue that overlaps with the data range of the new data management unit request. It is found that both the existing data management unit request obj_1a_p2 and the new data management unit request obj_1b_p1 need to access the storage resource obj_1 with oid 0x0000123400000001. Therefore, it is necessary to determine whether the data ranges of these two data management unit requests overlap, that is, to determine the size of the start and end addresses of the data ranges requested by the two data management unit requests within obj_1.
- the data range of obj_1a_p2 in obj_1 is [0,2] MB;
- offset_b_p1 1 (MB);
- the data range of obj_1b_p1 in obj_1 is [1,4] MB;
- the linked list of obj_1a_p2 is not initialized, then the linked list is initialized and used as the head of the IO mutex linked list. Then, the new data management unit request obj_1b_p1 is added to the tail of the IO mutex linked list. At this time, the new data management unit request obj_1b_p1 does not participate in IO scheduling. It needs to wait for the data management unit request obj_1a_p2 to complete before attempting to add the new data management unit request obj_1b_p1 to the IO request processing queue for scheduling.
- the second data management unit request, obj_2b_p2 should be placed in the second IO request processing queue. Since this data management unit request is a read/write IO request and IO request processing queue 2 is currently empty, it can be directly enqueued.
- each of the three IO request processing queues has one data management unit request being concurrently processed by worker threads in the thread pool, and there is one more data management unit request waiting to be scheduled on IO request processing queue 1.
- the data management unit request obj_1a_p2 on IO request processing queue 1 After the data management unit request obj_1a_p2 on IO request processing queue 1 is processed, it needs to be removed from IO request processing queue 1.
- the specific process is as follows: Upon inspection, it is found that the linked list for the data management unit request has been initialized and is not empty. A temporary linked list head is used to temporarily store the data management unit request. Then, the data management unit request is removed from the IO mutex list. Next, the data management unit request is removed from IO request processing queue 1. Then, the IO mutex list is traversed through the temporary linked list head to retrieve the data management unit request obj_1b_p1 (i.e., the data management unit request is removed from the IO mutex list).
- IO request processing queue 1 is empty, so it is simply added to the tail of the queue.
- the IO mutex list traversal is now complete, and the process ends.
- the two data management unit requests obj_0a_p1 and obj_1a_p2 split from the IO write request IO_req1, have both been processed. The results are merged and returned to the user.
- the IO request list only contains the data management unit request obj_1b_p1.
- the two data management unit requests obj_1b_p1 and obj_2b_p2 which were split from the IO read request IO_req2, have been processed. The results are then merged and returned to the user.
- This embodiment also provides an I/O scheduling device configured to implement the above embodiments and optional implementations, details of which will not be repeated.
- the term "module” can be a combination of software and/or hardware that implements a predetermined function.
- the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
- This embodiment provides an IO scheduling device, as shown in FIG16, including: an acquisition module 501, configured to acquire a currently pending IO request; a first determination module 502, configured to identify the currently pending IO request and determine the target request data corresponding to the currently pending IO request; a second determination module 503, configured to determine the request location of the target request data in the storage device and the corresponding request data volume of the target request data; and a scheduling module 504, configured to place the currently pending IO request into a target IO request processing queue according to the request location and request data volume corresponding to the target request data, and schedule the currently pending IO request.
- the IO scheduling device is presented in the form of a functional unit.
- a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and/or other devices that can provide the above functions.
- ASIC Application Specific Integrated Circuit
- This application also provides an electronic device having the IO scheduling device shown in FIG16 above.
- Figure 17 is a schematic diagram of an electronic device provided in an optional embodiment of this application.
- the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces.
- the various components communicate with each other using different buses and can be mounted on a common motherboard or otherwise installed as needed.
- the processor can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input/output device (such as a display device coupled to the interface).
- multiple processors and/or multiple buses can be used with multiple memories and multiple memory sets, if desired.
- multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system).
- Figure 17 uses one processor 10 as an example.
- Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may also include hardware chips. These hardware chips may be application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The programmable logic devices may be complex programmable logic devices (CLPs), field-programmable gate arrays (FPGAs), general-purpose array logic (GDAs), or any combination thereof.
- ASICs application-specific integrated circuits
- PLDs programmable logic devices
- the programmable logic devices may be complex programmable logic devices (CLPs), field-programmable gate arrays (FPGAs), general-purpose array logic (GDAs), or any combination thereof.
- CLPs complex programmable logic devices
- FPGAs field-programmable gate arrays
- GDAs general-purpose array logic
- the memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
- the memory 20 may include a program storage area and a data storage area.
- the program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device.
- the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device.
- the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
- the memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
- volatile memory such as random access memory
- non-volatile memory such as flash memory, hard disk or solid-state drive
- the memory 20 may also include a combination of the above types of memory.
- the electronic device also includes an input device 30 and an output device 40.
- the processor 10, memory 20, input device 30 and output device 20 can be connected via a bus or other means, as shown in Figure 17, which illustrates a bus connection.
- Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc.
- Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs (Light Emitting Diodes)), and haptic feedback devices (e.g., vibration motors).
- the aforementioned display devices include, but are not limited to, liquid crystal displays, LEDs, displays, and plasma displays. In some alternative embodiments, the display device may be a touch screen.
- This application also provides a computer-readable storage medium.
- the methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium.
- the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware.
- the storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; optionally, the storage medium may also include combinations of the above types of memory.
- computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
- a portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and/or technical solutions according to this application through the operation of the computer.
- computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc.
- ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program.
- the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
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)
- Debugging And Monitoring (AREA)
Abstract
Description
相关申请的交叉引用Cross-reference to related applications
本申请要求于2024年07月18日提交中国专利局,申请号为202410962881.9,申请名称为“IO调度方法、电子设备、存储介质及程序产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 202410962881.9, filed on July 18, 2024, entitled "IO Scheduling Method, Electronic Device, Storage Medium and Program Product", the entire contents of which are incorporated herein by reference.
本申请涉及IO调度技术领域,具体涉及IO调度方法、电子设备、存储介质及程序产品。This application relates to the field of I/O scheduling technology, specifically to I/O scheduling methods, electronic devices, storage media, and program products.
分布式存储系统的存储资源对所有客户端来说都是共享的。因此,分布式存储系统会接收到来自不同客户端的IO(Input/Output,输入/输出)请求,这些IO请求可能是关于同一个LUN(Logical Unit Number,逻辑单元)的相同字节区间,也可能是关于同一个LUN的不同字节区间,还可能是关于不同LUN各自的字节区间。In a distributed storage system, storage resources are shared by all clients. Therefore, the distributed storage system receives I/O (Input/Output) requests from different clients. These I/O requests may pertain to the same byte range within the same LUN (Logical Unit Number), different byte ranges within the same LUN, or individual byte ranges within different LUNs.
为了提高分布式存储系统的管理效率,通常以OBJ(object,分布式存储系统的最小数据管理单元)作为存储资源的最小管理单元,一个LUN由若干个OBJ构成。但是,相关技术中,通常将待处理IO请求放到同一个IO请求处理队列,然后按照顺序依次进行调度。但是,相关技术中的IO调度方法,并不能在很大程度上提高IO调度的并发度。To improve the management efficiency of distributed storage systems, OBJs (objects, the smallest data management unit in a distributed storage system) are typically used as the smallest management unit for storage resources, and a LUN consists of several OBJs. However, in related technologies, pending I/O requests are usually placed in the same I/O request processing queue and then scheduled sequentially. However, the I/O scheduling methods in these technologies do not significantly improve the concurrency of I/O scheduling.
有鉴于此,本申请提供了一种IO调度方法、电子设备、存储介质及程序产品,以解决IO调度的问题。In view of this, this application provides an I/O scheduling method, electronic device, storage medium, and program product to solve the I/O scheduling problem.
第一方面,本申请提供了一种IO调度方法,方法包括:获取当前待处理IO请求;对当前待处理IO请求进行识别,确定当前待处理IO请求对应的目标请求数据;确定目标请求数据在存储设备中的请求位置以及目标请求数据的对应的请求数据量;根据目标请求数据对应的请求位置和请求数据量,将当前待处理IO请求放入目标IO请求处理队列,对当前待处理IO请求进行调度。In a first aspect, this application provides an IO scheduling method, the method comprising: obtaining a currently pending IO request; identifying the currently pending IO request and determining the target request data corresponding to the currently pending IO request; determining the request location of the target request data in the storage device and the corresponding request data volume of the target request data; and, based on the request location and request data volume corresponding to the target request data, placing the currently pending IO request into a target IO request processing queue and scheduling the currently pending IO request.
本申请实施例提供的IO调度方法,获取当前待处理IO请求;对当前待处理IO请求进行识别,确定当前待处理IO请求对应的目标请求数据,保证了确定的目标请求数据的准确性。确定目标请求数据在存储设备中的请求位置以及目标请求数据的对应的请求数据量,根据目标请求数据对应的请求位置和请求数据量,将当前待处理IO请求放入目标IO请求处理队列,对当前待处理IO请求进行调度,保证了将当前待处理IO请求放入目标IO请求处理队列准确性,然后从目标IO请求处理队列对当前待处理IO请求进行调度,保证了对当前待处理IO请求进行调度的准确性。从而可以实现将多个IO请求处理队列中的待处理IO请求进行同时处理,进而不需要等待前一次待处理IO请求全部完成后,才对后一次的待处理IO请求进行调度处理,从而进一步提高了分布式存储系统的整体IO请求性能。The IO scheduling method provided in this application embodiment obtains the currently pending IO requests; identifies the currently pending IO requests and determines the target request data corresponding to them, ensuring the accuracy of the determined target request data. It determines the request location of the target request data in the storage device and the corresponding request data volume. Based on the request location and request data volume, the currently pending IO requests are placed into a target IO request processing queue, and then scheduled. This ensures the accuracy of placing the currently pending IO requests into the target IO request processing queue. Furthermore, the method schedules the currently pending IO requests from the target IO request processing queue, ensuring the accuracy of scheduling. This allows for the simultaneous processing of pending IO requests in multiple IO request processing queues, eliminating the need to wait for the previous pending IO requests to complete before scheduling the next pending IO request, thereby further improving the overall IO request performance of the distributed storage system.
在一种可选的实施方式中,根据目标请求数据对应的请求位置和请求数据量,将当前待处理IO请求放入目标IO请求处理队列,对当前待处理IO请求进行调度,包括:对比请求数据量与预设请求数据量阈值;在请求数据量小于或者等于预设请求数据量阈值的情况下,根据请求位置,将当前待处理IO请求放入目标IO请求处理队列,对当前待处理IO请求进行调度;在请求数据量大于预设请求数据量阈值的情况下,根据目标请求数据对当前待处理IO请求进行拆分,得到多个子待处理IO请求;根据各个子待处理IO请求对应的子目标数据对应的子请求位置,将各个子待处理IO请求放入各个子待处理IO请求对应的目标IO请求处理队列,对多个子待处理IO请求进行调度。In one optional implementation, based on the request location and request data volume corresponding to the target request data, the current pending IO request is placed into the target IO request processing queue, and the current pending IO request is scheduled, including: comparing the request data volume with a preset request data volume threshold; if the request data volume is less than or equal to the preset request data volume threshold, based on the request location, the current pending IO request is placed into the target IO request processing queue, and the current pending IO request is scheduled; if the request data volume is greater than the preset request data volume threshold, the current pending IO request is split into multiple sub-pending IO requests based on the target request data; based on the sub-request location corresponding to the sub-target data of each sub-pending IO request, each sub-pending IO request is placed into the target IO request processing queue corresponding to its respective sub-pending IO request, and the multiple sub-pending IO requests are scheduled.
在一种可选的实施方式中,根据目标请求数据对应的请求位置和请求数据量,将当前待处理IO请求放入目标IO请求处理队列,包括:根据目标请求数据对应的请求位置和请求数据量,确定目标请求数据对应的目标数据管理单元的数量;若目标数据管理单元的数量为1,则根据目标数据管理单元,将当前待处理IO请求放入目标数据管理单元对应的目标IO请求处理队列中。In one optional implementation, the current pending IO request is placed into the target IO request processing queue according to the request location and request data volume corresponding to the target request data, including: determining the number of target data management units corresponding to the target request data according to the request location and request data volume corresponding to the target request data; if the number of target data management units is 1, then the current pending IO request is placed into the target IO request processing queue corresponding to the target data management unit according to the target data management unit.
本申请实施例提供的IO调度方法,根据目标请求数据对应的请求位置和请求数据量,确定目标请求数据对应的目标数据管理单元的数量,保证了确定的目标请求数据对应的目标数据管理单元的数量的准确性。若目标数据管理单元的数量为1,则根据目标数据管理单元,将当前待处理IO请求放入目标数据管理单元对应的目标IO请求处理队列中,保证了将当前待处理IO请求放入目标数据管理单元对应的目标IO请求处理队列中的准确性。The IO scheduling method provided in this application determines the number of target data management units corresponding to the target request data based on the request location and the amount of request data, ensuring the accuracy of the determined number of target data management units. If the number of target data management units is 1, the currently pending IO request is placed into the target IO request processing queue corresponding to the target data management unit, ensuring the accuracy of placing the currently pending IO request into the target IO request processing queue corresponding to the target data management unit.
在一种可选的实施方式中,根据目标请求数据对应的请求位置和请求数据量,确定目标请求数据对应的目标数据管理单元的数量,包括:根据目标请求数据对应的请求位置,确定目标请求数据对应的目标逻辑单元以及目标请求数据对应的请求位置在目标逻辑单元中的偏移量,得到目标请求数据的起始地址对应的数据管理单元;根据请求数据量确定目标请求数据的结束地址对应的数据管理单元;在起始地址对应的数据管理单元和结束地址对应的数据管理单元为同一个数据管理单元的情况下,确定目标数据管理单元的数量为1;在起始地址对应的数据管理单元和结束地址对应的数据管理单元为不同的数据管理单元的情况下,确定目标数据管理单元的数量大于1。In one optional implementation, determining the number of target data management units corresponding to the target request data based on the request location and the amount of request data includes: determining the target logical unit corresponding to the target request data and the offset of the request location within the target logical unit based on the request location corresponding to the target request data, thereby obtaining the data management unit corresponding to the start address of the target request data; determining the data management unit corresponding to the end address of the target request data based on the amount of request data; if the data management unit corresponding to the start address and the data management unit corresponding to the end address are the same data management unit, determining the number of target data management units to be 1; if the data management unit corresponding to the start address and the data management unit corresponding to the end address are different data management units, determining the number of target data management units to be greater than 1.
在一种可选的实施方式中,根据目标请求数据对应的请求位置和请求数据量,将当前待处理IO请求放入目标IO请求处理队列,还包括:若目标数据管理单元的数量大于1,则根据目标数据管理单元的数量,对当前待处理IO请求进行拆分,得到多个子待处理IO请求;子待处理IO请求的数量与目标数据管理单元的数量一致;根据各子待处理IO请求对应的目标数据管理单元,将各子待处理IO请求放入对应的目标IO请求处理队列中,以对各子待处理IO请求进行调度。In one optional implementation, the current pending IO request is placed into the target IO request processing queue according to the request location and the amount of request data corresponding to the target request data. The method further includes: if the number of target data management units is greater than 1, the current pending IO request is split into multiple sub-pending IO requests according to the number of target data management units; the number of sub-pending IO requests is consistent with the number of target data management units; and each sub-pending IO request is placed into the corresponding target IO request processing queue according to the target data management unit corresponding to each sub-pending IO request, so as to schedule each sub-pending IO request.
本申请实施例提供的IO调度方法,若目标数据管理单元的数量大于1,则根据目标数据管理单元的数量,对当前待处理IO请求进行拆分,得到多个子待处理IO请求,保证了对当前待处理IO请求进行拆分,得到多个子待处理IO请求的准确性。根据各子待处理IO请求对应的目标数据管理单元,将各子待处理IO请求放入对应的目标IO请求处理队列中,以对各子待处理IO请求进行调度,保证了将各子待处理IO请求放入对应的目标IO请求处理队列中的准确性,以对各子待处理IO请求进行调度,进而可以进一步提高分布式存储系统的整体IO请求性能。The IO scheduling method provided in this application, if the number of target data management units is greater than 1, splits the current pending IO request into multiple sub-pending IO requests based on the number of target data management units, ensuring the accuracy of splitting the current pending IO request into multiple sub-pending IO requests. Based on the target data management unit corresponding to each sub-pending IO request, each sub-pending IO request is placed into the corresponding target IO request processing queue for scheduling, ensuring the accuracy of placing each sub-pending IO request into the corresponding target IO request processing queue, thereby further improving the overall IO request performance of the distributed storage system.
在一种可选的实施方式中,IO请求处理队列为多个,将当前待处理IO请求放入目标IO请求处理队列中,包括:获取IO请求处理队列对应的队列数量;获取当前待处理IO请求对应的目标数据管理单元的标识信息;根据队列数量和标识信息,将当前待处理IO请求放入目标IO请求处理队列中。In one optional implementation, there are multiple IO request processing queues. Placing the currently pending IO request into a target IO request processing queue includes: obtaining the queue number corresponding to the IO request processing queue; obtaining the identification information of the target data management unit corresponding to the currently pending IO request; and placing the currently pending IO request into the target IO request processing queue according to the queue number and the identification information.
本申请实施例提供的IO调度方法,获取IO请求处理队列对应的队列数量;获取当前待处理IO请求对应的目标数据管理单元的标识信息;根据队列数量和标识信息,将当前待处理IO请求放入目标IO请求处理队列中,保证了将当前待处理IO请求放入目标IO请求处理队列中的准确性。The IO scheduling method provided in this application embodiment obtains the queue number corresponding to the IO request processing queue; obtains the identification information of the target data management unit corresponding to the current IO request to be processed; and puts the current IO request to be processed into the target IO request processing queue according to the queue number and the identification information, thereby ensuring the accuracy of putting the current IO request to be processed into the target IO request processing queue.
在一种可选的实施方式中,获取IO请求处理队列对应的队列数量,包括:根据逻辑单元的数量和各个逻辑单元所包括的数据管理单元的数量,计算队列数量。In one optional implementation, obtaining the number of queues corresponding to the IO request processing queue includes: calculating the number of queues based on the number of logical units and the number of data management units included in each logical unit.
在一种可选的实施方式中,目标数据管理单元的标识信息为目标数据管理单元在对应的逻辑单元中的位置顺序标识,根据队列数量和标识信息,将当前待处理IO请求放入目标IO请求处理队列中,包括:利用位置顺序标识对队列数量进行取模计算;根据计算结果,从各IO请求处理队列中确定当前待处理IO请求对应的目标IO请求处理队列;将当前待处理IO请求放入目标IO请求处理队列中。In one optional implementation, the identification information of the target data management unit is the positional order identifier of the target data management unit in the corresponding logical unit. Based on the queue number and the identification information, the current IO request to be processed is placed into the target IO request processing queue, including: performing a modulo calculation on the queue number using the positional order identifier; determining the target IO request processing queue corresponding to the current IO request to be processed from each IO request processing queue based on the calculation result; and placing the current IO request to be processed into the target IO request processing queue.
本申请实施例提供的IO调度方法,利用位置顺序标识对队列数量进行取模计算;根据计算结果,从各IO请求处理队列中确定当前待处理IO请求对应的目标IO请求处理队列,保证了确定的目标IO请求处理队列准确性。将当前待处理IO请求放入目标IO请求处理队列中,保证了将当前待处理IO请求放入目标IO请求处理队列中的准确性。The IO scheduling method provided in this application uses a positional order identifier to perform a modulo calculation on the number of queues. Based on the calculation result, the target IO request processing queue corresponding to the current IO request to be processed is determined from each IO request processing queue, ensuring the accuracy of the determined target IO request processing queue. The current IO request to be processed is then placed into the target IO request processing queue, ensuring the accuracy of placing the current IO request to be processed into the target IO request processing queue.
在一种可选的实施方式中,将当前待处理IO请求放入目标IO请求处理队列中,包括:获取目标IO请求处理队列中各历史待处理IO请求对应的历史请求数据;从目标IO请求处理队列中确定历史请求数据处于目标数据管理单元的各第一待对比历史IO请求;将目标请求数据与各第一待对比历史IO请求对应的第一待对比历史请求数据进行对比;根据对比结果,将当前待处理IO请求放入目标IO请求处理队列中。In one optional implementation, placing the current pending IO request into the target IO request processing queue includes: obtaining historical request data corresponding to each historical pending IO request in the target IO request processing queue; determining from the target IO request processing queue that the historical request data belongs to each first historical IO request to be compared in the target data management unit; comparing the target request data with the first historical request data corresponding to each first historical IO request to be compared; and placing the current pending IO request into the target IO request processing queue based on the comparison result.
本申请实施例提供的IO调度方法,获取目标IO请求处理队列中各历史待处理IO请求对应的历史请求数据;从目标IO请求处理队列中确定历史请求数据处于目标数据管理单元的各第一待对比历史IO请求,保证了确定的各第一待对比历史IO请求对应的历史请求数据和目标请求数据均处于目标数据管理单元,从而使得各第一待对比历史IO请求对应的历史请求数据和目标请求数据之间可能存在重叠数据。将目标请求数据与各第一待对比历史IO请求对应的第一待对比历史请求数据进行对比,保证了得到的对比结果的准确性。根据对比结果,将当前待处理IO请求放入目标IO请求处理队列中,保证了将当前待处理IO请求放入目标IO请求处理队列中的准确性。The IO scheduling method provided in this application obtains historical request data corresponding to each historical IO request to be processed in the target IO request processing queue; determines each first historical IO request to be compared whose historical request data is located in the target data management unit from the target IO request processing queue, ensuring that the historical request data corresponding to each first historical IO request to be compared and the target request data are both located in the target data management unit, thereby ensuring that there may be overlapping data between the historical request data corresponding to each first historical IO request to be compared and the target request data. The target request data is compared with the first historical request data to be compared corresponding to each first historical IO request to be compared, ensuring the accuracy of the comparison result. Based on the comparison result, the current IO request to be processed is placed into the target IO request processing queue, ensuring the accuracy of placing the current IO request to be processed into the target IO request processing queue.
在一种可选的实施方式中,获取目标IO请求处理队列中各历史待处理IO请求对应的历史请求数据,包括:从目标IO请求处理队列中获取目标IO请求处理队列中的各个历史待处理IO请求;识别各个历史待处理IO请求,得到各个历史待处理IO请求对应的历史请求数据以及历史请求数据对应的历史数据管理单元。In one optional implementation, obtaining historical request data corresponding to each historical pending IO request in the target IO request processing queue includes: obtaining each historical pending IO request in the target IO request processing queue; identifying each historical pending IO request to obtain historical request data corresponding to each historical pending IO request and a historical data management unit corresponding to the historical request data.
在一种可选的实施方式中,根据对比结果,将当前待处理IO请求放入目标IO请求处理队列中,包括:若目标请求数据与各第一待对比历史请求数据之间不存在重叠数据,则将当前待处理IO请求放入目标IO请求处理队列中。In one optional implementation, the current IO request to be processed is placed into the target IO request processing queue according to the comparison result, including: if there is no overlapping data between the target request data and each of the first historical request data to be compared, then the current IO request to be processed is placed into the target IO request processing queue.
本申请实施例提供的IO调度方法,若目标请求数据与各第一待对比历史请求数据之间不存在重叠数据,则将当前待处理IO请求放入目标IO请求处理队列中,从而保证了在对各第一待对比历史请求数据时,不存在与各第一待对比历史IO请求存在重叠数据的待处理IO请求,进而避免了针对某一地址的IO请求尚未完成的情况下,经常又追加发生了针对该地址的IO请求操作,从而出现数据不一致问题。The IO scheduling method provided in this application embodiment, if there is no overlapping data between the target request data and each first historical request data to be compared, then the current IO request to be processed is placed in the target IO request processing queue, thereby ensuring that when processing each first historical request data to be compared, there is no IO request to be processed that overlaps with each first historical IO request to be compared, thus avoiding the problem of data inconsistency caused by the frequent occurrence of additional IO request operations for an address before the IO request for a certain address has been completed.
在一种可选的实施方式中,根据对比结果,将当前待处理IO请求放入目标IO请求处理队列中,还包括:若目标请求数据与各第一待对比历史请求数据之间存在重叠数据,则将与目标请求数据存在重叠数据的第一待对比历史IO请求确定为目标历史IO请求;将当前待处理IO请求放入目标历史IO请求对应的第一目标互斥链表中;当目标历史IO请求处理完毕,将当前待处理IO请求放入目标IO请求处理队列中。In an optional implementation, based on the comparison results, the current pending IO request is placed into the target IO request processing queue, and the method further includes: if there is overlapping data between the target request data and each of the first historical request data to be compared, then the first historical IO request to be compared that has overlapping data with the target request data is determined as the target historical IO request; the current pending IO request is placed into the first target mutex list corresponding to the target historical IO request; when the target historical IO request is processed, the current pending IO request is placed into the target IO request processing queue.
本申请实施例提供的IO调度方法,若目标请求数据与各第一待对比历史请求数据之间存在重叠数据,则将与目标请求数据存在重叠数据的第一待对比历史IO请求确定为目标历史IO请求,保证了确定的目标历史IO请求的准确性。将当前待处理IO请求放入目标历史IO请求对应的第一目标互斥链表中,进而可以避免在对目标历史IO请求进行处理时,加入了当前待处理IO请求,导致出现数据不一致的问题。当目标历史IO请求处理完毕,将当前待处理IO请求放入目标IO请求处理队列中,进而可以避免出现数据不一致的问题。The IO scheduling method provided in this application, if there is overlapping data between the target request data and each of the first historical request data to be compared, determines the first historical IO request to be compared that has overlapping data as the target historical IO request, thus ensuring the accuracy of the determined target historical IO request. The current IO request to be processed is placed in the first target mutex linked list corresponding to the target historical IO request, thereby avoiding data inconsistency caused by adding the current IO request to be processed while processing the target historical IO request. When the target historical IO request is processed, the current IO request to be processed is placed in the target IO request processing queue, thereby avoiding data inconsistency.
在一种可选的实施方式中,当目标历史IO请求处理完毕,将当前待处理IO请求放入目标IO请求处理队列中,包括:使用临时链表头暂存第一目标互斥链表;从第一目标互斥链表上移除目标历史IO请求;从目标IO请求处理队列中移除目标历史IO请求;通过临时链表头遍历暂存的第一目标互斥链表,按照顺序依次对第一目标互斥链表上除目标历史IO请求外的各个其他待处理IO请求执行以下步骤:将其他待处理IO请求从第一目标互斥链表上移除,并将其他待处理IO请求重新放入目标IO请求处理队列中。In one optional implementation, when the target historical IO request has been processed, the current pending IO request is placed into the target IO request processing queue, including: temporarily storing the first target mutex list using a temporary linked list head; removing the target historical IO request from the first target mutex list; removing the target historical IO request from the target IO request processing queue; traversing the temporarily stored first target mutex list through the temporary linked list head, and sequentially performing the following steps on each other pending IO request on the first target mutex list other than the target historical IO request: removing the other pending IO requests from the first target mutex list, and putting the other pending IO requests back into the target IO request processing queue.
在一种可选的实施方式中,当目标历史IO请求处理完毕,将当前待处理IO请求放入目标IO请求处理队列中,包括:当目标历史IO请求处理完毕,再次从目标IO请求处理队列中获取各第二待对比历史IO请求;第二待对比历史IO请求对应的历史请求数据处于目标数据管理单元;将目标请求数据与第二待对比历史IO请求对应的第二待对比历史请求数据进行对比;若目标请求数据与各第二待对比历史请求数据之间不存在重叠数据,则将当前待处理IO请求放入目标IO请求处理队列中;若目标请求数据与各第二待对比历史请求数据之间存在重叠数据,则将当前待处理IO请求放入第二目标互斥链表,其中,第二目标互斥链表为与目标请求数据存在重叠数据的第二待对比历史请求数据对应的互斥链表。In one optional implementation, after the target historical IO request is processed, the current pending IO request is placed into the target IO request processing queue, including: after the target historical IO request is processed, retrieving each second historical IO request to be compared from the target IO request processing queue; the historical request data corresponding to the second historical IO request to be compared is located in the target data management unit; comparing the target request data with the second historical request data corresponding to the second historical IO request to be compared; if there is no overlapping data between the target request data and each second historical request data to be compared, then placing the current pending IO request into the target IO request processing queue; if there is overlapping data between the target request data and each second historical request data to be compared, then placing the current pending IO request into a second target mutex list, wherein the second target mutex list is the mutex list corresponding to the second historical request data to be compared that has overlapping data with the target request data.
本申请实施例提供的IO调度方法,当目标历史IO请求处理完毕,再次从目标IO请求处理队列中获取各第二待对比历史IO请求,保证了获取到的各第二待对比历史IO请求对应的第二待对比历史请求数据与目标请求数据均处于目标数据管理单元中。将目标请求数据与第二待对比历史IO请求对应的第二待对比历史请求数据进行对比;若目标请求数据与各第二待对比历史请求数据之间不存在重叠数据,则将当前待处理IO请求放入目标IO请求处理队列中。若目标请求数据与各第二待对比历史请求数据之间存在重叠数据,则将当前待处理IO请求放入第二目标互斥链表。进而避免了针对某一地址的IO请求尚未完成的情况下,经常又追加发生了针对该地址的IO请求操作,从而出现数据不一致问题。The IO scheduling method provided in this application, after the target historical IO request has been processed, retrieves each second historical IO request to be compared from the target IO request processing queue, ensuring that the second historical request data corresponding to each second historical IO request to be compared and the target request data are both in the target data management unit. The target request data is compared with the second historical request data corresponding to the second historical IO requests to be compared; if there is no overlapping data between the target request data and each second historical request data to be compared, the current IO request to be processed is placed in the target IO request processing queue. If there is overlapping data between the target request data and each second historical request data to be compared, the current IO request to be processed is placed in the second target mutex list. This avoids the problem of data inconsistency caused by frequent additional IO request operations for a certain address before an IO request for that address has been completed.
在一种可选的实施方式中,将目标请求数据与各第一待对比历史IO请求对应的第一待对比历史请求数据进行对比,包括:根据目标请求数据对应的请求位置,确定目标请求数据在目标数据管理单元中的目标位置偏移量;获取第一待对比历史请求数据在目标数据管理单元中的历史位置偏移量和历史数据量;根据目标位置偏移量、请求数据量、历史位置偏移量和历史数据量之间的关系,将目标请求数据与各第一待对比历史IO请求对应的第一待对比历史请求数据进行对比。In one optional implementation, comparing the target request data with the first historical request data corresponding to each first historical IO request to be compared includes: determining the target position offset of the target request data in the target data management unit based on the request position corresponding to the target request data; obtaining the historical position offset and historical data volume of the first historical request data to be compared in the target data management unit; and comparing the target request data with the first historical request data corresponding to each first historical IO request to be compared based on the relationship between the target position offset, the request data volume, the historical position offset, and the historical data volume.
本申请实施例提供的IO调度方法,根据目标请求数据对应的请求位置,确定目标请求数据在目标数据管理单元中的目标位置偏移量,保证了确定的目标位置偏移量的准确性。获取第一待对比历史请求数据在目标数据管理单元中的历史位置偏移量和历史数据量;根据目标位置偏移量、请求数据量、历史位置偏移量和历史数据量之间的关系,将目标请求数据与各第一待对比历史IO请求对应的第一待对比历史请求数据进行对比,保证了得到的对比结果的准确性。The IO scheduling method provided in this application determines the target position offset of the target request data in the target data management unit based on the request position corresponding to the target request data, ensuring the accuracy of the determined target position offset. It obtains the historical position offset and historical data volume of the first historical request data to be compared in the target data management unit; based on the relationship between the target position offset, request data volume, historical position offset, and historical data volume, it compares the target request data with the first historical request data corresponding to each first historical IO request to be compared, ensuring the accuracy of the obtained comparison results.
在一种可选的实施方式中,根据目标位置偏移量、请求数据量、历史位置偏移量和历史数据量之间的关系,将目标请求数据与各第一待对比历史IO请求对应的第一待对比历史请求数据进行对比,包括:计算历史位置偏移量和历史数据量的和,得到第一总偏移量;计算目标位置偏移量和请求数据量的和,得到第二总偏移量;将目标位置偏移量与第一总偏移量进行对比;将历史位置偏移量与第二总偏移量进行对比;若目标位置偏移量大于第一总偏移量,或,历史位置偏移量大于第二总偏移量,则确定目标请求数据与各第一待对比历史请求数据之间不存在重叠数据。In one optional implementation, based on the relationship between the target position offset, the requested data volume, the historical position offset, and the historical data volume, the target requested data is compared with the first historical request data corresponding to each first historical IO request to be compared. This includes: calculating the sum of the historical position offset and the historical data volume to obtain a first total offset; calculating the sum of the target position offset and the requested data volume to obtain a second total offset; comparing the target position offset with the first total offset; comparing the historical position offset with the second total offset; if the target position offset is greater than the first total offset, or the historical position offset is greater than the second total offset, then it is determined that there is no overlapping data between the target requested data and each first historical request data to be compared.
本申请实施例提供的IO调度方法,计算历史位置偏移量和历史数据量的和,得到第一总偏移量,保证了计算得到的第一总偏移量的准确性。计算目标位置偏移量和请求数据量的和,得到第二总偏移量保证了计算得到的第二总偏移量的准确性。将目标位置偏移量与第一总偏移量进行对比;将历史位置偏移量与第二总偏移量进行对比;若目标位置偏移量大于第一总偏移量,或,历史位置偏移量大于第二总偏移量,则确定目标请求数据与各第一待对比历史请求数据之间不存在重叠数据,保证了确定的目标请求数据与各第一待对比历史请求数据之间不存在重叠数据的准确性。The IO scheduling method provided in this application calculates the sum of historical position offsets and historical data volumes to obtain a first total offset, ensuring the accuracy of the calculated first total offset. It also calculates the sum of target position offsets and requested data volumes to obtain a second total offset, ensuring the accuracy of the calculated second total offset. The target position offset is compared with the first total offset; the historical position offset is compared with the second total offset. If the target position offset is greater than the first total offset, or if the historical position offset is greater than the second total offset, then it is determined that there is no overlapping data between the target requested data and each of the first historical requested data to be compared, ensuring the accuracy of the determined non-overlapping data between the target requested data and each of the first historical requested data to be compared.
在一种可选的实施方式中,对当前待处理IO请求进行调度,包括:利用目标处理线程对目标IO请求处理队列中的当前待处理IO请求进行调度;目标处理线程为多个处理线程中的任一个。In one alternative implementation, scheduling the currently pending I/O requests includes: scheduling the currently pending I/O requests in the target I/O request processing queue using a target processing thread; the target processing thread is any one of a plurality of processing threads.
本申请实施例提供的IO调度方法,利用目标处理线程对目标IO请求处理队列中的当前待处理IO请求进行调度;目标处理线程为多个处理线程中的任一个,从而保证了对当前待处理IO请求进行调度的准确性,且实现了多个待处理IO请求并行进行调度,进一步提高了分布式存储系统的整体IO请求性能。The IO scheduling method provided in this application uses a target processing thread to schedule the current pending IO requests in the target IO request processing queue. The target processing thread can be any one of multiple processing threads, thereby ensuring the accuracy of scheduling the current pending IO requests and realizing the parallel scheduling of multiple pending IO requests, further improving the overall IO request performance of the distributed storage system.
第二方面,本申请提供了一种电子设备,包括:存储器和处理器,存储器和处理器之间互相通信连接,存储器中存储有计算机指令,处理器通过执行计算机指令,从而执行上述第一方面或其对应的任一实施方式的IO调度方法。Secondly, this application provides an electronic device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the IO scheduling method of the first aspect or any corresponding embodiment described above.
第三方面,本申请提供了一种计算机非暂时可读存储介质,该计算机非暂时可读存储介质上存储有计算机指令,计算机指令用于使计算机执行上述第一方面或其对应的任一实施方式的IO调度方法。Thirdly, this application provides a computer non-transitory readable storage medium storing computer instructions, which are used to cause a computer to execute the IO scheduling method of the first aspect or any corresponding embodiment described above.
第四方面,本申请提供了一种计算机程序产品,包括计算机指令,计算机指令用于使计算机执行上述第一方面或其对应的任一实施方式的IO调度方法。Fourthly, this application provides a computer program product, including computer instructions for causing a computer to execute the I/O scheduling method of the first aspect or any corresponding embodiment thereof.
为了更清楚地说明本申请具体实施方式或相关技术中的技术方案,下面将对具体实施方式或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。To more clearly illustrate the technical solutions in the specific embodiments or related technologies of this application, the drawings used in the description of the specific embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
图1是根据本申请实施例的分布式存储系统的架构的示意图;Figure 1 is a schematic diagram of the architecture of a distributed storage system according to an embodiment of this application;
图2是根据本申请实施例的第一种IO调度方法的流程示意图;Figure 2 is a flowchart illustrating a first IO scheduling method according to an embodiment of this application;
图3是根据本申请实施例的第二种IO调度方法的流程示意图;Figure 3 is a flowchart illustrating a second IO scheduling method according to an embodiment of this application;
图4是根据本申请实施例的第三种IO调度方法的流程示意图;Figure 4 is a flowchart illustrating a third IO scheduling method according to an embodiment of this application;
图5是根据本申请实施例的第一种目标请求数据与各第一待对比历史请求数据之间不存在重叠数据的流程示意图;Figure 5 is a flowchart illustrating that there is no overlap between the first type of target request data and each first historical request data to be compared according to an embodiment of this application.
图6是根据本申请实施例的第二种目标请求数据与各第一待对比历史请求数据之间不存在重叠数据的流程示意图;Figure 6 is a flowchart illustrating that there is no overlap between the second type of target request data and each of the first historical request data to be compared according to an embodiment of this application;
图7是根据本申请实施例的当前待处理IO请求放入目标IO请求处理队列中的示意图;Figure 7 is a schematic diagram of placing the current pending IO request into the target IO request processing queue according to an embodiment of this application;
图8是根据本申请实施例的第一种目标请求数据与各第一待对比历史请求数据之间存在重叠数据的流程示意图;Figure 8 is a flowchart illustrating the overlapping data between the first type of target request data and each first historical request data to be compared according to an embodiment of this application.
图9是根据本申请实施例的第二种目标请求数据与各第一待对比历史请求数据之间存在重叠数据的流程示意图;Figure 9 is a flowchart illustrating the overlapping data between the second type of target request data and each of the first historical request data to be compared, according to an embodiment of this application.
图10是根据本申请实施例的互斥链表添加逻辑的流程图;Figure 10 is a flowchart of the mutex list addition logic according to an embodiment of this application;
图11是根据本申请实施例的互斥链表移除逻辑的流程图;Figure 11 is a flowchart of the mutex list removal logic according to an embodiment of this application;
图12是根据本申请实施例的当前待处理IO请求与多个目标历史IO请求存在重叠数据的示意图;Figure 12 is a schematic diagram showing that there is overlap between the current pending IO request and multiple target historical IO requests according to an embodiment of this application;
图13是根据本申请实施例的对当前待处理IO请求进行拆分的示意图;Figure 13 is a schematic diagram of splitting the current pending IO request according to an embodiment of this application;
图14是根据本申请实施例的对IO请求处理队列进行优化的示意图。Figure 14 is a schematic diagram of optimizing the IO request processing queue according to an embodiment of this application.
图15是根据本申请实施例的第四种IO调度方法的举例示意图;Figure 15 is a schematic diagram illustrating a fourth IO scheduling method according to an embodiment of this application;
图16是根据本申请实施例的IO调度装置的结构框图;Figure 16 is a structural block diagram of an IO scheduling device according to an embodiment of this application;
图17是本申请实施例的电子设备的硬件结构示意图。Figure 17 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application.
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
对于一台超融合服务器而言,最终的数据读写都是发生在分布式存储系统上,因此分布式存储系统的性能对于整个超融合服务器的性能具有至关重要的意义。分布式存储系统对外提供iSCSI(Internet Small Computer System Interface,一种网络标准协议)target(iSCSI目标端)服务,支持多个iSCSI client端(iSCSI客户端)同时发起连接请求,即分布式存储系统的存储资源对所有客户端来说都是共享的。因此,分布式存储系统会接收到来自不同客户端的IO请求,这些IO请求可能是关于同一个逻辑单元的相同字节区间,也可能是关于同一个逻辑单元的不同字节区间,还可能是关于不同逻辑单元各自的字节区间。For a hyperconverged server, all data read and write operations ultimately occur on the distributed storage system. Therefore, the performance of the distributed storage system is crucial to the overall performance of the hyperconverged server. The distributed storage system provides iSCSI (Internet Small Computer System Interface, a network standard protocol) target service, supporting multiple iSCSI clients to simultaneously initiate connection requests. This means that the storage resources of the distributed storage system are shared by all clients. Consequently, the distributed storage system receives IO requests from different clients. These IO requests may pertain to the same byte range within the same logical unit, different byte ranges within the same logical unit, or individual byte ranges within different logical units.
为了提高分布式存储系统的管理效率,通常以数据管理单元作为存储资源的最小管理单元,一个逻辑单元由若干个数据管理单元构成。分布式存储系统中的数据管理单元,类似于物理磁盘中扇区的概念。数据管理单元越小,存储资源的管理颗粒度越小,IO并发度越高,但盘损越大(每个数据管理单元都对应有一个元数据,相同磁盘容量下,数据管理单元越小,数据管理单元个数则越多,元数据也越多,元数据占用的磁盘空间越大,可用的磁盘空间越小),管理效率越低;数据管理单元越大,存储资源的管理颗粒度越大,IO并发度越低,但盘损越小,管理效率越高。目前业界通常将数据管理单元设置为4MB(Megabyte,兆字节)。To improve the management efficiency of distributed storage systems, data management units (DMUs) are typically used as the smallest management unit for storage resources. A logical unit consists of several DMUs. The DMU in a distributed storage system is similar to the concept of a sector on a physical disk. Smaller DMUs result in finer granularity of storage resource management and higher I/O concurrency, but also higher disk loss (each DMU corresponds to metadata; for the same disk capacity, smaller DMUs result in more DMUs, more metadata, more disk space occupied, and less usable disk space), and lower management efficiency. Conversely, larger DMUs result in finer granularity of storage resource management, lower I/O concurrency, but lower disk loss and higher management efficiency. Currently, the industry typically sets the DMU to 4MB (Megabyte).
为了提高分布式存储系统的IO并发度,对不同逻辑单元的IO请求,对同一逻辑单元不同区域的IO请求,由于存储资源相互独立,故可以并发处理,以增加IO并发度。To improve the IO concurrency of a distributed storage system, IO requests from different logical units and IO requests from different regions of the same logical unit can be processed concurrently because the storage resources are independent of each other, thereby increasing IO concurrency.
但对于存储资源有重叠部分的IO请求,为了数据一致性的考虑,所有的IO请求都是在请求处理队列中按照FIFO(First In First Out,先进先出)的方式执行的,IO请求数据块作为IO调度的颗粒度,这种执行方式确实在IO调度层面解决了数据一致性的问题,但是对于分布式存储系统整体的性能来说并不友好,因为同一个逻辑单元的不同IO请求之间可能不存在读写相关或者写写相关,这些请求可以更早的被调度执行,而无需等待先于它到达的请求执行完毕之后才被调度执行。However, for IO requests with overlapping storage resources, all IO requests are executed in the request processing queue in a FIFO (First In First Out) manner for the sake of data consistency. The IO request data block is used as the granularity of IO scheduling. This execution method does solve the data consistency problem at the IO scheduling level, but it is not friendly to the overall performance of the distributed storage system. This is because different IO requests of the same logical unit may not have read-write or write-write dependencies. These requests can be scheduled and executed earlier without waiting for the requests that arrived earlier to be executed.
随着IO请求并行度的与日俱增,在针对某一地址的IO尚未完成的情况下,经常又追加发生了针对该地址的IO请求操作,为了避免出现数据不一致问题,目前传统方案,要等待前一次IO请求全部完成后,才对后一次的IO请求进行调度处理。在IO压力大的场景下,特别是同时存在大量对同一存储资源的读写访问时,传统方案的IO调度策略可以进一步优化,IO并发量仍有一定提升空间,分布式存储系统的整体IO性能还能够进一步提升。With the increasing parallelism of I/O requests, new I/O requests for the same address often occur before the previous one is completed. To avoid data inconsistency, traditional solutions wait for the previous I/O request to finish before scheduling the next one. However, in scenarios with high I/O pressure, especially when there are numerous simultaneous read and write accesses to the same storage resource, the traditional I/O scheduling strategy can be further optimized. There is still room for improvement in I/O concurrency, and the overall I/O performance of the distributed storage system can be further enhanced.
基于此本申请实施例提供了一种IO调度方法,该IO调度方法应用于分布式存储系统,如图1所示,分布式存储系统的架构自上而下分别为协议层,IO调度层,存储引擎层,设备驱动层,物理磁盘。协议层用于接收和解析各个cl ient(客户端)发起的连接请求和IO请求,这里不涉及存储资源的互斥,故这里可以最大程度并发进行。IO调度层不再以整个IO请求为最小调度单位,而是以数据管理单元为最小调度单位处理IO请求。Based on this, this application provides an IO scheduling method applied to a distributed storage system, as shown in Figure 1. The architecture of the distributed storage system, from top to bottom, consists of a protocol layer, an IO scheduling layer, a storage engine layer, a device driver layer, and physical disks. The protocol layer is used to receive and parse connection requests and IO requests initiated by various clients. Since mutual exclusion of storage resources is not involved, concurrency can be maximized here. The IO scheduling layer no longer uses the entire IO request as the smallest scheduling unit, but rather processes IO requests using a data management unit as the smallest scheduling unit.
在一些实施例中,如图2所示,IO调度方法的处理流程为:获取当前待处理IO请求;对当前待处理IO请求进行识别,确定当前待处理IO请求对应的目标请求数据,保证了确定的目标请求数据的准确性。确定目标请求数据在存储设备中的请求位置以及目标请求数据的对应的请求数据量。当某个IO请求的数据长度大于一个数据管理单元的长度或者跨越两个4MB(数据管理单元的大小)对齐的相邻数据管理单元时,则将所请求的数据长度按照4MB对齐切分为多个不同的数据管理单元并发调度处理。具体实现见后面描述;当同时存在对同一个数据管理单元中数据的多个IO请求,则根据每个IO请求中数据区间的重叠情况,减小并发IO调度颗粒度,进而增加IO并发量。存储引擎层用于管理物理磁盘(一个逻辑单元上多个的数据可能分布在多个磁盘上)。设备驱动层用于衔接物理磁盘和软件操作系统。物理磁盘用于存放用户数据。In some embodiments, as shown in Figure 2, the processing flow of the IO scheduling method is as follows: Obtain the current pending IO request; identify the current pending IO request and determine the target request data corresponding to it, ensuring the accuracy of the determined target request data. Determine the request location of the target request data in the storage device and the corresponding request data volume. When the data length of an IO request is greater than the length of a data management unit or spans two adjacent data management units aligned to 4MB (the size of a data management unit), the requested data length is divided into multiple different data management units aligned to 4MB and processed concurrently. Specific implementation details are described later. When multiple IO requests exist simultaneously for data in the same data management unit, the granularity of concurrent IO scheduling is reduced based on the overlap of data intervals in each IO request, thereby increasing IO concurrency. The storage engine layer manages the physical disk (data from multiple logical units may be distributed across multiple disks). The device driver layer connects the physical disk and the software operating system. The physical disk stores user data.
需要说明的是,本申请实施例提供的IO调度的方法,其执行主体可以是IO调度的装置,该IO调度的装置可以通过软件、硬件或者软硬件结合的方式实现成为电子设备的部分或者全部,其中,该电子设备可以是服务器或者终端,其中,本申请实施例中的服务器可以为一台服务器,也可以为由多台服务器组成的服务器集群,本申请实施例中的终端可以是智能手机、个人电脑、平板电脑、可穿戴设备以及智能机器人等其他智能硬件设备。下述方法实施例中,均以执行主体是电子设备为例来进行说明。It should be noted that the IO scheduling method provided in this application embodiment can be executed by an IO scheduling device. This IO scheduling device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. The electronic device can be a server or a terminal. In this application embodiment, the server can be a single server or a server cluster composed of multiple servers. The terminal in this application embodiment can be a smartphone, personal computer, tablet computer, wearable device, or other intelligent hardware device such as an intelligent robot. The following method embodiments will all use an electronic device as an example for explanation.
根据本申请实施例,提供了一种IO调度方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of this application, an IO scheduling method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
在本实施例中提供了一种IO调度方法,可用于上述的电子设备,图3是根据本申请实施例的IO调度方法的流程图,如图3所示,该流程包括如下步骤:This embodiment provides an I/O scheduling method that can be used in the aforementioned electronic device. Figure 3 is a flowchart of the I/O scheduling method according to an embodiment of this application. As shown in Figure 3, the process includes the following steps:
步骤S101,获取当前待处理IO请求。Step S101: Obtain the currently pending IO requests.
在一些实施例中,电子设备可以接收用户输入的当前待处理IO请求,也可以接收其他设备发送的当前待处理IO请求。本申请实施例对电子设备获取当前待处理IO请求的方式不做具体限定。In some embodiments, the electronic device can receive currently pending I/O requests input by the user, or it can receive currently pending I/O requests sent by other devices. This application does not specifically limit the method by which the electronic device obtains currently pending I/O requests.
步骤S102,对当前待处理IO请求进行识别,确定当前待处理IO请求对应的目标请求数据。Step S102: Identify the current pending IO request and determine the target request data corresponding to the current pending IO request.
在一些实施例中,电子设备可以对当前待处理IO请求进行识别,确定当前待处理IO请求对应的目标请求数据。In some embodiments, the electronic device can identify the currently pending I/O request and determine the target request data corresponding to the currently pending I/O request.
步骤S103,确定目标请求数据在存储设备中的请求位置以及目标请求数据的对应的请求数据量。Step S103: Determine the request location of the target request data in the storage device and the corresponding request data volume of the target request data.
在一些实施例中,电子设备对当前待处理IO请求对应的目标请求数据进行识别,确定目标请求数据在存储设备中的请求位置以及目标请求数据的对应的请求数据量。In some embodiments, the electronic device identifies the target request data corresponding to the current pending IO request, determines the request location of the target request data in the storage device, and the corresponding request data volume of the target request data.
步骤S104,根据目标请求数据对应的请求位置和请求数据量,将当前待处理IO请求放入目标IO请求处理队列,对当前待处理IO请求进行调度。Step S104: Based on the request location and request data volume corresponding to the target request data, the current pending IO request is placed into the target IO request processing queue, and the current pending IO request is scheduled.
在一些实施例中,电子设备可以将目标请求数据对应的请求数据量与预设请求数据量阈值进行对比。In some embodiments, the electronic device may compare the amount of request data corresponding to the target request data with a preset request data amount threshold.
若目标请求数据对应的请求数据量不大于预设请求数据量阈值,则根据目标请求数据对应的请求位置,将当前待处理IO请求放入目标IO请求处理队列,对当前待处理IO请求进行调度。If the amount of request data corresponding to the target request data is not greater than the preset request data amount threshold, then according to the request position corresponding to the target request data, the current pending IO request is placed into the target IO request processing queue, and the current pending IO request is scheduled.
若目标请求数据对应的请求数据量大于预设请求数据量阈值,则根据目标请求数据对当前待处理IO请求进行拆分,得到多个子待处理IO请求。然后根据各子待处理IO请求对应的子目标数据对应的子请求位置,将各子待处理IO请求放入各自对应的目标IO请求处理队列,对多个子待处理IO请求进行调度。If the amount of request data corresponding to the target request data is greater than a preset request data volume threshold, the current pending IO request is split into multiple sub-pending IO requests based on the target request data. Then, based on the sub-request position corresponding to the sub-target data of each sub-pending IO request, each sub-pending IO request is placed into its corresponding target IO request processing queue, and the multiple sub-pending IO requests are scheduled.
本申请实施例提供的IO调度方法,获取当前待处理IO请求;对当前待处理IO请求进行识别,确定当前待处理IO请求对应的目标请求数据,保证了确定的目标请求数据的准确性。确定目标请求数据在存储设备中的请求位置以及目标请求数据的对应的请求数据量,根据目标请求数据对应的请求位置和请求数据量,将当前待处理IO请求放入目标IO请求处理队列,对当前待处理IO请求进行调度,保证了将当前待处理IO请求放入目标IO请求处理队列准确性,然后从目标IO请求处理队列对当前待处理IO请求进行调度,保证了对当前待处理IO请求进行调度的准确性。从而可以实现将多个IO请求处理队列中的待处理IO请求进行同时处理,进而不需要等待前一次待处理IO请求全部完成后,才对后一次的待处理IO请求进行调度处理,从而进一步提高了分布式存储系统的整体IO请求性能。The IO scheduling method provided in this application embodiment obtains the currently pending IO requests; identifies the currently pending IO requests and determines the target request data corresponding to them, ensuring the accuracy of the determined target request data. It determines the request location of the target request data in the storage device and the corresponding request data volume. Based on the request location and request data volume, the currently pending IO requests are placed into a target IO request processing queue, and then scheduled. This ensures the accuracy of placing the currently pending IO requests into the target IO request processing queue. Furthermore, the method schedules the currently pending IO requests from the target IO request processing queue, ensuring the accuracy of scheduling. This allows for the simultaneous processing of pending IO requests in multiple IO request processing queues, eliminating the need to wait for the previous pending IO requests to complete before scheduling the next pending IO request, thereby further improving the overall IO request performance of the distributed storage system.
在本实施例中提供了一种IO调度方法,可用于上述的电子设备,图4是根据本申请实施例的IO调度方法的流程图,如图4所示,该流程包括如下步骤:This embodiment provides an I/O scheduling method that can be used in the aforementioned electronic device. Figure 4 is a flowchart of the I/O scheduling method according to an embodiment of this application. As shown in Figure 4, the process includes the following steps:
步骤S201,获取当前待处理IO请求。Step S201: Obtain the currently pending IO requests.
关于该步骤请参见图3对步骤S101的介绍,在此不进行赘述。Please refer to Figure 3 for a description of step S101; it will not be repeated here.
步骤S202,对当前待处理IO请求进行识别,确定当前待处理IO请求对应的目标请求数据。Step S202: Identify the current pending IO request and determine the target request data corresponding to the current pending IO request.
关于该步骤请参见图3对步骤S102的介绍,在此不进行赘述。Please refer to Figure 3 for a description of step S102; it will not be repeated here.
步骤S203,确定目标请求数据在存储设备中的请求位置以及目标请求数据的对应的请求数据量。Step S203: Determine the request location of the target request data in the storage device and the corresponding request data volume of the target request data.
关于该步骤请参见图3对步骤S103的介绍,在此不进行赘述。Please refer to Figure 3 for a description of step S103; it will not be repeated here.
步骤S204,根据目标请求数据对应的请求位置和请求数据量,将当前待处理IO请求放入目标IO请求处理队列,对当前待处理IO请求进行调度。Step S204: Based on the request location and request data volume corresponding to the target request data, the current pending IO request is placed into the target IO request processing queue, and the current pending IO request is scheduled.
在一些实施例中,上述步骤S204中的“根据目标请求数据对应的请求位置和请求数据量,将当前待处理IO请求放入目标IO请求处理队列”,可以包括如下步骤:In some embodiments, step S204 above, "placing the current pending IO request into the target IO request processing queue according to the request location and request data volume corresponding to the target request data," may include the following steps:
步骤S2041,根据目标请求数据对应的请求位置和请求数据量,确定目标请求数据对应的目标数据管理单元的数量。Step S2041: Determine the number of target data management units corresponding to the target request data based on the request location and the amount of request data corresponding to the target request data.
在一些实施例中,电子设备可以根据目标请求数据对应的请求位置和请求数据量,确定目标请求数据对应的目标数据管理单元的数量。In some embodiments, the electronic device may determine the number of target data management units corresponding to the target request data based on the request location and the amount of request data.
其中,目标数据管理单元为分布式存储系统的最小数据管理单元,每个目标数据管理单元都有唯一的标识信息。分布式存储系统中可以包括很多个逻辑单元,每个逻辑单元中包括很多个数据管理单元。每个数据管理单元对应的数据存储容量可以是4M,也可以是3M,还可以是其他存储容量,本申请实施例对每个数据管理单元对应的数据存储容量不做具体限定。In this system, the target data management unit is the smallest data management unit, and each target data management unit has a unique identifier. The distributed storage system can include multiple logical units, and each logical unit includes multiple data management units. The data storage capacity corresponding to each data management unit can be 4MB, 3MB, or other storage capacities. This embodiment does not specifically limit the data storage capacity corresponding to each data management unit.
在一些实施例中,电子设备可以根据目标请求数据对应的请求位置,确定目标请求数据对应的目标逻辑单元以及目标请求位置在目标逻辑单元中的偏移量,从而确定目标请求数据的起始地址对应的数据管理单元,然后,根据目标请求数据对应的数据量确定目标请求数据结束地址对应的数据管理单元。若对应同一个数据管理单元,则目标数据管理单元的数量为1。若目标请求数据的起始地址与结束地址对应不同的数据管理单元,则目标数据管理单元的数量不为1。In some embodiments, the electronic device can determine the target logic unit corresponding to the target request data and the offset of the target request position within the target logic unit based on the request position corresponding to the target request data, thereby determining the data management unit corresponding to the start address of the target request data. Then, it determines the data management unit corresponding to the end address of the target request data based on the data volume corresponding to the target request data. If they correspond to the same data management unit, the number of target data management units is 1. If the start address and end address of the target request data correspond to different data management units, the number of target data management units is not 1.
步骤S2042,若目标数据管理单元的数量为1,则根据目标数据管理单元,将当前待处理IO请求放入目标数据管理单元对应的目标IO请求处理队列中。Step S2042: If the number of target data management units is 1, then according to the target data management unit, the current unprocessed IO request is placed into the target IO request processing queue corresponding to the target data management unit.
在本申请一种可选的实施方式中,IO请求处理队列为多个,上述步骤S2042,可以包括如下步骤:In one optional embodiment of this application, there are multiple IO request processing queues, and step S2042 above may include the following steps:
步骤a1,获取IO请求处理队列对应的队列数量。Step a1: Obtain the number of queues corresponding to the IO request processing queue.
在一些实施例中,电子设备可以接收用户设定的IO请求处理队列对应的队列数量,也可接收其他设备发送的IO请求处理队列对应的队列数量,电子设备还可以根据分布式存储系统中的逻辑单元的数量以及各逻辑单元包括的数据管理单元的数量,计算IO请求处理队列对应的队列数量。In some embodiments, the electronic device can receive the number of queues corresponding to the IO request processing queue set by the user, or it can receive the number of queues corresponding to the IO request processing queue sent by other devices. The electronic device can also calculate the number of queues corresponding to the IO request processing queue based on the number of logical units in the distributed storage system and the number of data management units included in each logical unit.
示例性的,针对同一个逻辑单元,利用各逻辑单元包括的数据管理单元的数量除以3,得到IO请求处理队列对应的队列数量。For example, for the same logical unit, the number of queues corresponding to the IO request processing queue is obtained by dividing the number of data management units included in each logical unit by 3.
步骤a2,获取当前待处理IO请求对应的目标数据管理单元的标识信息。Step a2: Obtain the identification information of the target data management unit corresponding to the current pending IO request.
在一些实施例中,电子设备可以根据目标请求数据的起始地址与结束地址确定目标数据管理单元以及目标数据管理单元的标识信息。In some embodiments, the electronic device can determine the target data management unit and its identification information based on the start and end addresses of the target request data.
步骤a3,根据队列数量和标识信息,将当前待处理IO请求放入目标IO请求处理队列中。Step a3: Based on the queue number and identification information, place the currently pending IO request into the target IO request processing queue.
在一些实施例中,目标数据管理单元的标识信息为目标数据管理单元在对应的逻辑单元中的位置顺序标识,上述步骤a3,可以包括如下步骤:In some embodiments, the identification information of the target data management unit is the positional identifier of the target data management unit in the corresponding logical unit, and step a3 above may include the following steps:
步骤a31,利用位置顺序标识对队列数量进行取模计算。Step a31: Calculate the queue size using the positional order identifier modulo operation.
在一些实施例中,电子设备利用位置顺序标识对队列数量进行取模计算。In some embodiments, the electronic device uses the positional sequence identifier to perform a modulo calculation on the queue size.
步骤a32,根据计算结果,从各IO请求处理队列中确定当前待处理IO请求对应的目标IO请求处理队列。Step a32: Based on the calculation results, determine the target IO request processing queue corresponding to the current IO request to be processed from each IO request processing queue.
在一些实施例中,电子设备根据计算结果,从各IO请求处理队列中确定当前待处理IO请求对应的目标IO请求处理队列。In some embodiments, the electronic device determines the target IO request processing queue corresponding to the current IO request to be processed from each IO request processing queue based on the calculation results.
示例性的,假设队列数量为3,电子设备利用目标数据管理单元在对应的逻辑单元中的位置顺序标识除以3之后,取余数。若余数为0,则从各IO请求处理队列中确定当前待处理IO请求对应的目标IO请求处理队列为IO请求处理队列0;若余数为1,则从各IO请求处理队列中确定当前待处理IO请求对应的目标IO请求处理队列为IO请求处理队列1;若余数为2,则从各IO请求处理队列中确定当前待处理IO请求对应的目标IO请求处理队列为IO请求处理队列2。For example, assuming the number of queues is 3, the electronic device divides the position sequence identifier of the target data management unit in the corresponding logical unit by 3 and takes the remainder. If the remainder is 0, the target IO request processing queue corresponding to the current IO request to be processed is determined as IO request processing queue 0; if the remainder is 1, the target IO request processing queue corresponding to the current IO request to be processed is determined as IO request processing queue 1; if the remainder is 2, the target IO request processing queue corresponding to the current IO request to be processed is determined as IO request processing queue 2.
步骤a33,将当前待处理IO请求放入目标IO请求处理队列中。Step a33: Place the currently pending IO request into the target IO request processing queue.
在一些实施例中,在确定了当前待处理IO请求对应的目标IO请求处理队列之后,可以将当前待处理IO请求放入目标IO请求处理队列中。In some embodiments, after determining the target IO request processing queue corresponding to the current IO request to be processed, the current IO request to be processed can be placed into the target IO request processing queue.
在一些实施例中,上述步骤a33,可以包括如下步骤:In some embodiments, step a33 above may include the following steps:
步骤a331,获取目标IO请求处理队列中各历史待处理IO请求对应的历史请求数据。Step a331: Obtain the historical request data corresponding to each historical pending IO request in the target IO request processing queue.
在一些实施例中,电子设备可以从目标IO请求处理队列中获取目标IO请求处理队列中各历史待处理IO请求,并对各历史待处理IO请求进行识别,确定各历史待处理IO请求对应的历史请求数据以及历史请求数据对应的历史数据管理单元。In some embodiments, the electronic device can obtain each historical pending IO request from the target IO request processing queue, identify each historical pending IO request, and determine the historical request data corresponding to each historical pending IO request and the historical data management unit corresponding to the historical request data.
步骤a332,从目标IO请求处理队列中确定历史请求数据处于目标数据管理单元的各第一待对比历史IO请求。Step a332: Determine from the target IO request processing queue each of the first historical IO requests to be compared in the target data management unit.
在一些实施例中,电子设备将各历史待处理IO请求对应的历史请求数据对应的历史数据管理单元与目标数据管理单元进行对比。然后,从目标IO请求处理队列中确定历史请求数据处于目标数据管理单元的各第一待对比历史IO请求。即各第一待对比历史IO请求对应的历史请求数据对应的历史数据管理单元与目标请求数据对应的目标数据管理单元一致。In some embodiments, the electronic device compares the historical data management unit corresponding to the historical request data of each historical pending IO request with the target data management unit. Then, it determines from the target IO request processing queue each first historical IO request to be compared whose historical request data is located in the target data management unit. That is, the historical data management unit corresponding to the historical request data of each first historical IO request to be compared is consistent with the target data management unit corresponding to the target request data.
步骤a333,将目标请求数据与各第一待对比历史IO请求对应的第一待对比历史请求数据进行对比。Step a333: Compare the target request data with the first historical request data corresponding to each first historical IO request to be compared.
在一些实施例中,上述步骤a333,可以包括如下步骤:In some embodiments, step a333 above may include the following steps:
步骤a3331,根据目标请求数据对应的请求位置,确定目标请求数据在目标数据管理单元中的目标位置偏移量。Step a3331: Determine the target position offset of the target request data in the target data management unit based on the request position corresponding to the target request data.
在一些实施例中,电子设备可以根据目标请求数据对应的请求位置,确定目标请求数据在目标数据管理单元中的目标位置偏移量。In some embodiments, the electronic device can determine the target position offset of the target request data in the target data management unit based on the request position corresponding to the target request data.
步骤a3332,获取第一待对比历史请求数据在目标数据管理单元中的历史位置偏移量和历史数据量。Step a3332: Obtain the historical position offset and historical data volume of the first historical request data to be compared in the target data management unit.
在一些实施例中,电子设备可以对第一待对比历史IO请求对应的第一待对比历史请求数据进行识别,确定第一待对比历史请求数据在目标数据管理单元中的历史位置偏移量和历史数据量。In some embodiments, the electronic device can identify the first historical request data to be compared corresponding to the first historical IO request to be compared, and determine the historical position offset and historical data volume of the first historical request data to be compared in the target data management unit.
步骤a3333,根据目标位置偏移量、请求数据量、历史位置偏移量和历史数据量之间的关系,将目标请求数据与各第一待对比历史IO请求对应的第一待对比历史请求数据进行对比。Step a3333: Based on the relationship between the target position offset, the requested data volume, the historical position offset, and the historical data volume, compare the target requested data with the first historical request data corresponding to each first historical IO request to be compared.
在一些实施例中,上述步骤a3333,可以包括如下步骤:In some embodiments, step a3333 described above may include the following steps:
步骤a33331,计算历史位置偏移量和历史数据量的和,得到第一总偏移量。Step a33331: Calculate the sum of the historical position offset and the historical data volume to obtain the first total offset.
在一些实施例中,电子设备计算历史位置偏移量和历史数据量的和,得到第一总偏移量。In some embodiments, the electronic device calculates the sum of the historical location offset and the amount of historical data to obtain a first total offset.
步骤a33332,计算目标位置偏移量和请求数据量的和,得到第二总偏移量。Step a33332: Calculate the sum of the target position offset and the requested data amount to obtain the second total offset.
在一些实施例中,电子设备计算目标位置偏移量和请求数据量的和,得到第二总偏移量。In some embodiments, the electronic device calculates the sum of the target location offset and the requested data amount to obtain a second total offset.
步骤a33333,将目标位置偏移量与第一总偏移量进行对比。Step a33333: Compare the target position offset with the first total offset.
步骤a33334,将历史位置偏移量与第二总偏移量进行对比。Step a33334: Compare the historical position offset with the second total offset.
步骤a33335,若目标位置偏移量大于第一总偏移量,或,历史位置偏移量大于第二总偏移量,则确定目标请求数据与各第一待对比历史请求数据之间不存在重叠数据。Step a33335: If the target position offset is greater than the first total offset, or the historical position offset is greater than the second total offset, then it is determined that there is no overlapping data between the target request data and each of the first historical request data to be compared.
在一些实施例中,电子设备将目标位置偏移量与第一总偏移量进行对比,且将历史位置偏移量与第二总偏移量进行对比。In some embodiments, the electronic device compares the target position offset with a first total offset and compares the historical position offset with a second total offset.
若目标位置偏移量大于第一总偏移量,或,历史位置偏移量大于第二总偏移量,则确定目标请求数据与各第一待对比历史请求数据之间不存在重叠数据。If the target location offset is greater than the first total offset, or the historical location offset is greater than the second total offset, then it is determined that there is no overlapping data between the target request data and each of the first historical request data to be compared.
示例性的,如图5所示,为历史位置偏移量大于第二总偏移量的情况示意图。图5中,上边为当前待处理IO请求,下边为第一待对比历史IO请求。其中,当前待处理IO请求对应的目标数据的结束位置比第一待对比历史IO请求的第一待对比历史请求数据起始位置小,即a_offset+a_len<b_offset,则确定目标请求数据与各第一待对比历史请求数据之间不存在重叠数据。For example, Figure 5 illustrates the case where the historical position offset is greater than the second total offset. In Figure 5, the top represents the current IO request to be processed, and the bottom represents the first historical IO request to be compared. Wherein, the end position of the target data corresponding to the current IO request to be processed is smaller than the start position of the first historical request data to be compared in the first historical IO request to be compared, i.e., a_offset + a_len < b_offset, then it is determined that there is no overlapping data between the target request data and each of the first historical request data to be compared.
如图6所示,为目标位置偏移量大于第一总偏移量的情况示意图。图6中,上边为当前待处理IO请求,下边为第一待对比历史IO请求。其中,当前待处理IO请求对应的目标数据的起始位置比第一待对比历史IO请求的第一待对比历史请求数据结束位置大,即a_offset>b_offset+b_len,则确定目标请求数据与各第一待对比历史请求数据之间不存在重叠数据。Figure 6 illustrates the case where the target position offset is greater than the first total offset. In Figure 6, the top represents the current I/O request to be processed, and the bottom represents the first set of historical I/O requests to be compared. If the starting position of the target data corresponding to the current I/O request to be processed is greater than the ending position of the first set of historical I/O requests to be compared (i.e., a_offset > b_offset + b_len), then it is determined that there is no overlapping data between the target request data and each of the first set of historical I/O requests to be compared.
步骤a334,根据对比结果,将当前待处理IO请求放入目标IO请求处理队列中。Step a334: Based on the comparison results, put the current pending IO request into the target IO request processing queue.
在一些实施例中,上述步骤a334,可以包括如下步骤:In some embodiments, step a334 above may include the following steps:
步骤a3341,若目标请求数据与各第一待对比历史请求数据之间不存在重叠数据,则将当前待处理IO请求放入目标IO请求处理队列中。Step a3341: If there is no overlapping data between the target request data and each of the first historical request data to be compared, then the current IO request to be processed is placed into the target IO request processing queue.
在一些实施例中,若目标请求数据与各第一待对比历史请求数据之间不存在重叠数据,则将当前待处理IO请求放入目标IO请求处理队列中。In some embodiments, if there is no overlapping data between the target request data and each of the first historical request data to be compared, the current IO request to be processed is placed in the target IO request processing queue.
示例性的,如图7所示,为目标请求数据与各第一待对比历史请求数据之间不存在重叠数据,则将当前待处理IO请求放入目标IO请求处理队列中的示意图。For example, as shown in Figure 7, if there is no overlap between the target request data and each of the first historical request data to be compared, then the current IO request to be processed is placed into the target IO request processing queue.
步骤a3342,若目标请求数据与各第一待对比历史请求数据之间存在重叠数据,则将与目标请求数据存在重叠数据的第一待对比历史IO请求确定为目标历史IO请求。Step a3342: If there is overlapping data between the target request data and each of the first historical request data to be compared, then the first historical IO request to be compared that has overlapping data with the target request data is determined as the target historical IO request.
在一些实施例中,若目标请求数据与各第一待对比历史请求数据之间存在重叠数据,则将与目标请求数据存在重叠数据的第一待对比历史IO请求确定为目标历史IO请求。In some embodiments, if there is overlapping data between the target request data and each of the first historical request data to be compared, then the first historical IO request to be compared that has overlapping data with the target request data is determined as the target historical IO request.
步骤a3343,将当前待处理IO请求放入目标历史IO请求对应的第一目标互斥链表中。Step a3343: Place the current pending IO request into the first target mutex linked list corresponding to the target historical IO request.
在一些实施例中,电子设备根据目标历史IO请求对应的标识信息,将当前待处理IO请求放入目标历史IO请求对应的第一目标互斥链表中。In some embodiments, the electronic device places the current pending IO request into the first target mutex list corresponding to the target historical IO request based on the identification information corresponding to the target historical IO request.
如图8所示,obj_1c为当前待处理IO请求,obj_1a为目标历史IO请求。由于当前待处理IO请求的目标请求数据和目标IO请求处理队列中处于目标数据管理单元的第一个第一待对比历史IO请求的数据区间有重叠,即存在存储资源竞争互斥,故需要先将当前待处理IO请求挂在存在数据区间重叠的第一个第一待对比历史IO请求的互斥链表上,待其处理完成后,再将互斥链表上的当前待处理IO请求重新尝试加入到目标IO请求处理队列。As shown in Figure 8, obj_1c is the current pending IO request, and obj_1a is the target historical IO request. Since the target request data of the current pending IO request overlaps with the data range of the first historical IO request to be compared in the target data management unit in the target IO request processing queue, i.e., there is storage resource contention and mutual exclusion, it is necessary to first add the current pending IO request to the mutex list of the first historical IO request to be compared with the overlapping data range. After that is processed, the current pending IO request on the mutex list is then re-attempted to be added to the target IO request processing queue.
如图9所示,obj_1c为当前待处理IO请求,obj_1b为目标历史IO请求。由于当前待处理IO请求的目标请求数据和目标IO请求处理队列中处于目标数据管理单元的第一个第一待对比历史IO请求的数据区间有重叠,即不存在存储资源竞争互斥,故两个可以并发处理。但目标IO请求处理队列中处于目标数据管理单元的第二个第一待对比历史IO请求的数据区间有重叠,即存在存储资源竞争互斥,故需要先将当前待处理IO请求挂在存在数据区间重叠的第二个第一待对比历史IO请求的互斥链表上,待其处理完成后,再将互斥链表上的当前待处理IO请求重新尝试加入到目标IO请求处理队列。As shown in Figure 9, obj_1c is the current pending IO request, and obj_1b is the target historical IO request. Since the target request data of the current pending IO request overlaps with the data range of the first first historical IO request to be compared in the target data management unit within the target IO request processing queue, meaning there is no storage resource contention, the two can be processed concurrently. However, the data range of the second first historical IO request to be compared in the target data management unit within the target IO request processing queue overlaps, meaning there is storage resource contention. Therefore, the current pending IO request needs to be added to the mutex list of the second first historical IO request with overlapping data ranges. After that second request is processed, the current pending IO request on the mutex list can be re-added to the target IO request processing queue.
在本申请一种可选的实施方式中,如图10所示,为互斥链表添加逻辑的流程图。首先判断该OBJ请求的类型,若该OBJ请求不是读写类IO请求,则直接结束,因为其他诸如管理类、查询类IO请求不需要做真正的IO读写处理,故不需要执行本方法涉及到的相关逻辑。若该OBJ请求是读写类IO请求,则判断目标IO请求处理队列是否为空,若目标IO请求处理队列为空则直接将其添加到队列尾部结束,若目标IO请求处理队列不为空则需要按照从队首到队尾的顺序遍历目标IO请求处理队列。若发现目标IO请求处理队列上存在和当前待处理IO请求的oid(Object Identifier,对象标识符)相同(即均处于目标数据管理单元)且数据区间有重叠的目标历史IO请求,则判断该目标历史IO请求的链表是否已经初始化,若该目标历史IO请求的链表没有初始化,则将其初始化,且作为互斥链表的链表头,然后将当前待处理IO请求添加到该互斥链表的尾部,结束。若目标IO请求处理队列上没有发现和当前待处理IO请求的oid相同且数据区间有重叠的目标历史IO请求,则将当前待处理IO请求添加到IO请求处理队列尾部,结束。In one optional implementation of this application, as shown in Figure 10, a flowchart of the logic for adding logic to the mutex linked list is presented. First, the type of the OBJ request is determined. If the OBJ request is not a read/write IO request, the process ends directly, because other IO requests such as management or query IO requests do not require actual IO read/write processing, and therefore do not need to execute the relevant logic involved in this method. If the OBJ request is a read/write IO request, it is determined whether the target IO request processing queue is empty. If the target IO request processing queue is empty, it is directly added to the tail of the queue and the process ends. If the target IO request processing queue is not empty, it needs to be traversed from the head to the tail of the queue. If a target historical IO request with the same OID (Object Identifier) as the current pending IO request (i.e., both are within the target data management unit) and overlapping data ranges is found in the target IO request processing queue, then it is determined whether the linked list of the target historical IO request has been initialized. If the linked list has not been initialized, it is initialized and used as the head of a mutex linked list. Then, the current pending IO request is added to the tail of the mutex linked list, and the process ends. If no target historical IO request with the same OID and overlapping data ranges as the current pending IO request is found in the target IO request processing queue, the current pending IO request is added to the tail of the IO request processing queue, and the process ends.
互斥链表上支持同时挂多个待处理请求,要求按照时间顺序往链表尾部挂OBJ请求,不允许在链表中间插入待处理请求。The mutex linked list supports multiple pending requests to be attached simultaneously. Requests must be attached to the tail of the list in chronological order, and requests cannot be inserted in the middle of the list.
步骤a3344,当目标历史IO请求处理完毕,将当前待处理IO请求放入目标IO请求处理队列中。Step a3344: Once the target historical IO requests have been processed, place the current pending IO requests into the target IO request processing queue.
在本申请一种可选的实施方式中,当目标历史IO请求处理完毕,需要将该目标历史IO请求从目标IO请求处理队列上移除,同时将有数据区间重叠的当前待处理IO请求从目标历史IO请求对应的互斥链表上移除,并尝试重新加入到目标IO请求处理队列上,具体实现逻辑如图11所示。图11为互斥链表移除逻辑的流程图。对于即将要出队的目标历史IO请求,首先判断该目标历史IO请求的互斥链表是否已经初始化且非空。若该目标历史IO请求上的互斥链表没有初始化,则说明该目标历史IO请求未曾有过数据区域重叠历史,直接将该目标历史IO请求从目标IO请求处理队列中移除即可;若该目标历史IO请求上的互斥链表已经初始化,但链表为空,则说明该目标历史IO请求曾有过数据区域重叠历史,但当前没有存储资源互斥,直接将其从目标IO请求处理队列中移除即可;若该目标历史IO请求上的互斥链表已经初始化且非空,则需要做以下处理。先使用一个临时链表头暂存该目标历史IO请求上的互斥链表(防止该目标历史IO请求上的IO互斥链表信息丢失),接着从互斥链表上移除该目标历史IO请求,再从目标IO请求处理队列中移除该目标历史IO请求,然后通过临时链表头遍历前面暂存的互斥链表,按照顺序依次对斥链表上的其他待处理IO请求做以下操作:将该其他待处理IO请求从互斥链表上移除,按照前文的互斥链表添加逻辑尝试将其重新加入到目标IO请求处理队列。In one optional implementation of this application, when a target historical IO request is processed, it needs to be removed from the target IO request processing queue. Simultaneously, the currently pending IO requests with overlapping data ranges are removed from the mutex list corresponding to the target historical IO request and attempted to be re-added to the target IO request processing queue. The specific implementation logic is shown in Figure 11. Figure 11 is a flowchart of the mutex list removal logic. For a target historical IO request about to be dequeued, it is first determined whether the mutex list of the target historical IO request has been initialized and is not empty. If the mutex list on the target historical IO request is not initialized, it means that the target historical IO request has never had a history of overlapping data regions, and the target historical IO request can be directly removed from the target IO request processing queue. If the mutex list on the target historical IO request has been initialized but the list is empty, it means that the target historical IO request has had a history of overlapping data regions, but currently there is no storage resource mutual exclusion, and it can be directly removed from the target IO request processing queue. If the mutex list on the target historical IO request has been initialized and is not empty, the following processing is required. First, a temporary linked list head is used to temporarily store the mutex list on the target historical IO request (to prevent the loss of IO mutex list information on the target historical IO request). Then, the target historical IO request is removed from the mutex list and then removed from the target IO request processing queue. Then, the previously stored mutex list is traversed through the temporary linked list head, and the following operations are performed on other pending IO requests on the mutex list in order: the other pending IO requests are removed from the mutex list, and the mutex list addition logic described above is used to try to add them back to the target IO request processing queue.
在一些实施例中,上述步骤a3344,可以包括如下步骤:In some embodiments, step a3344 above may include the following steps:
步骤a33441,当目标历史IO请求处理完毕,再次从目标IO请求处理队列中获取各第二待对比历史IO请求。Step a33441: After the target historical IO request is processed, retrieve each second historical IO request to be compared from the target IO request processing queue again.
其中,第二待对比历史IO请求对应的历史请求数据处于目标数据管理单元。Among them, the historical request data corresponding to the second historical IO request to be compared is located in the target data management unit.
在一些实施例中,当目标历史IO请求处理完毕,再次从目标IO请求处理队列中获取各第二待对比历史IO请求。In some embodiments, once the target historical IO request has been processed, each second historical IO request to be compared is retrieved again from the target IO request processing queue.
步骤a33442,将目标请求数据与第二待对比历史IO请求对应的第二待对比历史请求数据进行对比。Step a33442: Compare the target request data with the second historical request data corresponding to the second historical IO request to be compared.
在一些实施例中,电子设备将目标请求数据与第二待对比历史IO请求对应的第二待对比历史请求数据进行对比。In some embodiments, the electronic device compares the target request data with the second historical request data corresponding to the second historical IO request to be compared.
步骤a33443,若目标请求数据与各第二待对比历史请求数据之间不存在重叠数据,则将当前待处理IO请求放入目标IO请求处理队列中。Step a33443: If there is no overlapping data between the target request data and each of the second historical request data to be compared, then the current IO request to be processed is placed into the target IO request processing queue.
在一些实施例中,若目标请求数据与各第二待对比历史请求数据之间不存在重叠数据,则电子设备将当前待处理IO请求放入目标IO请求处理队列中。In some embodiments, if there is no overlapping data between the target request data and each of the second historical request data to be compared, the electronic device places the current pending IO request into the target IO request processing queue.
步骤a33444,若目标请求数据与各第二待对比历史请求数据之间存在重叠数据,则将当前待处理IO请求放入第二目标互斥链表。Step a33444: If there is overlapping data between the target request data and each of the second historical request data to be compared, then the current IO request to be processed is placed into the second target mutex list.
其中,第二目标互斥链表为与目标请求数据存在重叠数据的第二待对比历史请求数据对应的互斥链表。The second target mutex list is the mutex list corresponding to the second historical request data to be compared that has overlapping data with the target request data.
在一些实施例中,若目标请求数据与各第二待对比历史请求数据之间存在重叠数据,则将当前待处理IO请求放入第二目标互斥链表。In some embodiments, if there is overlapping data between the target request data and each of the second historical request data to be compared, the current IO request to be processed is placed into the second target mutex list.
示例性的,如图12所示,当前待处理IO请求与多个目标历史IO请求存在重叠数据的示意图。由于当前待处理IO请求的目标请求数据和目标IO请求处理队列中处于目标数据管理单元的第一个第一待对比历史IO请求的数据区间有重叠,即存在存储资源竞争互斥,故需要先将当前待处理IO请求挂在存在数据区间重叠的第一个第一待对比历史IO请求的互斥链表上,待其处理完成后,再将互斥链表上的当前待处理IO请求重新尝试加入到目标IO请求处理队列。这里选择挂在第一个第一待对比历史IO请求上的原因是:遍历目标IO请求处理队列时,按照从头到尾的遍历顺序,发现有重叠时,就不需要再继续遍历了,以提高性能。For example, as shown in Figure 12, this diagram illustrates overlapping data between the current pending IO request and multiple target historical IO requests. Since the target request data of the current pending IO request overlaps with the data range of the first historical IO request to be compared in the target data management unit within the target IO request processing queue, meaning there is storage resource contention and mutual exclusion, the current pending IO request needs to be added to the mutex list of the first historical IO request to be compared with overlapping data ranges. After that request is processed, the current pending IO request on the mutex list is then re-added to the target IO request processing queue. The reason for choosing to add it to the first historical IO request to be compared is that when traversing the target IO request processing queue, following the traversal order from beginning to end, if overlap is found, there is no need to continue traversing, thus improving performance.
然后,当目标历史IO请求处理完毕,再次从目标IO请求处理队列中获取各第二待对比历史IO请求。将目标请求数据与第二待对比历史IO请求对应的第二待对比历史请求数据进行对比。若目标请求数据与各第二待对比历史请求数据之间存在重叠数据,则将当前待处理IO请求放入第二目标互斥链表。Then, once the target historical I/O requests have been processed, each second historical I/O request to be compared is retrieved from the target I/O request processing queue. The target request data is compared with the second historical I/O request data corresponding to the second historical I/O requests to be compared. If there is overlapping data between the target request data and each of the second historical I/O requests to be compared, the current I/O request to be processed is placed into the second target mutex list.
步骤S2043,若目标数据管理单元的数量大于1,则根据目标数据管理单元的数量,对当前待处理IO请求进行拆分,得到多个子待处理IO请求。Step S2043: If the number of target data management units is greater than 1, then the current pending IO request is split according to the number of target data management units to obtain multiple sub-pending IO requests.
其中,子待处理IO请求的数量与目标数据管理单元的数量一致。The number of sub-IO requests to be processed is consistent with the number of target data management units.
示例性的,如图13所示,逻辑单元由若干个数据管理单元构成,若目标请求数据在该逻辑单元上偏移量为offset,长度为len的数据块,这里数据块按照4MB对齐划分后落在3数据管理单元上,则该当前待处理IO请求被拆分为对3个不同数据管理单元的请求,可以分别参与分布式存储系统的IO调度策略。因此,目标数据管理单元的数量为3。For example, as shown in Figure 13, a logical unit consists of several data management units. If the target request data is a data block with an offset of offset and length of len on this logical unit, and this data block is divided according to 4MB alignment and falls on 3 data management units, then the current pending IO request is split into requests to 3 different data management units, which can participate in the IO scheduling strategy of the distributed storage system respectively. Therefore, the number of target data management units is 3.
步骤S2044,根据各子待处理IO请求对应的目标数据管理单元,将各子待处理IO请求放入对应的目标IO请求处理队列中,以对各子待处理IO请求进行调度。Step S2044: Based on the target data management unit corresponding to each sub-IO request to be processed, place each sub-IO request to be processed into the corresponding target IO request processing queue in order to schedule each sub-IO request to be processed.
在一些实施例中,将各子待处理IO请求放入对应的目标IO请求处理队列中的过程,可以参见上述实施方式中“若目标数据管理单元的数量为1,则根据目标数据管理单元,将当前待处理IO请求放入目标数据管理单元对应的目标IO请求处理队列中”的过程,在此不进行赘述。In some embodiments, the process of placing each sub-IO request to be processed into the corresponding target IO request processing queue can be referred to in the above embodiment of "if the number of target data management units is 1, then according to the target data management unit, the current IO request to be processed is placed into the target IO request processing queue corresponding to the target data management unit", which will not be elaborated here.
在一些实施例中,上述步骤S204中的“对当前待处理IO请求进行调度”,可以包括如下步骤:In some embodiments, the "scheduling of the current pending IO requests" in step S204 above may include the following steps:
步骤S2045,利用目标处理线程对目标IO请求处理队列中的当前待处理IO请求进行调度。Step S2045: Use the target processing thread to schedule the currently pending IO requests in the target IO request processing queue.
其中,目标处理线程为多个处理线程中的任一个。The target processing thread can be any one of multiple processing threads.
示例性的,如图14所示,为对IO请求处理队列进行优化的示意图。每个IO请求处理队列由一个线程(非线程池中的worker线程)负责管理,主要负责IO请求处理队列遍历,数据管理单元请求的入队和出队,互斥链表的管理工作。当新的数据管理单元请求来到IO调度层,对其oid进行取模运算(即计算oid号除以3的余数),结果为0时,则将该数据管理单元请求放在第一个IO请求处理队列上处理,结果为1时,则将该数据管理单元请求放在第二个IO请求处理队列上处理,结果为2时,则将该数据管理单元请求放在第三个IO请求处理队列上处理。这样将IO请求处理队列由原来的一个分裂为3个,可以缩短IO请求处理队列长度,减小遍历IO请求处理队列耗时,从而提高IO请求处理队列管理效率。每个IO请求处理队列管理方法一致,如前文。For example, Figure 14 illustrates the optimization of the IO request processing queue. Each IO request processing queue is managed by a single thread (not a worker thread in the thread pool), primarily responsible for traversing the IO request processing queue, enqueuing and dequeuing data management unit requests, and managing the mutex linked list. When a new data management unit request arrives at the IO scheduling layer, its OID is moduloed (i.e., the remainder when the OID is divided by 3). If the result is 0, the data management unit request is placed in the first IO request processing queue; if the result is 1, it is placed in the second IO request processing queue; and if the result is 2, it is placed in the third IO request processing queue. This splits the IO request processing queue from one to three, shortening the queue length and reducing the time spent traversing the queue, thereby improving the efficiency of IO request processing queue management. The management method for each IO request processing queue is consistent, as described above.
默认将线程池中的worker线程平均分配给各个IO请求处理队列,用于处理数据管理单元请求。当IO请求处理队列负载不均时,线程池中的工作者线程worker可以在多个IO请求处理队列之间动态均衡,以最大程度发挥线程池的并发处理能力,尽量保证每个队列处理速度。By default, worker threads in the thread pool are evenly distributed across various I/O request processing queues to handle data management unit requests. When the load on the I/O request processing queues is uneven, the worker threads in the thread pool can dynamically balance the load across multiple I/O request processing queues to maximize the concurrent processing capacity of the thread pool and ensure the processing speed of each queue as much as possible.
本申请实施例提供的IO调度方法,根据目标请求数据对应的请求位置和请求数据量,确定目标请求数据对应的目标数据管理单元的数量,保证了确定的目标请求数据对应的目标数据管理单元的数量的准确性。若目标数据管理单元的数量为1,则获取IO请求处理队列对应的队列数量;获取当前待处理IO请求对应的目标数据管理单元的标识信息;利用位置顺序标识对队列数量进行取模计算;根据计算结果,从各IO请求处理队列中确定当前待处理IO请求对应的目标IO请求处理队列,保证了确定的目标IO请求处理队列准确性。The IO scheduling method provided in this application determines the number of target data management units corresponding to the target request data based on the request location and request data volume, ensuring the accuracy of the determined number of target data management units. If the number of target data management units is 1, the method obtains the queue number corresponding to the IO request processing queue; obtains the identification information of the target data management unit corresponding to the currently pending IO request; calculates the queue number modulo using the position order identifier; and determines the target IO request processing queue corresponding to the currently pending IO request from each IO request processing queue based on the calculation result, ensuring the accuracy of the determined target IO request processing queue.
获取目标IO请求处理队列中各历史待处理IO请求对应的历史请求数据;从目标IO请求处理队列中确定历史请求数据处于目标数据管理单元的各第一待对比历史IO请求,保证了确定的各第一待对比历史IO请求对应的历史请求数据和目标请求数据均处于目标数据管理单元,从而使得各第一待对比历史IO请求对应的历史请求数据和目标请求数据之间可能存在重叠数据。根据目标请求数据对应的请求位置,确定目标请求数据在目标数据管理单元中的目标位置偏移量,保证了确定的目标位置偏移量的准确性。获取第一待对比历史请求数据在目标数据管理单元中的历史位置偏移量和历史数据量;计算历史位置偏移量和历史数据量的和,得到第一总偏移量,保证了计算得到的第一总偏移量的准确性。计算目标位置偏移量和请求数据量的和,得到第二总偏移量保证了计算得到的第二总偏移量的准确性。将目标位置偏移量与第一总偏移量进行对比;将历史位置偏移量与第二总偏移量进行对比;若目标位置偏移量大于第一总偏移量,或,历史位置偏移量大于第二总偏移量,则确定目标请求数据与各第一待对比历史请求数据之间不存在重叠数据,保证了确定的目标请求数据与各第一待对比历史请求数据之间不存在重叠数据的准确性。The process involves: acquiring historical request data corresponding to each historical pending IO request in the target IO request processing queue; determining the first comparison historical IO requests whose historical request data is located in the target data management unit, ensuring that both the historical request data and the target request data for each of the first comparison historical IO requests are located in the target data management unit, thus preventing potential overlap between the historical request data and the target request data; determining the target position offset of the target request data in the target data management unit based on the request position corresponding to the target request data, ensuring the accuracy of the determined target position offset; acquiring the historical position offset and historical data volume of the first comparison historical request data in the target data management unit; calculating the sum of the historical position offset and the historical data volume to obtain the first total offset, ensuring the accuracy of the calculated first total offset; and calculating the sum of the target position offset and the request data volume to obtain the second total offset, ensuring the accuracy of the calculated second total offset. The target position offset is compared with the first total offset; the historical position offset is compared with the second total offset; if the target position offset is greater than the first total offset, or the historical position offset is greater than the second total offset, then it is determined that there is no overlapping data between the target request data and each of the first historical request data to be compared, thus ensuring the accuracy of the determination that there is no overlapping data between the target request data and each of the first historical request data to be compared.
若目标请求数据与各第一待对比历史请求数据之间不存在重叠数据,则将当前待处理IO请求放入目标IO请求处理队列中,从而保证了在对各第一待对比历史请求数据时,不存在与各第一待对比历史IO请求存在重叠数据的待处理IO请求,进而避免了针对某一地址的IO请求尚未完成的情况下,经常又追加发生了针对该地址的IO请求操作,从而出现数据不一致问题。If there is no overlapping data between the target request data and each of the first historical request data to be compared, the current pending IO request is placed in the target IO request processing queue. This ensures that when processing each of the first historical request data to be compared, there are no pending IO requests with overlapping data with each of the first historical IO requests to be compared. This avoids the problem of data inconsistency caused by IO requests to a certain address being added before the IO request to that address has been completed.
若目标请求数据与各第一待对比历史请求数据之间存在重叠数据,则将与目标请求数据存在重叠数据的第一待对比历史IO请求确定为目标历史IO请求,保证了确定的目标历史IO请求的准确性。将当前待处理IO请求放入目标历史IO请求对应的第一目标互斥链表中,进而可以避免在对目标历史IO请求进行处理时,加入了当前待处理IO请求,导致出现数据不一致的问题。当目标历史IO请求处理完毕,将当前待处理IO请求放入目标IO请求处理队列中,进而可以避免出现数据不一致的问题。If there is overlap between the target request data and each of the first historical request data to be compared, the first historical IO request with overlapping data is identified as the target historical IO request, ensuring the accuracy of the identified target historical IO request. The current pending IO request is placed in the first target mutex linked list corresponding to the target historical IO request, thus preventing data inconsistency caused by adding the current pending IO request while processing the target historical IO request. Once the target historical IO request is processed, the current pending IO request is placed in the target IO request processing queue, further preventing data inconsistency.
当目标历史IO请求处理完毕,再次从目标IO请求处理队列中获取各第二待对比历史IO请求,保证了获取到的各第二待对比历史IO请求对应的第二待对比历史请求数据与目标请求数据均处于目标数据管理单元中。将目标请求数据与第二待对比历史IO请求对应的第二待对比历史请求数据进行对比;若目标请求数据与各第二待对比历史请求数据之间不存在重叠数据,则将当前待处理IO请求放入目标IO请求处理队列中。若目标请求数据与各第二待对比历史请求数据之间存在重叠数据,则将当前待处理IO请求放入第二目标互斥链表。进而避免了针对某一地址的IO请求尚未完成的情况下,经常又追加发生了针对该地址的IO请求操作,从而出现数据不一致问题。Once the target historical I/O request is processed, the second historical I/O requests to be compared are retrieved from the target I/O request processing queue. This ensures that the second historical request data corresponding to each retrieved second historical I/O request to be compared, along with the target request data, are both within the target data management unit. The target request data is compared with the second historical request data corresponding to the second historical I/O requests to be compared. If there is no overlapping data between the target request data and the second historical request data to be compared, the current I/O request to be processed is placed in the target I/O request processing queue. If there is overlapping data between the target request data and the second historical request data to be compared, the current I/O request to be processed is placed in the second target mutex list. This avoids the problem of data inconsistency caused by additional I/O requests to a certain address occurring before an I/O request to that address has been completed.
若目标数据管理单元的数量大于1,则根据目标数据管理单元的数量,对当前待处理IO请求进行拆分,得到多个子待处理IO请求,保证了对当前待处理IO请求进行拆分,得到多个子待处理IO请求的准确性。根据各子待处理IO请求对应的目标数据管理单元,将各子待处理IO请求放入对应的目标IO请求处理队列中,以对各子待处理IO请求进行调度,保证了将各子待处理IO请求放入对应的目标IO请求处理队列中的准确性,以对各子待处理IO请求进行调度,进而可以进一步提高分布式存储系统的整体IO请求性能。If the number of target data management units is greater than one, the current pending IO request is split into multiple sub-pending IO requests based on the number of target data management units. This ensures the accuracy of splitting the current pending IO request into multiple sub-pending IO requests. Each sub-pending IO request is then placed into its corresponding target IO request processing queue based on the target data management unit it corresponds to, enabling scheduling of each sub-pending IO request. This ensures the accuracy of placing each sub-pending IO request into its corresponding target IO request processing queue, thereby further improving the overall IO request performance of the distributed storage system.
利用目标处理线程对目标IO请求处理队列中的当前待处理IO请求进行调度;目标处理线程为多个处理线程中的任一个,从而保证了对当前待处理IO请求进行调度的准确性,且实现了多个待处理IO请求并行进行调度,进一步提高了分布式存储系统的整体IO请求性能。The target processing thread is used to schedule the currently pending IO requests in the target IO request processing queue. The target processing thread can be any one of multiple processing threads, which ensures the accuracy of scheduling the currently pending IO requests and enables the parallel scheduling of multiple pending IO requests, thereby further improving the overall IO request performance of the distributed storage system.
为了更好地介绍本申请实施例介绍的IO调度方法,本申请实施例提供了做一种基于数据区间互斥的并发IO调度方法的具体实施方式以图15为例,详细阐述本申请技术的实现。To better illustrate the IO scheduling method described in the embodiments of this application, this application provides a specific implementation method for a concurrent IO scheduling method based on data interval mutual exclusion. Taking Figure 15 as an example, the implementation of the technology of this application is explained in detail.
假设待访问的目标逻辑单元总容量为12MB,由三个4MB(obj_size)大小的数据管理单元组成(从0开始编号,依次递增),分别为obj_0,obj_1,obj_2,其对应的oid分别为0x0000123400000000,0x0000123400000001,0x0000123400000002,连续进行IO_req1和IO_req2两次IO读写请求,IO_req1请求的偏移量offset_1为3MB,长度len_1为3MB,IO_req2请求的偏移量offset_2为5MB,长度len_2为4MB。Assume the total capacity of the target logical unit to be accessed is 12MB, consisting of three 4MB (obj_size) data management units (numbered sequentially from 0), namely obj_0, obj_1, and obj_2, with corresponding OIDs of 0x0000123400000000, 0x0000123400000001, and 0x0000123400000002, respectively. Two consecutive IO read/write requests, IO_req1 and IO_req2, are made. The offset_1 of IO_req1 is 3MB and the length len_1 is 3MB. The offset_2 of IO_req2 is 5MB and the length len_2 is 4MB.
分布式存储系统初始化时,配置第一阈值worker_num为3,即线程池中最大工作线程个数为3个,从0开始编号。启动多IO请求处理队列特性,并配置第二阈值queue_num为3,即同时存在3个IO请求处理队列,从0开始编号。同时默认开启线程池均衡技术,默认3个工作线程worker_num均分在3个IO请求处理队列上处理IO请求。During the initialization of the distributed storage system, the first threshold `worker_num` is configured to be 3, meaning the maximum number of worker threads in the thread pool is 3, numbered starting from 0. The multi-IO request processing queue feature is enabled, and the second threshold `queue_num` is configured to be 3, meaning there are 3 IO request processing queues simultaneously, numbered starting from 0. Thread pool load balancing is also enabled by default, meaning the 3 worker threads (`worker_num`) are evenly distributed across the 3 IO request processing queues to handle IO requests.
首先分布式存储系统接收到IO写请求IO_req1,检查发现请求的数据区间横跨两个数据管理单元,需要拆分,检查和拆分方法如下:First, the distributed storage system receives the IO write request IO_req1. Upon inspection, it finds that the requested data range spans two data management units and needs to be split. The inspection and splitting methods are as follows:
(1)计算请求的数据块的起始地址位于哪个数据管理单元;
offset_1/obj_size=3/4=0……3;(1) Calculate which data management unit the starting address of the requested data block is located in;
offset_1/obj_size=3/4=0...3;
即起始地址位于第0个数据管理单元,即obj_0。That is, the starting address is located in the 0th data management unit, i.e., obj_0.
(2)计算请求的数据块的结束地址位于哪个数据管理单元;
(offset_1+len_1)/obj_size=(3+3)/4=1……2;(2) Calculate which data management unit the end address of the requested data block is located in;
(offset_1+len_1)/obj_size=(3+3)/4=1...2;
即结束地址位于第1个数据管理单元,即obj_1。The end address is located in the first data management unit, namely obj_1.
(3)判断IO请求是否需要拆分;(3) Determine whether the IO request needs to be split;
起始地址所在数据管理单元和结束地址所在数据管理单元不在同一个数据管理单元上,故需要按照obj_size对齐,将IO请求拆分为两个数据管理单元请求分别进行IO调度。Since the data management unit where the starting address is located and the data management unit where the ending address is located are not in the same data management unit, it is necessary to align according to obj_size and split the IO request into two data management unit requests for IO scheduling respectively.
第一个子IO_req1请求为obj_0a_p1,请求obj_0中的偏移量offset_a_p1为3MB,长度len_a_p1为1MB;The first sub-IO_req1 request is obj_0a_p1, which requests an offset_a_p1 of 3MB and a length len_a_p1 of 1MB in obj_0.
第二个子IO_req1请求为obj_1a_p2,请求obj_1中的偏移量offset_a_p2为0,长度len_a_p2为2MB;The second sub-IO_req1 request is obj_1a_p2, which requests that the offset_a_p2 in obj_1 is 0 and the length len_a_p2 is 2MB;
然后将这两个子IO请求obj_0a_p1和obj_1a_p2放到IO请求处理队列上进行调度。这里对命名进行补充说明:“obj_0”表示目标数据管理单元为obj_0,“a”表示第一个并发IO请求,“p1”,“p2”表示将IO请求拆分为两个数据管理单元请求。Then, the two sub-IO requests, obj_0a_p1 and obj_1a_p2, are placed on the IO request processing queue for scheduling. Here's a supplementary explanation of the naming: "obj_0" indicates the target data management unit is obj_0, "a" indicates the first concurrent IO request, and "p1" and "p2" indicate that the IO request is split into two data management unit requests.
(1)对第一个数据管理单元请求obj_0a_p1所要访问的数据管理单元的oid做取模运算:
oid%queue_num=0x0000123400000000/3=0;(1) Perform a modulo operation on the OID of the data management unit that the first data management unit requests obj_0a_p1 to access:
oid%queue_num=0x0000123400000000/3=0;
即将第一个子IO_req1请求obj_0a_p1应该放在第0个IO请求处理队列上。而该子IO_req1为读写类IO请求且此时IO请求处理队列0为空,故直接入队即可。The first sub-IO_req1 request, obj_0a_p1, should be placed in the 0th IO request processing queue. Since this sub-IO_req1 is a read/write IO request and the IO request processing queue 0 is currently empty, it can be directly enqueued.
(2)对第二个数据管理单元请求obj_1a_p2所要访问的数据管理单元的oid做取模运算:
oid%queue_num=0x0000123400000001/3=1;(2) Perform a modulo operation on the OID of the data management unit that the second data management unit requests obj_1a_p2 to access:
oid%queue_num=0x0000123400000001/3=1;
即将第二个子IO_req1obj_1a_p2应该放在第1个IO请求处理队列上。而该子IO_req1请求为读写类IO请求且此时IO请求处理队列1为空,故直接入队即可。The second sub-IO_req1obj_1a_p2 should be placed in the first IO request processing queue. Since this sub-IO_req1 request is a read/write IO request and the IO request processing queue 1 is currently empty, it can be directly enqueued.
紧接着,子IO_req1请求被IO调度,线程池中的worker线程开始处理IO。Immediately afterwards, the sub-IO_req1 request is scheduled by IO, and the worker threads in the thread pool begin to process the IO.
在IO写请求IO_req1还没有处理完,分布式存储系统又并发接收到IO读请求IO_req2,检查发现请求的数据区间横跨两个数据管理单元,需要拆分,检查和拆分方法如下:Before the IO write request IO_req1 is completed, the distributed storage system concurrently receives the IO read request IO_req2. Upon inspection, it is found that the requested data range spans two data management units and needs to be split. The inspection and splitting methods are as follows:
(1)计算请求的数据块的起始地址位于哪个数据管理单元;
offset_2/obj_size=5/4=1……1;(1) Calculate which data management unit the starting address of the requested data block is located in;
offset_2/obj_size=5/4=1...1;
即起始地址位于第1个数据管理单元,即obj_1。That is, the starting address is located in the first data management unit, namely obj_1.
(2)计算请求的数据块的结束地址位于哪个数据管理单元;
(offset_1+len_1)/obj_size=(5+4)/4=2……1;(2) Calculate which data management unit the end address of the requested data block is located in;
(offset_1+len_1)/obj_size=(5+4)/4=2...1;
即结束地址位于第2个数据管理单元,即obj_2。The end address is located in the second data management unit, namely obj_2.
(3)判断IO请求是否需要拆分;(3) Determine whether the IO request needs to be split;
起始地址所在数据管理单元和结束地址所在数据管理单元不在同一个数据管理单元上,故需要按照obj_size对齐,将IO请求拆分为两个数据管理单元请求分别进行IO调度。Since the data management unit where the starting address is located and the data management unit where the ending address is located are not in the same data management unit, it is necessary to align according to obj_size and split the IO request into two data management unit requests for IO scheduling respectively.
第一个子IO_req2请求为obj_1b_p1,请求obj_1中的偏移量offset_b_p1为1MB,长度len_b_p1为3MB;The first sub-IO_req2 request is obj_1b_p1, which requests an offset_b_p1 of 1MB and a length len_b_p1 of 3MB in obj_1.
第二个子IO_req2请求为obj_2b_p2,请求obj_2中的偏移量offset_b_p2为0,长度len_b_p2为1MB;The second sub-IO_req2 request is obj_2b_p2, which requests an offset_b_p2 of 0 and a length len_b_p2 of 1MB in obj_2.
然后将这两个子IO_req2请求obj_1b_p1和obj_2b_p2放到IO请求处理队列上进行调度。Then, these two sub-IO_req2 requests, obj_1b_p1 and obj_2b_p2, are placed on the IO request processing queue for scheduling.
(1)对第一个子IO_req2请求obj_1b_p1所要访问的数据管理单元的oid做取模运算:
oid%queue_num=0x0000123400000001%3=1;(1) Perform a modulo operation on the OID of the data management unit to be accessed by the first sub-IO_req2 request obj_1b_p1:
oid%queue_num=0x0000123400000001%3=1;
即将第一个数据管理单元请求obj_1b_p1应该放在第1个IO请求处理队列上。该数据管理单元请求为读写类IO请求,此时IO请求处理队列1非空,故需要先遍历IO请求处理队列1,查看目标IO请求处理队列上是否已经存在与新数据管理单元请求的数据区间重叠的数据管理单元请求。发现已有的数据管理单元请求obj_1a_p2和新数据管理单元请求obj_1b_p1均要访问oid为0x0000123400000001的obj_1存储资源,故需要判断这两个数据管理单元请求的数据区间是否存在重叠,即判断在obj_1中,两个数据管理单元请求的数据区间的起始地址和结束地址的大小:The first data management unit request, obj_1b_p1, should be placed in the first IO request processing queue. This data management unit request is a read-write IO request. Since IO request processing queue 1 is not empty, it's necessary to first traverse IO request processing queue 1 to check if there is already a data management unit request in the target IO request processing queue that overlaps with the data range of the new data management unit request. It is found that both the existing data management unit request obj_1a_p2 and the new data management unit request obj_1b_p1 need to access the storage resource obj_1 with oid 0x0000123400000001. Therefore, it is necessary to determine whether the data ranges of these two data management unit requests overlap, that is, to determine the size of the start and end addresses of the data ranges requested by the two data management unit requests within obj_1.
obj_1a_p2在obj_1中的数据起始地址:offset_a_p2=0(MB);The starting address of the data in obj_1a_p2 is: offset_a_p2 = 0 (MB);
obj_1a_p2在obj_1中的数据结束地址:offset_a_p2+len_a_p2=0+2=2(MB);The end address of the data in obj_1a_p2 in obj_1: offset_a_p2 + len_a_p2 = 0 + 2 = 2 (MB);
即obj_1a_p2在obj_1中的数据区间:[0,2]MB;That is, the data range of obj_1a_p2 in obj_1 is [0,2] MB;
obj_1b_p1在obj_1中的数据起始地址:offset_b_p1=1(MB);The starting address of the data in obj_1b_p1: offset_b_p1 = 1 (MB);
obj_1b_p1在obj_1中的数据结束地址:offset_b_p2+len_b_p2=1+3=4(MB);The end address of the data in obj_1b_p1: offset_b_p2 + len_b_p2 = 1 + 3 = 4 (MB);
即obj_1b_p1在obj_1中的数据区间:[1,4]MB;That is, the data range of obj_1b_p1 in obj_1 is [1,4] MB;
数据区间[0,2]MB和数据区间[1,4]MB存在重叠,故需要先将obj_1b_p1挂在IO互斥链表上,具体操作如下:The data range [0,2]MB and the data range [1,4]MB overlap, so obj_1b_p1 needs to be added to the IO mutex list first. The specific operation is as follows:
检查发现obj_1a_p2的链表没有初始化,则对其进行链表初始化,并作为IO互斥链表的链表头,然后将新数据管理单元请求obj_1b_p1添加到IO互斥链表的尾部,此时新数据管理单元请求obj_1b_p1不参与IO调度,需要等待数据管理单元请求obj_1a_p2完成后,再将新数据管理单元请求obj_1b_p1尝试加入IO请求处理队列进行调度。If the check reveals that the linked list of obj_1a_p2 is not initialized, then the linked list is initialized and used as the head of the IO mutex linked list. Then, the new data management unit request obj_1b_p1 is added to the tail of the IO mutex linked list. At this time, the new data management unit request obj_1b_p1 does not participate in IO scheduling. It needs to wait for the data management unit request obj_1a_p2 to complete before attempting to add the new data management unit request obj_1b_p1 to the IO request processing queue for scheduling.
(2)对第二个数据管理单元请求obj_2b_p2所要访问的数据管理单元的oid做取模运算:
oid%queue_num=0x0000123400000002%3=2;(2) Perform a modulo operation on the OID of the data management unit that the second data management unit requests obj_2b_p2 to access:
oid%queue_num=0x0000123400000002%3=2;
即将第二个数据管理单元请求obj_2b_p2应该放在第2个IO请求处理队列上。而该数据管理单元请求为读写类IO请求且此时IO请求处理队列2为空,故直接入队即可。The second data management unit request, obj_2b_p2, should be placed in the second IO request processing queue. Since this data management unit request is a read/write IO request and IO request processing queue 2 is currently empty, it can be directly enqueued.
自此,3个IO请求处理队列上各有1个数据管理单元请求正在被线程池中的worker线程并发处理,IO请求处理队列1上还有一个数据管理单元请求在等待调度。At this point, each of the three IO request processing queues has one data management unit request being concurrently processed by worker threads in the thread pool, and there is one more data management unit request waiting to be scheduled on IO request processing queue 1.
当IO请求处理队列0上的数据管理单元请求obj_0a_p1处理完成后,需要将该数据管理单元请求从IO请求处理队列中移除。具体流程如下:检查发现该数据管理单元请求上的链表没有初始化,故可以直接将该数据管理单元请求从IO请求处理队列中移除。Once the data management unit request obj_0a_p1 on IO request processing queue 0 has been processed, it needs to be removed from the IO request processing queue. The specific process is as follows: Upon inspection, it is found that the linked list on the data management unit request has not been initialized, so the data management unit request can be directly removed from the IO request processing queue.
当IO请求处理队列1上的数据管理单元请求obj_1a_p2处理完成后,需要将该数据管理单元请求从IO请求处理队列1中移除。具体流程如下:检查发现该数据管理单元请求上的链表已经初始化且不为空,先使用一个临时链表头暂存该数据管理单元请求,在将该数据管理单元请求从IO互斥链表中移除,接着将该数据管理单元请求从IO请求处理队列1中移除,然后通过临时链表头遍历IO互斥链表,取出IO互斥链表上的数据管理单元请求obj_1b_p1(即从IO互斥链表上移除该数据管理单元请求),然后尝试将其重新加入到IO请求处理队列1上,此时IO请求处理队列1为空,直接将其添加到队列尾部即可。此时IO互斥链表遍历完成,自此结束。此时IO写请求IO_req1拆分后的两个数据管理单元请求obj_0a_p1和obj_1a_p2均已经处理完成,将结果合并后,即可返回给用户。After the data management unit request obj_1a_p2 on IO request processing queue 1 is processed, it needs to be removed from IO request processing queue 1. The specific process is as follows: Upon inspection, it is found that the linked list for the data management unit request has been initialized and is not empty. A temporary linked list head is used to temporarily store the data management unit request. Then, the data management unit request is removed from the IO mutex list. Next, the data management unit request is removed from IO request processing queue 1. Then, the IO mutex list is traversed through the temporary linked list head to retrieve the data management unit request obj_1b_p1 (i.e., the data management unit request is removed from the IO mutex list). Then, an attempt is made to add it back to IO request processing queue 1. At this point, IO request processing queue 1 is empty, so it is simply added to the tail of the queue. The IO mutex list traversal is now complete, and the process ends. At this point, the two data management unit requests obj_0a_p1 and obj_1a_p2, split from the IO write request IO_req1, have both been processed. The results are merged and returned to the user.
当IO请求处理队列2上的数据管理单元请求obj_2a_p2处理完成后,需要将该数据管理单元请求从IO请求处理队列中移除。具体流程如下:检查发现该数据管理单元请求上的链表没有初始化,故可以直接将该数据管理单元请求从IO请求处理队列中移除。Once the data management unit request obj_2a_p2 on IO request processing queue 2 has been processed, it needs to be removed from the IO request processing queue. The specific process is as follows: Upon inspection, it is found that the linked list on the data management unit request has not been initialized, so the data management unit request can be directly removed from the IO request processing queue.
此时IO请求链表上只有数据管理单元请求obj_1b_p1,待该数据管理单元请求完成后,IO读请求IO_req2拆分后的两个数据管理单元请求obj_1b_p1和obj_2b_p2均已经处理完成,将结果合并后,即可返回给用户。At this point, the IO request list only contains the data management unit request obj_1b_p1. After the data management unit request is completed, the two data management unit requests obj_1b_p1 and obj_2b_p2, which were split from the IO read request IO_req2, have been processed. The results are then merged and returned to the user.
在本实施例中还提供了一种IO调度装置,该装置被设置为实现上述实施例及可选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件,和/或,硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。This embodiment also provides an I/O scheduling device configured to implement the above embodiments and optional implementations, details of which will not be repeated. As used below, the term "module" can be a combination of software and/or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
本实施例提供一种IO调度装置,如图16所示,包括:获取模块501,被设置为获取当前待处理IO请求;第一确定模块502,被设置为对当前待处理IO请求进行识别,确定当前待处理IO请求对应的目标请求数据;第二确定模块503,被设置为确定目标请求数据在存储设备中的请求位置以及目标请求数据的对应的请求数据量;调度模块504,被设置为根据目标请求数据对应的请求位置和请求数据量,将当前待处理IO请求放入目标IO请求处理队列,对当前待处理IO请求进行调度。This embodiment provides an IO scheduling device, as shown in FIG16, including: an acquisition module 501, configured to acquire a currently pending IO request; a first determination module 502, configured to identify the currently pending IO request and determine the target request data corresponding to the currently pending IO request; a second determination module 503, configured to determine the request location of the target request data in the storage device and the corresponding request data volume of the target request data; and a scheduling module 504, configured to place the currently pending IO request into a target IO request processing queue according to the request location and request data volume corresponding to the target request data, and schedule the currently pending IO request.
上述各个模块和单元的更进一步的功能描述与上述对应实施例相同,在此不再赘述。Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
本实施例中的IO调度装置是以功能单元的形式来呈现,这里的单元是指ASIC(Appl icatIOn Specific Integrated Circuit,专用集成电路)电路,执行一个或多个软件或固定程序的处理器和存储器,和/或,其他可以提供上述功能的器件。In this embodiment, the IO scheduling device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and/or other devices that can provide the above functions.
本申请实施例还提供一种电子设备,具有上述图16所示的IO调度装置。This application also provides an electronic device having the IO scheduling device shown in FIG16 above.
请参阅图17,图17是本申请可选实施例提供的一种电子设备的结构示意图,如图17所示,该电子设备包括:一个或多个处理器10、存储器20,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相通信连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在一些可选的实施方式中,若需要,可以将多个处理器,和/或,多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图17中以一个处理器10为例。Please refer to Figure 17, which is a schematic diagram of an electronic device provided in an optional embodiment of this application. As shown in Figure 17, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components communicate with each other using different buses and can be mounted on a common motherboard or otherwise installed as needed. The processor can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input/output device (such as a display device coupled to the interface). In some optional embodiments, multiple processors and/or multiple buses can be used with multiple memories and multiple memory sets, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 17 uses one processor 10 as an example.
处理器10可以是中央处理器,网络处理器或其组合。其中,处理器10还可以包括硬件芯片。上述硬件芯片可以是专用集成电路,可编程逻辑器件或其组合。上述可编程逻辑器件可以是复杂可编程逻辑器件,现场可编程逻辑门阵列,通用阵列逻辑或其任意组合。Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may also include hardware chips. These hardware chips may be application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The programmable logic devices may be complex programmable logic devices (CLPs), field-programmable gate arrays (FPGAs), general-purpose array logic (GDAs), or any combination thereof.
其中,存储器20存储有可由至少一个处理器10执行的指令,以使至少一个处理器10执行实现上述实施例示出的方法。The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
存储器20可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器20可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些可选的实施方式中,存储器20可选包括相对于处理器10远程设置的存储器,这些远程存储器可以通过网络连接至该电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
存储器20可以包括易失性存储器,例如,随机存取存储器;存储器也可以包括非易失性存储器,例如,快闪存储器,硬盘或固态硬盘;存储器20还可以包括上述种类的存储器的组合。The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
该电子设备还包括输入装置30和输出装置40。处理器10、存储器20、输入装置30和输出装置20可以通过总线或者其他方式连接,图17中以通过总线连接为例。The electronic device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30 and output device 20 can be connected via a bus or other means, as shown in Figure 17, which illustrates a bus connection.
输入装置30可接收输入的数字或字符信息,以及产生与该电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等。输出装置40可以包括显示设备、辅助照明装置(例如,LED(Light Emitting Diode,发光二极管))和触觉反馈装置(例如,振动电机)等。上述显示设备包括但不限于液晶显示器,发光二极管,显示器和等离子体显示器。在一些可选的实施方式中,显示设备可以是触摸屏。Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs (Light Emitting Diodes)), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, LEDs, displays, and plasma displays. In some alternative embodiments, the display device may be a touch screen.
本申请实施例还提供了一种计算机可读存储介质,上述根据本申请实施例的方法可在硬件、固件中实现,或者被实现为可记录在存储介质,或者被实现通过网络下载的原始存储在远程存储介质或非暂时机器可读存储介质中并将被存储在本地存储介质中的计算机代码,从而在此描述的方法可被存储在使用通用计算机、专用处理器或者可编程或专用硬件的存储介质上的这样的软件处理。其中,存储介质可为磁碟、光盘、只读存储记忆体、随机存储记忆体、快闪存储器、硬盘或固态硬盘等;可选地,存储介质还可以包括上述种类的存储器的组合。可以理解,计算机、处理器、微处理器控制器或可编程硬件包括可存储或接收软件或计算机代码的存储组件,当软件或计算机代码被计算机、处理器或硬件访问且执行时,实现上述实施例示出的方法。This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; optionally, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
本申请的一部分可被应用为计算机程序产品,例如计算机程序指令,当其被计算机执行时,通过该计算机的操作,可以调用或提供根据本申请的方法,和/或,技术方案。本领域技术人员应能理解,计算机程序指令在计算机可读介质中的存在形式包括但不限于源文件、可执行文件、安装包文件等,相应地,计算机程序指令被计算机执行的方式包括但不限于:该计算机直接执行该指令,或者该计算机编译该指令后再执行对应的编译后程序,或者该计算机读取并执行该指令,或者该计算机读取并安装该指令后再执行对应的安装后程序。在此,计算机可读介质可以是可供计算机访问的任意可用的计算机可读存储介质或通信介质。A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and/or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
虽然结合附图描述了本申请的实施例,但是本领域技术人员可以在不脱离本申请的精神和范围的情况下做出各种修改和变型,这样的修改和变型均落入由所附权利要求所限定的范围之内。Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and all such modifications and variations fall within the scope defined by the appended claims.
Claims (20)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410962881.9 | 2024-07-18 | ||
| CN202410962881.9A CN118502680B (en) | 2024-07-18 | 2024-07-18 | IO scheduling method, electronic device, storage medium and program product |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2026017050A1 true WO2026017050A1 (en) | 2026-01-22 |
Family
ID=92248388
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2025/108685 Pending WO2026017050A1 (en) | 2024-07-18 | 2025-07-15 | Io scheduling method, electronic device, storage medium, and program product |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN118502680B (en) |
| WO (1) | WO2026017050A1 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118502680B (en) * | 2024-07-18 | 2024-10-18 | 济南浪潮数据技术有限公司 | IO scheduling method, electronic device, storage medium and program product |
| CN120406865B (en) * | 2025-07-04 | 2025-10-14 | 济南浪潮数据技术有限公司 | IO scheduling method, computer program product, device and computer medium |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101005486A (en) * | 2006-12-28 | 2007-07-25 | 金蝶软件(中国)有限公司 | Resource access control method and system |
| US20140095824A1 (en) * | 2012-09-28 | 2014-04-03 | SK Hynix Inc. | Semiconductor device and operating method thereof |
| CN115292025A (en) * | 2022-09-30 | 2022-11-04 | 神州数码融信云技术服务有限公司 | Task scheduling method and device, computer equipment and computer readable storage medium |
| CN117311619A (en) * | 2023-09-26 | 2023-12-29 | 中移(苏州)软件技术有限公司 | Request processing method, apparatus, device and readable storage medium |
| CN117492963A (en) * | 2023-11-22 | 2024-02-02 | 中国工商银行股份有限公司 | Request processing method, system, electronic device and storage medium |
| CN118312102A (en) * | 2024-04-19 | 2024-07-09 | 济南浪潮数据技术有限公司 | IO request processing method, device, storage device and storage medium |
| CN118502680A (en) * | 2024-07-18 | 2024-08-16 | 济南浪潮数据技术有限公司 | IO scheduling method, electronic device, storage medium and program product |
Family Cites Families (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5752267B2 (en) * | 2011-01-11 | 2015-07-22 | ヒューレット−パッカード デベロップメント カンパニー エル.ピー.Hewlett‐Packard Development Company, L.P. | Simultaneous request scheduling |
| CN107423301B (en) * | 2016-05-24 | 2021-02-23 | 华为技术有限公司 | A data processing method, related equipment and storage system |
| JP2020046929A (en) * | 2018-09-19 | 2020-03-26 | 富士通株式会社 | Information processing apparatus and information processing program |
| CN109783028B (en) * | 2019-01-16 | 2022-07-15 | Oppo广东移动通信有限公司 | Optimization method and device for I/O scheduling, storage medium and intelligent terminal |
| CN110297711B (en) * | 2019-05-16 | 2024-01-19 | 平安科技(深圳)有限公司 | Batch data processing method, device, computer equipment and storage medium |
| CN110750356B (en) * | 2019-09-09 | 2022-03-29 | 华南师范大学 | Multi-core interaction method, system and storage medium suitable for nonvolatile memory |
| CN111459882B (en) * | 2020-03-30 | 2023-08-29 | 北京百度网讯科技有限公司 | Namespace transaction processing method and device for distributed file system |
| CN111813554A (en) * | 2020-07-17 | 2020-10-23 | 济南浪潮数据技术有限公司 | Task scheduling processing method and device, electronic equipment and storage medium |
| CN111880750B (en) * | 2020-08-13 | 2025-08-15 | 腾讯科技(深圳)有限公司 | Method, device, equipment and storage medium for distributing disk read-write resources |
| CN115686341A (en) * | 2021-07-22 | 2023-02-03 | 华为技术有限公司 | Method, device, storage equipment and storage medium for processing access request |
| CN116266101A (en) * | 2021-12-17 | 2023-06-20 | 浙江宇视科技有限公司 | Distributed object storage system processing method and device and storage medium |
| CN115543194A (en) * | 2022-09-21 | 2022-12-30 | 联想凌拓科技有限公司 | Distributed object storage method, device, equipment and computer readable storage medium |
| CN117472273A (en) * | 2023-09-12 | 2024-01-30 | 杭州阿里云飞天信息技术有限公司 | Data reading and writing method, device and storage medium |
| CN117472597B (en) * | 2023-12-28 | 2024-03-15 | 苏州元脑智能科技有限公司 | Input/output request processing method, system, electronic device and storage medium |
-
2024
- 2024-07-18 CN CN202410962881.9A patent/CN118502680B/en active Active
-
2025
- 2025-07-15 WO PCT/CN2025/108685 patent/WO2026017050A1/en active Pending
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101005486A (en) * | 2006-12-28 | 2007-07-25 | 金蝶软件(中国)有限公司 | Resource access control method and system |
| US20140095824A1 (en) * | 2012-09-28 | 2014-04-03 | SK Hynix Inc. | Semiconductor device and operating method thereof |
| CN115292025A (en) * | 2022-09-30 | 2022-11-04 | 神州数码融信云技术服务有限公司 | Task scheduling method and device, computer equipment and computer readable storage medium |
| CN117311619A (en) * | 2023-09-26 | 2023-12-29 | 中移(苏州)软件技术有限公司 | Request processing method, apparatus, device and readable storage medium |
| CN117492963A (en) * | 2023-11-22 | 2024-02-02 | 中国工商银行股份有限公司 | Request processing method, system, electronic device and storage medium |
| CN118312102A (en) * | 2024-04-19 | 2024-07-09 | 济南浪潮数据技术有限公司 | IO request processing method, device, storage device and storage medium |
| CN118502680A (en) * | 2024-07-18 | 2024-08-16 | 济南浪潮数据技术有限公司 | IO scheduling method, electronic device, storage medium and program product |
Also Published As
| Publication number | Publication date |
|---|---|
| CN118502680A (en) | 2024-08-16 |
| CN118502680B (en) | 2024-10-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP7539202B2 (en) | Direct data access between accelerators and storage in a computing environment | |
| CN109997112B (en) | data processing | |
| WO2026017050A1 (en) | Io scheduling method, electronic device, storage medium, and program product | |
| US11119691B1 (en) | Method and apparatus to perform a function level reset in a memory controller | |
| JP7150902B2 (en) | Graph database traversal method, apparatus, apparatus and storage medium | |
| US12222859B2 (en) | Write data cache method and system, device, and storage medium | |
| US10459661B2 (en) | Stream identifier based storage system for managing an array of SSDs | |
| US11474712B2 (en) | Method, apparatus, device and storage medium for managing access request | |
| US20170228422A1 (en) | Flexible task scheduler for multiple parallel processing of database data | |
| CN112214292B (en) | Multi-core system and method of controlling operation of multi-core system | |
| Yu et al. | Virtual shuffling for efficient data movement in mapreduce | |
| US9817754B2 (en) | Flash memory management | |
| US11366689B2 (en) | Hardware for supporting OS driven observation and anticipation based on more granular, variable sized observation units | |
| JP2018528515A (en) | A method for a simplified task-based runtime for efficient parallel computing | |
| US8954969B2 (en) | File system object node management | |
| US10826848B2 (en) | Balanced, opportunistic multicore I/O scheduling from non-SMP applications | |
| CN117827423A (en) | GPU sharing method and device, electronic equipment and storage medium | |
| CN107528871B (en) | Data analysis in storage systems | |
| US20180329756A1 (en) | Distributed processing system, distributed processing method, and storage medium | |
| EP3702911B1 (en) | Hardware for supporting os driven load anticipation based on variable sized load units | |
| US20090320036A1 (en) | File System Object Node Management | |
| KR102456017B1 (en) | Apparatus and method for file sharing between applications | |
| US20140149691A1 (en) | Data processing system and data processing method | |
| US11520713B2 (en) | Distributed bus arbiter for one-cycle channel selection using inter-channel ordering constraints in a disaggregated memory system | |
| US11847512B1 (en) | Method and apparatus for optimizing system call (syscall) processing |