21 Jul, 2011

2 commits

  • With the write lock path simply subtracting RW_LOCK_BIAS there
    is, on large systems, the theoretical possibility of overflowing
    the 32-bit value that was used so far (namely if 128 or more
    CPUs manage to do the subtraction, but don't get to do the
    inverse addition in the failure path quickly enough).

    A first measure is to modify RW_LOCK_BIAS itself - with the new
    value chosen, it is good for up to 2048 CPUs each allowed to
    nest over 2048 times on the read path without causing an issue.
    Quite possibly it would even be sufficient to adjust the bias a
    little further, assuming that allowing for significantly less
    nesting would suffice.

    However, as the original value chosen allowed for even more
    nesting levels, to support more than 2048 CPUs (possible
    currently only for 64-bit kernels) the lock itself gets widened
    to 64 bits.

    Signed-off-by: Jan Beulich
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/4E258E0D020000780004E3F0@nat28.tlf.novell.com
    Signed-off-by: Ingo Molnar

    Jan Beulich
     
  • Rather than having two functionally identical implementations
    for 32- and 64-bit configurations, extend the existing assembly
    abstractions enough to fold the two rwlock implementations into
    a shared one.

    Signed-off-by: Jan Beulich
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/4E258DD7020000780004E3EA@nat28.tlf.novell.com
    Signed-off-by: Ingo Molnar

    Jan Beulich