Visit Our UNIX and Linux User Community


IRQ and Number of Devices

 
Thread Tools Search this Thread
Special Forums Hardware IRQ and Number of Devices
# 1  
Old 06-27-2013
IRQ and Number of Devices

Hello everyone. I feel that I'm about to answer my own question, but I just want to be sure that I'm right. I know computers all use, at a very low level, the IRQ system of interrupting the CPU when it needs something. My questions are as follows:

1. Does the device in question, say.. a mouse, need to use the interrupt wire every single time, I use it? Say if the CPU is potentially idle, and I tap a few keys, even though the CPU wasn't busy, will it still use the interrupt feature? Or intteruppting the CPU only done when it has other things it's busy with?

2. How can there only be 16 IRQ devices? Also considering that 3 of them are already taken, (timer, keyboard, and clock) and that 2 & 9 are the same. Doesn't this mean that if I plug in 16 devices into a 20port usb hub that I'd be out of device room? Or does the usb bus count as 1 device? Same goes for SATA ports? I have 4 SATA ports on my motherboard. if I plug in 4 SATA hard drives, does that mean i'm filling up 4 seperate IRQ slots?


Thanks for the help in advance!
# 2  
Old 06-27-2013
Quote:
Originally Posted by Lost in Cyberia
1. Does the device in question, say.. a mouse, need to use the interrupt wire every single time, I use it? Say if the CPU is potentially idle, and I tap a few keys, even though the CPU wasn't busy, will it still use the interrupt feature? Or intteruppting the CPU only done when it has other things it's busy with?
The CPU is able to temporarily ignore interrupts if it's busy doing something really important, like a device driver or an even higher-priority interrupt. Otherwise, yes, it does get interrupted very often. In the old days, if you left a stapler on your keyboard, it could waste a lot of CPU time!

Of course, the CPU gets interrupted frequently even if you don't. The clock interrupt cannot be ignored. (Some OSes like modern Linux are 'clockless', doing away with the 18-times-a-second interrupt and adjusting the timer on the fly. This gives a little efficiency boost.)

This is fine, not much performance loss, because interrupts are a hardware feature. The CPU does all the legwork.
Quote:
2. How can there only be 16 IRQ devices? Also considering that 3 of them are already taken, (timer, keyboard, and clock) and that 2 & 9 are the same. Doesn't this mean that if I plug in 16 devices into a 20port usb hub that I'd be out of device room? Or does the usb bus count as 1 device? Same goes for SATA ports? I have 4 SATA ports on my motherboard. if I plug in 4 SATA hard drives, does that mean i'm filling up 4 seperate IRQ slots?
If you remember computers having ISA slots, they couldn't share IRQ's, which made installing anything a maddening struggle of jumpers. ISA plug-and-play was even more of a joke; slow, unreliable, and most hardware couldn't do anything but tell you which hardwired IRQ it was demanding anyway.

PCI changed everything -- IRQ's can be shared! It has a built-in mechanism to tell the computer not just which interrupt, but which card on which interrupt. Resource conflicts mostly don't happen any more, and good riddance. Only the lowest-number IRQ's you mention are unshared now. I'll show you cat /proc/interrupts from my machine:

Code:
           CPU0       CPU1
  0:   17523426 1159587364   IO-APIC-edge      timer
  1:          0          8   IO-APIC-edge      i8042
  4:      19747    1576187   IO-APIC-edge
  7:          1          0   IO-APIC-edge      parport0
  8:          0         71   IO-APIC-edge      rtc0
  9:          0          0   IO-APIC-fasteoi   acpi
 14:     290784    8136376   IO-APIC-edge      pata_amd
 15:          0          0   IO-APIC-edge      pata_amd
 16:    2893418  135850554   IO-APIC-fasteoi   ohci_hcd:usb6, serial
 17:      93428     948486   IO-APIC-fasteoi   ehci_hcd:usb3
 18:          0          0   IO-APIC-fasteoi   ahci, ohci_hcd:usb8
 19:          0          0   IO-APIC-fasteoi   ahci, ohci_hcd:usb7
 20:          0         20   IO-APIC-fasteoi   ehci_hcd:usb2
 21:          2         93   IO-APIC-fasteoi   ehci_hcd:usb1, hda_intel
 22:     637342    8907010   IO-APIC-fasteoi   ohci_hcd:usb5
 23:   11385776  185922221   IO-APIC-fasteoi   ahci, ohci_hcd:usb4
 47:    5784110  240348995   PCI-MSI-edge      lan

