Slow disk detection method, device and equipment

Through the tracking point mechanism and cache queue statistics in the kernel state, resource saving and flexibility improvement of hard disk latency detection are achieved, which solves the problems of high resource consumption and poor adaptability of traditional methods, and improves system performance and adaptability.

CN118567927APending Publication Date: 2024-08-30XINHUASAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410777888.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Traditional hard disk latency detection methods consume a lot of resources and cannot adapt to disk hot swapping in real time, affecting system performance and adaptability.

Method used

The tracking point mechanism in the kernel state is used to register the I/O completion callback function, the I/O delay is counted through the cache queue, slow disks are determined based on the preset strategy, and the hard disk list is dynamically updated to reduce resource consumption and improve flexibility.

Benefits of technology

It reduces the consumption of detection resources, reduces the impact on I/O performance, improves the flexibility and intelligence of monitoring disk hot-plug scenarios, and reduces the load on the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567927A
    Figure CN118567927A
Patent Text Reader

Abstract

The invention provides a slow disk detection method, device and equipment, which are used for solving the technical problem of relatively high resource consumption of hard disk time delay detection. According to the method, fine detection and statistics of I / O time delay are realized based on a tracking point mechanism of a kernel mode, a blktrace tool does not need to be used and adapted, a detection thread does not need to be created for each disk and CPU, resource and memory consumption during detection starting is reduced, and the influence on I / O performance is reduced. In addition, for dynamic monitoring in a disk hot plug scene, the flexibility and intelligence of detection are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technology, and in particular to a slow disk detection method, device and equipment. Background Art

[0002] In large-scale distributed systems and real-time systems, accurate monitoring and analysis of hard disk performance is crucial for system performance optimization and troubleshooting. However, traditional hard disk latency detection methods have some challenges, such as difficulty in latency tracking across multiple components, long intermediate software stack paths, and significant impact on real-time performance.

[0003] In the application scenario using Linux system, the tool blktrace, which tracks the I / O operation of block devices on Linux system, is usually used to obtain I / O latency information in user state. To adapt to the principle of blktrace tool, a thread is created for each disk and each CPU in user state, and the I / O control function ioctl is used to control blktrace and obtain information of each process stage of I / O. Then, each I / O information is managed through red-black tree structure, and these data structures are analyzed in real time. When the disk is found to have too high latency, the disk slow event is reported to the upper storage system through the existing event reporting channel.

[0004] The above-mentioned hard disk latency detection solution has several defects. First, in order to monitor I / O latency in real time, this solution needs to start threads for each disk and each CPU, which will consume a lot of system resources. Secondly, in order to analyze I / O data in real time, this solution uses a red-black tree data structure to store I / O data, which will cause a large amount of memory usage when the business load is large. Thirdly, this solution does not adapt to the hot plug of disks in user mode, resulting in the need to restart the module after each hot plug, and its adaptability and intelligence are poor. Summary of the invention

[0005] In view of this, the present invention provides a slow disk detection method, device and equipment for solving the technical problem of large consumption of hard disk delay detection resources.

[0006] According to one aspect of an embodiment of the present invention, the present invention provides a slow disk detection method, the method comprising:

[0007] During the initialization process, the I / O completion callback function for capturing I / O completion events (I / OComplete) is registered based on the tracepoint mechanism, and a list of hard disks to be monitored is created;

[0008] The I / O completion event is captured through the I / O completion callback function, the latency value from the issuance to the completion of the I / O request is calculated, and the latency value is stored in the cache queue in the form of an I / O record, wherein the I / O record includes at least the hard disk information and latency value for processing the I / O request;

[0009] According to the I / O records stored in the cache queue, the number of timed I / Os and the total number of I / Os of each hard disk in the hard disk list are counted, and whether a slow disk is generated is determined periodically based on the statistical results and the preset slow disk determination strategy;

[0010] When a slow disk is detected, the detected slow disk information is reported to the upper device management module in the user state.

[0011] Furthermore, the method of capturing the I / O completion event through the I / O completion callback function and calculating the delay value from the issuance to the completion of the I / O request is:

