Interrupt disabling apparatus, system, and method
An interrupt processing apparatus, system, and article including a machine-accessible medium, along with a method of processing interrupts, optimize interrupt-handling by combining the activities of acknowledging and disabling the interrupt. In one embodiment, the apparatus may include an interrupt cause register coupled to an interrupt disabling register and an interrupt mask register. The system may include a processor coupled to an interrupt cause register using a bus, along with an interrupt disabling register coupled to an interrupt mask register and the interrupt disabling register. The method may include reading an interrupt cause register in response to receiving an interrupt, and transferring a mask value stored in an interrupt disabling register directly to an interrupt mask register so as to disable receiving further interrupts from the interrupt source.
Latest Patents:
- Method to detect camera position change on moving vehicle parts
- Imaging chamber for an imaging system
- Method and apparatus for processing three dimensional graphic data, device, storage medium and product
- Method and apparatus of encoding/decoding series of data
- Dynamic generation of goals and images
This application is a continuation of U.S. patent application Ser. No. 10/087,382, filed on Mar. 1, 2002 and incorporated herein by reference.
TECHNICAL FIELDEmbodiments of the present invention relate generally to apparatus and methods used for program interrupt processing. More particularly, embodiments of the present invention relate to reducing the time required to respond to program interrupts, especially multiple interrupts in rapid succession.
BACKGROUND INFORMATIONA computer system typically includes one or more peripheral devices, such as, for example, a printer, disk drive, keyboard, video monitor, and/or a network interface card (NIC). Most peripheral devices coupled to a computer system generate an electrical signal, or interrupt, when they need some form of attention from a Central Processing Unit (CPU) or processor. This interrupt is usually an asynchronous event that suspends the normal processing operations of the CPU. For instance, a network controller might interrupt to indicate reception of a new packet, or to indicate the successful transmission of an outgoing packet.
Legacy devices generate interrupts by asserting an “interrupt line”, which alerts the host processor to the interrupt. Newer devices may use a Message-Signaled Interrupt (MSI) instead, which makes use of the interrupting device to write a predetermined value (i.e., a message) to a predetermined address in host memory. For example, a network controller might write a special “packet received” message to memory upon receipt of an incoming packet. The MSI message value and address are typically unique to each device.
Computer architecture often makes use of a bus, such as the Peripheral Component Interconnect (PCI) bus, as a mechanism peripheral devices forming various parts of a computer system can use to communicate with each other. Further information on the operation of the PCI bus can be obtained by referring to the PCI Local Bus Specification, Version 2.2, Dec. 18, 1998, published at http://www.pcisig.com. However, most buses are shared, in the sense that more than one peripheral device, such as a network adapter, may reside on the bus at the same time. Thus, when more than one device attempts to communicate with another device on the bus, arbitration occurs, and the bus is granted to only one device at a time. Devices that are prevented from using the bus during this time must wait for the next arbitration cycle to obtain access.
Every access by a device residing on the bus constitutes a “transaction”. Thus, each request to use the bus, arbitration, and grant to use the bus results in a separate transaction. Therefore, if the number of hardware access requests can be reduced, the efficiency of the bus can be increased.
This is quite apparent when there are multiple, high-speed network adapters communicating over a PCI bus. For example, since each adapter has to compete for bus access and participate in the arbitration process in order to process data within the computer system. Typically, each event that occurs in the context of network adapter operation is marked by an interrupt. To process the interrupts, the operating system calls an Interrupt Service Routine (ISR), which reads one or more registers in memory to discover the cause of the interrupt, usually logged in a hardware register called the “interrupt cause register”, which is cleared upon being read, acknowledging the interrupt. Next, the ISR typically disables further interrupts from the interrupting device so that the currently-interrupting event can be processed in an unbroken fashion (i.e., without further interrupts from the same device that diverts CPU processing attention before the ISR has completed its function).
To disable further interrupts, an interrupt “mask” is usually written into a register called the “interrupt mask register”. However, each access to the interrupt mask register typically constitutes a write operation across the bus. Thus, to increase the efficiency of bus operations, there is a need in the art for interrupt processing apparatus and systems, and methods of processing interrupts, which operate to reduce the number of bus transactions due to interrupting events.
BRIEF DESCRIPTION OF THE DRAWINGS
In the following detailed description of embodiments of the invention, reference is made to the accompanying drawings which form a part hereof, and in which are shown by way of illustration, and not of limitation, specific embodiments in which the invention may be practiced. In the drawings, like numerals describe substantially similar components throughout the several views. The embodiments illustrated are described in sufficient detail to enable those skilled in the art to understand and implement them. Other embodiments may be utilized and derived therefrom, such that structural and logical substitutions and changes may be made without departing from the scope of the present disclosure. The following detailed description, therefore, is not to be taken in a limiting sense, and the scope of embodiments of the invention is defined only by the appended claims, along with the full range of equivalents to which such claims are entitled.
Various embodiments of the invention optimize the interrupt-handling process by combining the activities of acknowledging and disabling the interrupt. Using a process which can be accomplished entirely in hardware, such that interrupts are disabled at approximately the same time they are acknowledged, there is no need to use explicit program instructions to write the disable mask value into the interrupt mask register, reducing the number of bus transactions. Using high-speed network adapters as an example, it is not uncommon to observe several thousand interrupts per second. Therefore, some embodiments of the present invention have the potential to save thousands of bus accesses per second, decreasing bus utilization due to interrupt generation. Such a scheme should be useful for many types of buses, including the PCI bus, and its enhanced version, the PCI-X bus.
Typically, an arithmetic logic unit 122 (ALU), as is commonly included in a processor 124, will be operatively coupled to the interrupt mask register 116, as well as the other registers 112, 114 so as to direct read/write operations from/to the registers 112, 114, 116 over some form of a bus 126, such as a PCI or PCI-X bus. A device driver 128, which may exist in the form of a software program module or firmware, for example, is capable of being operatively coupled to the registers 112, 114, 116, either directly, or via the ALU 122. The device driver 128 may reside within the same memory 118 or other device, such as a programmable interrupt controller 120, as the registers 112, 114, 116. The driver 128 may also form part of a processor 124 which includes the registers 112, 114, 116. Finally, the driver 128 may be physically separated from the registers 112, 114, 116, perhaps as part of a separate memory 132.
During operation of the embodiment illustrated in
For example, assuming that the initial disabling mask value 134 stored in the interrupt disabling register 114 is preprogrammed by a device driver 128 associated with a particular device 136 and an interrupt 137 during an operating system initialization process. This mask value 134 can then be used to disable the interrupt 137 serviced by an ISR, possibly residing within the driver 128.
One possible sequence of operations involving the illustrated embodiment might be initiated with the generation of an interrupt 137 by a device 136 requesting service. At this point, an operating system may make a call to the relevant ISR routine, which accesses the bus 126 to read the interrupt cause register 112. Reading the register 112 results in clearing the register 112, acknowledging the interrupt 137. At approximately the same time, further interrupts 137 from the same device 136 can be disabled by a transfer operation 138 which takes the content (mask 134) directly from the interrupt disabling register 114 and places it into the interrupt mask register 116. The direct transfer/write operation is triggered by reading the register 112, and may occur using a separate bus 140, for example. Thus, the need for a software program write operation across the system bus 126 to place the contents of an interrupt disabling mask into the interrupt mask register 116 can be obviated.
The apparatus 110 may also include an interrupt disabling override register 142 capable of being operatively coupled to the interrupt mask register 116. The override register 142 may be used, for example, by a programmer to override the activity of the interrupt disabling register 114. For example, if the disabling register 114 is initialized by the startup activity of a device driver 128 to a particular value 134, any other value written into the override register may be used to overwrite the value 134, or be placed directly into the mask register 116 from the override register 142, upon reading the cause register 112. The particular operational sequence and function of the override register 142 may be selected by the designer of the apparatus 110, as desired.
The system may also comprise a device 236 capable of generating an interrupt, as well as a memory 232, each capable of being operatively coupled to the processor 252 and/or the bus 226. The memory 232 may also be formed as an integral part of the processor 252. Typical devices 236 may include, for example, network adapters, graphics display controllers, storage devices, such as memory and disk drives, and/or disk drive controllers, among others. The memory 232 may be used to store a set of program instructions comprising a portion of an ISR, perhaps residing in a device driver 228. In any case, however, reading the interrupt cause register 212 in response to an interrupt 237 generated by a device 236 coupled to the processor 252 (e.g., via the bus 226) results in transferring a mask value 234 stored in the interrupt disabling register 214 directly to the interrupt mask register 216, perhaps using an internal bus 240.
Regarding both
One of ordinary skill in the art will understand that the apparatus and system of various embodiments of the present invention can be used in applications other than desktop computers and systems that include networked servers or devices, and thus, the invention is not to be so limited. The illustrations of an apparatus 110 and a system 250 are intended to provide a general understanding of the structure of various embodiments of the present invention, and they are not intended to serve as a complete description of all the elements and features of apparatus and systems that might make use of the structures described herein.
Applications that may include the novel apparatus and system of various embodiments of the present invention include electronic circuitry used in high-speed computers, communications and signal processing circuitry, processor modules, embedded processors, and application-specific modules, including multilayer, multi-chip modules. Such apparatus and systems may further be included as sub-components within a variety of electronic systems, such as televisions, cellular telephones, personal computers, radios, vehicles, and others.
The method may continue with reading an interrupt cause register in response to receiving the interrupt at block 355, acknowledging the interrupt at block 365 (e.g., the activities of blocks 355 and 365 may occur during execution of the ISR), and transferring the value stored in the interrupt disabling register (corresponding to and appropriate for the source of the interrupt) directly to an interrupt mask register at block 375. The activity of transferring the mask value directly to the interrupt disabling register has the effect of disabling the reception of further interrupts from the source of the masked interrupt without using the standard peripheral bus. At this time, the method may continue with generating a multiplicity of interrupts (using the same source, if desired), repeatedly reading the interrupt cause register in response to receiving the multiple interrupts, and repeatedly transferring the mask value stored in the interrupt disabling register directly to the interrupt mask register at blocks 335, 345, 355, 365, and 375.
Alternatively, the method may continue with writing an override value to an interrupt disabling override register at block 385, and transferring the override value directly to the interrupt mask register so as to enable receiving further interrupts from the interrupt source at block 395. This activity may occur, for example, when reception of further interrupts from the source of the interrupt is critical, even during the processing of a previous interrupt. It may also be useful to enable interrupts which may be disabled due to the automated activity on the part of an operating system or device driver, such as when the interrupt disabling register is preprogrammed with default values during a software initialization sequence.
It should be noted that while MSIs have been used as an example of an interrupt generation mechanism herein, other mechanisms, including PCI interrupts, may also be used according to various embodiments of the invention, and therefore, the invention is not to be so limited. Therefore, it should be clear that the some embodiments of the present invention may also be described in the context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules may include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. As such, and referring back to
One of ordinary skill in the art will understand, upon reading and comprehending this disclosure, the manner in which a software program can be launched from a computer-readable medium in a computer based system to execute the functions defined in the software program. One of ordinary skill in the art will further understand the various programming languages which may be employed to create a software program designed to implement and perform the method embodiments of the present invention. The programs can be structured in an object-orientated format using an object-oriented language such as Java, Smalltalk, or C++. Alternatively, the programs can be structured in a procedure-orientated format using a procedural language, such as COBOL or C. The software components may communicate using any of a number of mechanisms that are well-known to those skilled in the art, such as Application Program Interfaces (APIs) or interprocess communication techniques such as the Remote Procedure Call (RPC), Common Object Request Broker Architecture (CORBA), Component Object Model (COM), Distributed Component Object Model (DCOM), Distributed System Object Model (DSOM) and Remote Method Invocation (RMI). However, as will be appreciated by one of ordinary skill in the art upon reading this disclosure, the teachings of various embodiments of the present invention are not limited to any particular programming language or environment.
As is evident from the preceding description, and in referring back to
Thus, referring back to
Thus, various embodiments of the invention may provide a mechanism for increasing bus throughput and efficiency by offloading the task of disabling interrupts using a direct transfer process, possibly implemented entirely in hardware. This may be particularly effective in the case of network adapters, which tend to post several thousand interrupts per second.
Although specific embodiments have been illustrated and described herein, those of ordinary skill in the art will appreciate that any arrangement which is calculated to achieve the same purpose may be substituted for the specific embodiments shown. This disclosure is intended to cover any and all adaptations or variations of various embodiments of the present invention. It is to be understood that the above description has been made in an illustrative fashion, and not a restrictive one. Combinations of the above embodiments, and other embodiments not specifically described herein will be apparent to those of skill in the art upon reviewing the above description. The scope of various embodiments of the invention includes any other applications in which the above structures and methods are used. Thus, the scope of the embodiments of the invention should be determined with reference to the appended claims, along with the full range of equivalents to which such claims are entitled.
It is emphasized that the Abstract is provided to comply with 37 C.F.R. § 1.72(b) requiring an Abstract that will allow the reader to quickly ascertain the nature and gist of the technical disclosure. It is submitted with the understanding that it will not be used to interpret or limit the scope or meaning of the claims.
In the foregoing Detailed Description of Embodiments of the Invention, various features are grouped together in a single embodiment for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed embodiments of the invention require more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive subject matter lies in less than all features of a single disclosed embodiment. Thus the following claims are hereby incorporated into the Detailed Description of Embodiments of the Invention, with each claim standing on its own as a separate preferred embodiment.
Claims
1. An apparatus, comprising:
- a cause register;
- a disabling register to couple to the cause register; and
- a mask register to couple to the disabling register.
2. The apparatus of claim 1, wherein the cause register, the disabling register, and the mask register are included in a single monolithic memory circuit.
3. The apparatus of claim 1, wherein the cause register, the disabling register, and the mask register are included in a single programmable interrupt controller.
4. The apparatus of claim 1, further comprising:
- an arithmetic logic unit to couple to the mask register.
5. The apparatus of claim 1, further comprising:
- an override register to couple to the mask register.
6. The apparatus of claim 1, further comprising:
- a device driver to couple to the disabling register.
7. A system, comprising:
- a bus;
- an interrupt cause register to couple to the bus;
- an interrupt disabling register to couple to the interrupt cause register; and
- a mask register to couple to the interrupt disabling register.
8. The system of claim 7, further comprising:
- a device capable of generating an interrupt to couple to the bus.
9. The system of claim 8, wherein the device comprises a network adapter.
10. The system of claim 8, wherein the device comprises a graphics display controller.
11. The system of claim 8, wherein the device comprises a storage device.
12. The system of claim 7, wherein the bus comprises a peripheral component interconnect (PCI) bus.
13. The system of claim 7, wherein reading the interrupt cause register results in transferring a value stored in the interrupt disabling register to the interrupt mask register.
14. A method, comprising:
- reading an interrupt cause register in response to receiving an interrupt; and
- transferring a value stored in an interrupt disabling register corresponding to a source of the interrupt to an interrupt mask register to disable receiving further interrupts from the source of the interrupt.
15. The method of claim 14, further comprising:
- generating the interrupt.
16. The method of claim 14, further comprising:
- executing an interrupt service routine to acknowledge the interrupt.
17. The method of claim 14, further comprising:
- writing an override value to an interrupt disabling override register; and
- transferring the override value to the interrupt mask register to enable receiving further interrupts from the source of the interrupt.
18. An article comprising a machine-accessible medium having associated instructions, wherein the instructions, when accessed, result in a machine performing:
- reading an interrupt cause register in response to receiving an interrupt; and
- transferring a value stored in an interrupt disabling register corresponding to a source of the interrupt to an interrupt mask register to disable receiving further interrupts from the source of the interrupt.
19. The article of claim 18, wherein the instructions, when accessed, result in the machine performing:
- writing a message signaling an interrupt to a memory location.
20. The article of claim 18, wherein the value is transferred without accessing a bus.
21. The article of claim 18, wherein the instructions, when accessed, result in the machine performing:
- generating a multiplicity of interrupts using the source of the interrupt;
- repeatedly reading the interrupt cause register in response to receiving the multiplicity of interrupts; and
- repeatedly transferring the value stored in the interrupt disabling register corresponding to the source of the interrupt to the interrupt mask register.
Type: Application
Filed: Oct 29, 2004
Publication Date: Mar 24, 2005
Applicant:
Inventor: Hiremane Radhakrishna (Hillsboro, OR)
Application Number: 10/977,204