lkml.org 
[lkml]   [2019]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 07/16] locking/rwsem: Implement lock handoff to prevent lock starvation
On Sat, Apr 13, 2019 at 01:22:50PM -0400, Waiman Long wrote:
> +/*
> + * This is safe to be called without holding the wait_lock.

Because.... @waiter is *our* waiter and it's not going anywhere. So when
it's first, it stays first until we do something about it.

> + */
> +static inline bool
> +rwsem_waiter_is_first(struct rw_semaphore *sem, struct rwsem_waiter *waiter)
> +{
> + return list_first_entry(&sem->wait_list, struct rwsem_waiter, list)
> + == waiter;
> +}

\
 
 \ /
  Last update: 2019-04-17 10:18    [W:0.401 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site