13 Sep, 2011

1 commit

  • 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
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     

30 Oct, 2010

1 commit

  • 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
    Cc: Peter Zijlstra
    Cc: Christoph Hellwig
    LKML-Reference:

    Thomas Gleixner
     

08 Sep, 2010

1 commit

  • 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
    Cc: Peter Zijlstra
    Cc: Christoph Hellwig
    LKML-Reference:

    Thomas Gleixner
     

24 Jul, 2008

1 commit


17 Apr, 2008

5 commits

  • 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

    Matthew Wilcox
     
  • 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

    Matthew Wilcox
     
  • 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

    Matthew Wilcox
     
  • down_killable() is the functional counterpart of mutex_lock_killable.

    Signed-off-by: Matthew Wilcox

    Matthew Wilcox
     
  • 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
    Acked-by: Ingo Molnar

    Matthew Wilcox