[0012] The I / O completion callback function is used to obtain the I / O request delivery time and the hard disk information that processes the I / O. The I / O delay value is obtained by subtracting the I / O request delivery time from the current time.

[0013] Furthermore, the method for counting the number of timed I / Os and the total number of I / Os of each hard disk in the hard disk list according to the I / O records stored in the cache queue is:

[0014] Read I / O records from the cache queue based on polling or periodic triggering through the latency statistics thread; count the number of timeout I / Os and the total number of I / Os for each hard disk based on the hard disk information and latency value in the I / O record; the timeout I / O refers to the I / O whose latency value exceeds the preset I / O latency threshold;

[0015] If it is determined that the preset I / O latency threshold is exceeded, the number of timed I / Os and the total number of I / Os of the hard disk processing the I / O request will be increased by 1, otherwise only the total number of I / Os will be increased by 1.

[0016] Furthermore, the method for judging whether there is a slow disk according to the statistical results and the preset slow disk determination strategy is:

[0017] The latency analysis thread is started periodically with a preset detection cycle to determine whether the proportion of timed I / Os of each hard disk in the current cycle exceeds the preset timed I / O proportion threshold. If the timed I / O proportion of the hard disk exceeds the preset timed I / O proportion threshold within the preset N consecutive detection cycles, the hard disk is determined to be a slow disk with high latency.

[0018] Furthermore, the method further comprises:

[0019] Receive a stop command for stopping the slow disk I / O service issued by the upper-layer device management module;

[0020] Update the hard disk list after stopping the slow disk.

[0021] Furthermore, the method further comprises:

[0022] The hard disk information that has been hot-plugged is obtained through the Tracepoint hard disk hot-plug callback function registered in the kernel state for capturing hard disk hot-plug events, and the hard disk list is updated according to the obtained hot-plug information.

[0023] Furthermore, the cache queue for storing I / O records is a lock-free circular queue.

[0024] Based on another aspect of the embodiment of the present invention, the present invention further provides a slow disk detection device, the device comprising:

[0025] The latency acquisition module is used to capture the I / O completion event through the I / O completion callback function registered in the kernel, calculate the latency value from the issuance to the completion of the I / O request, and store it in the cache queue in the form of an I / O record, wherein the I / O record at least includes the hard disk information and latency value for processing the I / O request;

[0026] The delay statistics analysis module is used to count the number of timed I / Os and the total number of I / Os of each hard disk in the hard disk list according to the I / O records stored in the cache queue, and periodically determine whether a slow disk is generated according to the statistical results and the preset slow disk determination strategy; the hard disk list is a list of hard disks that are currently in place and in use;

[0027] The control module is used to report the detected slow disk information to the user state upper layer device management module when a slow disk is detected.

[0028] Further, the delay statistics analysis module includes a delay statistics module and a delay analysis module;

[0029] The latency statistics module is used to read I / O records from the cache queue based on polling or periodic triggering through the latency statistics thread, and count the number of timed I / Os and the total number of I / Os for each hard disk according to the hard disk information and latency value in the I / O record;

[0030] The delay analysis module is used to periodically determine whether a slow disk is generated according to the statistical results of the delay statistics module and the preset slow disk determination strategy through the delay analysis thread; specifically: the delay analysis thread is periodically started with a preset detection period to determine whether the proportion of timed I / Os of each hard disk in the current period exceeds the preset timed I / O proportion threshold; if the timed I / O proportion of the hard disk exceeds the preset timed I / O proportion threshold within the preset N consecutive detection periods, the hard disk is determined to be a high-latency slow disk.

[0031] Furthermore, the device also includes:

[0032] The hard disk monitoring module is used to scan all hard disks under the current hard disk controller during the initialization process, add the scanned hard disks to the hard disk linked list, and register the Tracepoint hard disk hot plug callback function for capturing hard disk hot plug events; this module is also used to obtain the inserted or unplugged hard disk according to the hard disk hot plug callback function, and update the hard disk list in real time according to the monitored hard disk information.

