Re: [PATCH] local_irq_disable removal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Esben Nielsen <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux