Messages in this thread | | | Date | Sun, 12 Jun 2005 13:52:49 +0200 | From | Ingo Molnar <> | Subject | Re: [PATCH] local_irq_disable removal |
| |
* 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |