I / O request scheduling method and device, electronic equipment, storage medium, system and computer program product

By dynamically adjusting the number of pre -read requests, the problem of the Linux I/O scheduler in handling emergency I/O request delay, and achieved more efficient I/O request scheduling and storage equipment utilization rate.

CN119356608APending Publication Date: 2025-01-24SAMSUNG (CHINA) SEMICONDUCTOR CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411412260.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The delay of existing Linux I/O schedulers significantly increases when handling emergency I/O requests, especially when emergency I/O requests occur frequently, resulting in system performance degradation.

Method used

The number threshold for pre -read requests from the virtual file system to the block layer by dynamically adjusts the I/O request according to the type of I/O request to be processed to ensure that the high -priority I/O request can be processed in time, and it can be processed in time, and and Improve the utilization rate of storage equipment.

Benefits of technology

Effectively reduce the delay of emergency I/O requests, improve the overall performance of the system, and achieve the host -level perception scheduling by optimizing the utilization of the storage device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356608A_ABST
    Figure CN119356608A_ABST
Patent Text Reader

Abstract

The invention provides an I / O request scheduling method and device, electronic equipment, a storage medium, a system and a computer program product.The I / O request scheduling method can comprise the following steps that information of an I / O request to be processed is obtained, the I / O request to be processed comprises a first I / O request suspended in a command queue and / or a request queue, and the first I / O request is stored in the command queue and / or the request queue; the information of the I / O request to be processed comprises a request type contained in the I / O request to be processed; based on the obtained information of the I / O requests to be processed, a first preset threshold value is adjusted, and the first preset threshold value is the number threshold value of pre-read requests in second I / O requests scheduled from the virtual file system to a request queue of a block layer; and scheduling a second I / O request scheduled from the virtual file system to the request queue of the block layer based on the adjusted first preset threshold. The suspended pre-reading requests can be dynamically and actively increased / decreased, and priority inversion caused by pre-reading and time delay increase of high-priority I / O are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of operating systems and storage, and in particular to a method, device, electronic device, storage medium, system and computer program product for scheduling I / O requests. Background Art

[0002] The Linux input / output (I / O) scheduler is located between the general block layer and the device driver layer. It can receive I / O requests from the general block layer and try to find the most appropriate I / O request to send to the block device driver. Currently, the mainstream Linux distributions use three I / O schedulers: Deadline, CFQ (Completely Fair Queuing Scheduler), and Noop. CFQ is the default I / O scheduler selected by the kernel, and some devices choose multi-queue no-operation I / O schedulers. Users can optimize system performance by setting the Linux I / O scheduler according to different memories.

[0003] Although the default host-level scheduling and the current I / O scheduling process of UFS4.0 (Universal Flash Storage) and TW (Turbo Write) function can achieve high read and write performance, the latency of urgent I / O requests is still significantly increased. Summary of the invention

[0004] The I / O request scheduling method, device, electronic device, storage medium, system and computer program product provided by the exemplary embodiments of the present disclosure can at least solve the above technical problems and other technical problems not mentioned above.

[0005] According to one aspect of the present disclosure, a method for scheduling I / O requests is provided, the method comprising: obtaining information of pending I / O requests, wherein the pending I / O requests include a first I / O request suspended in a command queue and / or a request queue, and the information of the pending I / O requests includes a request type contained in the pending I / O requests; based on the obtained information of the pending I / O requests, adjusting a first preset threshold, wherein the first preset threshold is a threshold value of the number of pre-read requests in a second I / O request in a request queue scheduled from a virtual file system to a block layer; and scheduling the second I / O request in the request queue scheduled from the virtual file system to the block layer based on the adjusted first preset threshold.

[0006] Optionally, the scheduling of the second I / O request of the request queue scheduled from the virtual file system to the block layer based on the adjusted first preset threshold includes: scheduling one or more I / O requests scheduled from the virtual file system to the block layer based on the adjusted first preset threshold; dispatching the one or more I / O requests scheduled to the block layer to the synchronous queue and the asynchronous queue under the corresponding task, wherein the types of requests dispatched in the synchronous queue include synchronous requests and pre-read requests, and the types of requests dispatched in the asynchronous queue include asynchronous write requests; assigning corresponding priorities to the synchronous queue and the asynchronous queue, wherein the priority of the synchronous queue is higher than the priority of the asynchronous queue; and scheduling the one or more I / O requests in the synchronous queue and the asynchronous queue to the request queue of the block layer based on the assigned priorities.

[0007] Optionally, in the synchronization queue, the priority of the synchronization request is higher than the priority of the pre-reading request.

[0008] Optionally, the scheduling method of the I / O request also includes: adjusting a second preset threshold and / or a third preset threshold based on the information of the I / O request to be processed, wherein the second preset threshold is a threshold for the number of pre-read requests scheduled in the block layer, and the third preset threshold is a threshold for the number of asynchronous write requests scheduled in the block layer; and scheduling the pre-read requests to be scheduled in the block layer and / or the asynchronous write requests to be scheduled in the block layer based on the adjusted second preset threshold and / or the third preset threshold.

[0009] Optionally, the second preset threshold and / or the third preset threshold are adjusted based on the information of the pending I / O request, including: when the pending I / O request does not include a synchronization request, adjusting the sum of the second preset threshold and the third preset threshold to: the maximum length of the request queue processed by the storage system or the I / O controller.

[0010] Optionally, adjusting the second preset threshold and / or the third preset threshold based on the information of the I / O request to be processed includes: when the I / O request to be processed includes a synchronization request, reducing the sum of the second preset threshold and the third preset threshold.

[0011] Optionally, the scheduling method of I / O requests also includes: dispatching one or more I / O requests dispatched to the I / O controller to multiple request queues corresponding to the request types; assigning corresponding weights to each request queue based on the request types assigned to each request queue in the multiple request queues; determining the write order corresponding to each request queue based on the corresponding weights assigned to each request queue; and writing the one or more I / O requests dispatched in each request queue to the storage system in sequence based on the write order corresponding to each request queue.

[0012] Optionally, based on the write order corresponding to each request queue, the one or more I / O requests dispatched in each request queue are written to the storage system in sequence, including: obtaining the ratio between different levels of weights in the corresponding weights of each request queue, and adjusting the corresponding weights of each request queue according to a preset ratio range, wherein the corresponding weights of each request queue are divided into multiple levels according to the weight values; based on the adjusted corresponding weights of each request queue, the one or more I / O requests dispatched in each request queue are written to the storage system.

[0013] Optionally, based on the write order corresponding to each request queue, the one or more I / O requests dispatched in each request queue are written into the storage system in sequence, including: based on the write order corresponding to each request queue, the one or more I / O requests dispatched in each request queue are written into the corresponding buffer area in the storage system in sequence.

[0014] Optionally, the I / O request scheduling method further includes: adjusting the size of a corresponding buffer area in the storage system based on the corresponding weights allocated to each request queue and the number of request queues.

[0015] Optionally, the corresponding weights allocated to the request queues are used to give priority to I / O requests of a type whose write update frequency exceeds a threshold and / or whose read frequency exceeds a threshold.

[0016] Optionally, based on the write order corresponding to each request queue, the one or more I / O requests dispatched in each request queue are written in sequence to a corresponding buffer area in the storage system, including: writing synchronous read requests and / or read requests of foreground applications, synchronous write requests, pre-read requests, and asynchronous requests of background applications into a corresponding buffer area in the storage system in sequence.

[0017] Optionally, the first preset threshold is adjusted based on the acquired information of the pending I / O request, including: when the pending I / O request includes a synchronous request, reducing or maintaining the first preset threshold; and / or when the pending I / O request includes at least a predetermined number of asynchronous write requests, increasing the first preset threshold, wherein the information of the pending I / O request also includes the number of asynchronous write requests in the pending I / O request.

[0018] According to another aspect of the present disclosure, a scheduling device for an I / O request is also provided, and the scheduling device for an I / O request includes: an information acquisition module, configured to: acquire information of an I / O request to be processed, wherein the I / O request to be processed includes a first I / O request suspended in a command queue and / or a request queue, and the information of the I / O request to be processed includes a request type contained in the I / O request to be processed; a first threshold adjustment module, configured to: adjust a first preset threshold based on the acquired information of the I / O request to be processed, wherein the first preset threshold is a threshold value of the number of pre-read requests in a second I / O request in a request queue scheduled from a virtual file system to a block layer; and a first request scheduling module, configured to: schedule the second I / O request in the request queue scheduled from the virtual file system to the block layer based on the adjusted first preset threshold.

[0019] Optionally, the first request scheduling module is configured to: schedule the one or more I / O requests scheduled from the virtual file system to the block layer based on the adjusted first preset threshold; dispatch the one or more I / O requests scheduled to the block layer to the synchronous queue and the asynchronous queue under the corresponding task, wherein the types of requests dispatched in the synchronous queue include synchronous requests and pre-read requests, and the types of requests dispatched in the asynchronous queue include asynchronous write requests; assign corresponding priorities to the synchronous queue and the asynchronous queue, wherein the priority of the synchronous queue is higher than the priority of the asynchronous queue; and schedule the one or more I / O requests in the synchronous queue and the asynchronous queue to the request queue of the block layer based on the assigned priority.

[0020] Optionally, in the synchronization queue, the priority of the synchronization request is higher than the priority of the pre-reading request.

[0021] Optionally, the I / O request scheduling device also includes: a second threshold adjustment module, configured to: adjust the second preset threshold and / or the third preset threshold based on the information of the I / O request to be processed, wherein the second preset threshold is the threshold of the number of pre-read requests scheduled in the block layer, and the third preset threshold is the threshold of the number of asynchronous write requests scheduled in the block layer; a third request scheduling module, configured to: schedule the pre-read requests to be scheduled in the block layer, and / or the asynchronous write requests to be scheduled in the block layer based on the adjusted second preset threshold and / or the third preset threshold.

[0022] Optionally, the third request scheduling module is configured to: when the to-be-processed I / O requests do not include synchronization requests, adjust the sum of the second preset threshold and the third preset threshold to: the maximum length of the request queue processed by the storage system or I / O controller.

[0023] Optionally, the third request scheduling module is configured to: when the to-be-processed I / O request includes a synchronization request, reduce the sum of the second preset threshold and the third preset threshold.

[0024] Optionally, the scheduling device for I / O requests also includes: a second request dispatching module, configured to dispatch one or more I / O requests dispatched to the I / O controller to multiple request queues corresponding to the request types; a weight allocation module, configured to allocate corresponding weights to each request queue in the multiple request queues based on the request types respectively allocated to each request queue; an order determination module, configured to determine the write order corresponding to each request queue based on the corresponding weights allocated to each request queue; and a request writing module, configured to write the one or more I / O requests dispatched in each request queue to the storage system in sequence based on the write order corresponding to each request queue.

[0025] Optionally, the request writing module is configured to: obtain the ratio between different levels of weights in the corresponding weights of the request queues, and adjust the corresponding weights of the request queues according to a preset ratio range, wherein the corresponding weights of the request queues are divided into multiple levels according to the weight values; based on the adjusted corresponding weights of the request queues, write the one or more I / O requests dispatched in the request queues to the storage system.

[0026] Optionally, the request writing module is configured to: based on the writing order corresponding to the request queues, write the one or more I / O requests dispatched in the request queues into the corresponding buffer area in the storage system in sequence.

[0027] Optionally, the I / O request scheduling device further includes: a buffer size adjustment module configured to adjust the size of a corresponding buffer area in the storage system based on the corresponding weights allocated to each request queue and the number of request queues.

[0028] Optionally, the corresponding weights allocated to the request queues are used to give priority to I / O requests of a type whose write update frequency exceeds a threshold and / or whose read frequency exceeds a threshold.

[0029] Optionally, the request writing module is configured to sequentially write synchronous read requests and / or read requests of foreground applications, synchronous write requests, pre-read requests, and asynchronous requests of background applications into corresponding buffer areas in the storage system.

[0030] Optionally, the first threshold adjustment module is configured to: reduce or maintain the first preset threshold when the pending I / O requests include synchronous requests; and / or increase the first preset threshold when the pending I / O requests include at least a predetermined number of asynchronous write requests, wherein the information of the pending I / O requests also includes the number of asynchronous write requests in the pending I / O requests.

[0031] According to another aspect of an embodiment of the present disclosure, there is also provided an electronic device, comprising: at least one processor; and at least one memory storing computer executable instructions, wherein when the computer executable instructions are executed by the at least one processor, the at least one processor is prompted to execute any of the I / O request scheduling methods described above.

[0032] According to another aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium storing instructions is also provided. When the instructions are executed by at least one processor, the at least one processor is prompted to execute any of the I / O request scheduling methods described above.

[0033] According to another aspect of an embodiment of the present disclosure, a system is also provided, comprising at least one computing device and at least one storage device storing instructions, wherein when the instructions are executed by the at least one computing device, the at least one computing device is prompted to execute any of the I / O request scheduling methods described above.

[0034] According to another aspect of an embodiment of the present disclosure, a computer program product is further provided, including a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the method for scheduling an I / O request as described above is implemented.

[0035] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0036] According to the scheduling method, device, electronic device, storage medium, system and computer program product of I / O request of the present disclosure, the number threshold of pre-read requests scheduled from the virtual file system to the block layer can be adjusted according to the request type contained in the pending I / O request, and the pending pre-read requests can be dynamically and actively increased / reduced to yield task execution resources to I / O requests with higher update frequency and / or read frequency, or types that have a greater impact on user experience, such as yielding to synchronization requests, etc.; and, in the case of abundant current task execution resources, the utilization rate of storage devices can be improved by increasing the number threshold of pre-read requests scheduled from the virtual file system to the block layer. Analyzing the type components of pending requests and combining limited pre-reading can avoid the significant increase in the latency of high-priority I / O caused by priority inversion caused by pre-reading, and can increase storage utilization to achieve host-level aware scheduling (HAS).

[0037] In addition, the block layer can dynamically adjust the number of scheduled read-ahead requests and asynchronous write requests according to the request status of synchronous requests and other types in the queue, so as to yield task execution resources such as storage bandwidth to I / O requests with higher update frequency and / or read frequency, or types that have a greater impact on user experience, in the form of limited read-ahead and limited write.

[0038] Additionally, limited writes can also be used to address read / write interference to reduce asynchronous write requests and ensure that other read or write operations are blocked while a write operation is in progress.

[0039] In addition, limiting the number of read-ahead requests and asynchronous write requests can also prevent priority inversion in device-level scheduling.

[0040] In addition, in the I / O controller, corresponding weights are assigned to each request queue according to the type and category of the request, and WRR (Weighted Round Robin Arbitration) is implemented based on the strategy of giving priority to writing to the storage device with high weight. This can be combined with restrictions on the number of pre-read requests and asynchronous write requests to better prevent priority inversion in device-level scheduling.

[0041] In addition, the weight of each request queue is adjusted according to the ideal ratio range, and the I / O requests stored in each request queue are written into the TW buffer of the storage system in sequence according to the adjusted weights from high to low. This can avoid TW buffer congestion and further long delays caused by excessive priority writing of high-weight I / O requests into the TW buffer. It can also avoid the problem of not being able to meet cache bandwidth utilization requirements due to too many low-weight I / O requests.

[0042] In addition, by using limited read-ahead, limited write, and dynamic read-ahead block-level I / O scheduling, priority inversion and read / write interference can be prevented, which has better performance and lower I / O latency than the scheduler that mainly uses the CFQ algorithm.

[0043] In addition, by defining the I / O scheduling mechanism from the block layer to the device layer, as well as the host-to-device scheduling technology and data storage method, I / O requests can be distributed and written according to the type, category and priority of different I / O data, which can optimize the latency and buffer utilization on UFS devices.

[0044] In addition, the storage device may dynamically adjust the size of the TW buffer according to the priority and number of pending requests and may fix the size of the TW buffer to further improve cache bandwidth utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0046] Figure 1 A block diagram showing an I / O subsystem of an operating system;

[0047] Figure 2 A flow chart showing two scheduling techniques involved in device-level scheduling;

[0048] Figure 3 Schematic diagram showing the three main functions of TW;

[0049] Figure 4 A schematic diagram showing host-level CFQ scheduling;

[0050] Figure 5 A schematic diagram showing device level round robin arbitration;

[0051] Figure 6 A schematic diagram showing the relationship between multitasking environment and TW buffer utilization;

[0052] Figure 7 A flowchart showing a method for scheduling I / O requests in an exemplary embodiment of the present disclosure;

[0053] Figure 8 A schematic diagram showing I / O request scheduling from a virtual file system to a block layer in an exemplary embodiment of the present disclosure is shown;

[0054] Fig. 9 A schematic diagram of I / O request scheduling of a block layer in an exemplary embodiment of the present disclosure is shown;

[0055] Fig.10A schematic diagram showing I / O request scheduling in a process in which a device controller writes data into a device memory in an exemplary embodiment of the present disclosure;

[0056] Fig.11 A schematic diagram showing a flow chart of an I / O request scheduling method in an exemplary embodiment of the present disclosure;

[0057] Fig.12 A diagram showing a comparison between a scheduling method for an I / O request and a scheduling method for an I / O request in an exemplary embodiment of the present disclosure;

[0058] Fig.13 A simplified comparison diagram showing a scheduling method for an I / O request and a scheduling method for an I / O request in an exemplary embodiment of the present disclosure;

[0059] Fig.14 A block diagram showing an I / O request scheduling apparatus according to an exemplary embodiment of the present disclosure;

[0060] Fig.15 A block diagram showing an electronic device according to an exemplary embodiment of the present disclosure;

[0061] Fig.16 yes Figure 1 A block diagram of example components of one or more devices in. DETAILED DESCRIPTION

[0062] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0063] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following embodiments do not represent all implementation methods consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims. In the present disclosure, the singular form may also refer to the plural form.

[0064] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.

[0065] I / O requests (input / output requests) refer to requests from a computer system to operate its input / output devices (I / O devices). I / O devices can be in the form of hard disk drives, solid-state drives, USB devices, network interface cards, monitors, keyboards, etc. The operating system is usually responsible for managing these I / O requests, using device drivers to interact with hardware devices, and providing services such as buffering, queuing, and scheduling to improve the efficiency and performance of I / O operations.

[0066] I / O request is a broad concept that can cover all types of input and output operations, while read and write operations are specific instances of I / O requests, which can specifically refer to data reading and writing operations in scenarios where data is transmitted between storage media or networks.

[0067] When an I / O request is initiated from the application layer, it will pass through the operating system (including the file system layer and the block layer) and then be passed to the device controller, which can finally operate the actual storage device to complete the I / O operation corresponding to the I / O request. During the whole process, the request may be queued in the queue of the block layer and the queue of the device controller waiting to be processed.

[0068] Figure 1 A block diagram showing the I / O subsystem of an operating system.

[0069] Reference Figure 1 The I / O subsystem of the Linux operating system exists in the kernel of the operating system and may include VFS (Virtual File System), a common block layer, a Linux I / O scheduler, and a device driver layer.

[0070] Specifically, VFS can provide a unified interface for various file systems, allowing the operating system to access and manage different types of file systems in a standard manner.

[0071] The general block layer can be considered as an abstraction of block devices. Through the block layer, block devices can be regarded as data spaces composed of several sectors, and the block layer can provide a unified processing mechanism for read and write requests from the upper layer. In one or more examples, block devices can provide buffered access to hardware devices. Block devices can allow reading and writing blocks of any desired size.

[0072] The role of the I / O scheduler may include sorting and scheduling I / O requests according to certain strategies to optimize the performance of I / O operations. It is responsible for determining a good order to execute these I / O requests to improve the overall performance of the system and reduce the average waiting time required for I / O completion. The I / O scheduler may include scheduling strategies such as Deadline, CFQ, and Multi-queue. It is understandable that these scheduling strategies can also be used in combination with each other to achieve efficient I / O performance according to specific needs. Among them, CFQ is usually the default I / O scheduler selected by the kernel. The CFQ scheduler can use the type and category of each I / O request to perform priority-driven fair scheduling, and allow synchronous requests to preempt asynchronous request processing.

[0073] The VFS, generic block layer, and I / O scheduler can all be considered part of the host-level scheduler.

[0074] The device driver layer can provide an interface for communicating with specific hardware devices. It can convert I / O requests into instructions that the hardware can understand, and interact with the hardware to complete data reading and writing operations.

[0075] The I / O subsystem can process and manage requests related to I / O devices through the collaborative work of various layers, including providing a unified interface for upper-level applications and optimizing the access efficiency of underlying hardware, thereby realizing a complete process from I / O requests of upper-level applications to access of underlying hardware.

[0076] UFS4.0 can be used as an example, or it can be applied to other related devices. UFS itself does not directly participate in the scheduling of I / O requests, but provides fast and stable data read and write services as a storage medium, supporting the I / O scheduler to effectively manage and schedule I / O requests. UFS 4.0 can be a flash memory, such as for mobile devices and computing systems that require high performance and low power consumption. UFS 4.0 can have a full-duplex interface, allowing simultaneous read and write operations.

[0077] Figure 2 Flowchart showing two scheduling techniques involved in device-level scheduling.

[0078] Reference Figure 2Device-level scheduling can support scheduling technologies such as single-queue FIFO (First-in-First-out) and multi-queue RR arbitration (Round-robin Arbitration).

[0079] Single-queue FIFO is a scheduling strategy in which all I / O requests are placed in a single queue and processed in the order they enter the queue. This strategy is suitable for scenarios where requests have similar priority and the response time requirements are not particularly strict, so that requests are processed on a first-come, first-served basis.

