Re: kernel-hacking-HOWTO: An lk primer seeks feedback

Jes Sorensen (Jes.Sorensen@cern.ch)
20 Sep 1999 18:07:41 +0200


>>>>> "Werner" == Werner Almesberger <almesber@lrc.di.epfl.ch> writes:

Werner> Paul Rusty Russell wrote:
>> `This document describes the common routines, locking systems and
>> general requirements for kernel code: its goal is to serve as a
>> primer for Linux kernel development.'

Werner> 5.2: you may want to
Werner> discuss disable_irq, disable_irq_nosync, and enable_irq. On
Werner> most (all?) architectures, they are reasonably inexpensive
Werner> ways to block specific interrupts. (BTW, why don't we actually
Werner> have some kind of interrupt blocking that doesn't go down to
Werner> the interrupt controller hardware ? Is the PIC part considered
Werner> to be cheap enough in all possible cases ?)

Actually I think the discussion of disable_irq/enable_irq should say
something along the lines of "don't use these, if you think you need
them, think again, if you still think you need them, think again real
hard".

enable_irq/disable_irq are quite expensive and should not be used
except for very special cases. I'd claim that 99.9% of the time people
are better off disabling interrupts directly on the device (most sane
hardware has a bit to disable it) or using spin locks.

Jes

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/