]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'lockref' (locked reference counts)
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 3 Sep 2013 15:08:21 +0000 (08:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 3 Sep 2013 15:08:21 +0000 (08:08 -0700)
commit28c28dca5c65c9d035057f1b25c5c403ef066122
treeb7de25e97b03c31ea6c5f2540f641b0be2c91832
parent83db0fac521fd5abc2a3befd77c410a51f19b600
parentd526e080089870a358572f43f190c9e2cb01e8b8
Merge branch 'lockref' (locked reference counts)

Merge lockref infrastructure code by me and Waiman Long.

I already merged some of the preparatory patches that didn't actually do
any semantic changes earlier, but this merges the actual _reason_ for
those preparatory patches.

The "lockref" structure is a combination "spinlock and reference count"
that allows optimized reference count accesses.  In particular, it
guarantees that the reference count will be updated AS IF the spinlock
was held, but using atomic accesses that cover both the reference count
and the spinlock words, we can often do the update without actually
having to take the lock.

This allows us to avoid the nastiest cases of spinlock contention on
large machines under heavy pathname lookup loads.  When updating the
dentry reference counts on a large system, we'll still end up with the
cache line bouncing around, but that's much less noticeable than
actually having to spin waiting for the lock.

* lockref:
  lockref: implement lockless reference count updates using cmpxchg()
  lockref: uninline lockref helper functions
  vfs: reimplement d_rcu_to_refcount() using lockref_get_or_lock()
  vfs: use lockref_get_not_zero() for optimistic lockless dget_parent()
  lockref: add 'lockref_get_or_lock() helper