An interrupt binding core monitoring method, device, equipment and storage medium
By creating an interrupt monitoring driver in the Linux operating system to monitor and rebind network card interrupt core binding information, the problem of insufficient core binding monitoring in existing technologies is solved, thus improving the stability and reliability of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2022-10-21
- Publication Date
- 2026-06-19
AI Technical Summary
Existing technologies cannot effectively monitor whether network card interrupt binding is effective or fails during operation, resulting in insufficient stability, security and reliability of system interrupt binding.
By creating an interrupt monitoring driver in the Linux operating system, the network card interrupt binding information is monitored, and it is determined whether the current binding information is consistent with the expected binding table. If they are inconsistent, the interrupt is rebound to the specified CPU core.
It improves the stability, security, and reliability of system interrupt binding cores, and enhances the stability of system performance.
Smart Images

Figure CN115495318B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device and storage medium for interrupting core binding monitoring. Background Technology
[0002] In the Linux operating system, core binding is done in two ways: one is automatic system scheduling of core binding, and the other is manually specifying a particular CPU (Central Processing Unit) for core binding. Compared to using the kernel's irqbalance service (the interrupt balancing service provided by the Linux operating system) to schedule network card interrupts across all cores, manually binding cores fixes interrupts, which can effectively improve the network's packet sending and receiving capabilities.
[0003] For manually specifying a particular CPU for core binding, network card manufacturers usually provide a specific set_irq_affinity script to help users quickly achieve the manual core binding requirement. However, this script is only limited to completing the core binding action. It cannot monitor whether the core binding is effective or whether the core binding fails during the process.
[0004] Therefore, how to monitor whether the core binding is effective and whether the core binding fails during operation is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide an interrupt binding monitoring method, apparatus, device, and storage medium, which can monitor interrupts and observe whether interrupts are bound to the specified CPU core as expected. If the binding failure is found, the binding operation can be re-performed, thereby improving the stability, security, and reliability of system interrupt binding, and improving the stability of system performance. The specific solution is as follows:
[0006] Firstly, this application discloses an interrupt-bound core monitoring method applied to the Linux operating system, including:
[0007] When the network card driver receives a network card interrupt command message, it performs the corresponding interrupt operation according to the network card interrupt command message, and generates the corresponding network card status message according to the result of the interrupt operation.
[0008] The network card status message is sent to the pre-created interrupt monitoring driver so that the current interrupt binding information can be obtained from the Linux operating system through the interrupt monitoring driver;
[0009] The interrupt core binding table is obtained from the memory of the interrupt monitoring driver through the interrupt monitoring driver, and it is determined whether the current interrupt core binding information is consistent with the interrupt core binding table.
[0010] If the current interrupt binding information is inconsistent with the interrupt binding table, then each interrupt in the interrupt binding table will be rebound to the corresponding CPU core.
[0011] Optionally, the interruption core-binding monitoring method further includes:
[0012] The interrupt monitoring driver listens for input / output control configuration commands issued by the user through the input / output control interface, and configures the input / output control interface accordingly based on the input / output control configuration commands.
[0013] The preset time interval of the timer issued by the user and the interrupt binding table are saved to the memory of the interrupt monitoring driver through the input / output control interface.
[0014] Optionally, obtaining the interrupt binding table from the memory of the interrupt monitoring driver via the interrupt monitoring driver includes:
[0015] The interrupt binding table is retrieved from the memory of the interrupt monitoring driver by using the timer in the interrupt monitoring driver at the preset time interval.
[0016] Optionally, obtaining the interrupt binding table from the memory of the interrupt monitoring driver via the interrupt monitoring driver includes:
[0017] The interrupt binding table is retrieved from the memory of the interrupt monitoring driver using the timer in the interrupt monitoring driver and at the default time interval of the timer.
[0018] Optionally, determining whether the current interrupt core binding information is consistent with the interrupt core binding table includes:
[0019] The interrupt monitoring driver uses a timer to determine whether the current interrupt binding information matches the interrupt binding table.
[0020] Optionally, determining whether the current interrupt core binding information is consistent with the interrupt core binding table includes:
[0021] The Netlink service thread in the interrupt monitoring driver determines whether the current interrupt core binding information is consistent with the interrupt core binding table.
[0022] Optionally, sending the network card status message to the pre-created interrupt monitoring driver includes:
[0023] The network card status message is sent to the pre-created interrupt monitoring driver via a Netlink socket.
[0024] Secondly, this application discloses an interrupt-bound kernel monitoring device applied to the Linux operating system, comprising:
[0025] The interrupt operation module is used to perform corresponding interrupt operations according to the network card interrupt command message when the network card driver obtains the network card interrupt command message.
[0026] The status message generation module is used to generate corresponding network card status messages based on the interrupt operation results;
[0027] The status message sending module is used to send the network card status message to the pre-created interrupt monitoring driver;
[0028] The interrupt core binding information acquisition module is used to obtain the current interrupt core binding information from the Linux operating system through the interrupt monitoring driver;
[0029] The interrupt binding table acquisition module is used to acquire the interrupt binding table from the memory of the interrupt monitoring driver through the interrupt monitoring driver;
[0030] The judgment module is used to determine whether the current interrupt binding information is consistent with the interrupt binding table;
[0031] The interrupt rebinding module is used to rebind each interrupt in the interrupt binding table to the corresponding CPU core if the current interrupt binding information is inconsistent with the interrupt binding table.
[0032] Thirdly, this application discloses an electronic device, including a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the aforementioned interrupt binding core monitoring method.
[0033] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned interrupt binding core monitoring method.
[0034] As can be seen, this application is applied to the Linux operating system. When the network card driver receives a network card interrupt command message, it executes the corresponding interrupt operation according to the network card interrupt command message, generates a corresponding network card status message based on the interrupt operation result, and then sends the network card status message to a pre-created interrupt monitoring driver. This allows the interrupt monitoring driver to obtain the current interrupt core binding information from the Linux operating system. Next, the interrupt monitoring driver retrieves the interrupt core binding table from its memory and determines whether the current interrupt core binding information matches the interrupt core binding table. If the current interrupt core binding information does not match the interrupt core binding table, each interrupt in the interrupt core binding table is re-bound to its corresponding CPU core. This application, through a pre-created interrupt monitoring driver, can monitor interrupts and observe whether interrupts are bound to the specified CPU core as expected. If a core binding failure is found, the core binding operation can be re-performed, thereby improving the stability, security, and reliability of system interrupt core binding, and simultaneously improving system performance stability. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0036] Figure 1 This is a flowchart of a method for interrupting core binding monitoring disclosed in this application;
[0037] Figure 2 This application discloses a specific flowchart of a method for interrupting core binding monitoring;
[0038] Figure 3 This is a block diagram of a specific interruption core binding monitoring method disclosed in this application;
[0039] Figure 4 This application discloses a specific flowchart of a method for interrupting core binding monitoring;
[0040] Figure 5 This is a block diagram of a specific interruption core binding monitoring method disclosed in this application;
[0041] Figure 6 This is a schematic diagram of the structure of a core-binding monitoring device disclosed in this application;
[0042] Figure 7 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0043] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0044] This application discloses an interrupt-binding core monitoring method applied to the Linux operating system. See also... Figure 1 As shown, the method includes:
[0045] Step S11: When the network card driver obtains the network card interrupt command message, it performs the corresponding interrupt operation according to the network card interrupt command message, and generates the corresponding network card status message according to the interrupt operation result.
[0046] In this embodiment, the network card driver monitors the command messages that cause its own interruption in real time. When the network card driver receives a network card interruption command message, it first executes the corresponding interrupt operation according to the interrupt command message, and then generates the corresponding network card status message based on the execution result of the interrupt operation. For example, when the network card driver receives a message of an ifdown, ifup, or other command that caused its own interruption, it first executes an interrupt operation to close or open the network card driver, and then generates the corresponding network card status message based on the execution result after closing or opening the network card driver, such as the current network card driver being open or the current network card driver being closed.
[0047] Step S12: Send the network card status message to the pre-created interrupt monitoring driver so as to obtain the current interrupt binding information from the Linux operating system through the interrupt monitoring driver.
[0048] In this embodiment, after generating the corresponding network card status message based on the interrupt operation result, the network card status message is further sent to the pre-created interrupt monitoring driver. Then, the interrupt monitoring driver can obtain the current interrupt binding information from the Linux operating system.
[0049] In one specific implementation, sending the network interface card (NIC) status message to a pre-created interrupt monitoring driver may specifically include: sending the NIC status message to the pre-created interrupt monitoring driver via a Netlink socket. That is, when sending the NIC status message to the pre-created interrupt monitoring driver, information transmission is performed through a Netlink socket.
[0050] It should be noted that, in addition to acquiring network card status messages sent by the network card driver, the interrupt monitoring driver also includes: listening to user-issued input / output control configuration commands through the input / output control interface in the interrupt monitoring driver, and configuring the input / output control interface accordingly based on the input / output control configuration commands; and saving the user-issued preset time interval of the timer and the interrupt binding table to the memory of the interrupt monitoring driver through the input / output control interface. That is, the input / output control (i.e., ioctl) interface in the interrupt monitoring driver can also listen to user-issued input / output control configuration commands in real time. When a user-issued input / output control configuration command is detected, the input / output control interface is configured accordingly based on the aforementioned input / output control configuration command. Furthermore, the input / output control interface can also save the user-issued preset time interval of the timer and the interrupt binding table; the specific saving location includes, but is not limited to, the memory of the input / output control interface.
[0051] Step S13: Obtain the interrupt binding table from the memory of the interrupt monitoring driver through the interrupt monitoring driver, and determine whether the current interrupt binding information is consistent with the interrupt binding table.
[0052] In this embodiment, after obtaining the current interrupt binding information from the Linux operating system through the interrupt monitoring driver, the interrupt monitoring driver can further obtain the pre-stored interrupt binding table from the memory of the interrupt monitoring driver, and then compare the current interrupt binding information with the interrupt binding table to determine whether the information recorded in the two is consistent.
[0053] In one specific implementation, retrieving the interrupt binding table from the interrupt monitoring driver's memory via the interrupt monitoring driver may specifically include: retrieving the interrupt binding table from the interrupt monitoring driver's memory using a timer within the interrupt monitoring driver and according to the timer's default time interval. That is, a default time interval is preset in the timer within the interrupt monitoring driver; when the default time interval is reached, the timer triggers the operation of retrieving the interrupt binding table from the interrupt monitoring driver's memory.
[0054] Step S14: If the current interrupt binding information is inconsistent with the interrupt binding table, then rebind each interrupt in the interrupt binding table to the corresponding CPU core.
[0055] In this embodiment, if the current interrupt binding information is inconsistent with the information recorded in the interrupt binding table, then each interrupt in the interrupt binding table will be rebound to the corresponding CPU core.
[0056] As can be seen, this application embodiment is applied to the Linux operating system. When the network card driver obtains a network card interrupt command message, it executes the corresponding interrupt operation according to the network card interrupt command message, generates a corresponding network card status message based on the interrupt operation result, and then sends the network card status message to a pre-created interrupt monitoring driver. This allows the interrupt monitoring driver to obtain the current interrupt core binding information from the Linux operating system. Next, the interrupt monitoring driver retrieves the interrupt core binding table from its memory and determines whether the current interrupt core binding information matches the interrupt core binding table. If the current interrupt core binding information does not match the interrupt core binding table, each interrupt in the interrupt core binding table is re-bound to its corresponding CPU core. This application embodiment, through the pre-created interrupt monitoring driver, can monitor interrupts and observe whether interrupts are bound to the specified CPU core as expected. If a core binding failure is found, the core binding operation can be re-performed, thereby improving the stability, security, and reliability of system interrupt core binding, and simultaneously improving system performance stability.
[0057] This application discloses a specific interrupt binding core monitoring method applied to the Linux operating system. See [link to relevant documentation]. Figure 2 As shown, the method includes:
[0058] Step S21: Listen for input / output control configuration commands issued by the user through the input / output control interface in the pre-created interrupt monitoring driver, and configure the input / output control interface accordingly based on the input / output control configuration commands.
[0059] In this embodiment, see Figure 3 As shown, the input / output control configuration commands issued by the user are first monitored through the input / output control interface in the pre-created interrupt monitoring driver. When the input / output control configuration command issued by the user is detected, the input / output control interface is configured accordingly based on the input / output control configuration command.
[0060] Step S22: Save the preset time interval of the timer issued by the user and the interrupt binding table to the memory of the interrupt monitoring driver through the input / output control interface.
[0061] In this embodiment, after configuring the input / output control interface according to the input / output control configuration command, the preset time interval of the timer issued by the user and the interrupt binding table are further stored in the memory of the interrupt monitoring driver through the input / output control interface.
[0062] Step S23: When the network card driver obtains the network card interrupt command message, it performs the corresponding interrupt operation according to the network card interrupt command message, and generates the corresponding network card status message according to the interrupt operation result.
[0063] In this embodiment, after the preset time interval of the timer issued by the user and the interrupt binding table are saved to the memory of the interrupt monitoring driver through the input / output control interface, when the network card driver obtains the network card interrupt command message, such as ifdown, ifup, etc., it first performs the interrupt operation of the network card driver to disable or enable the interrupt according to the interrupt action carried in the above network card interrupt command message, and then generates the corresponding network card status message according to the execution result of the interrupt operation.
[0064] Step S24: Send the network card status message to the pre-created interrupt monitoring driver via the Netlink socket, so as to obtain the current interrupt binding information from the Linux operating system through the interrupt monitoring driver.
[0065] In this embodiment, after generating the corresponding network card status message based on the interrupt operation result, see [link to documentation]. Figure 3 As shown, the network card status message can be sent to the pre-created interrupt monitoring driver via a Netlink socket, and then the interrupt monitoring driver can obtain the current interrupt binding information from the Linux operating system.
[0066] Step S25: Obtain the interrupt binding table from the memory of the interrupt monitoring driver using the timer in the interrupt monitoring driver and according to the preset time interval, and determine whether the current interrupt binding information is consistent with the interrupt binding table using the timer in the interrupt monitoring driver.
[0067] In this embodiment, after obtaining the current interrupt binding information from the Linux operating system through the interrupt monitoring driver, the interrupt binding table can be further obtained from the memory of the interrupt monitoring driver through the timer in the interrupt monitoring driver according to the preset time interval. That is, the time interval of the user-set timer is pre-stored in the memory of the interrupt monitoring driver. When the preset time interval is reached, the operation of obtaining the interrupt binding table from the memory of the interrupt monitoring driver is triggered. Then, the current interrupt binding information and the interrupt binding table are compared by the timer in the interrupt monitoring driver, and it is determined whether the information recorded in the two is consistent.
[0068] Step S26: If the current interrupt binding information is inconsistent with the interrupt binding table, then rebind each interrupt in the interrupt binding table to the corresponding CPU core.
[0069] For a more detailed explanation of the process of step S26, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.
[0070] As can be seen, in this embodiment, the input / output control interface in the pre-created interrupt monitoring driver first listens for the input / output control configuration commands issued by the user, and configures the input / output control interface accordingly according to the input / output control configuration commands. Then, the preset time interval of the timer issued by the user and the interrupt core binding table are saved to the memory of the interrupt monitoring driver through the input / output control interface. When the network card driver obtains the network card interrupt command message, it performs the corresponding interrupt operation according to the network card interrupt command message, and generates the corresponding network card status message according to the interrupt operation result. Then, the network card status message is sent to the pre-created interrupt monitoring driver through the Netlink socket, so that the interrupt monitoring driver can obtain the current interrupt core binding information from the Linux operating system. Then, the interrupt core binding table is obtained from the memory of the interrupt monitoring driver through the timer in the interrupt monitoring driver according to the preset time interval. The interrupt core binding information is determined by the timer in the interrupt monitoring driver to see if the current interrupt core binding information is consistent with the interrupt core binding table. If the current interrupt core binding information is inconsistent with the interrupt core binding table, each interrupt in the interrupt core binding table is rebound to the corresponding CPU core. This application embodiment can monitor interrupts through a pre-created interrupt monitoring driver, and determine whether the interrupt is bound to the specified CPU core as expected by the interrupt binding table in the interrupt monitoring driver's memory. If the interrupt binding table is inconsistent with the current interrupt binding information, the binding is determined to be invalid, and each interrupt in the interrupt binding table can be rebound. Furthermore, the input / output control interface in the interrupt monitoring driver can listen to the input / output control configuration commands issued by the user and configure the input / output control interface accordingly, thereby improving the stability, security, and reliability of the system interrupt binding, and improving the stability of system performance.
[0071] This application discloses a specific interrupt binding core monitoring method applied to the Linux operating system. See [link to relevant documentation]. Figure 4 As shown, the method includes:
[0072] Step S31: Listen for input / output control configuration commands issued by the user through the input / output control interface in the pre-created interrupt monitoring driver, and configure the input / output control interface accordingly based on the input / output control configuration commands.
[0073] In this embodiment, the input / output control configuration commands issued by the user are first monitored through the input / output control interface in the pre-created interrupt monitoring driver. When the input / output control configuration command issued by the user is detected, the input / output control interface can be configured accordingly based on the input / output control configuration command.
[0074] Step S32: Save the preset time interval of the timer issued by the user and the interrupt binding table to the memory of the interrupt monitoring driver through the input / output control interface.
[0075] In this embodiment, see Figure 5 As shown, after configuring the input / output control interface according to the input / output control configuration command, the preset time interval of the timer issued by the user and the interrupt binding table can be further saved into the memory of the interrupt monitoring driver through the input / output control interface.
[0076] Step S33: When the network card driver obtains the network card interrupt command message, it performs the corresponding interrupt operation according to the network card interrupt command message, and generates the corresponding network card status message according to the interrupt operation result.
[0077] In this embodiment, when the network card driver obtains a network card interrupt command message (such as ifdown, ifup, etc.), it executes the corresponding interrupt operation according to the network card interrupt command message, and then generates the corresponding network card status message based on the execution result of the interrupt operation.
[0078] Step S34: Send the network card status message to the pre-created interrupt monitoring driver via the Netlink socket, so as to obtain the current interrupt binding information from the Linux operating system through the interrupt monitoring driver.
[0079] In this embodiment, after generating the corresponding network card status message based on the interrupt operation result, the network card status message can be sent to the pre-created interrupt monitoring driver through the Netlink socket, and then the interrupt monitoring driver can obtain the current interrupt binding information from the Linux operating system.
[0080] Step S35: Obtain the interrupt core binding table from the memory of the interrupt monitoring driver using the timer in the interrupt monitoring driver and according to the preset time interval, and determine whether the current interrupt core binding information is consistent with the interrupt core binding table through the Netlink service thread in the interrupt monitoring driver.
[0081] In this embodiment, after obtaining the current interrupt binding information from the Linux operating system through the interrupt monitoring driver, when the preset time interval set for the timer is reached, the interrupt binding table stored in the memory of the interrupt monitoring driver is obtained through the timer in the interrupt monitoring driver. Then, the Netlink service thread (i.e., the Netlink Server thread) in the interrupt monitoring driver determines whether the current interrupt binding information is consistent with the information recorded in the interrupt binding table.
[0082] Step S36: If the current interrupt binding information is inconsistent with the interrupt binding table, then rebind each interrupt in the interrupt binding table to the corresponding CPU core.
[0083] For a more detailed description of the process of step S36, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.
[0084] As can be seen, in this embodiment, the input / output control interface in the pre-created interrupt monitoring driver first listens for the input / output control configuration commands issued by the user, and configures the input / output control interface accordingly according to the input / output control configuration commands. Then, the preset time interval of the timer issued by the user and the interrupt core binding table are saved to the memory of the interrupt monitoring driver through the input / output control interface. When the network card driver obtains the network card interrupt command message, it performs the corresponding interrupt operation according to the network card interrupt command message, and generates the corresponding network card status message according to the interrupt operation result. Then, the network card status message is sent to the pre-created interrupt monitoring driver through the Netlink socket, so that the interrupt monitoring driver can obtain the current interrupt core binding information from the Linux operating system. Then, the interrupt core binding table is obtained from the memory of the interrupt monitoring driver through the timer in the interrupt monitoring driver according to the preset time interval. The Netlink service thread in the interrupt monitoring driver determines whether the current interrupt core binding information is consistent with the interrupt core binding table. If the current interrupt core binding information is inconsistent with the interrupt core binding table, the interrupts in the interrupt core binding table are rebound to the corresponding CPU cores. This application embodiment can monitor interrupts through a pre-created interrupt monitoring driver, and determine whether the interrupt is bound to the specified CPU core as expected by using the Netlink service thread and the interrupt binding table in the interrupt monitoring driver's memory. If the interrupt binding table is inconsistent with the current interrupt binding information, the binding is determined to be invalid, and each interrupt in the interrupt binding table can be rebound. Furthermore, the input / output control interface in the interrupt monitoring driver can listen to the input / output control configuration commands issued by the user and configure the input / output control interface accordingly, thereby improving the stability, security, and reliability of the system interrupt binding, and improving the stability of system performance.
[0085] Accordingly, this application also discloses an interrupt-binding core monitoring device applied to the Linux operating system, see [link to relevant documentation]. Figure 6 As shown, the device includes:
[0086] Interrupt operation module 11 is used to perform corresponding interrupt operations according to the network card interrupt command message when the network card driver obtains the network card interrupt command message;
[0087] Status message generation module 12 is used to generate corresponding network card status messages based on the interrupt operation results;
[0088] Status message sending module 13 is used to send the network card status message to a pre-created interrupt monitoring driver;
[0089] Interrupt core binding information acquisition module 14 is used to acquire current interrupt core binding information from the Linux operating system through the interrupt monitoring driver;
[0090] Interrupt binding table acquisition module 15 is used to acquire the interrupt binding table from the memory of the interrupt monitoring driver through the interrupt monitoring driver;
[0091] The judgment module 16 is used to determine whether the current interrupt binding information is consistent with the interrupt binding table;
[0092] Interrupt rebinding module 17 is used to rebind each interrupt in the interrupt binding table to the corresponding CPU core if the current interrupt binding information is inconsistent with the interrupt binding table.
[0093] The specific workflow of each of the above modules can be found in the relevant content disclosed in the foregoing embodiments, and will not be repeated here.
[0094] As can be seen, this application embodiment is applied to the Linux operating system. When the network card driver obtains a network card interrupt command message, it executes the corresponding interrupt operation according to the network card interrupt command message, generates a corresponding network card status message based on the interrupt operation result, and then sends the network card status message to a pre-created interrupt monitoring driver. This allows the interrupt monitoring driver to obtain the current interrupt core binding information from the Linux operating system. Next, the interrupt monitoring driver retrieves the interrupt core binding table from its memory and determines whether the current interrupt core binding information matches the interrupt core binding table. If the current interrupt core binding information does not match the interrupt core binding table, each interrupt in the interrupt core binding table is re-bound to its corresponding CPU core. This application embodiment, through the pre-created interrupt monitoring driver, can monitor interrupts and observe whether interrupts are bound to the specified CPU core as expected. If a core binding failure is found, the core binding operation can be re-performed, thereby improving the stability, security, and reliability of system interrupt core binding, and simultaneously improving system performance stability.
[0095] In some specific embodiments, the interruption core-binding monitoring device may further include:
[0096] The control configuration command listening unit is used to listen for input / output control configuration commands issued by the user through the input / output control interface in the interrupt monitoring driver;
[0097] An interface configuration unit is used to configure the input / output control interface accordingly based on the input / output control configuration command.
[0098] The information storage unit is used to save the preset time interval of the timer issued by the user and the interrupt binding table to the memory of the interrupt monitoring driver through the input / output control interface.
[0099] In some specific embodiments, the interrupt binding core table acquisition module 15 may specifically include:
[0100] The first interrupt binding table acquisition unit is used to acquire the interrupt binding table from the memory of the interrupt monitoring driver through the timer in the interrupt monitoring driver and according to the preset time interval.
[0101] In some specific embodiments, the interrupt binding core table acquisition module 15 may specifically include:
[0102] The second interrupt binding table acquisition unit is used to acquire the interrupt binding table from the memory of the interrupt monitoring driver through the timer in the interrupt monitoring driver and according to the default time interval of the timer.
[0103] In some specific embodiments, the determination module 16 may specifically include:
[0104] The first judgment unit is used to determine whether the current interrupt binding information is consistent with the interrupt binding table by using the timer in the interrupt monitoring driver.
[0105] In some specific embodiments, the determination module 16 may specifically include:
[0106] The second judgment unit is used to determine whether the current interrupt core binding information is consistent with the interrupt core binding table through the Netlink service thread in the interrupt monitoring driver.
[0107] In some specific embodiments, the status message sending module 13 may specifically include:
[0108] The status message sending unit is used to send the network card status message to a pre-created interrupt monitoring driver via a Netlink socket.
[0109] Furthermore, embodiments of this application also disclose an electronic device, Figure 7 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0110] Figure 7This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the interrupt binding core monitoring method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0111] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0112] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0113] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the interrupt-bound core monitoring method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0114] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned interrupt binding core monitoring method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0115] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0116] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0117] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0118] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0119] The above provides a detailed description of the interruption core binding monitoring method, apparatus, device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An interrupt bundle monitoring method, comprising: Applied to the Linux operating system, including: When the network card driver receives a network card interrupt command message, it performs the corresponding interrupt operation according to the network card interrupt command message, and generates the corresponding network card status message according to the result of the interrupt operation. The network card status message is sent to the pre-created interrupt monitoring driver so that the current interrupt binding information can be obtained from the Linux operating system through the interrupt monitoring driver; The interrupt core binding table is obtained from the memory of the interrupt monitoring driver through the interrupt monitoring driver, and it is determined whether the current interrupt core binding information is consistent with the interrupt core binding table. If the current interrupt binding information is inconsistent with the interrupt binding table, then each interrupt in the interrupt binding table will be rebound to the corresponding CPU core. The method is characterized in that it further includes: The interrupt monitoring driver listens for input / output control configuration commands issued by the user through the input / output control interface, and configures the input / output control interface accordingly based on the input / output control configuration commands. The preset time interval of the timer issued by the user and the interrupt binding table are saved to the memory of the interrupt monitoring driver through the input / output control interface.
2. The interrupt bundle monitoring method of claim 1, wherein, The step of retrieving the interrupt binding table from the memory of the interrupt monitoring driver via the interrupt monitoring driver includes: The interrupt binding table is retrieved from the memory of the interrupt monitoring driver by using the timer in the interrupt monitoring driver at the preset time interval.
3. The interruption core-binding monitoring method according to claim 1, characterized in that, The step of retrieving the interrupt binding table from the memory of the interrupt monitoring driver via the interrupt monitoring driver includes: The interrupt binding table is retrieved from the memory of the interrupt monitoring driver using the timer in the interrupt monitoring driver and at the default time interval of the timer.
4. The interruption core-binding monitoring method according to claim 1, characterized in that, The step of determining whether the current interrupt core binding information is consistent with the interrupt core binding table includes: The interrupt monitoring driver uses a timer to determine whether the current interrupt binding information matches the interrupt binding table.
5. The interruption-binding core monitoring method according to claim 1, characterized in that, The step of determining whether the current interrupt core binding information is consistent with the interrupt core binding table includes: The Netlink service thread in the interrupt monitoring driver determines whether the current interrupt core binding information is consistent with the interrupt core binding table.
6. The interruption core-binding monitoring method according to any one of claims 1 to 5, characterized in that, Sending the network card status message to the pre-created interrupt monitoring driver includes: The network card status message is sent to the pre-created interrupt monitoring driver via a Netlink socket.
7. A device for monitoring interrupted core binding, characterized in that, Applied to the Linux operating system, including: The interrupt operation module is used to perform corresponding interrupt operations according to the network card interrupt command message when the network card driver obtains the network card interrupt command message. The status message generation module is used to generate corresponding network card status messages based on the interrupt operation results; The status message sending module is used to send the network card status message to the pre-created interrupt monitoring driver; The interrupt core binding information acquisition module is used to obtain the current interrupt core binding information from the Linux operating system through the interrupt monitoring driver; The interrupt binding table acquisition module is used to acquire the interrupt binding table from the memory of the interrupt monitoring driver through the interrupt monitoring driver; The judgment module is used to determine whether the current interrupt binding information is consistent with the interrupt binding table; The interrupt rebinding module is used to rebind each interrupt in the interrupt binding table to the corresponding CPU core if the current interrupt binding information is inconsistent with the interrupt binding table. The device is further configured to listen for input / output control configuration commands issued by the user through the input / output control interface in the interrupt monitoring driver, and configure the input / output control interface accordingly based on the input / output control configuration commands; and save the preset time interval of the timer issued by the user and the interrupt binding table to the memory of the interrupt monitoring driver through the input / output control interface.
8. An electronic device, characterized in that, It includes a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the interrupt binding core monitoring method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the interrupt binding core monitoring method as described in any one of claims 1 to 6.