[0033] The present invention realizes fine detection and statistics of I / O latency based on the kernel-state tracking point mechanism, and no longer needs to use and adapt the blktrace tool, and no longer needs to create a detection thread for each disk and CPU, which reduces the resource and memory consumption when the detection is turned on, and reduces the impact on I / O performance. In addition, the dynamic monitoring in the disk hot-swap scenario greatly improves the flexibility and intelligence of the detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments of the present invention or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings of the embodiments of the present invention.

[0035] Figure 1 A schematic diagram of the logical structure and principle of a slow disk detection device provided by an embodiment of the present invention;

[0036] Figure 2 A schematic diagram of the process flow of the slow disk detection method provided by the present invention;

[0037] Figure 3 A schematic diagram of the structure of an electronic device provided in one embodiment of the present invention for implementing the slow disk detection method provided in the present invention. DETAILED DESCRIPTION

[0038] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, rather than limiting the embodiments of the present invention. The singular forms of "a", "said" and "the" used in the embodiments of the present invention are also intended to include plural forms, unless the context clearly indicates other meanings. Although the embodiments of the present invention may be described in a first, second, or third manner, this description is only used to distinguish similar information, entities, or steps, rather than to describe a specific order or sequence. For example, without departing from the scope of the embodiments of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. For another example, in some scenarios, the first information may refer to one information or to multiple information of the same type. In addition, the word "if" used may be interpreted as "at..." or "when..." or "in response to determination". The "and / or" in the present invention is only a kind of association relationship describing the associated objects, indicating that there may be three relationships, for example, A and / or B, which may represent: A exists alone, A and B exist at the same time, and B exists alone, wherein A and B may be singular or plural. In addition, in the description of the present invention, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.

[0039] As the core of the operating system, the Linux kernel is responsible for key tasks such as allocating resources, scheduling processes, and managing memory, and it also manages hardware more directly. If the I / O latency of the hard disk device is detected based on the Linux kernel, and it is determined whether the hard disk is a slow disk with excessive I / O latency and slow speed, it can assist the storage system in discovering slow disks that may have problems as early as possible and isolate them, thereby reducing the impact on the overall business. The slow disk described in the present invention refers to a hard disk whose input / output, i.e., I / O latency, exceeds a preset multiple (e.g., 10 times) of the average latency of the hard disk under normal conditions in a preset proportion (e.g., 80%) of one or more continuous detection cycles.

[0040] The tracepoint mechanism is a function in the Linux kernel for performance analysis and tracing. It allows developers to predefine some key points in the kernel code, which can be used to dynamically insert tracing code to track various events and operations when the kernel is running. Through the tracepoint mechanism, developers can define tracepoints in the kernel code and register related events. When these events are triggered, the relevant tracing functions will be called, which can record event-related information, stack traces, or perform other monitoring and analysis operations. This enables the kernel to dynamically collect various tracing information during operation, including function calls, system calls, interrupt processing, etc. The tracepoint mechanism is lightweight and low-overhead, and can be used to track systems running in production environments with little impact on system performance.

[0041] Based on the above analysis and research, the present invention provides a slow disk detection solution to solve the technical problems of excessive resource consumption and increased business load in existing slow disk detection solutions. The basic idea of ​​the present invention is: based on the TracePoint mechanism of the Linux kernel, the delay from the I / O request being sent from the driver to the SCSI (Small Computer System Interface) hard disk under different Redundant Array of Independent Disks (RAID) controllers or hard disk controllers is counted, and according to the preset strategy, it is determined whether a slow disk is found. If a slow disk is found, the communication mechanism between the kernel and the user space is used to notify the upper-level business software to perform abnormal isolation, reduce the impact of abnormal disks on the system, and thus improve system reliability.

[0042] The specific implementation process of the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the steps shown in the processes of the accompanying drawings and embodiments can be executed in a computer system such as a set of computer executable instructions, and, although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0043] Figure 1 The logical structure and principle diagram of a slow disk detection device provided by an embodiment of the present invention. The slow disk detection device provided by the present invention mainly includes four functional modules, namely, a SCSI disk delay acquisition module, a delay statistics analysis module, a control module, and a plug-in monitoring module.