[0080] Compared with the FIFO scheduling strategy, multi-queue RR arbitration is a more flexible scheduling strategy. Under this strategy, I / O requests can be classified and placed in different queues, each of which may correspond to different priorities, request types, or devices. The scheduler can process the requests in these queues in sequence according to a certain strategy (such as polling). This strategy can better handle I / O requests with different priorities and requirements, and provide more fine-grained control and management.

[0081] Single-queue FIFO and multi-queue RR arbitration can have the following characteristics:

[0082] (1) Admin SQ (Submission queue) (the submission queue for administrative commands) has the same priority as I / O SQ (the submission queue for I / O requests);

[0083] (2) The device controller will obtain a certain number of commands from all submission queues in sequence or in a round-robin manner.

[0084] UFS4.0 can be used as an example, or it can be applied to other related devices. For the device-level scheduling of UFS4.0, the command queue on it allows multiple I / O requests to be suspended in the queue, and the MCQ (Multiple Command Queue) RR scheduling strategy can support parallel I / O request allocation, thereby achieving high-performance reading and writing.

[0085] Figure 3 Schematic diagram showing the three main functions of TW.

[0086] exist Figure 3 In the memory, SLC (Single-Level Cell), TLC (Triple-Level Cell), and QLC (Quad-Level Cell) are different types of memory cells, and NAND is a type of flash memory technology.

[0087] A traditional flush operation writes the data of the entire cache area (usually the SLC cache area) to the main storage area (usually TLC / QLC NAND) at one time, which may cause large delays and increase the write burden of the main storage area.

[0088] TW technology is usually used in conjunction with the cache area (usually SLC cache area) in SSD (Solid State Disk or Solid State Drive). When writing data, the SSD first tries to write the data to this high-speed cache area to increase the write speed and improve the performance of SSDs based on TLC NAND.

[0089] For the new standard of UFS4.0, Turbo Write 2.1 (TW 2.1), it includes three main functions:

[0090] (1) Partial Flush: The host can only flush a portion of the TW buffer.

[0091] In order to reduce the write burden of the main storage area, the partial flush mechanism of Turbo Write can be introduced. Under this mechanism, when the cache area needs to release space, the data in the entire cache area is not refreshed at once, but only part of the data is refreshed.

[0092] For example, refer to Figure 3 In (a), when the host writes / migrates the task data corresponding to the I / O request in the data blocks A, B, C, D, E, and F to the device through TW, the partial flush mechanism can select and refresh those data blocks that are no longer needed or have lower priority (assuming A, B, and C), while retaining those data blocks that are still frequently accessed or important (assuming D, E, and F) in the cache. In other words, the host can adjust the size of the reserved area during the cache refresh process. Depending on the specific situation, the amount of data refreshed may be variable.

[0093] (2) Pinned TW: The buffer can be fixed, and the size of the fixed buffer can be adjusted dynamically.

[0094] For example, refer to Figure 3In (b), when the host sends a write request to the SSD, the host can first write this part of the data (such as A, B, C, D, E, F) to the TW cache area, which usually uses higher-performance storage units, such as SLC, to provide faster write speeds. The Pinned TW mechanism can use a part of the storage space inside the SSD as a fixed (Pinned) cache area (such as B, D, F), so that only another part of the data (such as A, C, E) can be migrated to the main storage area during the refresh process. The size of the area reserved during the refresh process is the fixed SLC cache area.

[0095] (3) Auto Resize: The host can dynamically adjust the size of the SLC (Single-Level Cell) in real time based on the data writing situation.

[0096] For example, refer to Figure 3 In (c), for adjusting the TW buffer size, increasing the TW buffer size can achieve high-performance read and write operations, and reducing the TW buffer size can increase the life of the storage device.

[0097] Although the default host-level scheduling and UFS4.0's current I / O scheduling process and TW function can achieve higher performance read and write operations, the delay increase of urgent I / O requests is still significant. This is due to the following reasons:

[0098] (1) Priority inversion in the command queue;

[0099] (2) Read and write interference in the command queue;

[0100] (3) The sequential write strategy of the TW buffer results in its low utilization.

[0101] It is understandable that the I / O requests in the request queue can be mapped to the commands in the command queue. The request is first processed by the I / O scheduler of the operating system and then sent to the command queue of the storage device for execution. Therefore, the request queue is an abstraction at the operating system level, used to manage and schedule I / O requests, while the command queue is a concept at the hardware level, used for command scheduling inside the storage device.

[0102] Read-write interference usually occurs in a concurrent environment when multiple processes or threads read and write to a shared resource at the same time without proper synchronization mechanisms. If multiple readers and writers are allowed to operate on a shared resource at the same time, data inconsistencies or race conditions may occur. For example, if a thread tries to read data while another thread is writing the same data, the reading thread may get a partially updated, inconsistent data (e.g., corrupted data), resulting in errors or unpredictable behavior.

[0103] In the related art, the host level can use CFQ scheduling to reduce the impact of command queue queuing, but this method does not consider the problem of priority inversion caused by pre-reading. According to the understanding of ordinary technicians in this field, priority inversion may occur when a high-priority task is replaced by a low-priority task. The pre-read request or operation can be a system call of an application (such as a Linux kernel) that loads data (such as file content) into temporary memory (such as page cache). This function can pre-fetch data so that when the data is accessed later, it is read from the main memory (RAM) instead of the hard disk drive (HDD), thereby greatly reducing file access latency.

[0104] CFQ is an I / O scheduling algorithm in the Linux kernel that creates a separate queue for each process that issues an I / O request and serves these queues in a round-robin manner. CFQ aims to ensure fair distribution of I / O time and allow each process to obtain a corresponding proportion of I / O bandwidth.

[0105] Figure 4 A schematic diagram showing host-level CFQ scheduling.

[0106] Reference Figure 4 After VFS receives an I / O request from the computer system to operate its input and output devices, such as read, write, and pre-read requests, the host-level scheduling can combine the CFQ scheduling algorithm with the single queue (Single-queue) or round-robin multiple command queue (RR MCQ) in the controller (or scheduler, Controller, Device Controller) to reduce the impact of command queue queuing through the host's CFQ scheduling.

[0107] In the example, the round-robin arbitration (RR Arbitration) of the device scheduler does not support priority-driven scheduling, which will cause priority inversion to occur frequently and significantly increase the latency of high-priority I / O.

[0108] Figure 5A schematic diagram showing device-level round-robin arbitration.

[0109] Reference Figure 5 , the host-level scheduler can support other devices that handle urgent I / O requests through a combination of the file system and the block layer, through a single-queue CFQ or deadline scheduling algorithm, or through multiple queues. However, the device-level scheduler does not support other devices that handle urgent I / O requests, resulting in a large number of pending I / Os. A large number of pending requests will significantly increase the latency of urgent I / O. The more accumulated pending read requests, the higher the latency of urgent I / O requests in mixed workloads.

[0110] For storing data in the TW buffer, the write strategy of the TW buffer may be sequential write, and the higher the utilization rate of the TW, the better the performance.

[0111] Modern mobile devices can provide users with a multitasking environment that runs multiple applications at the same time. While the efficiency brought by running a multitasking environment also brings the following problems:

[0112] (1) There is high interference between FG (foreground) and BG (background) applications, and the I / O request priority inversion increases.

[0113] (2) Most of the fixed TW is occupied by background pending requests, resulting in an increase in the response time of frequently updated foreground applications.

[0114] (3) Since the TW buffer is mainly occupied by pre-reading and background application requests, the latency of foreground application requests will increase.

[0115] In one or more examples, the foreground application may be an application that is visible to the user on the screen during execution, and the background application may be an application that is executing but not visible to the user. These situations cause the TW buffer to be occupied by more data that is not urgent or not updated frequently, resulting in high latency for urgent applications.

[0116] Figure 6 Schematic diagram showing the relationship between multitasking environment and TW buffer utilization.

[0117] Reference Figure 6In TW technology, when data is written in a pinning stream, the data is locked in a specific storage area for fast access and processing. A normal stream refers to a regular data stream that is not specially optimized. In TW technology, not all write operations use a pinning stream. Some write operations that are not so critical or do not need to be accelerated urgently may be performed through a normal stream to maintain the overall performance and balance of the system.

[0118] In TW technology, the pinning area can be an area in the memory used to store data that needs to be quickly accessed and processed. The flush area can be used to store data that has not yet been persisted to the final storage medium (such as NAND flash memory); the data in the flush area is usually gradually written to the final storage medium according to a certain strategy (such as first-in-first-out).

[0119] Reference Figure 6 (a), the following situation can achieve ideal TW buffer utilization: the foreground application preferentially writes to the fixed area in the TW buffer in a fixed stream manner, and the background application mainly writes to the refresh area in the TW buffer in a standard stream manner.

[0120] However, referring to Figure 6 (b) Under normal circumstances, due to the frequent switching between the foreground application and the background application, the following situation will occur: the foreground application mainly writes to the refresh area in the TW buffer in a standard stream manner, and the background application preferentially writes to the fixed area in the TW buffer in a fixed stream manner, resulting in pre-read requests and I / O requests of the background application being ranked at the forefront of the pending requests, while the I / O requests of the foreground application are severely delayed, resulting in low utilization of the TW buffer.

[0121] Instead, it is expected that TW2.1 will be used effectively to:

[0122] (1) Reduce read request latency;

[0123] (2) Reduce processing overhead in storing frequently updated data.

[0124] In order to solve the above-mentioned or other problems related to these technologies, the present disclosure provides a scheduling method, device, electronic device, storage medium, system and computer program product for I / O request, which can adjust the number threshold of pre-read requests scheduled from the virtual file system to the block layer according to the request type contained in the current pending I / O request, and can dynamically and actively increase / reduce the pending pre-read requests to yield task execution resources to I / O requests with higher update frequency and / or read frequency, or types that have a greater impact on user experience, such as yielding to synchronization requests, etc.; and, in the case of abundant current task execution resources, the utilization of storage devices can be improved by increasing the number threshold of pre-read requests scheduled from the virtual file system to the block layer. Analyzing the type components of pending requests and combining limited pre-reading can avoid the significant increase in the latency of high-priority I / O caused by priority inversion caused by pre-reading, and can increase storage utilization to achieve host-level perceived scheduling. In one or more examples, when the update frequency of the I / O request exceeds the threshold, the I / O request may have a higher update frequency. In one or more examples, when the read frequency of the I / O request exceeds the threshold, the I / O request may have a higher read frequency.

[0125] Next, we will refer to Figures 7 to 15 The I / O request scheduling method, apparatus, electronic device, storage medium, system and computer program product of the present disclosure are specifically described.

[0126] Figure 7 A flow chart showing a method for scheduling an I / O request in an exemplary embodiment of the present disclosure is shown.

