Interrupt processing method and device, computer equipment and computer readable storage medium
By matching and sending interrupt event information into message, the problem of limited number of vector numbers in the general interrupt controller is solved, and the special vector number allocation of each interrupt event is realized, which reduces the interrupt processing delay and improves the system's Responsiveness.
Patent Information
- Application Number
- CN202411271025.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-11-29
AI Technical Summary
The limited number of line interrupt vector numbers supported by existing general interrupt controllers results in an increase in interrupt processing delays and cannot meet the increasing interrupt needs in the system.
The processor obtains the line interrupt request information from the interrupt source, matches the pre-stored interrupt event information, and sends the matching successful information to the interrupt controller for processing, avoiding transmission through the dedicated signal line, and realizing each interrupt event special vector number allocation.
It solves the problem of limited number of vector numbers and large interrupt processing delay, allowing each interrupt event to allocate a special vector number, which improves the system's responsiveness and processing capabilities.
Smart Images

Figure CN119046209A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of interrupt processing, and in particular to an interrupt processing method, apparatus, computer equipment and computer-readable storage medium. Background Art
[0002] The existing Generic Interrupt Controller (GIC) can only support a small number of line interrupt vector numbers (IDs) (the number of signal lines is limited). As the system continues to expand, the number of interrupts continues to increase, and it can no longer meet application needs. Although interrupts can be merged to share the same vector number, it will increase the delay in interrupt processing (it is necessary to read the corresponding status to determine the specific event). Summary of the invention
[0003] The embodiments of the present application provide an interrupt processing method, apparatus, computer device, computer-readable storage medium and computer program product, which can solve the above-mentioned technical problems of limited number of vector numbers and large interrupt processing delay.
[0004] In view of this, in a first aspect, an embodiment of the present application provides an interrupt processing method, comprising:
[0005] Obtaining line interrupt request information from an interrupt source, wherein the line interrupt request information includes a vector number;
[0006] Matching the vector number in the line interrupt request information with a plurality of pre-stored groups of interrupt event information, each group of the interrupt event information including a vector number, address information and characteristic information of an interrupt event;
[0007] A set of the interrupt event information that is successfully matched is sent to the interrupt controller for message interrupt processing.
[0008] In one embodiment, several groups of the interruption event information are stored in a list form.
[0009] In one embodiment, several sets of the interrupt event information are stored in a random access memory.
[0010] In one embodiment, the successfully matched interrupt event information is sent to a routing network and then sent to the interrupt router through the routing network.
[0011] In one embodiment, each group of the interruption event information further includes priority information. When there are two or more groups of the interruption event information that are successfully matched, the routing network determines the sending order of each group of the interruption event information according to the priority.
[0012] In one embodiment, the interrupt handler is a general interrupt controller.
[0013] In one embodiment, the interrupt processing method is performed based on the ARM architecture.
[0014] In a second aspect, an embodiment of the present application further provides an interrupt processing device, including:
[0015] An acquisition module, used for acquiring line interrupt request information from an interrupt source, wherein the line interrupt request information includes a vector number;
[0016] A matching module, used for matching a plurality of pre-stored groups of interrupt event information based on the vector number in the line interrupt request information, each group of the interrupt event information including a vector number, address information and characteristic information of an interrupt event;
[0017] The sending module is used to send a group of successfully matched interrupt event information to the interrupt controller for message interrupt processing.
[0018] In a third aspect, an embodiment of the present application further provides a computer device, including a memory and a processor;
[0019] The memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the interrupt processing method described in any one of the first aspects.
[0020] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the interrupt handling method described in any one of the first aspects.
[0021] In a fifth aspect, an embodiment of the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
[0022] The above interrupt processing method, device, computer equipment, computer-readable storage medium and computer program product obtain line interrupt request information from the interrupt source through the processor, and the line interrupt request information does not need to be transmitted to the interrupt controller through a dedicated signal line. After the processor obtains the line interrupt request information, the vector number therein is matched with a plurality of pre-stored groups of interrupt event information. When the corresponding interrupt event information is matched, the successfully matched interrupt event information can be sent to the interrupt controller in the form of a message for processing. In this way, the interrupt controller can perform corresponding message interrupt processing after receiving the successfully matched interrupt event information. In the case of converting the line interrupt request information into a message interrupt for processing, a dedicated vector number can be assigned to each interrupt event, and the vector number based on the dedicated signal line will not be occupied, which can solve the technical problems of limited number of vector numbers and large interrupt processing delay. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 Schematic diagram of the process of interrupt processing in the embodiment of the present application.
[0024] Figure 2 It is a schematic block diagram of an interrupt processing method according to an embodiment of the present application.
[0025] Figure 3 It is a schematic diagram of an interrupt processing device in an embodiment of the present application.
[0026] Figure 4 It is a schematic diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0028] Interrupt handling refers to a mechanism in a computer system that responds to external events or hardware exceptions. When an interrupt occurs in the system, the CPU will pause the currently executed command and execute the interrupt-related handler instead. Interrupt handling can be applied to handle various events, such as hardware failures, input / output requests, etc. Interrupt handling helps improve the system's responsiveness and processing complexity.
[0029] With the rapid development of the ARM architecture, there is a strong demand for products based on its architecture, especially in the field of high-performance computing. As the system continues to grow, the requirements for the RAS mechanism are getting higher and higher, and interrupts are the key function of the RAS mechanism, which is crucial to the reliability, stability, and maintainability of the entire system. At the same time, more and more interrupt information is needed to notify the processor to manage specific events to ensure the reliability of the entire system. At present, the SGI / PPI interrupt vector number planned by the general interrupt controller is limited. With the continuous expansion of the system, the number of interrupts continues to increase, which can no longer meet the application needs. Although the same vector number can be shared by interrupt merging, it will increase the delay of interrupt processing (it is necessary to read the corresponding status to determine the specific event).
[0030] Message interrupts (LPI; Locality-specific Peripheral Interrupts) are the trend of future technology development, and SoC design requires the use of message interrupts for management as much as possible (ARM has no limit on the number of message interrupts).
[0031] Based on the above situation, an embodiment of the present application proposes an interrupt processing solution, which aims to solve at least part of the above-mentioned technical problems.
[0032] See also Figure 1 and Figure 2 , the embodiment of the present application discloses an interrupt processing method, including:
[0033] S101. Obtain line interrupt request information from an interrupt source, where the line interrupt request information includes a vector number.
[0034] It should be explained that the so-called line interrupt refers to an interruption in which the interrupt request information needs to be transmitted through a dedicated signal line. The interrupt request information of the line interrupt can be named as line interrupt request information. In the prior art, the line interrupt request information is transmitted to the interrupt controller through a dedicated signal line. For example, when a user presses a key on the keyboard, the keyboard controller detects the key event and sends the line interrupt request information to the interrupt controller through the dedicated signal line. How to deal with the existing line interruption in the future is known to those skilled in the art and will not be described in detail here.
[0035] Since the interrupt request information itself is no different, in order to facilitate the improvement of converting it into a message interrupt for processing in the embodiment of the present application, the embodiment of the present application still names it as line interrupt request information, but the line interrupt request information does not need to be transmitted through a dedicated signal line.
[0036] In some embodiments, the line interrupt request information may be obtained by monitoring the rising edge or falling edge of the interrupt source, but this is not limited thereto.
[0037] S102 . Matching is performed based on the vector number in the line interrupt request information with a plurality of pre-stored groups of interrupt event information, where each group of interrupt event information includes a vector number, address information, and feature information of an interrupt event.
[0038] The address information and characteristic information can refer to the prior art, wherein the characteristic information is data reflecting which interrupt event it is, for example, when the interrupt event is A, the characteristic information is data that can be determined as interrupt event A. Corresponding interrupt processing can be performed based on the address information and characteristic information.
[0039] In an embodiment of the present application, the line interrupt request information originally to be transmitted through the dedicated signal line does not need to be transmitted to the interrupt controller through the dedicated signal line, but the line interrupt request information from the interrupt source is obtained by the processor. After the processor obtains the line interrupt request information, the vector number therein is matched with several pre-stored groups of interrupt event information. After matching the corresponding group of interrupt event information, the successfully matched interrupt event information can be sent to the interrupt controller in the form of a message for processing. In the case of converting the line interrupt request information into a message interrupt for processing, a special vector number can be assigned to each interrupt event, and the vector number based on the dedicated signal line will not be occupied. For example, in the case of 1000 dedicated signal lines, there are 10,000 interrupt events, and 10,000 vector numbers corresponding to the 10,000 interrupt events can be configured respectively. At the same time, 10,000 groups of interrupt event information can be pre-stored, and the vector number in each group of interrupt event information is one of the vector numbers.
[0040] In some implementations, several groups of interrupt event information are stored in a list format, which may include items such as vector number, address information, feature information, etc. Accordingly, each group of interrupt event information occupies one entry, including the corresponding vector number, address information, feature information, etc.
[0041] In some implementations, sets of interrupt event information are stored in random access memory (RAM).
[0042] Specifically, during the system initialization phase, each group of interrupt event information may be filled in as required to implement interrupt registration for subsequent matching.
[0043] S103: Send a set of successfully matched interrupt event information to the interrupt controller.
[0044] It should be noted that sending the interrupt event information to the interrupt controller here does not necessarily mean sending all information of a set of interrupt event information to the interrupt controller.
[0045] How the interrupt controller performs message interrupt processing based on the received address information and data information is well known to those skilled in the art and will not be described in detail here.
[0046] Specifically, the successfully matched interrupt event information is sent to the routing network and sent to the interrupt router through the routing network. How to transmit messages between the routing network and the interrupt controller and how the interrupt controller processes the information sent from the routing network are known to those skilled in the art and will not be described in detail here.
[0047] Furthermore, each group of interruption event information also includes priority information (QoS). When there are two or more groups of successfully matched interruption event information, the routing network determines the order of sending each group of interruption event information according to the priority level based on the received priority information. Specifically, the priority information can be adjusted as needed, and the priority information in each group of interruption event information can also be set to be the same.
[0048] Specifically, the interrupt handler in the embodiment of the present application is a generic interrupt controller (GIC; GenericInterrupt Controller).
[0049] Specifically, the interrupt processing method of the embodiment of the present application is performed based on the ARM architecture. The ARM architecture has no restrictions on the number of vector numbers of message interrupts, and a dedicated vector number can be assigned to each interrupt event.
[0050] In the embodiment of the present application, the processor obtains the line interrupt request information from the interrupt source, and the line interrupt request information does not need to be transmitted to the interrupt controller through a dedicated signal line. After the processor obtains the line interrupt request information, the vector number therein is matched with a plurality of pre-stored groups of interrupt event information. When the corresponding interrupt event information is matched, the successfully matched interrupt event information can be sent to the interrupt controller in the form of a message for processing. In this way, after receiving the successfully matched interrupt event information, the interrupt controller can perform the corresponding message interrupt processing. In the case of converting the line interrupt request information into a message interrupt for processing, a dedicated vector number can be assigned to each interrupt event, and the vector number based on the dedicated signal line will not be occupied, which can solve the technical problems of limited number of vector numbers and large interrupt processing delay.
[0051] In order to facilitate understanding of the embodiments of the present application, the following examples are briefly described:
[0052] Suppose a system needs to implement 100 interrupt events, and the vector number of each interrupt event is 1 to 100. First, in the system initialization phase, the software fills in the information of 100 entries as needed to form 100 groups of interrupt event information to realize interrupt registration. At the same time, the priority information is set, for example, the priority information of each entry is 0 by default, that is, there is no priority distinction for all interrupts. Then, start normal business. At this time, if an abnormal event occurs in the system, its vector number is 9. Through the matching of the vector number, the entry with vector number 9 is hit, and then the address information, feature information, priority information, etc. in the entry are read out and sent to the routing network, and then the routing network sends the address information and feature information to the interrupt controller for processing.
[0053] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0054] Based on the same inventive concept, the embodiment of the present application also provides an interrupt processing device for implementing the interrupt processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations / descriptions in the interrupt processing device embodiment provided below can refer to the limitations / descriptions of the interrupt processing method above, and will not be repeated here.
[0055] See also Figure 3 , the interrupt processing device of the embodiment of the present application includes:
[0056] The acquisition module 201 is used to acquire line interrupt request information from an interrupt source, where the line interrupt request information includes a vector number;
[0057] A matching module 202, used for matching a plurality of pre-stored groups of interrupt event information based on the vector number in the line interrupt request information, each group of interrupt event information including a vector number, address information and characteristic information of an interrupt event;
[0058] The sending module 203 is used to send a set of successfully matched interrupt event information to the interrupt controller for message interrupt processing.
[0059] In the embodiment of the present application, the processor obtains the line interrupt request information from the interrupt source, and the line interrupt request information does not need to be transmitted to the interrupt controller through a dedicated signal line. After the processor obtains the line interrupt request information, the vector number therein is matched with a plurality of pre-stored groups of interrupt event information. When the corresponding interrupt event information is matched, the successfully matched interrupt event information can be sent to the interrupt controller in the form of a message for processing. In this way, after receiving the successfully matched interrupt event information, the interrupt controller can perform the corresponding message interrupt processing. In the case of converting the line interrupt request information into a message interrupt for processing, a dedicated vector number can be assigned to each interrupt event, and the vector number based on the dedicated signal line will not be occupied, which can solve the technical problems of limited number of vector numbers and large interrupt processing delay.
[0060] In the embodiments of the present application, the term "module" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0061] Figure 4 Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 4 As shown, the computer device may include: a processor 301 and a memory 302. The memory 302 is connected to the processor 301, and the memory 302 is used to store a computer program. The processor 301 is used to call the computer program so that the computer device executes the interrupt processing method described in the above embodiment. In addition, the above computer device may also include: at least one communication bus 303. Among them, the communication bus 303 is used to realize the connection communication between components. The memory 302 can be a high-speed RAM memory, or a non-volatile memory, such as at least one disk memory.
[0062] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for being loaded by a processor and executing the interrupt processing method described in the above embodiment.
[0063] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the electronic device executes the interrupt processing method described in the above embodiment.
[0064] It should be understood that in the embodiments of the present application, the processor referred to may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0065] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by hardware related to computer program instructions, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0066] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0067] The above disclosure is only a preferred example of the present application and cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are all within the scope covered by the present application.
Claims
1. An interrupt processing method, characterized in that: include: Obtaining line interrupt request information from an interrupt source, wherein the line interrupt request information includes a vector number; Matching the vector number in the line interrupt request information with a plurality of pre-stored groups of interrupt event information, each group of the interrupt event information including a vector number, address information and characteristic information of an interrupt event; A set of the interrupt event information that is successfully matched is sent to the interrupt controller for message interrupt processing.
2. The interrupt processing method according to claim 1, characterized in that: Several groups of the interruption event information are stored in a list form.
3. The interrupt processing method according to claim 1 or 2, characterized in that: Several groups of the interrupt event information are stored in a random access memory.
4. The interrupt processing method according to claim 1, characterized in that: The successfully matched interrupt event information is sent to the routing network and then sent to the interrupt router through the routing network.
5. The interrupt processing method according to claim 4, characterized in that: Each group of the interruption event information further includes priority information. When there are two or more groups of the interruption event information that are successfully matched, the routing network determines the sending order of each group of the interruption event information according to the priority.
6. The interrupt processing method according to claim 1, characterized in that: The interrupt processor is a general interrupt controller.
7. The interrupt processing method according to claim 1, characterized in that: The interrupt processing method is performed based on the ARM architecture.
8. An interrupt processing device, characterized in that: include: An acquisition module, used for acquiring line interrupt request information from an interrupt source, wherein the line interrupt request information includes a vector number; A matching module, used for matching a plurality of pre-stored groups of interrupt event information based on the vector number in the line interrupt request information, each group of the interrupt event information including a vector number, address information and characteristic information of an interrupt event; The sending module is used to send a group of successfully matched interrupt event information to the interrupt controller for message interrupt processing.
9. A computer device, characterized in that: including memory and processor; The memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the interrupt processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the interrupt processing method according to any one of claims 1 to 7.