[0044] The latency acquisition module is used to capture the I / O completion event through the I / O completion callback function registered in the kernel, calculate the latency value from the issuance to the completion of the I / O request, and store it in the cache queue in the form of an I / O record, wherein the I / O record at least includes the hard disk information and latency value for processing the I / O request;

[0045] The delay statistics analysis module is used to count the number of timed I / Os and the total number of I / Os of each hard disk in the hard disk list according to the I / O records stored in the cache queue. The hard disk list is a list of hard disks that are currently in place and in use; the module is also used to periodically determine whether a slow disk is generated based on the statistical results and the preset slow disk determination strategy;

[0046] The control module is used to report the slow disk detection result to the upper device management module in user mode; and start or stop the slow disk according to the start and stop instructions issued by the device management module.

[0047] Figure 2 The present invention provides a method for detecting a slow disk. The method is applied to a hard disk array controller or a device where a hard disk controller is located. The method includes:

[0048] Step 201: During the initialization process, an I / O completion callback function for capturing an I / O completion event (I / O Complete) is registered based on a tracepoint mechanism, and a list of hard disks to be monitored is created;

[0049] In one embodiment of the present invention, the Linux kernel software module corresponding to the slow disk detection device is loaded into the running kernel through the insmod command in Linux. After the kernel software module is loaded, the module initialization process is first started. The main functions completed by the initialization process include configuration parsing steps and interface registration steps.

[0050] The configuration parsing step includes: reading and parsing the configuration file, and obtaining configuration information such as supported hard disk types, configuration and policies related to slow disk detection, and cycles related to slow disk detection from the configuration file.

[0051] During the initialization process of the present invention, it is necessary to turn on the tracepoint mechanism enable switch in the Linux kernel and register an I / O completion callback function for capturing an I / O completion event (I / O Complete), for example, registering a tracepoint callback interface function for capturing a block request completion event blk_rq_complete.

[0052] In addition, during the initialization process, it is also necessary to create a delay statistics thread and a delay analysis thread for the I / O delay statistics analysis module.

[0053] Step 202: Capture the I / O completion event through the I / O completion callback function, calculate the delay value from the issuance to the completion of the I / O request, and store it in the cache queue in the form of an I / O record, wherein the I / O record at least includes the hard disk information and the delay value for processing the I / O request;

[0054] When the upper storage software performs read / write operations on the hard disk, it will send an I / O request to the hard disk. When the I / O request is processed, the Linux kernel executes the I / O completion callback function. The entry parameter of the callback function is the detailed information of the I / O. The I / O delay acquisition module obtains the sending time of the I / O request and the hard disk information that processes the I / O through the I / O completion callback function, and then subtracts the sending time of the I / O request from the current time to get the delay value of this I / O. Then, the hard disk information and the delay value are formed into an I / O record and saved together in a lock-free cache queue (RingBuffer), which can be a circular reusable queue. The lock-free circular queue can well control the resource overhead, thereby avoiding excessive occupation of system resources. After the I / O completion callback function is processed, the I / O request will continue to return to the upper layer.

[0055] Step 203: Count the number of timed I / Os and the total number of I / Os of each hard disk in the hard disk list according to the I / O records stored in the cache queue, and determine whether a slow disk is generated according to the statistical results and a preset slow disk determination strategy;

[0056] The delay statistics analysis module further includes a delay statistics module and a delay analysis module.

[0057] The latency statistics module reads I / O records from the cache queue through the latency statistics thread based on polling or periodic triggering, and then counts the number of timed I / Os and the total number of I / Os for each hard disk based on the hard disk information and latency values ​​in the I / O records.

[0058] Specifically, when an I / O record is read from the cache list, an identification match is performed with all hard disks in the hard disk list based on the hard disk information of the I / O record. If the match is successful, it is further determined whether the current I / O delay value exceeds the preset I / O delay threshold. The threshold is used to determine whether the processing delay of the I / O request reaches the judgment standard of slow I / O, i.e., timed-out I / O. If it exceeds, the current I / O is determined to be a timed-out I / O. Different I / O delay thresholds can be configured for different hard disk types. In one embodiment of the present invention, the I / O delay threshold value can be configured as 10 times the average delay.

