lkml.org 
[lkml]   [2015]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] locking/rwsem: reduce spinlock contention in wakeup after up_read/up_write
From
Date
On Fri, 2015-04-17 at 22:03 -0400, Waiman Long wrote:

> diff --git a/include/linux/osq_lock.h b/include/linux/osq_lock.h
> index 3a6490e..703ea5c 100644
> --- a/include/linux/osq_lock.h
> +++ b/include/linux/osq_lock.h
> @@ -32,4 +32,9 @@ static inline void osq_lock_init(struct optimistic_spin_queue *lock)
> extern bool osq_lock(struct optimistic_spin_queue *lock);
> extern void osq_unlock(struct optimistic_spin_queue *lock);
>
> +static inline bool osq_is_locked(struct optimistic_spin_queue *lock)
> +{
> + return atomic_read(&lock->tail) != OSQ_UNLOCKED_VAL;
> +}

Would it be better to separate the addition of osq_is_locked() into its
own patch, since this can be useful for other situations and isn't just
specific to the rwsem optimization.



\
 
 \ /
  Last update: 2015-04-20 22:41    [W:0.062 / U:3.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site