Re: [RFC][PATCH 06/13] percpu-rwsem: Provide percpu_down_read_trylock()

2015-06-22 Thread Oleg Nesterov
On 06/22, Peter Zijlstra wrote: > > +static inline bool percpu_down_read_trylock(struct percpu_rw_semaphore *sem) > +{ > + bool ret = true; > + > + preempt_disable(); > + __this_cpu_inc(*sem->refcount); > + if (unlikely(!rcu_sync_is_idle(&sem->rss))) > + ret = __percpu_d

[RFC][PATCH 06/13] percpu-rwsem: Provide percpu_down_read_trylock()

2015-06-22 Thread Peter Zijlstra
Signed-off-by: Peter Zijlstra (Intel) --- include/linux/percpu-rwsem.h | 17 + kernel/locking/percpu-rwsem.c | 12 2 files changed, 29 insertions(+) --- a/include/linux/percpu-rwsem.h +++ b/include/linux/percpu-rwsem.h @@ -17,6 +17,7 @@ struct percpu_rw_semapho