[0127] Reference Figure 7 In step 701, information about the currently pending I / O request may be obtained, wherein the currently pending I / O request may include I / O requests suspended in the current command queue and / or request queue, and the information about the currently pending I / O request may include but is not limited to the request type contained in the currently pending I / O request.

[0128] According to an exemplary embodiment of the present disclosure, the process of I / O scheduling and storing data involves related file systems, block layers, device controllers, and device storage. The types of I / O requests can be distinguished in the file system (VFS), for example, distinguishing between read requests and pre-read requests, etc. The file system can obtain information about the currently pending I / O requests, for example, it can detect which request types are included in the currently pending I / O requests. In one example, the currently pending I / O requests may include I / O requests suspended in the current command queue and / or request queue. In one or more examples, the block layer may be part of an operating system (such as a Linux kernel), which implements an interface used by applications and file systems to access various storage devices. The block layer can process requests for one or more block devices in the system. The data structure of the block layer may include a descriptor of an ongoing I / O block device operation, called bio. Bio may include one or more segments for describing the memory area involved in the I / O operation. The functions of the block layer include, but are not limited to: placing data buffers in large memory, implementing a "zero copy" mode, managing logical volumes, and utilizing advanced functions of the latest disk controllers.

[0129] According to an exemplary embodiment of the present disclosure, the VFS can monitor the pending I / O requests in the command queue, identify the type of the currently pending I / O request through the process ID, and count the number of each type of I / O request.

[0130] In step 702, the first preset threshold can be adjusted based on the information of the currently pending I / O request obtained, wherein the first preset threshold is a threshold value of the number of pre-read requests in the I / O requests scheduled from the virtual file system to the request queue of the block layer.

[0131] According to an exemplary embodiment of the present disclosure, when the information of the currently pending I / O request obtained indicates that the currently pending I / O request contains synchronization requests and other request types that have a greater impact on the user experience, or a higher update frequency and / or read frequency, in order to allocate more processing resources to these request types that have a greater impact on the user experience, or a higher update frequency and / or read frequency, the number threshold of requests such as pre-read requests that have a smaller impact on the user experience, or a lower update frequency and / or read frequency in the I / O requests scheduled from the virtual file system to the block layer can be adjusted to limit the number of similar requests such as pending pre-read requests and avoid the problem of priority inversion caused by pre-reading. In this regard, when a specific I / O request belongs to a type that is determined to consume more resources, the number of such I / O requests entering the queue will be limited. In one or more examples, the number of such I / O requests is limited until the processing of a specific I / O request is completely completed, or until the processing of a specific I / O request reaches a predetermined processing stage.

[0132] According to an exemplary embodiment of the present disclosure, a pre-read request is usually generated by a background kernel thread, and therefore has the characteristics of less impact on user experience, or a lower update frequency and / or read frequency. Whereas a read / write request generated by a user application usually has a greater impact on user experience, or a higher update frequency and / or read frequency.

[0133] According to an exemplary embodiment of the present disclosure, an incremental adjustment operation may be performed on the first preset threshold only when it is detected that a sequential read mode is currently being adopted. The sequential read mode may include reading and writing records in a file in a sequential manner. It is understandable that if an application is reading a large file and reading in the order of the file, the file system may predict the next read operation and may preload the next data into the memory (that is, more pre-read requests may be generated in the sequential read mode). Conversely, if the reading mode of the application is unpredictable or random, the file system may process each individual read request without performing a large number of pre-reads (that is, many pre-read requests may not be generated in random read modes). The logic for determining sequential reads or random reads is mainly completed at the VFS or higher-level file system layer, and the block layer is responsible for executing these decisions and interacting with the hardware.

[0134] According to an exemplary embodiment of the present disclosure, the operation of adjusting the first preset threshold value can be used only when there is no pending synchronization request and there may be read / write interference, so as to yield task execution resources such as storage bandwidth to I / O requests with higher update frequency and / or read frequency, or types that have a greater impact on user experience. It can be understood that read / write interference usually occurs in a concurrent environment; when multiple processes or threads read and write shared resources at the same time without an appropriate synchronization mechanism, if multiple readers and writers are allowed to operate shared resources at the same time, data inconsistency or race conditions may occur; for example, if a thread attempts to read data while another thread is writing the same data, the reading thread may obtain partially updated, inconsistent or corrupted data, resulting in erroneous or unpredictable behavior. In order to prevent read-write interference, a synchronization mechanism can be used to ensure that other read or write operations are blocked when a write operation is in progress, or multiple read operations are allowed to be performed simultaneously, but any other read or write operations are blocked when a write operation is in progress.

[0135] According to an exemplary embodiment of the present disclosure, the first preset threshold is adjusted based on the information of the currently pending I / O request obtained, which may specifically include the following steps: when the currently pending I / O request includes a synchronous request, reducing or maintaining the first preset threshold; and / or, when the currently pending I / O request includes at least a predetermined number of asynchronous write requests, increasing the first preset threshold, wherein the information of the currently pending I / O request also includes the number of asynchronous write requests in the currently pending I / O request.

[0136] According to an exemplary embodiment of the present disclosure, the number of synchronization requests in the currently pending I / O requests can be identified by the process ID. As long as there are any I / O requests of the type of synchronization request in the currently pending I / O requests, the size of the first preset threshold value may not be increased.

[0137] According to an exemplary embodiment of the present disclosure, it is possible to detect whether the currently pending I / O request includes an asynchronous write request, and the number of asynchronous write requests can be counted to generate information about the currently pending I / O request. In the case where the currently pending I / O request includes at least a predetermined number of asynchronous write requests, a first preset threshold value can be increased. The predetermined number can be marked with a symbol φ or the like for ease of expression. The predetermined number can also be in the form of setting an asynchronous constant value for ease of expression in a programming language.

[0138] It is understandable that asynchronous writing can easily cause read / write interference. Therefore, when the currently pending I / O requests include more asynchronous write requests, the first preset threshold can be increased to allow multiple read operations to be performed simultaneously to prevent read / write interference.

[0139] According to an exemplary embodiment of the present disclosure, among the types of I / O requests currently to be processed, if there are only a few I / O requests that have a small impact on user experience or have a low update frequency and / or read frequency, then the first preset threshold can be increased to more efficiently utilize the storage bandwidth.

[0140] In step 703, the I / O request scheduled from the virtual file system to the request queue of the block layer may be scheduled based on the adjusted first preset threshold.

[0141] According to an exemplary embodiment of the present disclosure, the number threshold of pre-read requests in I / O requests scheduled from the virtual file system to the block layer can be limited by a first preset threshold, and the first preset threshold can be adjusted. Scheduling I / O requests based on the first preset threshold can dynamically and actively increase / decrease pending pre-read requests by adjusting the first preset threshold. In an example, the first preset threshold can be replaced by a symbol such as RAmax for ease of expression.

[0142] According to an exemplary embodiment of the present disclosure, the step of dynamically adjusting the threshold of the number of pre-read requests in the I / O requests scheduled from the VFS to the block layer multi-queue can be regarded as implementing a dynamic readahead (DRA) module for scheduling host-level I / O pre-read requests in the file system.

[0143] Figure 8 A schematic diagram of I / O request scheduling from a virtual file system to a block layer in an exemplary embodiment of the present disclosure is shown.

[0144] Reference Figure 8 According to an exemplary embodiment of the present disclosure, in VFS, the threshold of the number of pre-read requests to be scheduled to the block layer can be adjusted through dynamic pre-reading of data (user data) processed by user space applications and I / O requests generated by kernel threads, and the pre-read requests that have passed the number limit are submitted to the block layer after passing the file system. The I / O requests submitted to the block layer can have different priorities, and the queue monitor of the block layer can monitor the number and size of each type of requests that have been dispatched and are to be processed.

[0145] According to an exemplary embodiment of the present disclosure, scheduling I / O requests scheduled from the virtual file system to the request queue of the block layer based on the adjusted first preset threshold may include the following steps: scheduling the I / O requests scheduled from the virtual file system to the block layer based on the adjusted first preset threshold; dispatching the I / O requests scheduled to the block layer to the synchronous queue and the asynchronous queue under the corresponding task, wherein the types of requests dispatched in the synchronous queue include but are not limited to synchronous requests and pre-read requests, and the types of requests dispatched in the asynchronous queue include but are not limited to asynchronous write requests; assigning corresponding priorities to the synchronous queue and the asynchronous queue, wherein the priority of the synchronous queue is higher than the priority of the asynchronous queue; and scheduling the I / O requests in the synchronous queue and the asynchronous queue to the request queue of the block layer based on the assigned priorities.

[0146] According to an exemplary embodiment of the present disclosure, I / O requests can be classified to distinguish synchronous requests and asynchronous requests of each task in the block layer, and to facilitate ensuring the priority of the request assigned to the command queue. Specifically, the I / O requests scheduled to the block layer can be respectively assigned to the synchronous queue and the asynchronous queue under the corresponding task, and the synchronous queue can be used to store synchronous requests such as synchronous requests and pre-read requests, and the asynchronous queue can be used to store asynchronous requests such as asynchronous write requests, so that pre-read and synchronous read / write requests can be assigned to the synchronous queue of each task, and the asynchronous write request is assigned to the asynchronous queue. At this time, the synchronous queue and the asynchronous queue can be assigned corresponding priorities, so that the priority of the synchronous queue is higher than that of the asynchronous queue; finally, the I / O requests of the synchronous queue and the asynchronous queue can be scheduled in turn according to the assigned priorities.

[0147] According to an exemplary embodiment of the present disclosure, in a synchronization queue, the priority of a synchronization request may be higher than the priority of a pre-read request.

[0148] According to an exemplary embodiment of the present disclosure, in the process of scheduling I / O requests according to the priorities assigned to the synchronous queue and the asynchronous queue, corresponding priorities can be further assigned to the synchronous requests and pre-read requests dispatched in the synchronous queue, so that the priority of the synchronous request is higher than the priority of the pre-read request, and thus the synchronous request, the pre-read request and the asynchronous request can be scheduled in sequence according to the assigned priorities.

[0149] According to an exemplary embodiment of the present disclosure, synchronous requests, asynchronous requests, and pre-read requests can be identified and distinguished by marking. Since different read requests can be distinguished when scheduling I / O requests in the block layer, the priority of the pre-read request can be set lower than the priority of the synchronous I / O request.

[0150] According to an exemplary embodiment of the present disclosure, the above-mentioned I / O request scheduling method may also include but is not limited to the following steps: based on the information of the currently pending I / O request, adjusting the second preset threshold and / or the third preset threshold, wherein the second preset threshold is the threshold of the number of pre-read requests to be scheduled in the block layer, and the third preset threshold is the threshold of the number of asynchronous write requests to be scheduled in the block layer; based on the adjusted second preset threshold and / or third preset threshold, scheduling the pre-read requests to be scheduled in the block layer, and / or the asynchronous write requests to be scheduled in the block layer.

