13 Sep, 2011

1 commit

  • There is no reason to allow the lock protecting rwsems (the
    ownerless variant) to be preemptible on -rt. Convert it to raw.

    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.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     

27 Jan, 2011

2 commits

  • The rwsem initializers and related macros and functions are mostly the
    same. Some of them lack the lockdep initializer, but having it in
    place does not matter for architectures which do not support lockdep.

    powerpc, sparc, x86: No functional change

    sh, s390: Removes the duplicate init_rwsem (inline and #define)

    alpha, ia64, xtensa: Use the lockdep capable init function in
    lib/rwsem.c which is just uninlining the init
    function for the LOCKDEP=n case

    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: David Howells
    Cc: Benjamin Herrenschmidt
    Cc: Matt Turner
    Acked-by: Tony Luck
    Acked-by: Heiko Carstens
    Cc: Paul Mundt
    Acked-by: David Miller
    Cc: Chris Zankel
    LKML-Reference:

    Thomas Gleixner
     
  • All rwsem implementations include the same headers. Include them from
    include/linux/rwsem.h

    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: David Howells
    Cc: Benjamin Herrenschmidt
    Cc: Matt Turner
    Acked-by: Tony Luck
    Acked-by: Heiko Carstens
    Cc: Paul Mundt
    Acked-by: David Miller
    Cc: Chris Zankel
    LKML-Reference:

    Thomas Gleixner
     

16 Dec, 2009

1 commit

  • rwsem_is_locked() tests ->activity without locks, so we should always keep
    ->activity consistent. However, the code in __rwsem_do_wake() breaks this
    rule, it updates ->activity after _all_ readers waken up, this may give
    some reader a wrong ->activity value, thus cause rwsem_is_locked() behaves
    wrong.

    Quote from Andrew:

    "
    - we have one or more processes sleeping in down_read(), waiting for access.

    - we wake one or more processes up without altering ->activity

    - they start to run and they do rwsem_is_locked(). This incorrectly
    returns "false", because the waker process is still crunching away in
    __rwsem_do_wake().

    - the waker now alters ->activity, but it was too late.
    "

    So we need get a spinlock to protect this. And rwsem_is_locked() should
    not block, thus we use spin_trylock_irqsave().

    [akpm@linux-foundation.org: simplify code]
    Reported-by: Brian Behlendorf
    Cc: Ben Woodard
    Cc: David Howells
    Signed-off-by: WANG Cong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Amerigo Wang
     

14 Feb, 2008

1 commit


08 Dec, 2006

1 commit


04 Jul, 2006

2 commits


30 Oct, 2005

1 commit

  • Add sem_is_read/write_locked functions to the read/write semaphores, along the
    same lines of the *_is_locked spinlock functions. The swap token tuning patch
    uses sem_is_read_locked; sem_is_write_locked is added for completeness.

    Signed-off-by: Rik van Riel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rik Van Riel
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds