Input / output request detection method, device, equipment and medium
By obtaining the generation time of I/O requests and hardware queue information, the cause of I/O congestion can be quickly located, solving the time-consuming problem in existing technologies, improving system stability and reducing operation and maintenance costs.
Patent Information
- Application Number
- CN202210173628.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-24
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-02-24
AI Technical Summary
In the prior art, determining the cause of I/O ramming takes a long time, resulting in reduced operating system stability and increased operation and maintenance costs.
By obtaining the generation time of I/O requests, their status and hardware queue information, the retention location of I/O requests can be determined, thereby quickly locating the cause of I/O congestion.
This improves the efficiency of identifying the cause of I/O ramming, improves operating system stability, and reduces operation and maintenance costs.
Smart Images

Figure CN114706701B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of control technology, and in particular to an input / output request detection method, apparatus, device, and medium. Background Art
[0002] Input / output (I / O) hang refers to the phenomenon that during the operation of the operating system, the storage module of the operating system consumes too long or becomes unresponsive due to certain factors. Under normal circumstances, I / O hang may cause processes with I / O requirements to have no I / O available. Among them, for service processes with I / O access requirements, I / O hang may cause the process to be blocked for a long time and unable to provide services to the outside world until the I / O path is restored. In addition, I / O hang may also cause a large number of processes to enter an uninterruptible sleep state, causing the operating system to be under high load, and may even cause the operating system to be unresponsive for a long time and unable to execute corresponding commands. The operating system needs to be restarted to get out of this state. Therefore, I / O hang not only damages the user experience, but also reduces the stability of the operating system. If the cause of I / O hang can be determined in time when it occurs, it can help restore the stability of the operating system and reduce service losses.
[0003] In related technologies, in order to promptly determine the possible causes of I / O ramming, the I / O request causing the I / O ramming can be found using corresponding tools, and the information in the I / O request, the crash log (Crash Report) and the corresponding code can be analyzed to determine the possible causes of the I / O ramming.
[0004] However, in the above scheme, although the possible cause of I / O ramming can be determined, it takes a long time to analyze the information in the I / O request, the crash log and the corresponding code, and the cause of the I / O ramming cannot be determined in time, thereby reducing the efficiency of determining the cause of the I / O ramming, reducing the stability of the operating system, and increasing the operation and maintenance costs. Summary of the Invention
[0005] In order to solve the problems in the related art, embodiments of the present disclosure provide an input / output request detection method, apparatus, device, and medium.
[0006] In a first aspect, an embodiment of the present disclosure provides an input / output request detection method, the method comprising:
[0007] Get the time when at least one input / output (I / O) request was generated;
[0008] In response to a time difference between a generation time of the target I / O request and the current time being greater than or equal to a time difference threshold, obtaining at least one of status information of the target I / O request and hardware queue information of the target I / O request;
[0009] The retention position of the target I / O request is determined according to at least one of the state information of the target I / O request and the hardware queue information of the target I / O request.
[0010] In conjunction with the first aspect, in a first implementation of the first aspect of the present disclosure, determining the retention location of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0011] In response to determining that the start execution time or the completion execution time of the target I / O request is 0 according to the status information of the target I / O request, or the start execution time or the completion execution time of the target I / O request is empty, it is determined that the retention location of the target I / O request is a block device (block) layer of the operating system kernel.
[0012] In combination with the first aspect, in a second implementation of the first aspect of the present disclosure, determining the retention location of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0013] In response to determining, based on status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on hardware queue information of the target I / O request, determining that the I / O request submission queue does not include a target I / O request submission index corresponding to the target I / O request, it is determined that the retention location of the target I / O request is the driver layer.
[0014] In conjunction with the first aspect, in a third implementation of the first aspect of the present disclosure, determining the retention location of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0015] In response to determining, based on status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on hardware queue information of the target I / O request, determining that the I / O request submission queue includes a target I / O request submission index corresponding to the target I / O request, and the I / O request completion queue does not include a target I / O request completion index corresponding to the target I / O request, it is determined that the retention location of the target I / O request is a storage medium.
[0016] In conjunction with the first aspect, in a fourth implementation of the first aspect of the present disclosure, determining the retention location of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0017] In response to determining, based on the status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on the hardware queue information of the target I / O request, determining that the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request, and the I / O request completion queue includes the target I / O request completion index corresponding to the target I / O request, and based on the status information of the target I / O request, determining that the recovery status of the target I / O request is incomplete recovery, determining that the retention position of the target I / O request is a software recovery process.
[0018] In conjunction with the first aspect, in a fifth implementation of the first aspect of the present disclosure, determining the retention location of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0019] In response to determining, based on status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on hardware queue information of the target I / O request, determining that a sequence number of a latter target I / O request submission index in at least one pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is smaller than a sequence number of a former target I / O request submission index, it is determined that the retention position of the target I / O request is the driver layer.
[0020] In combination with the first aspect, in a sixth implementation of the first aspect of the present disclosure, determining the retention location of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0021] In response to determining, based on status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on hardware queue information of the target I / O request, determining that the sequence number of the latter target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is greater than or equal to the sequence number of the former target I / O request submission index, and that the sequence number of the latter target I / O request completion index in at least one pair of consecutive target I / O request completion indexes corresponding to the target I / O request in the I / O request completion queue is less than the sequence number of the former target I / O request completion index, it is determined that the retention location of the target I / O request is the storage medium.
[0022] In conjunction with the first aspect, in a seventh implementation of the first aspect of the present disclosure, determining the retention location of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0023] In response to determining, based on the status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on the hardware queue information of the target I / O request, determining that the sequence number of a latter target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is greater than or equal to the sequence number of a former target I / O request submission index, and that the sequence number of a latter target I / O request completion index in any pair of consecutive target I / O request completion indexes corresponding to the target I / O request in the I / O request completion queue is greater than or equal to the sequence number of the former target I / O request completion index, and determining, based on the status information of the target I / O request, that the recovery status of the target I / O request is incomplete recovery, it is determined that the retention position of the target I / O request is a software recovery process.
[0024] In a second aspect, an embodiment of the present disclosure provides an input / output request detection device, the device comprising:
[0025] A start execution time acquisition module is configured to acquire a generation time of at least one input / output (I / O) request;
[0026] a target information acquisition module configured to acquire at least one of status information of the target I / O request and hardware queue information of the target I / O request in response to a time difference between a generation time of the target I / O request and a current time being greater than or equal to a time difference threshold;
[0027] The retention position determining module is configured to determine the retention position of the target I / O request according to at least one of the state information of the target I / O request and the hardware queue information of the target I / O request.
[0028] In a third aspect, an embodiment of the present disclosure provides an electronic device comprising a memory and at least one processor; the memory is used to store one or more computer instructions, and the one or more computer instructions are executed by at least one processor to implement the method steps of any one of the first aspect and the first to seventh implementations of the first aspect.
[0029] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, the method steps of any one of the first aspect and the first to seventh implementations of the first aspect are implemented.
[0030] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the method steps of any one of the first aspect and the first to seventh implementations of the first aspect.
[0031] The technical solutions provided by the embodiments of the present disclosure may have the following beneficial effects:
[0032] According to the technical solution provided by the embodiments of the present disclosure, by obtaining the generation time of at least one I / O request and in response to the time difference between the generation time of the target I / O request and the current time being greater than or equal to a time difference threshold, at least one of the status information of the target I / O request and the hardware queue information of the target I / O request is obtained. Since the time difference between the generation time of the target I / O request and the current time being greater than or equal to the time difference threshold, the target I / O request can be understood as an I / O request that takes too long or is unresponsive, i.e., an I / O request that causes I / O throttling. By obtaining the status information of the target I / O request (the status information is used to indicate the status of the target I / O request and the time corresponding to the status), and the hardware queue information of the target I / O request (that is, the hardware queue information includes a queue of an index of at least one I / O request corresponding to the target storage medium, and the target storage medium is a storage medium for reading and writing data in response to the target I / O request), the retention position of the target I / O request is determined according to the status information of the target I / O request and at least one item of the hardware queue information of the target I / O request, that is, the position of the target I / O request that caused the I / O ramming when it failed to continue to be executed is determined. When further analysis is performed based on the retention position, the amount of data to be analyzed is relatively small, and the cause of the I / O ramming can be determined more accurately in a shorter time, thereby improving the efficiency of determining the cause of the I / O ramming, improving the stability of the operating system, and reducing operation and maintenance costs.
[0033] According to the technical solution provided by the embodiments of the present disclosure, by determining that the start execution time or the completion execution time of the target I / O request is 0, or the start execution time or the completion execution time of the target I / O request is empty in response to the status information of the target I / O request, the retention position of the target I / O request is determined to be the block device layer of the operating system kernel. When the target I / O request is retained in the block device layer and has not yet been sent down to the driver layer, the specific retention position of the target I / O request can be accurately determined, so that when further analysis is performed based on the retention position, the amount of data to be analyzed can be reduced, further improving the efficiency of determining the cause of the I / O ramming.
[0034] According to the technical solution provided by the embodiment of the present disclosure, by responding to the determination that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty according to the status information of the target I / O request, and determining that the I / O request submission queue does not include the target I / O request submission index corresponding to the target I / O request according to the hardware queue information of the target I / O request, and determining that the retention position of the target I / O request is the driver layer, the specific retention position of the target I / O request can be accurately determined when the target I / O request is still retained in the driver layer and cannot be provided to the storage medium, so that when further analysis is performed based on the retention position, the amount of data to be analyzed can be reduced, further improving the efficiency of determining the cause of the I / O ramming.
[0035] According to the technical solution provided by the embodiment of the present disclosure, by responding to the determination that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty according to the status information of the target I / O request, and determining according to the hardware queue information of the target I / O request that the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request, and the I / O request completion queue does not include the target I / O request completion index corresponding to the target I / O request, and determining that the retention location of the target I / O request is the storage medium, when the target I / O request is still retained in the corresponding storage medium, that is, the storage medium fails to complete the operation corresponding to the target I / O request, such as the read and write operation, the specific retention location of the target I / O request can be accurately determined, so that when further analysis is performed based on the retention location, the amount of data to be analyzed can be reduced, further improving the efficiency of determining the cause of the I / O ramming.
[0036] According to the technical solution provided by the embodiment of the present disclosure, by responding to the determination that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty according to the status information of the target I / O request, and determining that the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request, and the I / O request completion queue includes the target I / O request completion index corresponding to the target I / O request according to the hardware queue information of the target I / O request, and determining that the recovery status of the target I / O request is incomplete recovery according to the status information of the target I / O request, and determining that the retention position of the target I / O request is the software recovery process, the specific retention position of the target I / O request can be accurately determined when the target I / O request is retained in the software recovery process, that is, the software recovery process fails to successfully release the resources occupied by the operating system in executing the target I / O request, so that when further analysis is performed based on the retention position, the amount of data to be analyzed can be reduced, further improving the efficiency of determining the cause of I / O ramming.
[0037] According to the technical solution provided by the embodiment of the present disclosure, by responding to the determination that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty according to the status information of the target I / O request, and determining that the sequence number of the latter target I / O request submission index in at least one pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is smaller than the sequence number of the former target I / O request submission index according to the hardware queue information of the target I / O request, the retention position of the target I / O request is determined to be the driver layer, and when the target I / O request is still retained in the driver layer and cannot be provided to the storage medium, the specific retention position of the target I / O request can be accurately determined, so that when further analysis is performed based on the retention position, the amount of data to be analyzed can be reduced, further improving the efficiency of determining the cause of the I / O ramming.
[0038] According to the technical solution provided by the embodiment of the present disclosure, in response to determining that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty according to the status information of the target I / O request, and according to the hardware queue information of the target I / O request, determining that the sequence number of the latter target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is greater than or equal to the sequence number of the previous target I / O request submission index, and at least one pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request completion queue If the sequence number of the subsequent target I / O request completion index in the target I / O request completion index is smaller than the sequence number of the previous target I / O request completion index, the target I / O request retention location is determined to be the storage medium. When the target I / O request is still retained in the corresponding storage medium and the storage medium fails to complete the operation corresponding to the target I / O request, such as a read or write operation, the specific retention location of the target I / O request can be accurately determined. Therefore, when further analysis is performed based on the retention location, the amount of data that needs to be analyzed can be reduced, thereby further improving the efficiency of determining the cause of the I / O ramming.
[0039] According to the technical solution provided by the embodiment of the present disclosure, in response to determining that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty according to the status information of the target I / O request, and according to the hardware queue information of the target I / O request, determining that the sequence number of the subsequent target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is greater than or equal to the sequence number of the previous target I / O request submission index, and the sequence number of the subsequent target I / O request submission index in any pair of consecutive target I / O request completion indexes corresponding to the target I / O request in the I / O request completion queue is greater than or equal to the sequence number of the previous target I / O request submission index. The sequence number of the completion index is greater than or equal to the sequence number of the completion index of the previous target I / O request, and the recovery state of the target I / O request is determined to be incomplete recovery based on the status information of the target I / O request, and the retention position of the target I / O request is determined to be the software recovery process. When the target I / O request is retained in the software recovery process, that is, the software recovery process fails to successfully release the resources occupied by the operating system in executing the target I / O request, the specific retention position of the target I / O request can be accurately determined, so that when further analysis is performed based on the retention position, the amount of data that needs to be analyzed can be reduced, further improving the efficiency of determining the cause of I / O ramming.
[0040] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the drawings:
[0042] Figure 1 A flowchart illustrating an input / output request detection method according to an embodiment of the present disclosure is shown;
[0043] Figure 2 A schematic block diagram of an input / output request detection system according to an embodiment of the present disclosure is shown;
[0044] Figure 3 A structural block diagram of an input / output request detection device according to an embodiment of the present disclosure is shown;
[0045] Figure 4 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;
[0046] Figure 5 It is a structural diagram of a computer system suitable for implementing the input / output request detection method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0047] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.
[0048] In the present disclosure, it should be understood that terms such as "including" or "having" are intended to indicate the presence of labels, numbers, steps, actions, components, parts, or combinations thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other labels, numbers, steps, actions, components, parts, or combinations thereof exist or are added.
[0049] It should also be noted that, in the absence of conflict, the embodiments and labels in the embodiments of the present disclosure can be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0050] In order to ensure that the user can read the data he needs to read from the target storage space, the inventors of the present disclosure have considered the following solutions.
[0051] The crash log can be obtained, and the I / O request that caused the I / O ram can be determined through corresponding tools. The information in the I / O request and the code related to the I / O request (such as the code of the software module called in response to the I / O request, etc.) can be obtained. Based on the crash log, the information in the I / O request and the code related to the I / O request, the corresponding analyst can perform analysis and determine the possible cause of the I / O ram based on the analysis results.
[0052] Disadvantages of this solution: Although the possible cause of I / O ramming can be determined in the above solution, the large amount of data analyzed based on the crash log, the information in the I / O request, and the code related to the I / O request takes a long time, making it impossible to determine the cause of the I / O ramming in a timely manner. This reduces the efficiency of determining the cause of the I / O ramming, reduces the stability of the operating system, and increases operation and maintenance costs.
[0053] Considering the shortcomings of the above solutions, the inventors of the present disclosure have proposed a new solution: this solution obtains the generation time of at least one input / output (I / O) request, and in response to the time difference between the generation time of the target I / O request and the current time being greater than or equal to a time difference threshold, obtains at least one item of status information of the target I / O request and hardware queue information of the target I / O request. Since the time difference between the generation time of the target I / O request and the current time being greater than or equal to the time difference threshold, the target I / O request can be understood as an I / O request that takes too long or is unresponsive, i.e., an I / O request that causes I / O throttling. By obtaining the status information of the target I / O request (the status information is used to indicate the status of the target I / O request and the time corresponding to the status), and the hardware queue information of the target I / O request (that is, the hardware queue information includes a queue of an index of at least one I / O request corresponding to the target storage medium, and the target storage medium is a storage medium for reading and writing data in response to the target I / O request), the retention position of the target I / O request is determined according to the status information of the target I / O request and at least one item of the hardware queue information of the target I / O request, that is, the position of the target I / O request that caused the I / O ramming when it failed to continue to be executed is determined. When further analysis is performed based on the retention position, the amount of data to be analyzed is relatively small, and the cause of the I / O ramming can be determined more accurately in a shorter time, thereby improving the efficiency of determining the cause of the I / O ramming, improving the stability of the operating system, and reducing operation and maintenance costs.
[0054] Figure 1 A flow chart of an input / output request detection method according to an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the input / output request detection method includes steps S101, S102, and S103.
[0055] In step S101 , the generation time of at least one input / output (I / O) request is obtained.
[0056] In step S102 , in response to the time difference between the generation time of the target I / O request and the current time being greater than or equal to the time difference threshold, at least one of the status information of the target I / O request and the hardware queue information of the target I / O request is obtained.
[0057] In step S103 , the retention location of the target I / O request is determined according to at least one of the state information of the target I / O request and the hardware queue information of the target I / O request.
[0058] In one embodiment of the present disclosure, an I / O request may be understood as an access to data stored on a storage medium, for writing or reading the accessed data.
[0059] In one embodiment of the present disclosure, the moment an I / O request is generated can be understood as the moment an I / O request is generated in the operating system, where the operating system may generate the I / O request in response to a corresponding instruction, or the corresponding process may generate the I / O request in the operating system. For example, when an application needs to read data, a process of the application may access the file system layer of the operating system kernel layer from the application layer through a system call and search the cache of the file system layer for the data to be read. If the corresponding data cannot be found, the process may create an I / O request at the file system layer.
[0060] In one embodiment of the present disclosure, obtaining the generation time of the I / O request may be understood as continuously scanning the I / O requests in the operating system and obtaining the generation time of the scanned I / O requests.
[0061] In one embodiment of the present disclosure, the time difference threshold can be understood as the maximum time that an I / O request is allowed to last. In particular, since an I / O request that can obtain the generation time can be understood as an I / O request that is still ongoing, and a completed I / O request generally cannot obtain the corresponding generation time, when the time difference between the generation time of the target I / O request and the current time is greater than or equal to the time difference threshold, it can be understood that the target I / O request is still ongoing and the duration has exceeded the maximum time that the I / O request is allowed to last. The time difference threshold can be pre-set or obtained from other devices or systems.
[0062] In one embodiment of the present disclosure, the status information of an I / O request can be understood as being used to indicate which state the I / O request is in, and the time corresponding to the state. For example, when an I / O request has begun to be executed, the status information of the I / O request can be used to indicate that the I / O request is in a state of starting to be executed; or, the status information of the I / O request can include only the time when the I / O request starts to be executed, and the time when the I / O request starts to be executed is used to indicate the earliest time when the I / O request is in a state of starting to be executed. For another example, when an I / O request has been completed, the status information of the I / O request can be used to indicate that the I / O request is in a state of execution completion; or, the status information of the I / O request can include only the time when the I / O request finishes execution, and the time when the I / O request starts to be executed is used to indicate the earliest time when the I / O request is in a state of execution completion.
[0063] In one embodiment of the present disclosure, the hardware queue information of the target I / O request can be understood as a queue including an index of at least one I / O request corresponding to the target storage medium, where the target storage medium is a storage medium for reading and writing data in response to the target I / O request. The indexed queue may include multiple request submission indexes, each request submission index corresponding to an I / O request submitted for read and write operations by the storage medium. The indexed queue may also include multiple completion indexes, each completion index corresponding to an I / O request submitted for read and write operations by the storage medium, and the read and write operations have been completed.
[0064] In one embodiment of the present disclosure, the retention location of the I / O request may be understood as the layer of the operating system that last executed the I / O request, or the storage medium that last executed the I / O request.
[0065] In one embodiment of the present disclosure, determining the retention position of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request can be understood as performing calculations based on a preset algorithm based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request, and determining the retention position of the target I / O request based on the calculation results; or, it can also be understood as obtaining a pre-trained model, taking at least one of the status information of the target I / O request and the hardware queue information of the target I / O request as input to obtain retention position indication information output by the model, and determining the retention position based on the retention position indication information.
[0066] For example, Figure 2 A schematic block diagram of an input / output request detection system according to an embodiment of the present disclosure is shown. The input / output request detection system is used to perform an input / output request detection method, such as Figure 2As shown, the input / output request detection system may include a dynamic scanning module 101, a data acquisition module 102, and a behavior analysis module 103. The dynamic scanning module 101 may include an I / O acquisition submodule 111 and an I / O filtering submodule 121, wherein the I / O acquisition submodule 111 may continuously scan the I / O requests in the operating system and obtain the generation time of the scanned I / O requests. The I / O filtering submodule 121 may obtain the current time and determine the target I / O request 104 whose time difference between the generation time and the current time is greater than or equal to a time difference threshold. The data acquisition module 102 may obtain at least one of the status information 114 of the target I / O request and the hardware queue information 124 of the target I / O request. The behavior analysis module 103 can analyze the status information of the target I / O request and the hardware queue information of the target I / O request to determine the retention position of the target I / O request and output the retention position 105, wherein the retention position of the target I / O request can be the target layer 113, which can be a layer in the operating system kernel software, and the retention position of the target I / O request can also be the target storage medium 123, which can be a storage medium used to read and write data in response to the target I / O request.
[0067] According to the technical solution provided by the embodiments of the present disclosure, by obtaining the generation time of at least one I / O request and, in response to the time difference between the generation time of the target I / O request and the current time being greater than or equal to a time difference threshold, obtaining at least one item of status information of the target I / O request and hardware queue information of the target I / O request. Since the time difference between the generation time of the target I / O request and the current time being greater than or equal to the time difference threshold, the target I / O request can be understood as an I / O request that takes too long or is unresponsive, i.e., an I / O request that causes I / O throttling. By obtaining the status information of the target I / O request (the status information is used to indicate the status of the target I / O request and the time corresponding to the status), and the hardware queue information of the target I / O request (that is, the hardware queue information includes a queue of an index of at least one I / O request corresponding to the target storage medium, and the target storage medium is a storage medium for reading and writing data in response to the target I / O request), the retention position of the target I / O request is determined according to the status information of the target I / O request and at least one item of the hardware queue information of the target I / O request, that is, the position of the target I / O request that caused the I / O ramming when it failed to continue to be executed is determined. When further analysis is performed based on the retention position, the amount of data to be analyzed is relatively small, and the cause of the I / O ramming can be determined more accurately in a shorter time, thereby improving the efficiency of determining the cause of the I / O ramming, improving the stability of the operating system, and reducing operation and maintenance costs.
[0068] In one embodiment of the present disclosure, in step S103, determining the retention position of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request can be achieved by the following steps:
[0069] In response to determining that the start execution time or the completion execution time of the target I / O request is 0 according to the status information of the target I / O request, or the start execution time or the completion execution time of the target I / O request is empty, it is determined that the retention location of the target I / O request is a block device (block) layer of the operating system kernel.
[0070] In one embodiment of the present disclosure, the start time of an I / O request can be understood as the time when disk reading or writing begins in response to the I / O request. The completion time of an I / O request can be understood as the time when disk reading or writing ends in response to the I / O request.
[0071] In one embodiment of the present disclosure, determining that the start execution time or the completion execution time of the target I / O request is 0, or that the start execution time or the completion execution time of the target I / O request is empty, based on the status information of the target I / O request, can be understood as parsing the status information of the target I / O request to obtain at least one of the start execution time of the target I / O request and the completion execution time of the target I / O request, and determining whether at least one of the obtained start execution time and the completion execution time is empty or 0.
[0072] In one embodiment of the present disclosure, the block device layer of the operating system kernel can be understood as a module interface used by applications and file systems in the operating system kernel to access various storage devices.
[0073] In one embodiment of the present disclosure, the target I / O request is retained at the block device layer of the operating system kernel. It can be understood that the block device layer of the operating system kernel is the last to execute the target I / O request, and the target I / O request has not yet been submitted to the driver layer.
[0074] According to the technical solution provided by the embodiments of the present disclosure, by determining that the start execution time or the completion execution time of the target I / O request is 0, or the start execution time or the completion execution time of the target I / O request is empty in response to the status information of the target I / O request, the retention position of the target I / O request is determined to be the block device layer of the operating system kernel. When the target I / O request is retained in the block device layer and has not yet been sent down to the driver layer, the specific retention position of the target I / O request can be accurately determined, so that when further analysis is performed based on the retention position, the amount of data to be analyzed can be reduced, further improving the efficiency of determining the cause of the I / O ramming.
[0075] In one embodiment of the present disclosure, in step S103, determining the retention position of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request can be achieved by the following steps:
[0076] In response to determining, based on status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on hardware queue information of the target I / O request, determining that the I / O request submission queue does not include a target I / O request submission index corresponding to the target I / O request, it is determined that the retention location of the target I / O request is the driver layer.
[0077] In one embodiment of the present disclosure, an I / O request submission index can be understood as an I / O request submitted to a corresponding storage medium for read or write operations. An I / O request submission queue can be understood as a queue including multiple I / O request submission indexes. The storage medium corresponding to an I / O request submission queue can sequentially perform read or write operations based on the I / O requests corresponding to the request submission indexes in the I / O request submission queue.
[0078] In one embodiment of the present disclosure, determining that the target I / O request submission index corresponding to the target I / O request is not included in the I / O request submission queue based on the hardware queue information of the target I / O request can be understood as parsing the hardware queue information of the target I / O request to obtain the I / O request submission queue, and determining whether the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request.
[0079] In one embodiment of the present disclosure, when it is determined based on the status information of the target I / O request that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, it is determined based on the hardware queue information of the target I / O request whether the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request; it is also possible that when it is determined based on the status information of the target I / O request that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, it is determined based on the hardware queue information of the target I / O request whether the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request. The present disclosure does not make any specific limitations on this.
[0080] In one embodiment of the present disclosure, the driver layer can be understood as providing an operating interface of the storage medium for the corresponding program and implementing a driver program of the storage medium. When performing read and write operations on the storage medium, it can be achieved by calling the interface of the corresponding driver program.
[0081] In one embodiment of the present disclosure, the target I / O request is retained at the driver layer. This means that the driver layer is the last to execute the target I / O request, and the target I / O request has not yet been submitted to the corresponding storage medium.
[0082] According to the technical solution provided by the embodiment of the present disclosure, by responding to the determination that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty according to the status information of the target I / O request, and determining that the I / O request submission queue does not include the target I / O request submission index corresponding to the target I / O request according to the hardware queue information of the target I / O request, and determining that the retention position of the target I / O request is the driver layer, the specific retention position of the target I / O request can be accurately determined when the target I / O request is still retained in the driver layer and cannot be provided to the storage medium, so that when further analysis is performed based on the retention position, the amount of data to be analyzed can be reduced, further improving the efficiency of determining the cause of the I / O ramming.
[0083] In one embodiment of the present disclosure, in step S103, determining the retention position of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request can be achieved by the following steps:
[0084] In response to determining, based on status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on hardware queue information of the target I / O request, determining that the I / O request submission queue includes a target I / O request submission index corresponding to the target I / O request, and the I / O request completion queue does not include a target I / O request completion index corresponding to the target I / O request, it is determined that the retention location of the target I / O request is a storage medium.
[0085] In one embodiment of the present disclosure, an I / O request completion index can be understood as an I / O request that has been submitted to a corresponding storage medium for a read or write operation and has completed the read or write operation. An I / O request completion queue can be understood as a queue including multiple I / O request completion indexes. After completing the read or write operation corresponding to a particular I / O request, the storage medium corresponding to the I / O request completion queue can add the request completion index corresponding to the I / O request to the I / O request completion queue.
[0086] In one embodiment of the present disclosure, it is determined based on the hardware queue information of the target I / O request that the target I / O request completion index corresponding to the target I / O request is not included in the I / O request completion queue. This can be understood as parsing the hardware queue information of the target I / O request to obtain the I / O request completion queue, and determining whether the I / O request completion queue includes the target I / O request completion index corresponding to the target I / O request.
[0087] In one embodiment of the present disclosure, when it is determined based on the status information of the target I / O request that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, it is determined based on the hardware queue information of the target I / O request whether the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request, and when it is determined based on the hardware queue information of the target I / O request that the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request, it is determined based on the hardware queue information of the target I / O request whether the I / O request completion queue includes the target I / O request submission index corresponding to the target I / O request. Whether it includes the target I / O request completion index corresponding to the target I / O request; it is also possible to determine whether the start execution time and the completion execution time of the target I / O request are both non-0 and non-empty based on the status information of the target I / O request, and at the same time determine whether the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request based on the hardware queue information of the target I / O request, and whether the I / O request completion queue includes the target I / O request completion index corresponding to the target I / O request based on the hardware queue information of the target I / O request. The present disclosure does not make specific limitations on this.
[0088] In one embodiment of the present disclosure, the target I / O request is retained in a storage medium, which may be understood as the storage medium failing to complete an operation corresponding to the target I / O request, such as a read or write operation.
[0089] According to the technical solution provided by the embodiment of the present disclosure, by responding to the determination that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty according to the status information of the target I / O request, and determining according to the hardware queue information of the target I / O request that the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request, and the I / O request completion queue does not include the target I / O request completion index corresponding to the target I / O request, and determining that the retention location of the target I / O request is the storage medium, when the target I / O request is still retained in the corresponding storage medium, that is, the storage medium fails to complete the operation corresponding to the target I / O request, such as the read and write operation, the specific retention location of the target I / O request can be accurately determined, so that when further analysis is performed based on the retention location, the amount of data to be analyzed can be reduced, further improving the efficiency of determining the cause of the I / O ramming.
[0090] In one embodiment of the present disclosure, in step S103, determining the retention position of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request can be achieved by the following steps:
[0091] In response to determining, based on the status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on the hardware queue information of the target I / O request, determining that the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request, and the I / O request completion queue includes the target I / O request completion index corresponding to the target I / O request, and based on the status information of the target I / O request, determining that the recovery status of the target I / O request is incomplete recovery, determining that the retention position of the target I / O request is a software recovery process.
[0092] In one embodiment of the present disclosure, determining that the recycling status of the target I / O request is incomplete recycling based on the status information of the target I / O request can be understood as parsing the status information of the target I / O request to obtain the recycling status of the target I / O request, and determining whether the obtained recycling status is incomplete recycling.
[0093] In one embodiment of the present disclosure, when it is determined based on the status information of the target I / O request that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, it is determined based on the hardware queue information of the target I / O request whether the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request, and when it is determined based on the hardware queue information of the target I / O request that the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request, it is determined based on the hardware queue information of the target I / O request whether the I / O request completion queue includes the target I / O request completion index corresponding to the target I / O request, and when it is determined based on the hardware queue information of the target I / O request that the I / O request completion queue includes the target I / O request submission index corresponding to the target I / O request, When the target I / O request completes the index, it is determined whether the recovery status of the target I / O request is incomplete recovery based on the status information of the target I / O request; it is also possible to determine whether the start execution time and the completion execution time of the target I / O request are both non-zero and non-empty based on the status information of the target I / O request, and at the same time, determine whether the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request based on the hardware queue information of the target I / O request, and at the same time, determine whether the I / O request completion queue includes the target I / O request completion index corresponding to the target I / O request based on the hardware queue information of the target I / O request, and at the same time, determine whether the recovery status of the target I / O request is incomplete recovery based on the status information of the target I / O request. The present disclosure does not make specific limitations on this.
[0094] In one embodiment of the present disclosure, the software recycling process can be understood as a process for releasing resources occupied by the operating system in executing corresponding I / O requests, such as cache resources, disk resources, computing resources, etc.
[0095] In one embodiment of the present disclosure, the retention location of the target I / O request is the software recovery process, which can be understood as that when the storage medium completes the operation corresponding to the target I / O request, such as read and write operations, the corresponding software recovery process is not successfully completed, that is, the resources occupied by the operating system in executing the target I / O request are not successfully released.
[0096] According to the technical solution provided by the embodiment of the present disclosure, by responding to the determination that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty according to the status information of the target I / O request, and determining that the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request, and the I / O request completion queue includes the target I / O request completion index corresponding to the target I / O request according to the hardware queue information of the target I / O request, and determining that the recovery status of the target I / O request is incomplete recovery according to the status information of the target I / O request, and determining that the retention position of the target I / O request is the software recovery process, the specific retention position of the target I / O request can be accurately determined when the target I / O request is retained in the software recovery process, that is, the software recovery process fails to successfully release the resources occupied by the operating system in executing the target I / O request, so that when further analysis is performed based on the retention position, the amount of data to be analyzed can be reduced, further improving the efficiency of determining the cause of I / O ramming.
[0097] In one embodiment of the present disclosure, in step S103, determining the retention position of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request can be achieved by the following steps:
[0098] In response to determining, based on status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on hardware queue information of the target I / O request, determining that a sequence number of a latter target I / O request submission index in at least one pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is smaller than a sequence number of a former target I / O request submission index, it is determined that the retention position of the target I / O request is the driver layer.
[0099] In one embodiment of the present disclosure, an I / O request submission index can be understood as an I / O request that is submitted to a corresponding storage medium for read and write operations. An I / O request submission queue can be understood as a queue including multiple I / O request submission indexes. The storage medium corresponding to the I / O request submission queue can sequentially perform read and write operations according to the I / O requests corresponding to the request submission index in the I / O request submission queue. The sequence number of the I / O request submission index can be understood as an order for indicating the order in which the I / O request submission index is added to the I / O request submission queue. For example, the sequence number of the I / O request submission index added to the I / O request submission queue at the first moment is smaller than the sequence number of the I / O request submission index added to the I / O request submission queue at the second moment, wherein the first moment is earlier than the second moment.
[0100] In one embodiment of the present disclosure, determining that the target I / O request submission index corresponding to the target I / O request is not included in the I / O request submission queue based on the hardware queue information of the target I / O request can be understood as parsing the hardware queue information of the target I / O request to obtain the I / O request submission queue, and determining whether the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request.
[0101] In one embodiment of the present disclosure, when it is determined based on the status information of the target I / O request that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, it is determined based on the hardware queue information of the target I / O request whether the I / O request submission queue includes at least one pair of consecutive target I / O request submission indexes corresponding to the target I / O request, and the sequence number of the latter target I / O request submission index in the pair of target I / O request submission indexes is smaller than the sequence number of the former target I / O request submission index. Alternatively, when it is determined based on the status information of the target I / O request that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, it is determined based on the hardware queue information of the target I / O request whether the I / O request submission queue includes at least one pair of consecutive target I / O request submission indexes corresponding to the target I / O request, and the sequence number of the latter target I / O request submission index in the pair of target I / O request submission indexes is smaller than the sequence number of the former target I / O request submission index. This disclosure does not specifically limit this.
[0102] In one embodiment of the present disclosure, the driver layer can be understood as providing an operating interface of the storage medium for the corresponding program and implementing a driver program of the storage medium. When performing read and write operations on the storage medium, it can be achieved by calling the interface of the corresponding driver program.
[0103] In one embodiment of the present disclosure, the target I / O request is retained at the driver layer. This means that the driver layer is the last to execute the target I / O request, and the target I / O request has not yet been submitted to the corresponding storage medium.
[0104] According to the technical solution provided by the embodiment of the present disclosure, by responding to the determination that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty according to the status information of the target I / O request, and determining that the sequence number of the latter target I / O request submission index in at least one pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is smaller than the sequence number of the former target I / O request submission index according to the hardware queue information of the target I / O request, the retention position of the target I / O request is determined to be the driver layer, and when the target I / O request is still retained in the driver layer and cannot be provided to the storage medium, the specific retention position of the target I / O request can be accurately determined, so that when further analysis is performed based on the retention position, the amount of data to be analyzed can be reduced, further improving the efficiency of determining the cause of the I / O ramming.
[0105] In one embodiment of the present disclosure, in step S103, determining the retention position of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request can be achieved by the following steps:
[0106] In response to determining, based on status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on hardware queue information of the target I / O request, determining that the sequence number of the latter target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is greater than or equal to the sequence number of the former target I / O request submission index, and that the sequence number of the latter target I / O request completion index in at least one pair of consecutive target I / O request completion indexes corresponding to the target I / O request in the I / O request completion queue is less than the sequence number of the former target I / O request completion index, it is determined that the retention location of the target I / O request is the storage medium.
[0107] In one embodiment of the present disclosure, an I / O request completion index can be understood as an I / O request that is submitted to a corresponding storage medium for a read / write operation and the read / write operation has been completed. An I / O request completion queue can be understood as a queue including multiple I / O request completion indexes. After completing the read / write operation corresponding to a certain I / O request, the storage medium corresponding to the I / O request completion queue can add the request completion index corresponding to the I / O request to the I / O request completion queue, and generate a corresponding serial number according to the order of adding to the I / O request completion queue. For example, the serial number of the I / O request completion index added to the I / O request completion queue at the third moment is smaller than the serial number of the I / O request completion index added to the I / O request completion queue at the fourth moment, where the third moment is earlier than the fourth moment.
[0108] In one embodiment of the present disclosure, it is determined based on the hardware queue information of the target I / O request that the target I / O request completion index corresponding to the target I / O request is not included in the I / O request completion queue. This can be understood as parsing the hardware queue information of the target I / O request to obtain the I / O request completion queue, and determining whether the I / O request completion queue includes the target I / O request completion index corresponding to the target I / O request.
[0109] In one embodiment of the present disclosure, when it is determined based on the status information of the target I / O request that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, it is determined based on the hardware queue information of the target I / O request whether the I / O request submission queue includes at least one pair of consecutive target I / O request submission indexes corresponding to the target I / O request, and the sequence number of the latter target I / O request submission index in the pair of target I / O request submission indexes is greater than or equal to the sequence number of the former target I / O request submission index; when it is determined based on the hardware queue information of the target I / O request that the sequence number of the latter target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is greater than or equal to the sequence number of the former target I / O request submission index, it is determined based on the hardware queue information of the target I / O request whether the I / O request completion queue includes at least one pair of consecutive target I / O request completion indexes corresponding to the target I / O request. index, and the sequence number of the latter target I / O request completion index in the pair of target I / O request completion indexes is smaller than the sequence number of the former target I / O request completion index; it is also possible to determine whether the start execution time and the completion execution time of the target I / O request are both non-zero and non-empty according to the status information of the target I / O request, and determine whether the I / O request submission queue includes at least one pair of consecutive target I / O request submission indexes corresponding to the target I / O request, and the sequence number of the latter target I / O request submission index in the pair of target I / O request submission indexes is greater than or equal to the sequence number of the former target I / O request submission index, and determine whether the I / O request completion queue includes at least one pair of consecutive target I / O request completion indexes corresponding to the target I / O request, and the sequence number of the latter target I / O request completion index is smaller than the sequence number of the former target I / O request completion index according to the hardware queue information of the target I / O request. The present disclosure does not make specific limitations on this.
[0110] In one embodiment of the present disclosure, the target I / O request is retained in a storage medium, which may be understood as the storage medium failing to complete an operation corresponding to the target I / O request, such as a read or write operation.
[0111] According to the technical solution provided by the embodiment of the present disclosure, in response to determining that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty according to the status information of the target I / O request, and according to the hardware queue information of the target I / O request, determining that the sequence number of the latter target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is greater than or equal to the sequence number of the previous target I / O request submission index, and at least one pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request completion queue If the sequence number of the subsequent target I / O request completion index in the target I / O request completion index is smaller than the sequence number of the previous target I / O request completion index, the target I / O request retention location is determined to be the storage medium. When the target I / O request is still retained in the corresponding storage medium and the storage medium fails to complete the operation corresponding to the target I / O request, such as a read or write operation, the specific retention location of the target I / O request can be accurately determined. Therefore, when further analysis is performed based on the retention location, the amount of data that needs to be analyzed can be reduced, thereby further improving the efficiency of determining the cause of the I / O ramming.
[0112] In one embodiment of the present disclosure, in step S103, determining the retention position of the target I / O request based on at least one of the status information of the target I / O request and the hardware queue information of the target I / O request can be achieved by the following steps:
[0113] In response to determining, based on the status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on the hardware queue information of the target I / O request, determining that the sequence number of a latter target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is greater than or equal to the sequence number of a former target I / O request submission index, and that the sequence number of a latter target I / O request completion index in any pair of consecutive target I / O request completion indexes corresponding to the target I / O request in the I / O request completion queue is greater than or equal to the sequence number of the former target I / O request completion index, and determining, based on the status information of the target I / O request, that the recovery status of the target I / O request is incomplete recovery, it is determined that the retention position of the target I / O request is a software recovery process.
[0114] In one embodiment of the present disclosure, determining that the recycling status of the target I / O request is incomplete recycling based on the status information of the target I / O request can be understood as parsing the status information of the target I / O request to obtain the recycling status of the target I / O request, and determining whether the obtained recycling status is incomplete recycling.
[0115] In one embodiment of the present disclosure, when it is determined based on the status information of the target I / O request that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, it is determined based on the hardware queue information of the target I / O request whether the I / O request submission queue includes at least one pair of consecutive target I / O request submission indexes corresponding to the target I / O request and the sequence number of the latter target I / O request submission index in the pair of target I / O request submission indexes is greater than or equal to the sequence number of the former target I / O request submission index. When the sequence number of the latter target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the submission queue is greater than or equal to the sequence number of the former target I / O request submission index, determine, based on the hardware queue information of the target I / O request, whether the I / O request completion queue includes at least one pair of consecutive target I / O request completion indexes corresponding to the target I / O request, and the sequence number of the latter target I / O request completion index in the pair of target I / O request completion indexes is greater than or equal to the sequence number of the former target I / O request completion index. When the sequence number of the latter target I / O request completion index in any pair of consecutive target I / O request completion indexes corresponding to the target I / O request is greater than or equal to the sequence number of the previous target I / O request completion index, it is determined whether the recycling state of the target I / O request is incomplete recycling according to the status information of the target I / O request; it is also possible to determine whether the start execution time and the completion execution time of the target I / O request are both not 0 and not empty according to the status information of the target I / O request, and whether the I / O request submission queue includes at least one pair of consecutive target I / O request completion indexes corresponding to the target I / O request according to the hardware queue information of the target I / O request. The target I / O request submission index corresponding to the target I / O request is determined, and the sequence number of the latter target I / O request submission index in the pair of target I / O request submission indexes is greater than or equal to the sequence number of the previous target I / O request submission index. At the same time, it is determined based on the hardware queue information of the target I / O request whether the I / O request completion queue includes at least one pair of consecutive target I / O request completion indexes corresponding to the target I / O request, and the sequence number of the latter target I / O request completion index in the pair of target I / O request completion indexes is greater than or equal to the sequence number of the previous target I / O request completion index. This disclosure does not make any specific limitations on this.
[0116] In one embodiment of the present disclosure, the software recycling process can be understood as a process for releasing resources occupied by the operating system in executing corresponding I / O requests, such as cache resources, disk resources, computing resources, etc.
[0117] In one embodiment of the present disclosure, the retention location of the target I / O request is the software recovery process, which can be understood as that when the storage medium completes the operation corresponding to the target I / O request, such as read and write operations, the corresponding software recovery process is not successfully completed, that is, the resources occupied by the operating system in executing the target I / O request are not successfully released.
[0118] According to the technical solution provided by the embodiment of the present disclosure, in response to determining that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty according to the status information of the target I / O request, and according to the hardware queue information of the target I / O request, determining that the sequence number of the subsequent target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is greater than or equal to the sequence number of the previous target I / O request submission index, and the sequence number of the subsequent target I / O request submission index in any pair of consecutive target I / O request completion indexes corresponding to the target I / O request in the I / O request completion queue is greater than or equal to the sequence number of the previous target I / O request submission index. The sequence number of the completion index is greater than or equal to the sequence number of the completion index of the previous target I / O request, and the recovery state of the target I / O request is determined to be incomplete recovery based on the status information of the target I / O request, and the retention position of the target I / O request is determined to be the software recovery process. When the target I / O request is retained in the software recovery process, that is, the software recovery process fails to successfully release the resources occupied by the operating system in executing the target I / O request, the specific retention position of the target I / O request can be accurately determined, so that when further analysis is performed based on the retention position, the amount of data that needs to be analyzed can be reduced, further improving the efficiency of determining the cause of I / O ramming.
[0119] The following reference Figure 3 Describe an input / output request detection device according to an embodiment of the present disclosure, Figure 3 A structural block diagram of an input / output request detection device according to an embodiment of the present disclosure is shown.
[0120] like Figure 3 As shown, the input / output request detection device 200 includes:
[0121] The execution start time acquisition module 201 is configured to acquire the generation time of at least one input / output (I / O) request.
[0122] The target information acquisition module 202 is configured to obtain at least one of the status information of the target I / O request and the hardware queue information of the target I / O request in response to the time difference between the generation time of the target I / O request and the current time being greater than or equal to the time difference threshold.
[0123] The retention position determining module 203 is configured to determine the retention position of the target I / O request according to at least one of the state information of the target I / O request and the hardware queue information of the target I / O request.
[0124] According to the technical solution provided by the embodiments of the present disclosure, by obtaining the generation time of at least one input / output (I / O) request and in response to the time difference between the generation time of the target I / O request and the current time being greater than or equal to a time difference threshold, at least one item of status information of the target I / O request and hardware queue information of the target I / O request is obtained. Since the time difference between the generation time of the target I / O request and the current time being greater than or equal to the time difference threshold, the target I / O request can be understood as an I / O request that takes too long or is unresponsive, i.e., an I / O request that causes I / O throttling. By obtaining the status information of the target I / O request (the status information is used to indicate the status of the target I / O request and the time corresponding to the status), and the hardware queue information of the target I / O request (that is, the hardware queue information includes a queue of an index of at least one I / O request corresponding to the target storage medium, and the target storage medium is a storage medium for reading and writing data in response to the target I / O request), the retention position of the target I / O request is determined according to the status information of the target I / O request and at least one item of the hardware queue information of the target I / O request, that is, the position of the target I / O request that caused the I / O ramming when it failed to continue to be executed is determined. When further analysis is performed based on the retention position, the amount of data to be analyzed is relatively small, and the cause of the I / O ramming can be determined more accurately in a shorter time, thereby improving the efficiency of determining the cause of the I / O ramming, improving the stability of the operating system, and reducing operation and maintenance costs.
[0125] Those skilled in the art will understand that referring to Figure 3 The technical solution described can be combined with any of the embodiments described above to achieve the technical effects achieved by any of the embodiments described above. The specific contents can refer to the description of the above embodiments, and the specific contents will not be repeated here.
[0126] Figure 4 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0127] The present disclosure also provides an electronic device, such as Figure 4 As shown, the electronic device 300 includes at least one processor 301; and a memory 302 in communication with the at least one processor 301; wherein the memory 302 stores instructions that can be executed by the at least one processor 301, and the instructions are executed by the at least one processor 301 to implement the following steps:
[0128] Get the time when at least one input / output (I / O) request was generated;
[0129] In response to a time difference between a generation time of the target I / O request and the current time being greater than or equal to a time difference threshold, obtaining at least one of status information of the target I / O request and hardware queue information of the target I / O request;
[0130] The retention position of the target I / O request is determined according to at least one of the state information of the target I / O request and the hardware queue information of the target I / O request.
[0131] In one embodiment of the present disclosure, determining the retention location of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0132] In response to determining that the start execution time or the completion execution time of the target I / O request is 0 according to the status information of the target I / O request, or the start execution time or the completion execution time of the target I / O request is empty, it is determined that the retention location of the target I / O request is a block device (block) layer of the operating system kernel.
[0133] In one embodiment of the present disclosure, determining the retention location of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0134] In response to determining, based on status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on hardware queue information of the target I / O request, determining that the I / O request submission queue does not include a target I / O request submission index corresponding to the target I / O request, it is determined that the retention location of the target I / O request is the driver layer.
[0135] In one embodiment of the present disclosure, determining the retention location of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0136] In response to determining, based on status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on hardware queue information of the target I / O request, determining that the I / O request submission queue includes a target I / O request submission index corresponding to the target I / O request, and the I / O request completion queue does not include a target I / O request completion index corresponding to the target I / O request, it is determined that the retention location of the target I / O request is a storage medium.
[0137] In one embodiment of the present disclosure, determining the retention location of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0138] In response to determining, based on the status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on the hardware queue information of the target I / O request, determining that the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request, and the I / O request completion queue includes the target I / O request completion index corresponding to the target I / O request, and based on the status information of the target I / O request, determining that the recovery status of the target I / O request is incomplete recovery, determining that the retention position of the target I / O request is a software recovery process.
[0139] In one embodiment of the present disclosure, determining the retention location of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0140] In response to determining, based on status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on hardware queue information of the target I / O request, determining that a sequence number of a latter target I / O request submission index in at least one pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is smaller than a sequence number of a former target I / O request submission index, it is determined that the retention position of the target I / O request is the driver layer.
[0141] In one embodiment of the present disclosure, determining the retention location of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0142] In response to determining, based on status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on hardware queue information of the target I / O request, determining that the sequence number of the latter target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is greater than or equal to the sequence number of the former target I / O request submission index, and that the sequence number of the latter target I / O request completion index in at least one pair of consecutive target I / O request completion indexes corresponding to the target I / O request in the I / O request completion queue is less than the sequence number of the former target I / O request completion index, it is determined that the retention location of the target I / O request is the storage medium.
[0143] In one embodiment of the present disclosure, determining the retention location of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes:
[0144] In response to determining, based on the status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on the hardware queue information of the target I / O request, determining that the sequence number of a latter target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is greater than or equal to the sequence number of a former target I / O request submission index, and that the sequence number of a latter target I / O request completion index in any pair of consecutive target I / O request completion indexes corresponding to the target I / O request in the I / O request completion queue is greater than or equal to the sequence number of the former target I / O request completion index, and determining, based on the status information of the target I / O request, that the recovery status of the target I / O request is incomplete recovery, it is determined that the retention position of the target I / O request is a software recovery process.
[0145] Figure 5 It is a structural diagram of a computer system suitable for implementing the input / output request detection method according to an embodiment of the present disclosure.
[0146] like Figure 5 As shown, the computer operating system 400 includes a processing unit 401, which can execute various processes in the embodiments shown in the above figures according to the programs stored in the read-only memory (ROM) 402 or the programs loaded from the storage unit 408 to the random access memory (RAM) 403. Various programs and data required for the operation of the operating system 400 are also stored in the RAM 403. The CPU 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0147] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed so that a computer program read therefrom can be installed into the storage section 408 as needed. Among them, the processing unit 401 can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, an NPU, etc.
[0148] In particular, according to an embodiment of the present disclosure, the method described above with reference to the accompanying drawings can be implemented as a computer software program. Exemplarily, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a readable medium thereof, wherein the computer program includes program code for executing the method in the accompanying drawings. In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion 409, and / or installed from a removable medium 411. Exemplarily, an embodiment of the present disclosure includes a readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the program code for executing the method in the accompanying drawings.
[0149] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of the operating systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each box in the diagram or block diagram can represent a module, program segment, or part of a code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the boxes can also occur in an order different from that marked in the accompanying drawings. For example, two boxes shown in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, as well as the combination of boxes in the block diagram and / or flow chart, can be implemented using a dedicated hardware-based operating system that performs the specified functions or operations, or can be implemented using a combination of dedicated hardware and computer instructions.
[0150] The units or modules involved in the embodiments described in this disclosure may be implemented in software or hardware. The units or modules described may also be provided in a processor, and the names of these units or modules do not, in certain circumstances, constitute limitations on the units or modules themselves.
[0151] As another aspect, the present disclosure further provides a computer-readable storage medium. This computer-readable storage medium may be included in the node described in the above embodiments, or may be a standalone computer-readable storage medium not incorporated into a device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the methods described in the present disclosure.
[0152] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in this disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the inventive concept. The above-mentioned exemplary features are replaced with (but not limited to) technical features with similar functions disclosed in this disclosure by mutual substitution.
Claims
1. A method for detecting an input / output request, wherein: The method comprises: Obtain the time when at least one input / output (I / O) request is generated in the operating system; In response to a time difference between a generation time of a target I / O request and a current time being greater than or equal to a time difference threshold, obtaining at least one of status information of the target I / O request and hardware queue information of the target I / O request; wherein the status information of the target I / O request is used to indicate a status of the target I / O request and a time corresponding to the status; and the hardware queue information of the target I / O request is a queue including an index of at least one I / O request corresponding to a target storage medium; The retention position of the target I / O request is determined according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request.
2. The input / output request detection method according to claim 1, wherein: The determining the retention position of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes: In response to determining, based on the status information of the target I / O request, that the start execution time or the completion execution time of the target I / O request is 0, or that the start execution time or the completion execution time of the target I / O request is empty, determining that the retention location of the target I / O request is a block device layer of the operating system kernel.
3. The input / output request detection method according to claim 1, wherein: The determining the retention position of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes: In response to determining, based on the status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on the hardware queue information of the target I / O request, determining that the I / O request submission queue does not include the target I / O request submission index corresponding to the target I / O request, it is determined that the retention position of the target I / O request is the driver layer.
4. The input / output request detection method according to claim 1, wherein: The determining the retention position of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes: In response to determining, based on the status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on the hardware queue information of the target I / O request, determining that the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request, and the I / O request completion queue does not include the target I / O request completion index corresponding to the target I / O request, it is determined that the retention location of the target I / O request is a storage medium.
5. The input / output request detection method according to claim 1, wherein: The determining the retention position of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes: In response to determining, based on the status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on the hardware queue information of the target I / O request, determining that the I / O request submission queue includes the target I / O request submission index corresponding to the target I / O request, and the I / O request completion queue includes the target I / O request completion index corresponding to the target I / O request, and based on the status information of the target I / O request, determining that the recovery status of the target I / O request is incomplete recovery, determining that the retention position of the target I / O request is a software recovery process.
6. The input / output request detection method according to claim 1, wherein: The determining the retention position of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes: In response to determining, based on the status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on the hardware queue information of the target I / O request, determining that the sequence number of the latter target I / O request submission index in at least one pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is smaller than the sequence number of the former target I / O request submission index, it is determined that the retention position of the target I / O request is the driver layer.
7. The input / output request detection method according to claim 1, wherein: The determining the retention position of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes: In response to determining, based on the status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on the hardware queue information of the target I / O request, determining that the sequence number of the latter target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is greater than or equal to the sequence number of the former target I / O request submission index, and that the sequence number of the latter target I / O request completion index in at least one pair of consecutive target I / O request completion indexes corresponding to the target I / O request in the I / O request completion queue is less than the sequence number of the former target I / O request completion index, it is determined that the retention location of the target I / O request is a storage medium.
8. The input / output request detection method according to claim 1, wherein: The determining the retention position of the target I / O request according to at least one of the status information of the target I / O request and the hardware queue information of the target I / O request includes: In response to determining, based on the status information of the target I / O request, that the start execution time and the completion execution time of the target I / O request are neither 0 nor empty, and based on the hardware queue information of the target I / O request, determining that the sequence number of the latter target I / O request submission index in any pair of consecutive target I / O request submission indexes corresponding to the target I / O request in the I / O request submission queue is greater than or equal to the sequence number of the previous target I / O request submission index, and that the sequence number of the latter target I / O request completion index in any pair of consecutive target I / O request completion indexes corresponding to the target I / O request in the I / O request completion queue is greater than or equal to the sequence number of the previous target I / O request completion index, and determining, based on the status information of the target I / O request, that the recovery status of the target I / O request is incomplete recovery, it is determined that the retention position of the target I / O request is a software recovery process.
9. An input / output request detection device, wherein: The device comprises: A start execution time acquisition module is configured to acquire a generation time of at least one input / output (I / O) request generated in the operating system; a target information acquisition module configured to, in response to a time difference between a generation time of a target I / O request and a current time being greater than or equal to a time difference threshold, acquire at least one of status information of the target I / O request and hardware queue information of the target I / O request; wherein the status information of the target I / O request indicates a status of the target I / O request and a time corresponding to the status; and the hardware queue information of the target I / O request is a queue including an index of at least one I / O request corresponding to a target storage medium; The retention position determination module is configured to determine the retention position of the target I / O request according to at least one of the state information of the target I / O request and the hardware queue information of the target I / O request.
10. An electronic device, wherein: The method comprises a memory and at least one processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the at least one processor to implement the method steps described in any one of claims 1 to 8.
11. A computer-readable storage medium having computer instructions stored thereon, wherein: When the computer instructions are executed by a processor, the method steps described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Hard disk hang-up fault detection and processing methods and apparatuses for distributed storage system
CN107273231A