[0151] According to an exemplary embodiment of the present disclosure, a queue monitor in the block layer can track the number and size of pending requests in the host-level request queue, and the multi-queue of the block layer (host-level request queue) can adjust the number of scheduled I / O requests through the queue monitoring function of the queue monitor. Therefore, based on the information of the currently pending I / O request, the number threshold of the pre-read requests to be scheduled in the block layer can be adjusted, and / or the number threshold of the asynchronous write requests to be scheduled in the block layer can be adjusted, that is, the second preset threshold and / or the third preset threshold can be adjusted; finally, the I / O request can be scheduled based on the adjusted number threshold of the pre-read request and / or the asynchronous write request.

[0152] According to an exemplary embodiment of the present disclosure, limited pre-reading can be achieved by limiting the number of pre-reading requests to be scheduled by a second preset threshold, and limited writing can be achieved by limiting the number of asynchronous write requests to be scheduled by a third preset threshold. These functions enable the block layer to dynamically adjust the number of scheduled pre-reading requests and asynchronous write requests according to the request status of types such as synchronous requests in the current queue in the form of limited pre-reading and limited writing, so as to yield task execution resources such as storage bandwidth to I / O requests with higher update frequency and / or read frequency, or types that have a greater impact on user experience. In this regard, the dynamic adjustment of the number of pre-reading requests and asynchronous write requests can limit the number of requests that have an adverse effect on user experience.

[0153] According to an exemplary embodiment of the present disclosure, limited pre-read and limited write operations can realize the function of command-aware queues. Limited pre-read and limited write operations can be used to limit pre-read and asynchronous write requests passed to the command queue when synchronous requests, etc. are expected to arrive. In order to limit the number of pre-read and asynchronous write requests, limited pre-read and limited write operations can be performed in two stages. In addition, limited write operations can also be used to solve read / write interference, reduce asynchronous write requests, and ensure that other read or write operations are blocked when write operations are performed. For example, limited write can also limit the number of asynchronous write requests based on the number of pre-read requests.

[0154] According to an exemplary embodiment of the present disclosure, limiting the number of pre-read requests and asynchronous write requests can actually prevent priority inversion of device-level scheduling.

[0155] According to an exemplary embodiment of the present disclosure, the block layer can actually add both limited pre-read and limited write modules to schedule I / O requests, thereby scheduling block queues. In one or more examples, only one of the limited pre-read and limited write operations can be added, and the present disclosure does not limit this. The limited pre-read operation can be used to adjust the number of pre-read requests dispatched to the block queue (block layer multi-queue); the limited write operation can be used to adjust the number of synchronous write requests dispatched to the block queue.

[0156] According to an exemplary embodiment of the present disclosure, the host-level I / O scheduler can start / stop one or more modules of dynamic pre-reading, limited pre-reading and limited writing according to instructions or automatically to use the I / O scheduling technology or original scheduling mechanism of the exemplary embodiment of the present disclosure.

[0157] Fig. 9 A schematic diagram of I / O request scheduling at the block layer in an exemplary embodiment of the present disclosure is shown.

[0158] Reference Fig. 9 According to an exemplary embodiment of the present disclosure, I / O requests from user applications and / or kernel threads in the host can be scheduled to the block layer through a default sort. In the block layer, synchronous requests and asynchronous requests can be distinguished from each other first, so as to assign synchronous requests and asynchronous requests to synchronous queues and asynchronous queues respectively. The synchronous queue can be a queue distinguished according to each task, and each task can correspond to each different application. Synchronous read requests, synchronous write requests, pre-read requests, etc. can be assigned to the synchronous queue under each task, and asynchronous write requests, etc. can be assigned to the asynchronous queue. The highest priority can be assigned to the synchronous read / write request of each task in the synchronous queue, and secondly, the medium priority can be assigned to the pre-read request in each task. Finally, the lowest priority can be assigned to the request in the asynchronous queue. As Fig. 9 As shown, the priority order can be ①>②>③. The number threshold of pre-read requests scheduled in the block layer can be limited by limited pre-read operations, and the number threshold of asynchronous write requests scheduled in the block layer can be limited by limited write operations. The queue monitor in the block layer can monitor the types, quantities, and other states of the I / O requests to be processed and the I / O requests that have been dispatched, and can adjust the number of scheduled I / O requests based on limited pre-read, limited write, and other functions.

[0159] According to an exemplary embodiment of the present disclosure, in the process of adjusting the second preset threshold and / or the third preset threshold, when the currently pending I / O request does not include a synchronization request, the sum of the second preset threshold and the third preset threshold can be adjusted to: the maximum length of the request queue that the storage system or I / O controller can effectively manage and process.

[0160] According to an exemplary embodiment of the present disclosure, when there is no synchronous request in the scheduler queue, the total pending size of the read-ahead request and the asynchronous write request may be limited to θmax, where θmax may represent the maximum processable size of the valid command queue.

[0161] It is understood that the scheduler queue may refer to a queue of processes or tasks waiting to be called by the operating system scheduler. When a process or task changes from a running state to a ready state, it may be placed in the scheduler queue waiting for scheduling by the scheduler. The scheduler may schedule these ready processes and assign them to available processors according to a certain priority or scheduling algorithm to run them.

[0162] The maximum processable size of the effective command queue refers to the maximum length of the I / O operation request queue that the storage system or I / O controller can effectively manage and process. This indicator can measure the number of I / O requests that an I / O system can process simultaneously without reducing efficiency. It can reflect the concurrent processing capability of the I / O system.

[0163] It is to be understood that when the present disclosure refers to the size of a request, it may refer to the storage space, execution resources, etc. required for the request, or it may refer to the number of requests, etc.

[0164] According to an exemplary embodiment of the present disclosure, in the process of adjusting the second preset threshold and / or the third preset threshold based on information of the currently pending I / O request, when it is detected that the currently pending I / O request includes a synchronization request, the sum of the second preset threshold and the third preset threshold can be reduced.

[0165] According to an exemplary embodiment of the present disclosure, if there are one or more synchronous requests in the host-level scheduler queue, a more aggressive request limit policy may be implemented. For example, the maximum pending size of read-ahead requests and asynchronous write requests may be limited to θmin (θmin<θmax).

[0166] According to an exemplary embodiment of the present disclosure, by using block layer I / O scheduling with limited pre-read operations, limited write operations, and dynamic pre-read operations, priority inversion and read / write interference can be prevented, and compared with a scheduler that mainly uses only the CFQ algorithm, better performance and lower I / O latency are achieved.

[0167] According to an exemplary embodiment of the present disclosure, the above-mentioned I / O request scheduling method may also include but is not limited to the following steps: dispatching the I / O requests scheduled to the I / O controller to multiple request queues corresponding to the request types; assigning corresponding weights to each request queue based on the request types assigned to each request queue in the multiple request queues; determining the write order corresponding to each request queue based on the weight assigned to each request queue; and writing the dispatched I / O requests in each request queue to the storage system in sequence based on the write order corresponding to each request queue.

[0168] According to an exemplary embodiment of the present disclosure, a weighted round-robin arbitration WRR can be implemented in a storage device. For example, in the process of scheduling I / O requests, the I / O requests scheduled to the I / O controller can be dispatched to multiple request queues corresponding to the request types, so as to process the I / O requests more flexibly; based on the request types assigned to each of the multiple request queues, a corresponding weight can be assigned to each request queue, and the weight can be calculated by a WRR weight calculator, so that the command queue (multiple queues) in the block layer corresponds to the queue of WRR through the WRR weight calculator; based on the write order corresponding to the weight assigned to each request queue, the dispatched I / O requests in each request queue can be written to the storage system in sequence.

[0169] According to an exemplary embodiment of the present disclosure, the device controller can enable or disable the WRR function. According to the WRR policy, the WRR weight calculator can assign weights to the I / O requests of each queue, or the WRR weight calculator can assign queue weights to the request queues of the host-level I / Q, or the WRR weight calculator can obtain requests from the host and assign priority queue weights to each I / O, which can be mapped to the corresponding priority queues after assigning weights. Multiple WRR queue priorities can be defined to dynamically assign weighted priority queues to TW buffers according to queue priorities to complete device-level WRR scheduling.

[0170] According to an exemplary embodiment of the present disclosure, the limitation on the number of pre-read requests and asynchronous write requests can actually be combined with WRR to better prevent priority inversion of device-level scheduling.

[0171] According to an exemplary embodiment of the present disclosure, the weights assigned to the above-mentioned request queues are used to give priority to I / O requests of a type with a higher write update frequency and / or read frequency.

[0172] According to an exemplary embodiment of the present disclosure, a higher weight can be assigned to I / O requests with higher update frequency and / or read frequency, such as synchronization requests, and the I / O request scheduling can be combined with a high-weight write priority strategy.

[0173] According to an exemplary embodiment of the present disclosure, the above-mentioned writing order corresponding to each request queue sequentially writes the dispatched I / O requests in each request queue into the corresponding buffer area in the storage system, which may include but is not limited to: sequentially writing synchronous read requests and / or read requests of foreground applications, synchronous write requests, pre-read requests, and asynchronous requests of background applications into the corresponding buffer area in the storage system.

[0174] According to an exemplary embodiment of the present disclosure, the types with higher update frequency and / or read frequency or more impact on user experience may be synchronous read requests and / or read requests of foreground applications, synchronous write requests, pre-read requests, and asynchronous requests of background applications. Therefore, these requests may be assigned weights from high to low in turn to be written to the storage device in the order listed above. Of course, other write orders that meet the requirements may also be used.

[0175] According to an exemplary embodiment of the present disclosure, the above-mentioned writing order corresponding to each request queue sequentially writes the dispatched I / O requests in each request queue to the storage system, which may include but is not limited to the following steps: obtaining the ratio between different levels of weights in the weight of each request queue, and adjusting the weight of each request queue according to a preset ratio range, wherein the weight of each request queue is divided into multiple levels according to the weight value; based on the adjusted weight of each request queue, writing the dispatched I / O requests in each request queue to the storage system.

[0176] According to an exemplary embodiment of the present disclosure, in the process of writing the dispatched I / O requests in each request queue to the storage system in sequence based on the write order corresponding to the weight assigned to each request queue, the ratio between the weights of different levels in the weight of each request queue can be obtained, for example, the ratio between the two levels of high and low weights can be obtained, and of course, there can be many other levels; then, the weight of each request queue can be adjusted according to a preset ratio range, for example, the preset ratio range can be that the ratio between the two levels of high and low weights does not exceed a minimum value and is not greater than a maximum value, and of course, there can be many other ratio ranges; based on the adjusted weights of each request queue, the dispatched I / O requests in each request queue can be written to the storage system.

