Revision 8339f0008c47cdd921c73f6d53d5588b5484f93c authored by Eric W. Biederman on 29 January 2007, 20:19:05 UTC, committed by Linus Torvalds on 30 January 2007, 16:29:58 UTC
When the world was a simple and static place setting up irqs was easy.
It sufficed to allocate a linux irq number and a find a free cpu
vector we could receive that linux irq on.  In those days it was
a safe assumption that any allocated vector was actually in use
so after one global pass through all of the vectors we would have
none left.

These days things are much more dynamic with interrupt controllers
(in the form of MSI or MSI-X) appearing on plug in cards and linux
irqs appearing and disappearing.  As these irqs come and go vectors
are allocated and freed,  invalidating the ancient assumption that all
allocated vectors stayed in use forever.

So this patch modifies the vector allocator to walk through every
possible vector before giving up, and to check to see if a vector
is in use before assigning it.  With these changes we stop leaking
freed vectors and it becomes possible to allocate and free irq vectors
all day long.

This changed was modeled after the vector allocator on x86_64 where
this limitation has already been removed.  In essence we don't update
the static variables that hold the position of the last vector we
allocated until have successfully allocated another vector.  This
allows us to detect if we have completed one complete scan through
all of the possible vectors.

Acked-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent c9cc8e7
History
File Mode Size
sn
Kbuild -rw-r--r-- 349 bytes
a.out.h -rw-r--r-- 799 bytes
acpi-ext.h -rw-r--r-- 616 bytes
acpi.h -rw-r--r-- 3.9 KB
agp.h -rw-r--r-- 989 bytes
asmmacro.h -rw-r--r-- 2.9 KB
atomic.h -rw-r--r-- 5.8 KB
auxvec.h -rw-r--r-- 284 bytes
bitops.h -rw-r--r-- 9.2 KB
break.h -rw-r--r-- 475 bytes
bug.h -rw-r--r-- 311 bytes
bugs.h -rw-r--r-- 397 bytes
byteorder.h -rw-r--r-- 830 bytes
cache.h -rw-r--r-- 731 bytes
cacheflush.h -rw-r--r-- 1.6 KB
checksum.h -rw-r--r-- 2.1 KB
compat.h -rw-r--r-- 4.4 KB
cpu.h -rw-r--r-- 417 bytes
cputime.h -rw-r--r-- 115 bytes
current.h -rw-r--r-- 379 bytes
cyclone.h -rw-r--r-- 403 bytes
delay.h -rw-r--r-- 1.7 KB
device.h -rw-r--r-- 255 bytes
div64.h -rw-r--r-- 31 bytes
dma-mapping.h -rw-r--r-- 2.1 KB
dma.h -rw-r--r-- 380 bytes
dmi.h -rw-r--r-- 69 bytes
elf.h -rw-r--r-- 10.5 KB
emergency-restart.h -rw-r--r-- 149 bytes
errno.h -rw-r--r-- 31 bytes
esi.h -rw-r--r-- 881 bytes
fcntl.h -rw-r--r-- 294 bytes
fpswa.h -rw-r--r-- 1.8 KB
fpu.h -rw-r--r-- 2.2 KB
futex.h -rw-r--r-- 3.1 KB
gcc_intrin.h -rw-r--r-- 17.5 KB
hardirq.h -rw-r--r-- 764 bytes
hw_irq.h -rw-r--r-- 4.8 KB
ia32.h -rw-r--r-- 1.2 KB
ia64regs.h -rw-r--r-- 2.7 KB
ide.h -rw-r--r-- 1.3 KB
intel_intrin.h -rw-r--r-- 4.6 KB
intrinsics.h -rw-r--r-- 5.2 KB
io.h -rw-r--r-- 12.6 KB
ioctl.h -rw-r--r-- 31 bytes
ioctls.h -rw-r--r-- 2.7 KB
iosapic.h -rw-r--r-- 2.9 KB
ipcbuf.h -rw-r--r-- 582 bytes
irq.h -rw-r--r-- 922 bytes
irq_regs.h -rw-r--r-- 34 bytes
kdebug.h -rw-r--r-- 2.4 KB
kexec.h -rw-r--r-- 1.6 KB
kmap_types.h -rw-r--r-- 472 bytes
kprobes.h -rw-r--r-- 3.6 KB
kregs.h -rw-r--r-- 6.6 KB
linkage.h -rw-r--r-- 188 bytes
local.h -rw-r--r-- 1.7 KB
machvec.h -rw-r--r-- 15.6 KB
machvec_dig.h -rw-r--r-- 406 bytes
machvec_hpsim.h -rw-r--r-- 501 bytes
machvec_hpzx1.h -rw-r--r-- 1.5 KB
machvec_hpzx1_swiotlb.h -rw-r--r-- 1.8 KB
machvec_init.h -rw-r--r-- 1.2 KB
machvec_sn2.h -rw-r--r-- 5.8 KB
mc146818rtc.h -rw-r--r-- 228 bytes
mca.h -rw-r--r-- 5.3 KB
mca_asm.h -rw-r--r-- 7.1 KB
meminit.h -rw-r--r-- 2.1 KB
mman.h -rw-r--r-- 999 bytes
mmu.h -rw-r--r-- 335 bytes
mmu_context.h -rw-r--r-- 5.3 KB
mmzone.h -rw-r--r-- 1.2 KB
module.h -rw-r--r-- 1.1 KB
msgbuf.h -rw-r--r-- 867 bytes
mutex.h -rw-r--r-- 2.9 KB
namei.h -rw-r--r-- 458 bytes
nodedata.h -rw-r--r-- 1.9 KB
numa.h -rw-r--r-- 2.0 KB
page.h -rw-r--r-- 6.3 KB
pal.h -rw-r--r-- 50.8 KB
param.h -rw-r--r-- 876 bytes
parport.h -rw-r--r-- 517 bytes
patch.h -rw-r--r-- 1.0 KB
pci.h -rw-r--r-- 5.0 KB
percpu.h -rw-r--r-- 2.4 KB
perfmon.h -rw-r--r-- 10.2 KB
perfmon_default_smpl.h -rw-r--r-- 3.4 KB
pgalloc.h -rw-r--r-- 3.5 KB
pgtable.h -rw-r--r-- 21.2 KB
poll.h -rw-r--r-- 632 bytes
posix_types.h -rw-r--r-- 3.4 KB
processor.h -rw-r--r-- 19.0 KB
ptrace.h -rw-r--r-- 12.0 KB
ptrace_offsets.h -rw-r--r-- 6.3 KB
resource.h -rw-r--r-- 197 bytes
rse.h -rw-r--r-- 1.6 KB
rwsem.h -rw-r--r-- 4.4 KB
sal.h -rw-r--r-- 25.3 KB
scatterlist.h -rw-r--r-- 873 bytes
sections.h -rw-r--r-- 916 bytes
segment.h -rw-r--r-- 162 bytes
semaphore.h -rw-r--r-- 2.1 KB
sembuf.h -rw-r--r-- 615 bytes
serial.h -rw-r--r-- 478 bytes
setup.h -rw-r--r-- 85 bytes
shmbuf.h -rw-r--r-- 1.0 KB
shmparam.h -rw-r--r-- 406 bytes
sigcontext.h -rw-r--r-- 3.0 KB
siginfo.h -rw-r--r-- 3.3 KB
signal.h -rw-r--r-- 3.9 KB
smp.h -rw-r--r-- 3.1 KB
socket.h -rw-r--r-- 1.3 KB
sockios.h -rw-r--r-- 430 bytes
sparsemem.h -rw-r--r-- 582 bytes
spinlock.h -rw-r--r-- 6.8 KB
spinlock_types.h -rw-r--r-- 432 bytes
stat.h -rw-r--r-- 1.0 KB
statfs.h -rw-r--r-- 1.0 KB
string.h -rw-r--r-- 620 bytes
suspend.h -rw-r--r-- 66 bytes
system.h -rw-r--r-- 8.7 KB
termbits.h -rw-r--r-- 4.3 KB
termios.h -rw-r--r-- 3.2 KB
thread_info.h -rw-r--r-- 4.2 KB
timex.h -rw-r--r-- 1.3 KB
tlb.h -rw-r--r-- 6.6 KB
tlbflush.h -rw-r--r-- 2.3 KB
topology.h -rw-r--r-- 3.1 KB
types.h -rw-r--r-- 1.5 KB
uaccess.h -rw-r--r-- 13.6 KB
ucontext.h -rw-r--r-- 297 bytes
unaligned.h -rw-r--r-- 132 bytes
uncached.h -rw-r--r-- 420 bytes
unistd.h -rw-r--r-- 10.1 KB
unwind.h -rw-r--r-- 5.7 KB
user.h -rw-r--r-- 2.2 KB
ustack.h -rw-r--r-- 458 bytes
vga.h -rw-r--r-- 618 bytes
xor.h -rw-r--r-- 1.1 KB

back to top