Re: [patch 0/9] mutex subsystem, -V4

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

 



On Thu, 22 Dec 2005, Andrew Morton wrote:

> I'd prefer to see mutexes compared with semaphores after you've put as much
> work into improving semaphores as you have into developing mutexes.

There is a fundamental difference between semaphores and mutexes.  The 
semaphore semantics _require_ atomic increments/decrements where mutexes 
do not.  This makes a huge difference on ARM where 99% of all ARM 
processors out there can only perform atomic swaps which is sufficient 
for mutexes but insufficient for semaphores.  Therefore on ARM 
performing an atomic increment/decrement (the semaphore fast 
path) requires extra costly locking 
and .text space (23 cycles over 8 instructions) while the mutex fast 
path is about 2-3 instructions and 
needs 7-8 cycles.  I bet many other architectures are in the same camp.


Nicolas
-
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