* Nick Piggin <[email protected]> wrote:
> >>Considering that on UP, the arm should not need to disable interrupts
> >>for this function (or has someone refuted Linus?), how about:
> >
> >Kernel preemption.
>
> preempt_disable() ?
please take a look at kernel/mutex.c, there's a define at the top of the
file:
// #define MUTEX_IRQ_SAFE
which, if off, makes the mutex code use preempt_disable() and
preempt_enable() to make it preemption-safe. If it's on, the mutex
implementation uses IRQ flags.
in my current tree i've already eliminated this define, and have
switched the code to use preempt_disable()/preempt_enable() exclusively,
because preempt_*() is equally fast on all platforms, while IRQ disable
costs vary largely. (and they are rarely faster than preempt_disable()).
my current tree also provides a mechanism for architectures to hand-code
the mutex lock and unlock fastpath, if they choose to do so. So i think
we can really stop the cycle counting.
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]