History log of /include/linux/semaphore.h
Revision Date Author Comments
8292c9e15c3b069459794a04f5e2cf0d5665ddc4 24-Feb-2010 Thomas Gleixner <tglx@linutronix.de> locking, semaphores: Annotate inner lock as raw

There is no reason to have the spin_lock protecting the semaphore
preemptible on -rt. Annotate it as a raw_spinlock.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

( On rt this also solves lockdep complaining about the
rt_mutex.wait_lock being not initialized. )

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
4882720b267b7b1d1b0ce08334b205f0329d4615 07-Sep-2010 Thomas Gleixner <tglx@linutronix.de> semaphore: Remove mutex emulation

Semaphores used as mutexes have been deprecated for years. Now that
all users are either converted to real semaphores or to mutexes remove
the cruft.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Hellwig <hch@infradead.org>
LKML-Reference: <20100907125057.562399240@linutronix.de>
febc88c5948f81114f64c3412011d695aecae233 07-Sep-2010 Thomas Gleixner <tglx@linutronix.de> semaphore: Add DEFINE_SEMAPHORE

The full cleanup of init_MUTEX[_LOCKED] and DECLARE_MUTEX has not been
done. Some of the users are real semaphores and we should name them as
such instead of confusing everyone with "MUTEX".

Provide the infrastructure to get finally rid of init_MUTEX[_LOCKED]
and DECLARE_MUTEX.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Hellwig <hch@infradead.org>
LKML-Reference: <20100907125054.795929962@linutronix.de>
b552068999b0b05087c454e525b30b785c79dc9b 23-Apr-2008 Matthew Wilcox <matthew@wil.cx> Remove __DECLARE_SEMAPHORE_GENERIC

There are no users of __DECLARE_SEMAPHORE_GENERIC in the kernel

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
714493cd5468f42ca3c4f730a9c17c203abd5059 11-Apr-2008 Matthew Wilcox <matthew@wil.cx> Improve semaphore documentation

Move documentation from semaphore.h to semaphore.c as requested by
Andrew Morton. Also reformat to kernel-doc style and add some more
notes about the implementation.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
b17170b2fac96705db3188f093f89e8e838418e4 14-Mar-2008 Matthew Wilcox <matthew@wil.cx> Simplify semaphore implementation

By removing the negative values of 'count' and relying on the wait_list to
indicate whether we have any waiters, we can simplify the implementation
by removing the protection against an unlikely race condition. Thanks to
David Howells for his suggestions.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
f1241c87a16c4fe9f4f51d6ed3589f031c505e8d 14-Mar-2008 Matthew Wilcox <matthew@wil.cx> Add down_timeout and change ACPI to use it

ACPI currently emulates a timeout for semaphores with calls to
down_trylock and sleep. This produces horrible behaviour in terms of
fairness and excessive wakeups. Now that we have a unified semaphore
implementation, adding a real down_trylock is almost trivial.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
f06d96865861c3dd01520f47e2e61c899db1631f 14-Mar-2008 Matthew Wilcox <matthew@wil.cx> Introduce down_killable()

down_killable() is the functional counterpart of mutex_lock_killable.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
64ac24e738823161693bf791f87adc802cf529ff 08-Mar-2008 Matthew Wilcox <matthew@wil.cx> Generic semaphore implementation

Semaphores are no longer performance-critical, so a generic C
implementation is better for maintainability, debuggability and
extensibility. Thanks to Peter Zijlstra for fixing the lockdep
warning. Thanks to Harvey Harrison for pointing out that the
unlikely() was unnecessary.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>