Re: [PATCH RFC 0/2] Lockless update of reference count protected by spinlock

2013-06-24 Thread Waiman Long

On 06/19/2013 12:50 PM, Waiman Long wrote:

This patchset supports a generic mechanism to atomically update
a reference count that is protected by a spinlock without actually
acquiring the lock itself. If the update doesn't succeeed, the caller
will have to acquire the lock and update the reference count in the
the old way.  This will help in situation where there is a lot of
spinlock contention because of frequent reference count update.

The new mechanism was designed in such a way to easily retrofit
into existing code with minimal changes. Both the spinlock and the
reference count can be accessed in the same way as before.

The d_lock and d_count fields of the struct dentry in dcache.h was
modified to use the new mechanism. This serves as an example of how
to convert existing spinlock and reference count combo to use the
new way of locklessly updating the reference count.

Signed-off-by: Waiman Long

Waiman Long (2):
   spinlock: New spinlock_refcount.h for lockless update of refcount
   dcache: Locklessly update d_count whenever possible

  fs/dcache.c   |   14 +++-
  include/linux/dcache.h|   22 +-
  include/linux/spinlock_refcount.h |  145 +
  include/linux/spinlock_types.h|   19 +
  4 files changed, 196 insertions(+), 4 deletions(-)
  create mode 100644 include/linux/spinlock_refcount.h



So far, I haven't received any feedback on this patch. I would really 
appreciate if someone could let me know if there is any improvement that 
will make this patch more merge-able.


Thanks,
Longman
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC 0/2] Lockless update of reference count protected by spinlock

2013-06-24 Thread Waiman Long

On 06/19/2013 12:50 PM, Waiman Long wrote:

This patchset supports a generic mechanism to atomically update
a reference count that is protected by a spinlock without actually
acquiring the lock itself. If the update doesn't succeeed, the caller
will have to acquire the lock and update the reference count in the
the old way.  This will help in situation where there is a lot of
spinlock contention because of frequent reference count update.

The new mechanism was designed in such a way to easily retrofit
into existing code with minimal changes. Both the spinlock and the
reference count can be accessed in the same way as before.

The d_lock and d_count fields of the struct dentry in dcache.h was
modified to use the new mechanism. This serves as an example of how
to convert existing spinlock and reference count combo to use the
new way of locklessly updating the reference count.

Signed-off-by: Waiman Longwaiman.l...@hp.com

Waiman Long (2):
   spinlock: New spinlock_refcount.h for lockless update of refcount
   dcache: Locklessly update d_count whenever possible

  fs/dcache.c   |   14 +++-
  include/linux/dcache.h|   22 +-
  include/linux/spinlock_refcount.h |  145 +
  include/linux/spinlock_types.h|   19 +
  4 files changed, 196 insertions(+), 4 deletions(-)
  create mode 100644 include/linux/spinlock_refcount.h



So far, I haven't received any feedback on this patch. I would really 
appreciate if someone could let me know if there is any improvement that 
will make this patch more merge-able.


Thanks,
Longman
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH RFC 0/2] Lockless update of reference count protected by spinlock

2013-06-19 Thread Waiman Long
This patchset supports a generic mechanism to atomically update
a reference count that is protected by a spinlock without actually
acquiring the lock itself. If the update doesn't succeeed, the caller
will have to acquire the lock and update the reference count in the
the old way.  This will help in situation where there is a lot of
spinlock contention because of frequent reference count update.

The new mechanism was designed in such a way to easily retrofit
into existing code with minimal changes. Both the spinlock and the
reference count can be accessed in the same way as before.

The d_lock and d_count fields of the struct dentry in dcache.h was
modified to use the new mechanism. This serves as an example of how
to convert existing spinlock and reference count combo to use the
new way of locklessly updating the reference count.

Signed-off-by: Waiman Long 

Waiman Long (2):
  spinlock: New spinlock_refcount.h for lockless update of refcount
  dcache: Locklessly update d_count whenever possible

 fs/dcache.c   |   14 +++-
 include/linux/dcache.h|   22 +-
 include/linux/spinlock_refcount.h |  145 +
 include/linux/spinlock_types.h|   19 +
 4 files changed, 196 insertions(+), 4 deletions(-)
 create mode 100644 include/linux/spinlock_refcount.h

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH RFC 0/2] Lockless update of reference count protected by spinlock

2013-06-19 Thread Waiman Long
This patchset supports a generic mechanism to atomically update
a reference count that is protected by a spinlock without actually
acquiring the lock itself. If the update doesn't succeeed, the caller
will have to acquire the lock and update the reference count in the
the old way.  This will help in situation where there is a lot of
spinlock contention because of frequent reference count update.

The new mechanism was designed in such a way to easily retrofit
into existing code with minimal changes. Both the spinlock and the
reference count can be accessed in the same way as before.

The d_lock and d_count fields of the struct dentry in dcache.h was
modified to use the new mechanism. This serves as an example of how
to convert existing spinlock and reference count combo to use the
new way of locklessly updating the reference count.

Signed-off-by: Waiman Long waiman.l...@hp.com

Waiman Long (2):
  spinlock: New spinlock_refcount.h for lockless update of refcount
  dcache: Locklessly update d_count whenever possible

 fs/dcache.c   |   14 +++-
 include/linux/dcache.h|   22 +-
 include/linux/spinlock_refcount.h |  145 +
 include/linux/spinlock_types.h|   19 +
 4 files changed, 196 insertions(+), 4 deletions(-)
 create mode 100644 include/linux/spinlock_refcount.h

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/