[0059] When the delay statistics module determines that the delay value in the current I / O record exceeds the I / O delay threshold, the hard disk timeout I / O count counter is incremented by 1 according to the hard disk information in the I / O record, and the issued I / O count counter, i.e., the total I / O count, is also incremented by 1, thereby obtaining the latest total timeout I / O count and total I / O count statistics for the hard disk. If the delay value of the I / O request does not exceed the I / O delay threshold, only the total I / O count is incremented by 1.

[0060] The delay analysis module uses the delay analysis thread to periodically determine whether a slow disk occurs based on the statistical results of the delay statistics module and the preset slow disk determination strategy.

[0061] For example, the latency analysis thread in the latency analysis module is started periodically with a preset detection period (for example, 2.5 seconds) to determine whether the proportion of timed I / Os of each hard disk in the current period exceeds a preset timed I / O proportion threshold (for example, 80%). If the proportion of timed I / Os of the hard disk exceeds the preset timed I / O proportion threshold within a preset N consecutive detection periods (for example, 5), the hard disk is determined to be a slow disk with high latency.

[0062] Step 204: When a slow disk is detected, report the detected slow disk information to the upper device management module in the user state;

[0063] In one embodiment of the present invention, when the latency statistics analysis module detects a slow disk, the slow disk information is notified to the control module through the interface between the control module and the control module, and the control module reports the slow disk information to the device management module in the user state, and the device management module can further report to the upper-level distributed storage software. After receiving the slow disk information, the distributed storage software can issue a stop operation instruction to stop the I / O service of the disk to reduce the impact of the high-latency hard disk on the overall storage performance. After the distributed storage software issues a start or stop instruction to the device management module according to the policy, the device management module issues the start or stop instruction to the control module, and the control module starts or stops the specified slow disk according to the start or stop instruction issued by the device management module.

[0064] The interface between the control module and the device management module may adopt the Netlink protocol interface.

[0065] For a redundant array of hard disks, in order to allow the user to perform hot-swap hard disk operations, the user is usually required to manually restart the slow disk detection device, and the technical problem of being unable to automatically monitor the plug-in and unplug operations of the hard disk and adaptively adjust the slow disk detection can not be achieved. To solve this problem, in one embodiment of the present invention, the slow disk detection device also includes a hard disk monitoring module, through which dynamic monitoring of the hard disk list is achieved. During the initialization process, the hard disk monitoring module scans all hard disks under the current hard disk controller, and adds the scanned hard disks to the hard disk linked list. In addition, a Tracepoint hard disk hot-swap callback function for capturing hard disk hot-swap events is registered for the module. The hard disk monitoring module obtains the inserted or unplugged hard disk according to the hard disk hot-swap callback function, and updates the hard disk list in real time according to the monitored hard disk information.

[0066] Accordingly, the slow disk detection method provided by the present invention also includes:

[0067] Step 205: obtaining information about the hard disk that has been hot-plugged through the Tracepoint hard disk hot-plug callback function registered in the kernel state for capturing hard disk hot-plug events, and updating the hard disk list according to the obtained hot-plug information;

[0068] After the hard disk monitoring module obtains the information of the hot-plugged hard disk through the Tracepoint hard disk hot-plug callback function registered in the kernel state for capturing hard disk hot-plug events, it determines whether a hard disk insertion event or a hard disk removal event occurs. If it is a hard disk insertion event, the new hard disk is inserted into the hard disk list; if it is a hard disk removal event, the removed hard disk is deleted from the hard disk list.

[0069] In addition, when the control module starts and stops the specified hard disk according to the start and stop instructions issued by the upper-level device management software, the hard disk monitoring module will also detect the event of the hard disk being started online or stopped offline, and will accordingly trigger the control module to perform maintenance operations on the hard disk list.

[0070] In another embodiment of the present invention, the control module is also used to configure parameters. In order to meet the requirements of different hard disk performance and business scenarios, the present invention supports the configuration of I / O delay threshold, timeout I / O ratio threshold, and detection cycle. The process of the control module performing reference configuration includes:

