From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752894AbbHMOAz (ORCPT ); Thu, 13 Aug 2015 10:00:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60918 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752249AbbHMOAy (ORCPT ); Thu, 13 Aug 2015 10:00:54 -0400 Date: Thu, 13 Aug 2015 15:58:38 +0200 From: Oleg Nesterov To: Jan Kara Cc: Al Viro , Dave Chinner , Dave Hansen , "Paul E. McKenney" , Peter Zijlstra , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 9/8] don't fool lockdep in freeze_super() and thaw_super() paths Message-ID: <20150813135838.GA17414@redhat.com> References: <20150811170343.GA26881@redhat.com> <20150812131138.GA7462@redhat.com> <20150813110155.GI26599@quack.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150813110155.GI26599@quack.suse.cz> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/13, Jan Kara wrote: > > On Wed 12-08-15 15:11:38, Oleg Nesterov wrote: > > On 08/11, Oleg Nesterov wrote: > > > > > > The only essential change is that I dropped the lockdep improvements > > > as we discussed. This means that 8/8 was changed a bit, and I decided > > > to add the new documentation patch, see 3/8. > > > > Update: The recent > > > > [PATCH 0/2] xfs: kill lockdep false positives from readdir > > > > changes from Dave fixed the problems ILOCK false-positives. So we can > > add the additional patch which (modulo comments) just turns v2 back into > > v1. > > > > Dave, Jan, you seem to agree with these patches. How should we route > > this all? > > Regarding the routing, ideally Al Viro should take these as a VFS > maintainer. OK. I'll send v3. But to remind, this particular patch depends on Dave's fixes, so I will send it later. And I forgot to mention that I have another patch which removes the trylock hack from __sb_start_write() as Dave suggested, it passed the tests. But again, I'd really like to send it separately so that it can be reverted in (unlikely) case something else does recursive read_lock(). > > Subject: [PATCH v2 9/8] don't fool lockdep in freeze_super() and thaw_super() paths > > > > sb_wait_write()->percpu_rwsem_release() fools lockdep to avoid the > > false-positives. Now that xfs was fixed by Dave we can remove it and > > change freeze_super() and thaw_super() to run with s_writers.rw_sem > > locks held; we add two trivial helpers for that, sb_freeze_release() > > and sb_freeze_acquire(). > > > > While at it, kill the outdated part of the comment above sb_wait_write. > > > > Signed-off-by: Oleg Nesterov > > The patch looks good. Just one nit: > > > + for (level = SB_FREEZE_LEVELS; --level >= 0; ) > > + percpu_rwsem_release(sb->s_writers.rw_sem + level, 0, _THIS_IP_); > > It is more common (and to me more readable) to have the loop written as: > > for (level = SB_FREEZE_LEVELS - 1; level >= 0; level--) > > I agree what you do is shorter but IMHO it's just an unnecessary > obfuscation :) Agreed, will fix. Oleg.