[0177] According to an exemplary embodiment of the present disclosure, the function of adjusting the weight of I / O requests according to the weight ratio of the current I / O requests can be implemented through the WRR scheduler. For example, the WRR scheduler can be used to adjust the queue weight through the HL ratio ((High Weight) / (Low Weight)=HL ratio) to dynamically adjust the respective proportions of high / low weights. Specifically, HighWeight can represent the number of requests with high-level weights or the size of the required execution resources, and Low Weight can represent the number of requests with low-level weights or the size of the required execution resources. When the HL ratio is too high, the I / O request weight in the low-priority queue is too low, which may cause congestion in the TW buffer and lead to longer delays. When the HL ratio is too low, the weight of the high-priority queue may not be sufficient to meet the requirements of storage bandwidth utilization and the like. Therefore, the actual HL ratio can be maintained within a relatively ideal preset ratio range through regulation.

[0178] According to an exemplary embodiment of the present disclosure, adopting the WRR policy instead of the RR policy can ensure the scheduling priority of the I / O request, so the I / O delay is lower.

[0179] According to an exemplary embodiment of the present disclosure, device-level scheduling may select a scheduling strategy according to instructions or automatically, for example, a scheduling strategy such as single queue scheduling, MCQ RR scheduling, or MCQ WRR scheduling.

[0180] According to an exemplary embodiment of the present disclosure, the device controller may use WRR scheduling having two or more functions, for example, WRR scheduling capable of adjusting the HL ratio and WRR scheduling with a fixed weight.

[0181] According to an exemplary embodiment of the present disclosure, the above-mentioned writing of the dispatched I / O requests in each request queue into the storage system in sequence based on the writing order corresponding to each request queue may include but is not limited to the following steps: based on the writing order corresponding to each request queue, writing the dispatched I / O requests in each request queue into the corresponding buffer area in the storage system in sequence.

[0182] According to an exemplary embodiment of the present disclosure, when the device controller writes data to the device memory, when the storage device can support Turbo Write 2.1 technology, the WRR scheduler can intelligently write each I / O request into the TW buffer according to the priority queue weight and its I / O type and category, or write the request into the TW buffer according to the priority queue alone to ensure that high-priority requests are written into the TW buffer first, or to ensure that frequently updated and read data are written into the TW buffer first.

[0183] For example, the requests of the foreground application, the pre-reading requests, and the requests of the background application will be written to the fixed TW and the ordinary TW in order according to the weight and quantity, and the queues with lower priority will be directly written to the ordinary storage. For another example, the synchronous read and write requests generated by the foreground application can be written to the fixed TW and the ordinary TW in priority according to the weight. When there are no synchronous requests generated by the foreground or the number of foreground synchronous requests is small, the pre-reading requests and the synchronous requests generated by the background application can be written to the fixed TW and the ordinary TW in order according to their weights, so that higher write performance and buffer utilization can be achieved.

[0184] According to an exemplary embodiment of the present disclosure, the above I / O request scheduling method may also include but is not limited to the following steps: adjusting the size of the corresponding buffer area in the storage system based on the weight assigned to each request queue and the number of request queues.

[0185] According to an exemplary embodiment of the present disclosure, the size of the TW buffer may be dynamically adjusted according to the priority and number of request queues and the size of the TW buffer may be fixed.

[0186] Fig.10 A schematic diagram showing I / O request scheduling in a process in which a device controller writes data into a device memory in an exemplary embodiment of the present disclosure is shown.

[0187] Reference Fig.10 According to an exemplary embodiment of the present disclosure, the block layer in the host can make a preliminary determination of the priority of the I / O request through multiple queues. Then, the multiple queues of the block layer can be mapped to the priority queue (WRR multiple queues) of the device controller through the WRR weight calculator. At this time, the queue priority can be divided into 4 levels, for example, urgent, high, medium, and low. The requests in the low-priority queue can be directly written to the ordinary storage area in the storage device through the ordinary write method without being written to the TW buffer first; the requests in the high-priority queue can be written to the fixed area, ordinary area, and adjustable area of ​​the TW buffer in order from high to low priority. In addition, the weight of the priority queue can be adjusted by the WRR scheduler. For example, the types and categories of requests are arranged in descending order according to the corresponding weights: synchronous read requests of foreground applications, synchronous write requests of foreground / background applications, pre-read requests, and asynchronous requests of background applications. At this time, each request can be written into the TW buffer in the above order. At the same time, the first two weight levels can be regarded as high weights, and the last two weight levels can be regarded as low weights. The HL ratio is calculated and the weights are adjusted according to the HL ratio.

[0188] Fig.11 A flow chart of an I / O request scheduling method in an exemplary embodiment of the present disclosure is shown.

[0189] Reference Fig.11According to an exemplary embodiment of the present disclosure, when the VFS receives an I / O request, for example, a read / write request, the threshold of the number of read-ahead requests scheduled from the VFS to the block layer can be adjusted through dynamic read-ahead. The I / O request is scheduled to the block layer through the file system and is assigned to an asynchronous queue or a synchronous queue under each task according to the request type. In the block layer, the number of read-ahead requests and asynchronous write requests to be scheduled can be limited by limited read-ahead and limited write. Then, they can be scheduled to the block layer multi-queue 1101 in sequence according to the priority corresponding to the type of each request. The queue monitor in the block layer can monitor the I / O requests to be processed and the I / O requests that have been dispatched, and can adjust the number of I / O requests to be scheduled according to functions such as limited read-ahead and limited write. Finally, when the storage device supports Turbo Write 2.1 technology, the I / O controller can map multiple queues in the block layer to the priority queue (WRR queue) of the I / O controller through the WRR strategy, and write the I / O requests in the priority queue in sequence from high to low priority to the fixed area, normal area, adjustable area of ​​the storage device TW buffer, and the normal storage area of ​​the storage device.

[0190] Fig.12 A comparison diagram showing a scheduling method for an I / O request in FIG. 1 and a scheduling method for an I / O request in an exemplary embodiment of the present disclosure is shown.

[0191] Reference Fig.12 (a) may use CFQ+RR+TW2.1 to schedule I / O requests. For example, VFS can schedule received I / O requests from the file system directly to the block layer, where the I / O requests can be sorted according to the default priority and CFQ algorithm and then scheduled to the SQ of the UFS controller. Then, the requested data can be written to the storage device containing TW in sequence according to the RR policy, and the data can be read in the usual way.

[0192] Reference Fig.12(b), according to an exemplary embodiment of the present disclosure, the HAS+WRR+TW2.1 method can be used to schedule I / O requests. For example, the threshold value of the number of pre-read requests scheduled to the block layer by the file system can be adjusted through dynamic pre-reading in VFS, and the request type can be further distinguished in the block layer, and the synchronous request queue and the asynchronous request queue corresponding to each task can be distinguished to dispatch the I / O request to the synchronous request queue or the asynchronous request queue under the corresponding task. The synchronous request queue under each task can store synchronous read / write requests and pre-read requests, and the asynchronous request queue can store asynchronous write requests. Then, I / O scheduling can be performed based on the priority corresponding to each type of request in the synchronous request queue and the asynchronous request queue in combination with limited pre-reading and limited writing, and the queue monitor in the block layer can monitor the I / O requests to be processed and the I / O requests that have been dispatched, and can adjust the number of I / O requests to be scheduled based on limited pre-reading, limited writing and other operations. After scheduling the I / O request to the SQ of the UFS controller, the SQ can be further assigned a corresponding weight so that the data of the I / O request can be intelligently written to the storage device containing the TW and read more quickly through the WRR strategy according to the assigned weight. HAS+WRR can reduce emergency I / O latency by changing the priority of I / O processing without affecting overall performance. WRR+TW2.1 can dynamically allocate TW buffers according to priority, improve performance, and reduce I / O latency.

[0193] Fig.13 A simplified comparison diagram showing a scheduling method for an I / O request and a scheduling method for an I / O request in an exemplary embodiment of the present disclosure.

[0194] Reference Fig.13 (a) may use CFQ+RR+TW2.1 to schedule I / O requests. Specifically, VFS can schedule the received I / O requests directly to the block layer. In the block layer, the I / O requests can be scheduled to the controller of the UFS device according to the CFQ algorithm. In the controller, the I / O requests can be further written into the TW buffer in a sequential storage manner through a single queue or RR MCQ strategy.

[0195] Reference Fig.13(b), according to an exemplary embodiment of the present disclosure, the HAS+WRR+TW2.1 method can be used to schedule I / O requests. Specifically, the threshold of the number of pre-read requests scheduled to the block layer can be adjusted through dynamic pre-read (DRA) in VFS, and the combination of host-level aware scheduling (HAS) and CFQ scheduling algorithm can be implemented in the block layer through one or more mechanisms such as limited pre-read, limited write, queue monitoring, etc., to schedule I / O requests to UFS devices. In the controller of the UFS device, weighted round-robin arbitration (WRR) can be implemented and combined with multi-command queues (MCQ) to further intelligently write requests to the TW buffer of the UFS device to achieve intelligent storage.

[0196] According to an exemplary embodiment of the present disclosure, data interaction related to I / O request scheduling can be performed between the block layer and the controller of the UFS device, and between the controller of the UFS device and the TW buffer, rather than just one-way data transmission. For example, data interaction such as the issuance of I / O requests, transmission of commands and data, and return of status and corresponding data can be performed between the block layer and the controller of the UFS device; data interaction such as the storage and acquisition of task data corresponding to the I / O request, and the management of task status can be performed between the controller of the UFS device and the TW buffer.

[0197] It can be understood that the controller, device controller, I / O controller, and UFS controller mentioned in the exemplary embodiments of the present disclosure may be corresponding or identical functional modules.

[0198] According to an exemplary embodiment of the present disclosure, in order to optimize I / O latency and improve utilization of the TW buffer, a modified host-aware scheduling (HAS), weighted round-robin arbitration (WRR), and Turbo Write 2.1 (TW2.1) supported by a UFS device may be adopted to prevent priority inversion and read-write interference.

[0199] Fig.14 A block diagram showing an I / O request scheduling apparatus according to an exemplary embodiment of the present disclosure.

[0200] Reference Fig.14 The exemplary embodiment of the present disclosure further provides an I / O request scheduling device 1400 , which may include but is not limited to an information acquisition module 1401 , a first threshold adjustment module 1402 , and a first request scheduling module 1403 .

[0201] The information acquisition module 1401 can obtain information about the currently pending I / O request, wherein the currently pending I / O request may include the I / O request suspended in the current command queue and / or request queue, and the information about the currently pending I / O request may include the request type contained in the currently pending I / O request.

[0202] The first threshold adjustment module 1402 can adjust the first preset threshold based on the information of the currently pending I / O request obtained, wherein the first preset threshold is the threshold value of the number of pre-read requests in the I / O requests scheduled from the virtual file system to the request queue of the block layer.

