lkml.org 
[lkml]   [2018]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/2] locking/rwsem: Add a new RWSEM_ANONYMOUSLY_OWNED flag
On Tue, May 15, 2018 at 01:38:03PM -0400, Waiman Long wrote:
> diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
> index 30465a2..b7208e1 100644
> --- a/kernel/locking/rwsem.c
> +++ b/kernel/locking/rwsem.c
> @@ -130,7 +130,8 @@ void up_read(struct rw_semaphore *sem)
> void up_write(struct rw_semaphore *sem)
> {
> rwsem_release(&sem->dep_map, 1, _RET_IP_);
> - DEBUG_RWSEMS_WARN_ON(sem->owner != current);
> + DEBUG_RWSEMS_WARN_ON((sem->owner != current) &&
> + !rwsem_has_anonymous_owner(sem->owner));

Why? Don't we always do percpu_rwsem_acquire() before up?

>
> rwsem_clear_owner(sem);
> __up_write(sem);

\
 
 \ /
  Last update: 2018-05-15 19:49    [W:0.099 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site