From: Mike Galbraith Subject: Re: [patchlet] locking/rt: fix rt_read_lock() lockdep annotation. Date: Wed, 07 May 2014 16:20:15 +0200 Message-ID: <1399472415.5248.15.camel@marge.simpson.net> References: <20140503170110.GA10652@linutronix.de> <1399449247.5142.14.camel@marge.simpson.net> <20140507094807.229d88d8@gandalf.local.home> <1399471264.5248.5.camel@marge.simpson.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Sebastian Andrzej Siewior , linux-rt-users , Thomas Gleixner , John Kacur To: Steven Rostedt Return-path: Received: from mail-ee0-f49.google.com ([74.125.83.49]:51280 "EHLO mail-ee0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932752AbaEGOUS (ORCPT ); Wed, 7 May 2014 10:20:18 -0400 Received: by mail-ee0-f49.google.com with SMTP id e53so799915eek.22 for ; Wed, 07 May 2014 07:20:17 -0700 (PDT) In-Reply-To: <1399471264.5248.5.camel@marge.simpson.net> Sender: linux-rt-users-owner@vger.kernel.org List-ID: On Wed, 2014-05-07 at 16:01 +0200, Mike Galbraith wrote: > On Wed, 2014-05-07 at 09:48 -0400, Steven Rostedt wrote: > > On Wed, 07 May 2014 09:54:07 +0200 > > Mike Galbraith wrote: > > > > > > > > rt-rw-lockdep-annotations.patch missed an rwlock_acquire_read() > > > > > > Signed-off-by: Mike Galbraith > > > --- > > > kernel/locking/rt.c | 3 +-- > > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > > > --- a/kernel/locking/rt.c > > > +++ b/kernel/locking/rt.c > > > @@ -244,13 +244,12 @@ void __lockfunc rt_read_lock(rwlock_t *r > > > { > > > struct rt_mutex *lock = &rwlock->lock; > > > > > > - > > > /* > > > * recursive read locks succeed when current owns the lock > > > */ > > > if (rt_mutex_owner(lock) != current) { > > > migrate_disable(); > > > - rwlock_acquire_read(&rwlock->dep_map, 0, 0, _RET_IP_); > > > + rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); > > > __rt_spin_lock(lock); > > > > This looks like it reverse applies? > > > Nope, I thought Thomas's whacked the one he did on purpose. I should learn to speak lockdep. How about this instead? locking/rt: fix rt_read_trylock() lockdep annotation. rt-rw-lockdep-annotations.patch dropped a rwlock_acquire_read Signed-off-by: Mike Galbraith --- kernel/locking/rt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/kernel/locking/rt.c +++ b/kernel/locking/rt.c @@ -217,7 +217,7 @@ int __lockfunc rt_read_trylock(rwlock_t migrate_disable(); ret = rt_mutex_trylock(lock); if (ret) - rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_); + rwlock_acquire_read(&rwlock->dep_map, 0, 1, _RET_IP_); else migrate_enable(); @@ -244,7 +244,6 @@ void __lockfunc rt_read_lock(rwlock_t *r { struct rt_mutex *lock = &rwlock->lock;