Debugging data storage method, device and equipment and computer readable storage medium
By writing debug data into memory directly in response to host write enable instructions in the RAID card, and notifying the host to transfer when the capacity is insufficient, the problem of debug data preservation affects the performance and memory waste of RAID card is solved, and efficient data preservation is achieved.
Patent Information
- Application Number
- CN202510655828.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-08-19
AI Technical Summary
In the prior art, the debug data storage method generated by the RAID card affects the read and write performance of the RAID card and may cause idle and waste of host memory resources.
By responding to the write enable instruction sent by the host, debugging data is written directly into the host's memory access space, and the host is notified to transfer data when the remaining capacity is below the threshold, avoiding affecting the read and write performance of the RAID card and freeing up memory resources.
It realizes that while saving a large amount of debugging data, it avoids affecting the read and write performance of RAID card and does not cause waste of host memory resources.
Smart Images

Figure CN120508256A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data storage, and in particular to a debugging data storage method, device, equipment and computer-readable storage medium. Background Art
[0002] The main function of a RAID (redundant array of independent disks) card is to manage disk arrays and implement RAID-level data storage and data protection. During operation, a RAID card generates a large amount of debug data, which can be used for fault location and analysis. Therefore, the debug data generated by the RAID card needs to be saved in a timely manner. However, the relevant technology lacks a mature method for saving debug data. As a result, saving debug data may affect the read and write performance of the RAID card and cause idle memory resources to be wasted.
[0003] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present. Summary of the Invention
[0004] The object of the present invention is to provide a debugging data storage method, device, equipment and computer-readable storage medium. In the present invention, in response to a write enable instruction sent by the host, the debugging data generated by the host can be directly written into the direct memory access space of the host, and when the remaining capacity of the direct memory access space of the host is low, the host is notified so that the host can transfer the data in the direct memory access space. In this way, on the basis of saving a large amount of debugging data, it is possible to avoid affecting the read and write performance of the RAID card and not cause idle waste of the host memory resources.
[0005] To solve the above technical problems, the present invention provides a debugging data storage method applied to a redundant array of independent disks card, comprising:
[0006] In response to a write enable instruction sent by the host, the debug data generated by the host is directly written into the memory direct access space of the host, wherein the write enable instruction is: a write enable instruction for the memory direct access space pre-allocated by the host to the independent disk redundant array card;
[0007] Determining whether the remaining capacity of the host's direct memory access space is lower than a first preset threshold;
[0008] If it is lower, the event that the remaining capacity of the direct memory access space is lower than the first preset threshold is notified to the host, so that the host can save the debugging data in the direct memory access space to the storage device and clear the debugging data in the direct memory access space.
[0009] On the other hand, the direct memory access space includes a plurality of direct memory access subspaces;
[0010] In response to a write enable instruction sent by the host, directly writing the debug data generated by the host into the memory direct access space of the host includes:
[0011] In response to a write enable instruction sent by the host, the memory direct access space pointed to by the write enable instruction is used as a target write space for debug data, so as to complete the write enable;
[0012] Determine, from the target write space, a memory direct access subspace in an idle state as a target memory space;
[0013] Writing the debugging data generated by itself directly into the target memory space;
[0014] After determining whether the remaining capacity of the host's direct memory access space is lower than a first preset threshold, the debugging data saving method further includes:
[0015] If it is lower, the step of determining an idle memory direct access subspace from the target write space as the target memory space is executed.
[0016] On the other hand, determining an idle direct memory access subspace in the target write space as the target memory space includes:
[0017] Determine the remainder of the current number of event notifications with respect to the total number of subspaces;
[0018] According to the first correspondence, a subspace sequence number uniquely corresponding to the remainder is determined and used as the target sequence number;
[0019] The memory direct access subspace with the target sequence number is used as the target memory space.
[0020] On the other hand, the write enable command is a manufacturer-defined command that refers to the non-volatile memory host controller interface specification protocol standard, with the data transmission direction being from the host to the controller and the operation code value being within a preset range;
[0021] The step of responding to a write enable instruction sent by the host and using the memory direct access space pointed to by the write enable instruction as the target write space for the debug data comprises:
[0022] In response to a write enable instruction sent by a host, determining whether there is an operation code in the write enable instruction whose value is within a preset range;
[0023] If so, it is determined that the write enable instruction is a manufacturer-defined command, and the memory direct access space pointed to by the write enable instruction is used as the target write space for the debugging data.
[0024] On the other hand, notifying the host of the event that the remaining capacity of the direct memory access space is lower than the first preset threshold includes:
[0025] Notifying the host of an event that the remaining capacity of the direct memory access space is lower than a first preset threshold in the form of an asynchronous event request;
[0026] The asynchronous event request refers to the non-volatile memory host controller interface specification protocol standard, and the value of the asynchronous event type in the asynchronous event request is a manufacturer-defined value.
[0027] To solve the above technical problems, the present invention further provides a debugging data storage method, which is applied to a host connected to a redundant array of independent disks card, comprising:
[0028] sending a write enable instruction to a redundant array of independent disks card so that the redundant array of independent disks card directly writes the generated debug data into a direct memory access space of the host, determining whether a remaining capacity of the direct memory access space of the host is less than a first preset threshold, and if so, notifying the host of an event that the remaining capacity of the direct memory access space is less than the first preset threshold;
[0029] The write enable instruction is: a write enable instruction for a memory direct access space pre-allocated by the host to the independent disk redundant array card;
[0030] In response to an event notification that the remaining capacity of the direct memory access space is lower than a first preset threshold, the debugging data in the direct memory access space is saved to a storage device, and the debugging data in the direct memory access space is cleared.
[0031] On the other hand, sending the write enable instruction to the redundant array of independent disks card includes:
[0032] Creating a direct memory access device and applying for direct memory access memory for the direct memory access device;
[0033] Registering the direct memory access device as a user space input and output device;
[0034] The step of saving the debugging data in the direct memory access space to a storage device and clearing the debugging data in the direct memory access space in response to an event notification indicating that the remaining capacity of the direct memory access space is lower than a first preset threshold value comprises:
[0035] In response to an event notification indicating that the remaining capacity of the direct memory access space is lower than a first preset threshold, saving the debugging data in the direct memory access space to a storage device via the user space input and output device;
[0036] Clear the debug data in the direct access memory space.
[0037] In order to solve the above technical problems, the present invention further provides a debugging data storage device, which is applied to a redundant array of independent disks card, comprising:
[0038] A first sending module is configured to write the debugging data generated by the module directly into a memory direct access space in the host in response to a write enable instruction sent by the host, wherein the write enable instruction is a write enable instruction for the memory direct access space pre-allocated by the host to the redundant array of independent disks card;
[0039] A first judging module is configured to judge whether the remaining capacity of the host's direct memory access space is lower than a first preset threshold, and if so, trigger the second sending module;
[0040] The second sending module is used to notify the host of the event that the remaining capacity of the direct memory access space is lower than the first preset threshold, so that the host can save the debugging data in the direct memory access space to the storage device and clear the debugging data in the direct memory access space.
[0041] In order to solve the above technical problems, the present invention further provides a debugging data storage device, comprising:
[0042] memory for storing computer programs;
[0043] The processor is used to implement the steps of the debugging data saving method described above when executing the computer program.
[0044] To solve the above technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned debugging data saving method are implemented.
[0045] Beneficial effect: The present invention provides a debugging data saving method. Considering that the data storage method of direct memory access does not occupy IO resources and the direct memory access space can be flexibly unloaded at any time, the present invention can respond to the write enable instruction sent by the host, directly write the debugging data generated by itself into the direct memory access space of the host, and notify the host when the remaining capacity of the direct memory access space of the host is low, so that the host can transfer the data of the direct memory access space. In this way, on the basis of saving a large amount of debugging data, it can avoid affecting the reading and writing performance of the RAID card and will not cause idle waste of the host's memory resources.
[0046] The present invention also provides a debugging data storage method, device, equipment and computer-readable storage medium, which have the same beneficial effects as the above debugging data storage method. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the relevant technologies and the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0048] Figure 1 A schematic flow chart of the first debugging data saving method provided by the present invention;
[0049] Figure 2 A schematic flow chart of a second debugging data storage method provided by the present invention;
[0050] Figure 3 A schematic diagram of the structure of the debugging data storage system provided by the present invention;
[0051] Figure 4 A schematic flow chart of a third debugging data storage method provided by the present invention;
[0052] Figure 5 A schematic structural diagram of a debugging data storage device provided by the present invention;
[0053] Figure 6 A schematic structural diagram of a debugging data storage device provided by the present invention;
[0054] Figure 7 A schematic structural diagram of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0055] The core of the present invention is to provide a debugging data storage method, device, equipment and computer-readable storage medium. In the present invention, in response to a write enable instruction sent by the host, the debugging data generated by the host can be directly written into the direct memory access space of the host, and when the remaining capacity of the direct memory access space of the host is low, the host is notified so that the host can transfer the data in the direct memory access space. In this way, on the basis of saving a large amount of debugging data, it is possible to avoid affecting the read and write performance of the RAID card and not cause idle waste of the host's memory resources.
[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0057] Please refer to Figure 1 , Figure 1 This is a flow chart of a first debugging data saving method provided by the present invention, which is applied to a redundant array of independent disks card, comprising:
[0058] S101: In response to a write enable instruction sent by a host, directly write the debug data generated by the host into a memory direct access space in the host, wherein the write enable instruction is a write enable instruction for the memory direct access space pre-allocated by the host to the redundant array of independent disks card;
[0059] Specifically, considering the technical problems in the above background technology, and considering that the data storage method of direct memory access does not occupy IO resources and the direct memory access space can be flexibly unloaded at any time, the present invention intends to store the debugging data of the RAID card through the DMA (Direct Memory Access) data storage method, thereby avoiding occupying the IO resources of the RAID card and affecting the read and write performance of the RAID card, and can also be flexibly unloaded when the DMA memory space is idle for a long time to free up space, thereby avoiding idle waste of host memory resources; based on this, in this step, the debug data generated by itself can be directly written into the direct memory access space of the host in response to the write enable instruction sent by the host, wherein the write enable instruction is: a write enable instruction for the "direct memory access space allocated by the host in advance for the redundant array of independent disks card".
[0060] Debug data can include logs and point data. Logs can be used to analyze and locate faults during development, while point data can be used to analyze performance bottlenecks. Debug data refers to the data generated by the various firmware systems in the RAID card during operation. The firmware system includes the core control system, auxiliary control system, RAID control system, power management system, power-off protection and recovery system, and boot system. The core control system is responsible for core control and data processing, including the PCIe EP (Peripheral Component Interconnect Express Endpoint) subsystem, RAID acceleration computing, and PCIe RC (Root Complex) subsystem. The auxiliary control system is responsible for system-interface communication, firmware upgrades, and system debugging and control. The RAID control system is responsible for user command processing and product form factor configuration. The power management system primarily provides power to the various systems in the RAID card. The power-off protection and recovery system is responsible for data protection during system power failures and data recovery upon system power-on. The boot system loads other firmware systems, exits after loading, and transfers control to the auxiliary control system.
[0061] After the RAID card is initialized, the host recognizes it as a PCIe device. The various firmware systems in the RAID card can interact with the host through the PCIe EP. The host can load a DMA device bound to the PCIe device to dynamically request contiguous physical memory and register the DMA device as a UIO (User-space I / O) device for easy access by user-space programs. When the host is ready, it sends a write enable command to the RAID card. The multiple firmware systems in the RAID card can then write debug data to the host's DMA memory through the debug data interface layer. When the host receives a DMA memory full event, it accesses the DMA memory through the host's user-space program, opens the UIO device, and saves the debug data in the DMA memory to a data file.
[0062] S102: Determine whether the remaining capacity of the host's direct memory access space is lower than a first preset threshold. If so, trigger S103;
[0063] Specifically, in order to continuously save a large amount of debugging data through limited DMA space, the embodiment of the present invention intends to notify the host when the DMA space is insufficient so that the host can transfer the debugging data in the DMA space. Therefore, in this step, it can be actively determined whether the remaining capacity of the host's direct memory access space is lower than a first preset threshold, and if it is lower, S103 is triggered to trigger the host's transfer action.
[0064] The first preset threshold value can be set independently, for example, it can be set to a lower percentage of the DMA space, such as 0% or 5%, etc., which is not limited in the embodiment of the present invention.
[0065] S103: Notify the host of an event that the remaining capacity of the direct memory access space is lower than a first preset threshold, so that the host saves the debugging data in the direct memory access space to a storage device and clears the debugging data in the direct memory access space.
[0066] Specifically, when the remaining capacity of the host's direct memory access space is lower than a first preset threshold, the situation can be notified to the host in the form of an event so that the host can save the debugging data in the direct memory access space to the storage device and clear the debugging data in the direct memory access space to ensure continuous storage of the debugging data.
[0067] The present invention provides a debugging data saving method. Considering that a data storage mode of direct memory access does not occupy IO resources and the direct memory access space can be flexibly unloaded at any time, the present invention can directly write debugging data generated by itself into the direct memory access space of the host in response to a write enable instruction sent by the host, and notify the host when the remaining capacity of the direct memory access space of the host is low, so that the host can transfer the data in the direct memory access space. In this way, on the basis of saving a large amount of debugging data, it is possible to avoid affecting the reading and writing performance of a RAID card and not cause idle waste of the host's memory resources.
[0068] Based on the above embodiment:
[0069] As an optional embodiment, the direct memory access space includes a plurality of direct memory access subspaces;
[0070] In response to a write enable instruction sent by the host, directly writing the debug data generated by the host into the memory direct access space of the host includes:
[0071] In response to a write enable instruction sent by the host, the memory direct access space pointed to by the write enable instruction is used as a target write space for debug data, so as to complete the write enable;
[0072] From the target write space, determine an idle memory direct access subspace as the target memory space;
[0073] Write the debugging data generated by itself directly into the target memory space;
[0074] After determining whether the remaining capacity of the host's direct memory access space is lower than a first preset threshold, the debugging data saving method further includes:
[0075] If it is lower, the step of determining an idle memory direct access subspace from the target write space as the target memory space is executed.
[0076] Specifically, to ensure that debug data can be continuously stored, the direct memory access space in the embodiment of the present invention may include multiple direct memory access sub-spaces. In this way, the RAID card can respond to a write enable instruction sent by the host and use the direct memory access space (including multiple direct memory access sub-spaces) pointed to by the write enable instruction as the target write space for debug data to complete the write enable. Then, from the target write space, an idle direct memory access sub-space is determined as the target memory space for writing debug data. When it is determined that the remaining capacity of the host's direct memory access space (here referring to the target memory space) is lower than a first preset threshold, the action of "determining an idle direct memory access sub-space from the target write space as the target memory space" can be executed again to switch the target memory space to the idle direct memory access sub-space, thereby ensuring that debug data can be continuously stored.
[0077] The specific number of the memory direct access subspaces can be set flexibly and autonomously, and is not limited in this embodiment of the present invention.
[0078] Specifically, to better illustrate the embodiments of the present invention, please refer to Figure 2 , Figure 2 This is a flow chart of a second debugging data saving method provided by the present invention. The debugging data saving method includes the following steps:
[0079] The first step is to power on and initialize the RAID card. After initialization, the host computer recognizes the RAID card as a PCIe device. The second step is for the host to request two DMA memory blocks (direct memory access subspace). The host creates a DMA device, dynamically allocates two contiguous physical memory blocks, and saves the physical addresses and sizes of these two DMA memory blocks. The host then associates the DMA device with the PCIe device corresponding to the RAID card, allowing the RAID card to directly access the two contiguous physical memory blocks requested by the DMA device. The DMA device is also registered as a UIO device, allowing host userspace programs to read debug data from these two contiguous physical memory blocks. The third step is for the host to issue a DMA memory write enable command. The host sends a custom host command to the RAID card indicating that the DMA memory is ready and notifies the RAID card of the physical addresses and sizes of the two host physical memory blocks. The fourth step is for the RAID card firmware to write debug data to the DMA memory (target memory space). The RAID card firmware system directly writes generated logs or dotted data to the DMA memory through the debug data interface layer. The fifth step is for the RAID card to notify the host that its memory space (DMA space) is insufficient. When one DMA memory block is full, the RAID card begins writing debug data to another DMA memory block and sends a custom asynchronous event indicating DMA memory full to the host, notifying the host to save the DMA memory data. In step 6, the host saves the debug data in the target memory space to a data file. The host's user space program saves the DMA memory data to a file using the UIO device.
[0080] Specifically, to better illustrate the embodiments of the present invention, please refer to Figure 3 and Figure 4 , Figure 3 This is a structural diagram of the debugging data storage system provided by the present invention. Figure 4 A flow chart of the third debugging data storage method provided by the present invention, Figure 3 In the process, the firmware system of the RAID card can write debugging data to the DMA space through the debugging data interface layer, and the host can read and save the debugging data from the DMA space through the UIO device based on the user space program.
[0081] Among them, Figure 4In RAID 5, the host and RAID card can agree on the read and write rules for two DMA memories (direct memory access subspaces). For example, after the host sends a memory write enable (command), it first writes to the first submemory (the submemory is the direct memory access subspace), then to the second submemory, and so on. The RAID card writes to the first submemory. When the first submemory is full, it writes to the second submemory. When the second submemory is full, it writes to the first submemory, and so on. The first time the host receives an asynchronous event indicating insufficient memory, it saves the data in the first submemory to a data file. The second time it receives an asynchronous event indicating insufficient memory, it saves the data in the second submemory to a data file. The third time it receives an asynchronous event indicating insufficient memory, it saves the data in the first submemory to a data file.
[0082] As an optional embodiment, determining an idle memory direct access subspace as the target memory space from the target write space includes:
[0083] Determine the remainder of the current number of event notifications with respect to the total number of subspaces;
[0084] According to the first correspondence, a subspace sequence number uniquely corresponding to the remainder is determined and used as the target sequence number;
[0085] The memory subspace with the target sequence number is directly accessed as the target memory space.
[0086] Specifically, considering that the remainder of the number of event notifications with respect to the total number of subspaces and the first corresponding relationship can be used to evenly store each memory direct access subspace as the target memory space for debugging data, in an embodiment of the present invention, when determining an idle memory direct access subspace as the target memory space from the target write space, the remainder of the current number of event notifications with respect to the total number of subspaces can be determined, and then according to the first corresponding relationship (which can be a one-to-one corresponding relationship between the remainder and the subspace sequence number), the subspace sequence number uniquely corresponding to the remainder is determined and used as the target sequence number, and then the memory direct access subspace with the target sequence number can be used as the target memory space. Through this method, each memory direct access subspace can be evenly used as the target memory space for debugging data, thereby ensuring the uniform use of each memory direct access subspace.
[0087] Of course, in addition to this method, other methods can also be used to "determine an idle memory direct access subspace from the target write space as the target memory space". For example, the status of each memory direct access subspace can be maintained, and when "determining an idle memory direct access subspace from the target write space as the target memory space", one can select one from the idle memory direct access subspace as the target memory space. The embodiment of the present invention does not limit this here.
[0088] As an optional embodiment, the write enable command is: a manufacturer-defined command that refers to the non-volatile memory host controller interface specification protocol standard, with the data transmission direction being from the host to the controller and the operation code value being within a preset range;
[0089] In response to a write enable instruction sent by a host, using the memory direct access space pointed to by the write enable instruction as a target write space for debug data includes:
[0090] In response to a write enable instruction sent by the host, determining whether there is an operation code in the write enable instruction whose value is within a preset range;
[0091] If it exists, it is determined that the write enable instruction is a manufacturer-defined command, and the memory direct access space pointed to by the write enable instruction is used as the target write space for the debugging data.
[0092] Specifically, considering that NVMe (Non-Volatile Memory Express, non-volatile memory host controller interface specification protocol standard) itself has the function of customizing commands, the write enable instruction can be customized and its operation code can be limited. Therefore, the write enable command in the embodiment of the present invention can be: with reference to the non-volatile memory host controller interface specification protocol standard, the data transmission direction is from the host to the controller, and the operation code value is within the preset range of the manufacturer's customized command; in this case, the RAID card can respond to the write enable instruction sent by the host, determine whether there is an operation code in the write enable instruction whose value is within the preset range, and if so, it can be determined that the write enable instruction is a manufacturer-customized command, and the memory direct access space pointed to by the write enable instruction is used as the target write space for the debugging data.
[0093] The transmission direction from the host to the controller can be represented by 0x1, the operation code is Opcode, and the preset range can be set independently, for example, it can be 0XC0~0xFF, which is not limited in the embodiment of the present invention.
[0094] As an optional embodiment, notifying the host of an event that the remaining capacity of the direct memory access space is lower than a first preset threshold includes:
[0095] Notifying the host of an event that the remaining capacity of the direct memory access space is lower than a first preset threshold in the form of an asynchronous event request;
[0096] The asynchronous event request refers to the non-volatile memory host controller interface specification protocol standard, and the value of the asynchronous event type in the asynchronous event request is a manufacturer-defined value.
[0097] Specifically, considering that the NVMe protocol itself has customizable asynchronous events, the event that the remaining capacity of the direct memory access space is lower than the first preset threshold can be notified to the host through the custom asynchronous event. Therefore, in the embodiment of the present invention, the event that the remaining capacity of the direct memory access space is lower than the first preset threshold can be notified to the host in the form of an asynchronous event request, which is efficient and accurate.
[0098] Among them, the asynchronous event request can be an AEN CQE (Asynchronous Event Completion QueueElement) message, and the type value of the asynchronous event in the asynchronous event request can be a variety of situations. For example, it can be customized by the manufacturer of 111b, and the corresponding asynchronous event content can be defined. The embodiment of the present invention does not limit this.
[0099] Specifically, the host can send a custom NVMe Test Command (also known as a write enable instruction) to the RAID card. Referring to the NVMe protocol standard, a manufacturer-defined command is defined with a data transfer direction of 0x1 (indicating host to controller) and an Opcode value between 0xC0 and 0xFF. The RAID card's host interface layer receives and parses the Submission Queue Entry (SQE). If it contains the opcode for the custom command, it sends the NVMe Test Command command to the firmware interface layer to enable DMA memory writes. Upon receiving the NVMe Test Command command, the firmware layer sends a "Test Command Receive OK" confirmation message to the host interface layer. The firmware systems in the firmware layer write debug data to the DMA memory and check for insufficient DMA memory. If DMA memory is insufficient, the firmware layer notifies the host interface layer. The host interface layer then sends an AEN CQE message to the host, notifying it of the insufficient DMA memory. According to the NVMe protocol standard, the AsynchronousEvent Type value in the Asynchronous Event Request is 111b, which is manufacturer-defined and defines the corresponding asynchronous message content. When the host receives a message indicating insufficient DMA memory, it opens the / dev / uioX device and uses mmap address mapping to save the DMA memory data to a file.
[0100] The present invention also provides a debugging data storage method, which is applied to a host connected to a redundant array of independent disks card, comprising:
[0101] sending a write enable instruction to the redundant array of independent disks card so that the redundant array of independent disks card directly writes the generated debug data into the direct memory access space of the host, determining whether the remaining capacity of the direct memory access space of the host is less than a first preset threshold, and if so, notifying the host of an event that the remaining capacity of the direct memory access space is less than the first preset threshold;
[0102] The write enable instruction is: a write enable instruction for a memory direct access space pre-allocated by the host to the independent disk redundant array card;
[0103] In response to an event notification that the remaining capacity of the direct memory access space is lower than a first preset threshold, the debugging data in the direct memory access space is saved to a storage device, and the debugging data in the direct memory access space is cleared.
[0104] For an introduction to the debugging data saving method applied to the host side provided by an embodiment of the present invention, reference may be made to the aforementioned embodiment of the debugging data saving method applied to the RAID card side, and the embodiment of the present invention will not be described in detail here.
[0105] As an optional embodiment, sending the write enable instruction to the redundant array of independent disks card includes:
[0106] Create a memory direct access device and apply for memory direct access memory for the memory direct access device;
[0107] Register the direct memory access device as a user space input and output device;
[0108] In response to an event notification indicating that the remaining capacity of the direct memory access space is lower than a first preset threshold, saving the debugging data in the direct memory access space to a storage device and clearing the debugging data in the direct memory access space include:
[0109] In response to an event notification that a remaining capacity of the direct memory access space is lower than a first preset threshold, saving the debugging data in the direct memory access space to the storage device through the user space input and output device;
[0110] Clears debug data in direct access memory space.
[0111] Specifically, after the RAID card controller is powered on and initialized and recognized as a PCIe device, the host creates a DMA device. This DMA device is used to dynamically request contiguous physical memory to prepare for the subsequent storage of RAID card debug data. For example, the host requests two contiguous physical memory areas from the operating system through relevant system calls or driver interfaces. The host also records the physical addresses and sizes of these two DMA memory areas, ensuring that the RAID card can directly access these memory spaces and facilitating the writing of debug data.
[0112] Specifically, the host registers the created DMA device as a UIO device. This operation enables user-space programs to conveniently access data in DMA memory. The registration process involves the operating system's device management mechanism. Through a specific registration process, the DMA device is associated with the UIO device, facilitating the subsequent reading of debug data from DMA memory and saving it to a storage device. For example, in Linux, by loading the corresponding UIO driver module and creating and configuring a device node, user-space programs can access DMA memory data through a device node such as / dev / uioX. After the host receives this event notification, the user-space program on the upper computer accesses the DMA memory through the UIO device (that is, the previously registered UIO device associated with the DMA device) using mmap address mapping, saving the debug data to a storage device (such as a hard drive). For example, the user-space program opens the / dev / uioX device, maps the DMA memory to the user-space memory address space using the mmap function, and then writes the data to a specified file, completing the process of saving the debug data from DMA memory to a storage device.
[0113] Of course, in addition to being registered as a UIO device, a DMA device may also be registered as other types, which is not limited in the embodiment of the present invention.
[0114] Specifically, after successfully saving debug data from the DMA memory to the storage device, the host needs to clear the debug data from the DMA memory to provide storage space for subsequent new debug data. This operation can be achieved by clearing the DMA memory or performing other related clearing operations. For example, at the software level, the corresponding memory operation function can be used to set all data in the DMA memory area to a specific initial value (such as 0), thereby clearing the saved debug data and ensuring that the DMA memory can continue to efficiently store new debug data.
[0115] In addition, as an optional embodiment, the debugging data saving method further includes:
[0116] Record the timestamp when the RAID card writes data to the DMA space;
[0117] Periodically determine whether the timestamp has reached a preset time threshold from the current moment;
[0118] If it is reached, it is determined that the DMA space is idle for a long time, the debugging data in the DMA space is saved to the storage device and the DMA device is uninstalled;
[0119] You can also control the reminder to prompt that the DMA device is uninstalled due to long-term idleness.
[0120] Specifically, from the perspective of system resource optimization, if DMA space is not used by the RAID card for a long time, continuing to retain the DMA device will result in a waste of system resources. Timely uninstallation of the DMA device can free up memory resources, reduce system overhead, and improve overall system performance. In some server environments with high resource utilization requirements, proper management of DMA device resources is crucial. When a system contains multiple RAID cards and DMA devices, timely uninstallation of unused DMA devices can free up space for other tasks that require more resources. In addition, the host has certain management and control rights over the DMA device and memory space during interaction with the RAID card. By setting up a specific monitoring mechanism, the host can monitor the usage of the DMA space. Therefore, in an embodiment of the present invention, the host can record a timestamp each time the RAID card writes data to the DMA space. If no new write operations are detected within a certain time interval, it can be determined that the DMA space has been unused for a long time. Corresponding monitoring code is added to the system's underlying driver to regularly check the write timestamp of the DMA space to determine its usage status.
[0121] Please refer to Figure 5 , Figure 5 This is a structural diagram of a debugging data storage device provided by the present invention, which is applied to a redundant array of independent disks card, comprising:
[0122] A first sending module 51 is configured to write the debugging data generated by the host directly into a memory direct access space in the host in response to a write enable instruction sent by the host, wherein the write enable instruction is a write enable instruction for the memory direct access space pre-allocated by the host to the redundant array of independent disks card;
[0123] A first determining module 52 is configured to determine whether the remaining capacity of the host's direct memory access space is lower than a first preset threshold, and if so, trigger the second sending module;
[0124] The second sending module 53 is used to notify the host of the event that the remaining capacity of the direct memory access space is lower than the first preset threshold, so that the host can save the debugging data in the direct memory access space to the storage device and clear the debugging data in the direct memory access space.
[0125] Based on the above embodiment:
[0126] As an optional embodiment, the direct memory access space includes a plurality of direct memory access subspaces;
[0127] The first sending module 51 includes:
[0128] A first action module is configured to respond to a write enable instruction sent by the host and use the memory direct access space pointed to by the write enable instruction as a target write space for debugging data, so as to complete the write enable;
[0129] A first determining module is configured to determine an idle memory direct access subspace from the target write space as a target memory space;
[0130] The second action module is used to directly write the debugging data generated by itself into the target memory space;
[0131] The first judgment module 52 is further configured to:
[0132] If it is lower, the first determination module is triggered.
[0133] As an optional embodiment, the first determining module includes:
[0134] A second determining module is used to determine the remainder of the current number of event notifications with respect to the total number of subspaces;
[0135] A third determining module is configured to determine, based on the first corresponding relationship, a subspace sequence number uniquely corresponding to the remainder and use it as a target sequence number;
[0136] The fourth determining module is configured to use the memory direct access subspace having the target sequence number as the target memory space.
[0137] As an optional embodiment, the write enable command is: a manufacturer-defined command that refers to the non-volatile memory host controller interface specification protocol standard, with the data transmission direction being from the host to the controller and the operation code value being within a preset range;
[0138] The first action module includes:
[0139] a second determining module, configured to respond to a write enable instruction sent by the host and determine whether there is an operation code with a value within a preset range in the write enable instruction, and if so, trigger a third action module;
[0140] The third action module is used to determine that the write enable instruction is a manufacturer-defined command, and use the memory direct access space pointed to by the write enable instruction as the target write space for debugging data.
[0141] As an optional embodiment, the second sending module 53 is specifically configured to:
[0142] Notifying the host of an event that the remaining capacity of the direct memory access space is lower than a first preset threshold in the form of an asynchronous event request;
[0143] The asynchronous event request refers to the non-volatile memory host controller interface specification protocol standard, and the value of the asynchronous event type in the asynchronous event request is a manufacturer-defined value.
[0144] For an introduction to the computer-readable storage medium provided by an embodiment of the present invention, please refer to the aforementioned embodiment of the debugging data storage device, and the embodiment of the present invention will not be described in detail here.
[0145] Please refer to Figure 6 , Figure 6 This is a structural diagram of a debugging data storage device provided by the present invention, the debugging data storage device comprising:
[0146] Memory 61, for storing computer programs;
[0147] The processor 62 is configured to implement the steps of the debugging data saving method in the aforementioned embodiment when executing a computer program.
[0148] For an introduction to the computer-readable storage medium provided by an embodiment of the present invention, please refer to the aforementioned embodiment of the debugging data saving method, and the embodiment of the present invention will not be described in detail here.
[0149] Please refer to Figure 7 , Figure 7 This is a structural diagram of a computer-readable storage medium provided by the present invention. A computer program 72 is stored on the computer-readable storage medium 71. When the computer program 72 is executed by the processor, the steps of the debugging data saving method in the aforementioned embodiment are implemented.
[0150] For an introduction to the computer-readable storage medium provided by an embodiment of the present invention, please refer to the aforementioned embodiment of the debugging data saving method, and the embodiment of the present invention will not be described in detail here.
[0151] The present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the debugging data saving method in the above embodiment when executed by a processor.
[0152] For an introduction to the computer program product provided by the embodiment of the present invention, please refer to the aforementioned embodiment of the debugging data saving method, and the embodiment of the present invention will not be described in detail here.
[0153] In this specification, the various embodiments are described in a progressive manner, with each embodiment focusing on the differences from the other embodiments. Similar or identical parts between the various embodiments may be referred to in conjunction with each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and for relevant parts, reference may be made to the method description. It should also be noted that, in this specification, relational terms such as first and second, etc., are used solely to distinguish one entity or operation from another, and do not necessarily require or imply any actual relationship or order between these entities or operations. Furthermore, the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, article, or device comprising that element.
[0154] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A debugging data storage method, characterized in that: Applicable to Redundant Array of Independent Disks (RAID) cards, including: In response to a write enable instruction sent by the host, the debug data generated by the host is directly written into the memory direct access space of the host, wherein the write enable instruction is: a write enable instruction for the memory direct access space pre-allocated by the host to the independent disk redundant array card; Determining whether the remaining capacity of the host's direct memory access space is lower than a first preset threshold; If it is lower, the event that the remaining capacity of the direct memory access space is lower than the first preset threshold is notified to the host, so that the host can save the debugging data in the direct memory access space to the storage device and clear the debugging data in the direct memory access space.
2. The debugging data storage method according to claim 1, wherein: The direct memory access space includes a plurality of direct memory access subspaces; In response to a write enable instruction sent by the host, directly writing the debug data generated by the host into the memory direct access space of the host includes: In response to a write enable instruction sent by the host, the memory direct access space pointed to by the write enable instruction is used as a target write space for debug data, so as to complete the write enable; Determine, from the target write space, an idle memory direct access subspace as the target memory space; Writing the debugging data generated by itself directly into the target memory space; After determining whether the remaining capacity of the host's direct memory access space is lower than a first preset threshold, the debugging data saving method further includes: If it is lower, the step of determining an idle memory direct access subspace from the target write space as the target memory space is executed.
3. The debugging data storage method according to claim 2, wherein: Determining, from the target write space, an idle memory direct access subspace as the target memory space includes: Determine the remainder of the current number of event notifications with respect to the total number of subspaces; According to the first correspondence, a subspace sequence number uniquely corresponding to the remainder is determined and used as the target sequence number; The memory direct access subspace with the target sequence number is used as the target memory space.
4. The debugging data storage method according to claim 2, wherein: The write enable command is a manufacturer-defined command that refers to the non-volatile memory host controller interface specification protocol standard, with the data transmission direction being from the host to the controller and the operation code value being within a preset range; The step of responding to a write enable instruction sent by the host and using the memory direct access space pointed to by the write enable instruction as the target write space for the debug data comprises: In response to a write enable instruction sent by a host, determining whether there is an operation code in the write enable instruction whose value is within a preset range; If so, it is determined that the write enable instruction is a manufacturer-defined command, and the memory direct access space pointed to by the write enable instruction is used as the target write space for the debugging data.
5. The debugging data storage method according to any one of claims 1 to 4, characterized in that: The notifying the host of the event that the remaining capacity of the direct memory access space is lower than the first preset threshold comprises: Notifying the host of an event that the remaining capacity of the direct memory access space is lower than a first preset threshold in the form of an asynchronous event request; The asynchronous event request refers to the non-volatile memory host controller interface specification protocol standard, and the value of the asynchronous event type in the asynchronous event request is a manufacturer-defined value.
6. A debugging data storage method, characterized in that: Applicable to hosts connected to independent disk redundant array cards, including: sending a write enable instruction to a redundant array of independent disks card so that the redundant array of independent disks card directly writes the generated debug data into a direct memory access space of the host, determining whether a remaining capacity of the direct memory access space of the host is less than a first preset threshold, and if so, notifying the host of an event that the remaining capacity of the direct memory access space is less than the first preset threshold; The write enable instruction is: a write enable instruction for a memory direct access space pre-allocated by the host to the independent disk redundant array card; In response to an event notification that the remaining capacity of the direct memory access space is lower than a first preset threshold, the debugging data in the direct memory access space is saved to a storage device, and the debugging data in the direct memory access space is cleared.
7. The debugging data storage method according to claim 6, characterized in that: The sending of the write enable instruction to the independent disk redundant array card includes: Creating a direct memory access device and applying for direct memory access memory for the direct memory access device; Registering the direct memory access device as a user space input and output device; The step of saving the debugging data in the direct memory access space to a storage device and clearing the debugging data in the direct memory access space in response to an event notification indicating that the remaining capacity of the direct memory access space is lower than a first preset threshold value comprises: In response to an event notification indicating that the remaining capacity of the direct memory access space is lower than a first preset threshold, saving the debugging data in the direct memory access space to a storage device via the user space input and output device; Clear the debug data in the direct access memory space.
8. A debugging data storage device, characterized in that: Applicable to Redundant Array of Independent Disks (RAID) cards, including: A first sending module is configured to write the debugging data generated by the module directly into a memory direct access space in the host in response to a write enable instruction sent by the host, wherein the write enable instruction is a write enable instruction for the memory direct access space pre-allocated by the host to the redundant array of independent disks card; A first judging module is configured to judge whether the remaining capacity of the host's direct memory access space is lower than a first preset threshold, and if so, trigger the second sending module; The second sending module is used to notify the host of the event that the remaining capacity of the direct memory access space is lower than the first preset threshold, so that the host can save the debugging data in the direct memory access space to the storage device and clear the debugging data in the direct memory access space.
9. A debugging data storage device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the debugging data saving method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the debugging data saving method according to any one of claims 1 to 7.