It doesn't show individual USB ports, it shows individual USB controllers, each of which handles a couple of ports. The number is inflated because of the three differing kinds of USB, which apparently call different interrupts? Not sure.

Last edited by Corona688; 06-27-2013 at 07:50 PM..

Previous Thread | Next Thread
Test Your Knowledge in Computers #368
Difficulty: Medium
The Open Group released the Single UNIX Specification Version 2 in 1987.
True or False?

10 More Discussions You Might Find Interesting

1. Linux

Ports,number of slots,network devices - UNIX

Hi All, Can someone help me in finding out below information from ReHat linux,Solaris,AIX, hp-ux machine : 1. How to find total number of ports in supported by each slot. 2. name of ports that are used to transmit data to the printer 3. total number of slots on a network device (2 Replies)
Discussion started by: omkar.jadhav
2 Replies

2. Programming

What is unbalanced IRQ?

------------------------ WARNING: at kernel/irq/manage.c:225 __enable_irq+0x3b/0x57() Unbalanced enable for IRQ 4 Modules linked in: svsknfdrvr Pid: 634, comm: ash Tainted: G W 2.6.28 #1 Call Trace: warn_slowpath+0x76/0x8d profile_tick+0x2d/0x57 irq_exit+0x32/0x34 ... (3 Replies)
Discussion started by: dragonpoint
3 Replies

3. UNIX for Dummies Questions & Answers

Doubt with irq handler.......

Hello, I have develop a driver for my hardware and now, I need to handle a IRQ but I does not work. As I can understand, to handle a irq, it is necessary to make a request_irq(). If the return value is zero, ok, no problem to handle irq. Here is a easy example of my driver: #include... (8 Replies)
Discussion started by: webquinty
8 Replies

4. Linux

A question with respect to IRQ distribution

Hi all, I am a Linux newbie in kernel development. In class I was asked a question about IRQ distribution as followed. IRQs can be distributed among the available CPUs (in a multiple-CPU system) in two ways: (1) Static distribution The IRQ signal is delivered to the local APICs listed... (2 Replies)
Discussion started by: sunnyhay
2 Replies

5. UNIX for Advanced & Expert Users

IRQ priority in FC9

Hi, I want to increase IRQ4 priority to maximum in Fedora core 9 (kernel version 2.6.25.11-97).If anybody knows plz help me.... I will be very thankful .. regards, Raj (0 Replies)
Discussion started by: rajuprade
0 Replies

6. UNIX for Dummies Questions & Answers

passthrough devices vs. named devices

I am having trouble understanding the difference between a passthrough device and a named device and when you would use one or the other to access equipment. As an example, we have a tape library and giving the command "camcontrol devlist" gives the following output: akx# camcontrol... (1 Reply)
Discussion started by: thumper
1 Replies

7. UNIX for Dummies Questions & Answers

irq complication

hi, i looked around already and had no luck finding anything. Im trying ot install a wpc11v3 linksys wireless card, and i have been for about a week now. :mad: Im near certain i have figured out my problem. When i plug in my card while knoppix is running, it crashes. When i plug it into... (0 Replies)
Discussion started by: jestra
0 Replies

8. UNIX for Dummies Questions & Answers

usb - deleting (irq)

FreeBSD 4.5 i installed my sound drivers (which are onboard) with the following lines in my kernel device pcm options PNPBIOS then cd /dev sh MAKEDEV snd0 output from cat /dev/sndstat show the devicedriver (correct one) ok this works nice untill i enter my kde and want to play a... (1 Reply)
Discussion started by: termiEEE
1 Replies

9. UNIX for Dummies Questions & Answers

forcing irq on PCMCIA card

ENV: linux Version: Mandrake 8.1, PCMCIA card: longshine lcs-8534TB. (supported according the PCMCIA docs) laptop is P-II lifetec /etc/sysconfig/pcmcia: PCMCIA=yes PCIC=i82365 ( found via probe -m ) PCIC_OPTS="cs_irq=11 pci_irq_list=11,11 do_scan=0" ( you see i want to force irq 11 )... (3 Replies)
Discussion started by: progressdll
3 Replies

10. UNIX for Dummies Questions & Answers

irq

where can i find the i/o and irq's in mandrake 8 help lost :D (2 Replies)
Discussion started by: RYRY46D9
2 Replies

Featured Tech Videos