[0203] The first request scheduling module 1403 may schedule the I / O requests from the virtual file system to the request queue of the block layer based on the adjusted first preset threshold.

[0204] According to an exemplary embodiment of the present disclosure, the first request scheduling module 1403 can: schedule I / O requests scheduled from the virtual file system to the block layer based on the adjusted first preset threshold; can dispatch the I / O requests scheduled to the block layer to the synchronous queue and the asynchronous queue under the corresponding task, wherein the types of requests dispatched in the synchronous queue may include but are not limited to synchronous requests and pre-read requests, and the types of requests dispatched in the asynchronous queue may include but are not limited to asynchronous write requests; can assign corresponding priorities to the synchronous queue and the asynchronous queue, wherein the priority of the synchronous queue is higher than the priority of the asynchronous queue; can schedule the I / O requests in the synchronous queue and the asynchronous queue to the request queue of the block layer based on the assigned priority.

[0205] According to an exemplary embodiment of the present disclosure, in a synchronization queue, the priority of a synchronization request may be higher than the priority of a pre-read request.

[0206] According to an exemplary embodiment of the present disclosure, the scheduling device for I / O requests may also include but is not limited to: a second threshold adjustment module (not shown in the figure), which can adjust the second preset threshold and / or the third preset threshold based on the information of the currently pending I / O request, wherein the second preset threshold is the threshold of the number of pre-read requests scheduled in the block layer, and the third preset threshold is the threshold of the number of asynchronous write requests scheduled in the block layer; a third request scheduling module (not shown in the figure), which can schedule the pre-read requests to be scheduled in the block layer, and / or the asynchronous write requests to be scheduled in the block layer based on the adjusted second preset threshold and / or third preset threshold.

[0207] According to an exemplary embodiment of the present disclosure, the third request scheduling module can adjust the sum of the second preset threshold and the third preset threshold to: the maximum length of the request queue that the storage system or I / O controller can effectively manage and process when the currently pending I / O requests do not include synchronization requests.

[0208] According to an exemplary embodiment of the present disclosure, the third request scheduling module may reduce the sum of the second preset threshold and the third preset threshold when the currently pending I / O request includes a synchronization request.

[0209] According to an exemplary embodiment of the present disclosure, the scheduling device for I / O requests may also include but is not limited to: a second request dispatching module (not shown in the figure), which can dispatch the I / O requests dispatched to the I / O controller to multiple request queues corresponding to the request types; a weight allocation module (not shown in the figure), which can assign corresponding weights to each request queue in the multiple request queues based on the request types respectively assigned to each request queue; an order determination module (not shown in the figure), which can determine the write order corresponding to each request queue based on the weight assigned to each request queue; a request writing module (not shown in the figure), which can write the dispatched I / O requests in each request queue to the storage system in sequence based on the write order corresponding to each request queue.

[0210] According to an exemplary embodiment of the present disclosure, a request writing module can obtain the ratio between different levels of weights in the weight of each request queue, and adjust the weight of each request queue according to a preset ratio range, wherein the weight of each request queue is divided into multiple levels according to the weight value; based on the adjusted weight of each request queue, the dispatched I / O requests in each request queue are written to the storage system.

[0211] According to an exemplary embodiment of the present disclosure, the request writing module may write the I / O requests assigned in each request queue into the corresponding buffer area in the storage system in sequence based on the writing order corresponding to each request queue.

[0212] According to an exemplary embodiment of the present disclosure, the I / O request scheduling device 1400 may also include but is not limited to: a buffer size adjustment module (not shown in the figure), which can adjust the size of the corresponding buffer area in the storage system based on the weight assigned to each request queue and the number of request queues.

[0213] According to an exemplary embodiment of the present disclosure, the weight assigned to each request queue is used to give priority to I / O requests of a type with a higher write update frequency and / or read frequency.

[0214] According to an exemplary embodiment of the present disclosure, a request write module can sequentially write synchronous read requests and / or read requests of foreground applications, synchronous write requests, pre-read requests, and asynchronous requests of background applications into corresponding buffer areas in the storage system.

[0215] According to an exemplary embodiment of the present disclosure, the first threshold adjustment module can reduce or maintain the first preset threshold when the currently pending I / O request includes a synchronous request; and / or increase the first preset threshold when the currently pending I / O request includes at least a predetermined number of asynchronous write requests, wherein the information of the currently pending I / O request may also include but is not limited to the number of asynchronous write requests in the currently pending I / O request.

[0216] It is understandable that in the exemplary embodiment of the above-mentioned I / O request scheduling device 1400, the specific implementation process is roughly the same as the exemplary embodiment of the above-mentioned I / O request scheduling method, and will not be repeated here. The I / O request scheduling device 1400 can be configured as software, hardware, firmware or any combination of the above items to perform specific functions. For example, these devices may correspond to dedicated integrated circuits, pure software codes, or modules that combine software and hardware. In addition, one or more functions implemented by these devices may also be uniformly executed by components in physical entity devices (for example, processors, clients, or servers, etc.). In one or more examples, Fig.14 Each module shown may be implemented by one or more processors.

[0217] Fig.15 A block diagram illustrating an electronic device according to an exemplary embodiment of the present disclosure.

[0218] Reference Fig.15 The electronic device 1500 includes at least one memory 1501 and at least one processor 1502, wherein the at least one memory 1501 stores a set of computer executable instructions. When the set of computer executable instructions is executed by the at least one processor 1502, a scheduling method for I / O requests according to an exemplary embodiment of the present disclosure is executed.

[0219] As an example, the electronic device 1500 may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above-mentioned instruction set. Here, the electronic device 1500 is not necessarily a single electronic device, but may also be any device or circuit collection capable of executing the above-mentioned instructions (or instruction sets) individually or in combination. The electronic device 1500 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.

[0220] In the electronic device 1500, the processor 1502 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not limitation, the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0221] The processor 1502 may execute instructions or codes stored in the memory 1501, wherein the memory 1501 may also store data. Instructions and data may also be sent and received over a network via a network interface device, wherein the network interface device may employ any known transmission protocol.

[0222] The memory 1501 may be integrated with the processor 1502, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 1501 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 1501 and the processor 1502 may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 1502 can read files stored in the memory.

[0223] In addition, the electronic device 1500 may further include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device 1500 may be connected to each other via a bus and / or a network.

[0224] Fig.16 yes Figure 1 1600 may correspond to a user device and / or a platform. Device 1600 may be any other suitable device, such as a television, a wall panel, etc. Fig.16 As shown, device 1600 may include a bus 1610 , a processor 1620 , a memory 1630 , a storage component 1640 , an input component 1650 , an output component 1660 , and a communication interface 1670 .

[0225] Bus 1610 includes components that allow communication between components of device 1600. Processor 1620 is implemented by hardware, firmware, or a combination of hardware and software. Processor 1620 can be a central processing unit (CPU), a graphics processing unit (GPU), an accelerated processing unit (APU), a microprocessor, a microcontroller, a digital signal processor (DSP), a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), or other types of processing components. In some embodiments, processor 1620 includes one or more processors that can be programmed to perform functions. Memory 1630 includes random access memory (RAM), read-only memory (ROM), and / or another type of dynamic or static storage device (e.g., flash memory, magnetic memory, and / or optical memory) for storing information and / or instructions for use by processor 1620.

[0226] Storage component 1640 stores information and / or software related to the operation and use of device 1600. For example, storage component 1640 may include a hard disk (such as a magnetic disk, optical disk, magneto-optical disk, and / or solid-state disk), a compact disk (CD), a digital versatile disk (DVD), a floppy disk, a cassette tape, and / or other types of non-transitory computer-readable media and corresponding drives.

[0227] Input components 1650 include components that allow device 1600 to receive information, such as through user input (e.g., a touch screen display, a keyboard, a keypad, a mouse, buttons, switches, and / or a microphone). In addition, input components 1650 may also include sensors for sensing information (e.g., a global positioning system (GPS) component, an accelerometer, a gyroscope, and / or an actuator). Output components 1660 include components that provide output information from device 1600 (e.g., a display, a speaker, and / or one or more light emitting diodes (LEDs)).

[0228] The communication interface 1670 includes transceiver-like components (e.g., a transceiver and / or a separate receiver and transmitter) that enable the device 1600 to communicate with other devices, such as via a wired connection, a wireless connection, or a combination of wired and wireless connections. The communication interface 1670 may allow the device 1600 to receive information from other devices and / or provide information to other devices. For example, the communication interface 1670 may include an Ethernet interface, an optical interface, a coaxial interface, an infrared interface, a radio frequency (RF) interface, a universal serial bus (USB) interface, a Wi-Fi interface, a cellular network interface, or the like.

[0229] Device 1600 may perform one or more processes / steps / operations described in the present disclosure. Device 1600 may perform these processes / steps / operations in response to processor 1620 executing software instructions stored by non-transitory computer-readable media such as memory 1630 and / or storage component 1640. Computer-readable media may be defined as non-transitory storage devices. Storage devices include storage space in a single physical storage device or storage space distributed in multiple physical storage devices.

[0230] The software instructions may be read into the memory 1630 and / or storage component 1640 from another computer-readable medium or from another device via the communication interface 1670. When executed, the software instructions stored in the memory 1630 and / or storage component 1640 may cause the processor 1620 to perform one or more processes described in the present disclosure. In addition, hard-wired circuits may be used in place of or in combination with software instructions to perform one or more processes described in the present disclosure. Therefore, the implementations described in the present disclosure are not limited to any specific combination of hardware circuitry and software.

[0231] Fig.16 The number and arrangement of components shown in the figure are provided only as examples. In practice, the device 1600 may include additional components, fewer components, different components, or different components. Fig.16 In addition, or as an alternative, one or more components of device 1600 (eg, one or more components) may perform one or more functions performed by another set of components of device 1600.

[0232] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium storing instructions may also be provided, wherein when the instructions are executed by at least one computing device, the at least one computing device is prompted to execute the above-mentioned I / O request scheduling method.

[0233] Examples of computer-readable storage media include read-only memory (ROM), random-access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random-access memory (RAM), dynamic random-access memory (DRAM), static random-access memory (SRAM), flash memory, nonvolatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers. It should be noted that the instructions can also be used to execute additional steps in addition to the above steps or to perform more specific processing when executing the above steps. The contents of these additional steps and further processing have been mentioned in the description of the relevant methods, so they will not be repeated here to avoid repetition.

[0234] Another embodiment of the present disclosure relates to a system including at least one computing device and at least one storage device storing instructions, wherein the instructions, when executed by the at least one computing device, prompt the at least one computing device to execute the above-mentioned I / O request scheduling method.

[0235] It should be noted that the system according to the exemplary embodiments of the present disclosure can completely rely on the execution of computer programs or instructions to realize corresponding functions, that is, each unit corresponds to each step in the functional architecture of the computer program, so that the entire system is called through a special software package (e.g., lib library) to realize the corresponding functions.