[0071] Step 206: receiving a parameter configuration command sent by the device management module through the management interface;

[0072] For example, the user state device management module sends a parameter configuration command to the control module through the Netlink interface. The parameters included in the parameter configuration command include but are not limited to the following examples:

[0073] (a) Enable / disable the slow disk detection function;

[0074] (b) I / O latency threshold (range 10-1000ms);

[0075] (c) Timeout I / O ratio threshold (range 10-90%)

[0076] (d) Detection period (range 1-6 seconds)

[0077] The control module will analyze the parameters and make a legal judgment. If they are legal, the parameters of the slow disk detection device in the kernel will be updated and the local configuration file will be updated. The parameters will continue to take effect when the device is started next time. If the parameters are illegal, an error will be directly uploaded and the kernel parameters and configuration file contents will not be changed.

[0078] Figure 3 A schematic diagram of the structure of an electronic device for implementing the slow disk detection method provided by the present invention is provided in one embodiment of the present invention. The device 300 includes: a processor 310 such as a central processing unit (CPU), a communication bus 320, a communication interface 340, and a memory 330. The processor 310 and the memory 330 can communicate with each other through the communication bus 320. The memory 330 stores a computer program, and when the computer program is executed by the processor 310, the function of one or more steps in the slow disk detection method provided by the present invention can be implemented.

[0079] Memory refers to a device based on a certain storage medium for storing computer programs and / or data. It can be a volatile memory (VM, often called memory) or a non-volatile memory (NVM). Memory refers to an internal memory that directly exchanges data with the processor. It can read and write data at any time and at a very fast speed. It is used as a storage medium for temporary data of the operating system and other running programs. Memory can be synchronous dynamic random access memory (SDRAM), dynamic random access memory (DRAM), etc. Non-volatile memory refers to a memory that uses a persistent storage medium. It has the characteristics of large capacity and persistent data storage. It can be a storage class memory (SCM), a solid state disk (SSD), a NAND flash memory, a disk, etc. SCM is the industry's general term for new storage media between memory and flash memory. It is a composite storage technology that combines persistent storage characteristics and memory characteristics. Its access speed is slower than DRAM and faster than SSD hard disks.

