Re: [PATCH] local_irq_disable removal

Ingo Molnar
2005-06-12T11:53:40Z

* Esben Nielsen <simlo@phys.au.dk> wrote:

> [...] With your argument above ???_local_irq_disable() should really
> be preempt_disable() as that is faster.

local_irq_disable() _is_ almost the same thing as preempt_disable():

void local_irq_disable(void)
{
mask_preempt_count(IRQSOFF_MASK);
}
EXPORT_SYMBOL(local_irq_disable);

which compiles to just 4 instructions:

c012f355 <local_irq_disable>:
c012f355: b8 00 e0 ff ff mov $0xffffe000,%eax
c012f35a: 21 e0 and %esp,%eax
c012f35c: 81 48 14 00 00 00 20 orl $0x20000000,0x14(%eax)
c012f363: c3 ret

we could inline it too, that would make it exactly the same cost as
preempt_disable().

it cannot be equivalent to preempt_disable()/enable due to the semantics
of the IRQ flag. But fortunately masking/unmasking a bit is just as fast
as inc/dec.

Ingo