[0236] On the other hand, when the above-mentioned system is implemented in software, firmware, middleware or microcode, the program code or code segment for performing the corresponding operation can be stored in a computer-readable medium such as a storage medium, so that at least one processor or at least one computing device can perform the corresponding operation by reading and running the corresponding program code or code segment.

[0237] According to an exemplary embodiment of the present disclosure, the storage device may be integrated with the computing device, for example, RAM or flash memory is arranged within an integrated circuit microprocessor, etc. In addition, the storage device may include an independent device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The storage device and the computing device may be operationally coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the computing device can read instructions stored in the storage device.

[0238] Another embodiment of the present disclosure relates to a computer program product, including a computer program / instruction, which can implement any of the above-mentioned scheduling methods for I / O requests when executed by a processor.

[0239] According to the scheduling method, device, electronic device, storage medium, system and computer program product of I / O request provided by the present disclosure, the number threshold of pre-read requests scheduled from the virtual file system to the block layer can be adjusted according to the request type contained in the current pending I / O request, and the pending pre-read requests can be dynamically and actively increased / reduced to yield task execution resources to I / O requests with higher update frequency and / or read frequency, or types that have a greater impact on user experience, such as yielding to synchronization requests, etc.; and, in the case of abundant current task execution resources, the utilization of storage devices can be improved by increasing the number threshold of pre-read requests scheduled from the virtual file system to the block layer. Analyzing the type components of pending requests and combining limited pre-reading can avoid the significant increase in the latency of high-priority I / O caused by priority inversion caused by pre-reading, and can increase storage utilization to achieve host-level aware scheduling (HAS).

[0240] In addition, the block layer can dynamically adjust the number of scheduled read-ahead requests and asynchronous write requests according to the request status of synchronous requests and other types in the current queue, so as to yield task execution resources such as storage bandwidth to I / O requests with higher update frequency and / or read frequency, or types that have a greater impact on user experience, in the form of limited read-ahead and limited write.

[0241] Additionally, limited writes can also be used to address read / write interference to reduce asynchronous write requests and ensure that other read or write operations are blocked while a write operation is in progress.

[0242] In addition, limiting the number of read-ahead requests and asynchronous write requests can also prevent priority inversion in device-level scheduling.

[0243] In addition, in the I / O controller, corresponding weights are assigned to each request queue according to the type and category of the request, and WRR (Weighted Round Robin Arbitration) is implemented based on the strategy of giving priority to writing to the storage device with high weight. This can be combined with restrictions on the number of pre-read requests and asynchronous write requests to better prevent priority inversion in device-level scheduling.

[0244] In addition, the weight of each request queue is adjusted according to the ideal ratio range, and the I / O requests stored in each request queue are written into the TW buffer of the storage system in sequence according to the adjusted weights from high to low. This can avoid TW buffer congestion and further long delays caused by excessive priority writing of high-weight I / O requests into the TW buffer. It can also avoid the problem of not being able to meet cache bandwidth utilization requirements due to too many low-weight I / O requests.

[0245] In addition, by using limited read-ahead, limited write, and dynamic read-ahead block-level I / O scheduling, priority inversion and read / write interference can be prevented, which has better performance and lower I / O latency than the scheduler that mainly uses the CFQ algorithm.

[0246] In addition, by defining the I / O scheduling mechanism from the block layer to the device layer, as well as the host-to-device scheduling technology and data storage method, I / O requests can be distributed and written according to the type, category and priority of different I / O data, which can optimize the latency and buffer utilization on UFS devices.

[0247] In addition, the storage device may dynamically adjust the size of the TW buffer according to the priority and number of pending requests and may fix the size of the TW buffer to further improve cache bandwidth utilization.

[0248] The above describes various exemplary embodiments of the present disclosure, and it should be understood that the above description is only exemplary and not exhaustive, and the present disclosure is not limited to the disclosed exemplary embodiments. Without departing from the scope and spirit of the present disclosure, many modifications and changes are obvious to those of ordinary skill in the art. Therefore, the scope of protection of the present disclosure should be based on the scope of the claims.

Claims

1. A method for scheduling I / O requests, characterized in that: The scheduling method of the I / O request includes: Acquire information about pending I / O requests, wherein the pending I / O requests include a first I / O request suspended in a command queue and / or a request queue, and the information about the pending I / O requests includes a request type included in the pending I / O requests; Based on the acquired information of the to-be-processed I / O request, adjusting a first preset threshold, wherein the first preset threshold is a threshold value of the number of pre-read requests in the second I / O request scheduled from the virtual file system to the request queue of the block layer; The second I / O request scheduled from the virtual file system to the request queue of the block layer is scheduled based on the adjusted first preset threshold.

2. The I / O request scheduling method according to claim 1, wherein: The step of scheduling the second I / O request of the request queue scheduled from the virtual file system to the block layer based on the adjusted first preset threshold comprises: Scheduling the one or more I / O requests scheduled from the virtual file system to the block layer based on the adjusted first preset threshold; Dispatching the one or more I / O requests scheduled to the block layer to a synchronous queue and an asynchronous queue under a corresponding task, wherein the types of requests dispatched in the synchronous queue include synchronous requests and pre-read requests, and the types of requests dispatched in the asynchronous queue include asynchronous write requests; Assigning corresponding priorities to the synchronous queue and the asynchronous queue, wherein the priority of the synchronous queue is higher than the priority of the asynchronous queue; The one or more I / O requests in the synchronous queue and the asynchronous queue are scheduled to a request queue of a block layer based on the assigned priorities.

3. The I / O request scheduling method according to claim 2, wherein: In the synchronization queue, the priority of the synchronization request is higher than the priority of the pre-reading request.

4. The I / O request scheduling method according to claim 1, wherein: The I / O request scheduling method also includes: Based on the information of the I / O request to be processed, adjusting the second preset threshold and / or the third preset threshold, wherein the second preset threshold is a threshold of the number of pre-read requests scheduled in the block layer, and the third preset threshold is a threshold of the number of asynchronous write requests scheduled in the block layer; Based on the adjusted second preset threshold and / or the third preset threshold, the pre-read request to be scheduled in the block layer and / or the asynchronous write request to be scheduled in the block layer are scheduled.

5. The method for scheduling I / O requests according to claim 4, wherein: The adjusting the second preset threshold and / or the third preset threshold based on the information of the to-be-processed I / O request includes: In a case where the to-be-processed I / O requests do not include a synchronization request, the sum of the second preset threshold and the third preset threshold is adjusted to: a maximum length of a request queue processed by the storage system or the I / O controller.

6. The method for scheduling I / O requests according to claim 4, wherein: The adjusting the second preset threshold and / or the third preset threshold based on the information of the to-be-processed I / O request includes: In a case where the to-be-processed I / O requests include a synchronization request, the sum of the second preset threshold and the third preset threshold is reduced.

7. The method for scheduling I / O requests according to claim 1, wherein: The I / O request scheduling method also includes: Dispatching one or more I / O requests scheduled to the I / O controller to a plurality of request queues corresponding to the request types; Based on the request type assigned to each of the multiple request queues, a corresponding weight is assigned to each of the request queues; Determining a write order corresponding to each request queue based on the corresponding weights assigned to each request queue; Based on the writing order corresponding to each request queue, the one or more I / O requests dispatched in each request queue are written to the storage system in sequence.

8. The method for scheduling I / O requests according to claim 7, wherein: The step of sequentially writing the one or more I / O requests assigned to each request queue to the storage system based on the write order corresponding to each request queue includes: Obtaining ratios between weights of different levels in the corresponding weights of the request queues, and adjusting the corresponding weights of the request queues according to a preset ratio range, wherein the corresponding weights of the request queues are divided into multiple levels according to the weight values; Based on the adjusted corresponding weights of the request queues, the one or more I / O requests dispatched in the request queues are written to the storage system.

9. The method for scheduling I / O requests according to claim 7, wherein: The step of sequentially writing the one or more I / O requests assigned to each request queue to the storage system based on the write order corresponding to each request queue includes: Based on the writing order corresponding to each request queue, the one or more I / O requests dispatched in each request queue are sequentially written into the corresponding buffer area in the storage system.

10. The I / O request scheduling method according to claim 9, characterized in that: The I / O request scheduling method also includes: Based on the corresponding weights assigned to the request queues and the number of request queues, the size of the corresponding buffer area in the storage system is adjusted.

11. The method for scheduling I / O requests according to claim 7, wherein: The corresponding weights allocated to the request queues are used to give priority to I / O requests of a type with a write update frequency exceeding a threshold and / or a read frequency exceeding a threshold.

12. The I / O request scheduling method according to claim 9, characterized in that: The step of sequentially writing the one or more I / O requests assigned to each request queue into a corresponding buffer area in the storage system based on the write order corresponding to each request queue includes: The synchronous read request and / or the read request of the foreground application, the synchronous write request, the pre-read request, and the asynchronous request of the background application are sequentially written into the corresponding buffer area of ​​the storage system.

13. The I / O request scheduling method according to claim 1, characterized in that: The adjusting the first preset threshold based on the acquired information of the to-be-processed I / O request includes: In a case where the to-be-processed I / O request includes a synchronization request, reducing or maintaining the first preset threshold; and / or, In a case where the pending I / O requests include at least a predetermined number of asynchronous write requests, the first preset threshold is increased, wherein the information of the pending I / O requests also includes the number of asynchronous write requests in the pending I / O requests.

14. A scheduling device for I / O requests, characterized in that: The scheduling device of the I / O request includes: The information acquisition module is configured to: acquire information of a pending I / O request, wherein the pending I / O request includes a first I / O request suspended in a command queue and / or a request queue, and the information of the pending I / O request includes a request type included in the pending I / O request; A first threshold adjustment module is configured to: adjust a first preset threshold based on the acquired information of the I / O request to be processed, wherein the first preset threshold is a threshold value of the number of pre-read requests in the second I / O request scheduled from the virtual file system to the request queue of the block layer; The first request scheduling module is configured to schedule the second I / O request of the request queue scheduled from the virtual file system to the block layer based on the adjusted first preset threshold.

15. An electronic device, characterized in that: include: at least one processor; at least one memory storing computer executable instructions, When the computer executable instructions are executed by the at least one processor, the at least one processor is prompted to execute the I / O request scheduling method according to any one of claims 1 to 13.

16. A non-transitory computer-readable storage medium storing instructions, characterized in that: When the instruction is executed by at least one processor, the at least one processor is prompted to execute the I / O request scheduling method according to any one of claims 1 to 13.

17. A system comprising at least one computing device and at least one storage device storing instructions, characterized in that: When the instructions are executed by the at least one computing device, the at least one computing device is prompted to execute the I / O request scheduling method as described in any one of claims 1 to 13.

18. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method for scheduling I / O requests as described in any one of claims 1 to 13 is implemented.