SACHIN G.
SACHIN G.

Reputation: 19

Is there any way to check whether the interrupt is handled or not?

Suppose my CPU is hogged down and I want to check whether any coming interrupt from any hardware device is handled or not? eg: on pressing keyboard CPU is giving no response, then I want to know whether processor handled my keyboard interrupt or not. Is there any interface to check.

Upvotes: 0

Views: 5488

Answers (1)

Gil Hamilton
Gil Hamilton

Reputation: 12347

The keyboard handler itself is often a good interface to determine if the system is live. In the default mode, the tty line discipline will echo characters typed at the keyboard (this echoing is done by the kernel and isn't dependent on any user-space process getting scheduled). So if you're sitting at an idle command line on the system console, and you're not seeing the characters you typed echo onto the screen, there's a good chance your system is locked up. Note, however, that the mode can be changed by a program (such as vi/vim) and that can turn this echoing off (in that case you only see what the vim process prints to the screen).

A second test is to access the machine from the network. There are several things that should cause responses when sent from another machine. If you send a ping (an ICMP Echo Request), the kernel should automatically respond with an ICMP Echo Reply packet. Or if you know there's a server running on port 5000 (say), you should be able to create a connection to that port even if the server process itself never gets a chance to run (the TCP SYN-ACK sent in response to the SYN is done completely within the kernel). If these work, you know network interrupts are being processed, and the kernel's network soft-interrupt handler is being scheduled.

There are other things that would show you whether the keyboard interrupt is triggering and being handled, but those would generally require you to have a working command line link to the machine.

If you have such a link, cat /proc/interrupts will show you counts for each interrupt for each CPU. If the keyboard is interrupting, for example, one of those counts should increase on each interrupt.

You should never have a case where an interrupt is occurring but is not being serviced. All interrupts will be serviced before user-space processing is resumed. (Exactly what it means to service the interrupt is up to the driver and may vary by device / device type.)

If no interrupts are being serviced at all, your system will be completely locked up and unusable as no input or output at all will generally occur without interrupts.

Upvotes: 1

Related Questions