lkml.org 
[lkml]   [2015]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] exit: Use read lock for do_notify_parent() instead of write lock

* Peter Zijlstra <peterz@infradead.org> wrote:

> On Thu, Apr 09, 2015 at 08:59:08PM +0300, Kirill Tkhai wrote:
>
> I've not really read your email yet, however:
>
> > Also, in the future we may think about new rwlock primitive, which atomically
> > drops write lock and acquires read lock. Something like this for example:
> >
> > include/asm-generic/qrwlock.h:
> > static inline void queue_reduce_locked_write_to_read(struct qrwlock *lock)
> > {
> > smp_mb__before_atomic();
> > atomic_add(_QR_BIAS - _QW_LOCKED, &lock->cnts);
> > }
>
> we actually have that for the rwsems: downgrade_write(). So the
> consistent naming would be: queue_downgrade_write().

and 'downgrade_write_lock()' on the rwlock side.

Thanks,

Ingo


\
 
 \ /
  Last update: 2015-04-10 11:01    [W:0.085 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site