[0080] The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0081] It should be appreciated that embodiments of the present invention may be implemented or implemented by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory (or non-persistent) memory. The method may be implemented in a computer program using standard programming techniques, including a non-transitory storage medium configured with a computer program, wherein the storage medium configured in this way causes the computer to operate in a specific and predefined manner. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if necessary, the program may be implemented in an assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed ASIC for this purpose. In addition, the operation of the process described in the present invention may be performed in any suitable order, unless the present invention otherwise indicates or otherwise clearly contradicts the context. The process described in the present invention (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as a code (e.g., executable instructions, one or more computer programs, or one or more applications) executed on one or more processors in common, by hardware or a combination thereof. The computer program includes a plurality of instructions that may be executed by one or more processors.

[0082] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Various aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or portions thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described in the present invention includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques of the present invention, the present invention also includes the computer itself.

[0083] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A slow disk detection method, It is characterized in that The method includes: During the initialization process, the I / O completion callback function for capturing I / O completion events (I / OComplete) is registered based on the tracepoint mechanism, and a list of hard disks to be monitored is created; The I / O completion event is captured through the I / O completion callback function, the latency value from the issuance to the completion of the I / O request is calculated, and the latency value is stored in the cache queue in the form of an I / O record, wherein the I / O record includes at least the hard disk information and latency value for processing the I / O request; According to the I / O records stored in the cache queue, the number of timed I / Os and the total number of I / Os of each hard disk in the hard disk list are counted, and whether a slow disk is generated is determined periodically based on the statistical results and the preset slow disk determination strategy; When a slow disk is detected, the detected slow disk information is reported to the upper device management module in the user state.

2. The method according to claim 1, It is characterized in that The method for capturing the I / O completion event through the I / O completion callback function and calculating the delay value from the issuance to the completion of the I / O request is: The I / O completion callback function is used to obtain the I / O request delivery time and the hard disk information that processes the I / O. The I / O delay value is obtained by subtracting the I / O request delivery time from the current time.

3. The method according to claim 1, It is characterized in that The method for counting the number of timed I / Os and the total number of I / Os of each hard disk in the hard disk list according to the I / O records stored in the cache queue is: Read I / O records from the cache queue based on polling or periodic triggering through the latency statistics thread; count the number of timeout I / Os and the total number of I / Os for each hard disk based on the hard disk information and latency value in the I / O record; the timeout I / O refers to the I / O whose latency value exceeds the preset I / O latency threshold; If it is determined that the preset I / O latency threshold is exceeded, the number of timed I / Os and the total number of I / Os of the hard disk processing the I / O request will be increased by 1, otherwise only the total number of I / Os will be increased by 1.

4. The method according to claim 3, It is characterized in that The method for judging whether there is a slow disk according to the statistical results and the preset slow disk judgment strategy is: The latency analysis thread is started periodically with a preset detection cycle to determine whether the proportion of timed I / Os of each hard disk in the current cycle exceeds the preset timed I / O proportion threshold. If the timed I / O proportion of the hard disk exceeds the preset timed I / O proportion threshold within the preset N consecutive detection cycles, the hard disk is determined to be a slow disk with high latency.

5. The method according to claim 1, It is characterized in that The method further comprises: Receive a stop command for stopping the slow disk I / O service issued by the upper-layer device management module; Update the hard disk list after stopping the slow disk.

6. The method according to claim 1, It is characterized in that The method further comprises: The hard disk information that has been hot-plugged is obtained through the Tracepoint hard disk hot-plug callback function registered in the kernel state for capturing hard disk hot-plug events, and the hard disk list is updated according to the obtained hot-plug information.

7. The method according to claim 1, It is characterized in that The cache queue for storing I / O records is a lock-free circular queue.

8. A slow disk detection device, It is characterized in that The device includes: The latency acquisition module is used to capture the I / O completion event through the I / O completion callback function registered in the kernel, calculate the latency value from the issuance to the completion of the I / O request, and store it in the cache queue in the form of an I / O record, wherein the I / O record at least includes the hard disk information and latency value for processing the I / O request; The delay statistics analysis module is used to count the number of timed I / Os and the total number of I / Os of each hard disk in the hard disk list according to the I / O records stored in the cache queue, and periodically determine whether a slow disk is generated according to the statistical results and the preset slow disk determination strategy; the hard disk list is a list of hard disks that are currently in place and in use; The control module is used to report the detected slow disk information to the user state upper layer device management module when a slow disk is detected.

9. The device according to claim 8, It is characterized in that The delay statistics analysis module includes a delay statistics module and a delay analysis module; The latency statistics module is used to read I / O records from the cache queue based on polling or periodic triggering through the latency statistics thread, and count the number of timed I / Os and the total number of I / Os for each hard disk according to the hard disk information and latency value in the I / O record; The delay analysis module is used to periodically determine whether a slow disk occurs based on the statistical results of the delay statistics module and the preset slow disk determination strategy through the delay analysis thread; Specifically: the latency analysis thread is started periodically with a preset detection cycle to determine whether the proportion of timed I / Os of each hard disk in the current cycle exceeds the preset timed I / O proportion threshold. If the timed I / O proportion of the hard disk exceeds the preset timed I / O proportion threshold within the preset N consecutive detection cycles, the hard disk is determined to be a slow disk with high latency.

10. The device according to claim 8, It is characterized in that The device also includes: The hard disk monitoring module is used to scan all hard disks under the current hard disk controller during the initialization process, add the scanned hard disks to the hard disk linked list, and register the Tracepoint hard disk hot plug callback function for capturing hard disk hot plug events; this module is also used to obtain the inserted or unplugged hard disk according to the hard disk hot plug callback function, and update the hard disk list in real time according to the monitored hard disk information.

11. An electronic device, It is characterized in that It includes a processor, a communication interface, a storage medium and a communication bus, wherein the processor, the communication interface and the storage medium communicate with each other via the communication bus; Storage medium for storing computer programs; A processor, for implementing the method according to any one of claims 1 to 7 when executing a computer program stored on a storage medium.