From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753181AbdHWCMW (ORCPT ); Tue, 22 Aug 2017 22:12:22 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:43149 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752912AbdHWCMV (ORCPT ); Tue, 22 Aug 2017 22:12:21 -0400 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Wed, 23 Aug 2017 11:12:17 +0900 From: Byungchul Park To: Peter Zijlstra Cc: Dave Chinner , mingo@kernel.org, linux-kernel@vger.kernel.org, kernel-team@lge.com, Arnaldo Carvalho de Melo , Tejun Heo , Boqun Feng Subject: Re: [PATCH v3 1/3] lockdep: Make LOCKDEP_CROSSRELEASE configs all part of PROVE_LOCKING Message-ID: <20170823021217.GB3108@X58A-UD3R> References: <1502960261-16206-1-git-send-email-byungchul.park@lge.com> <20170821154600.asyzqs2zg6w6o4pg@hirez.programming.kicks-ass.net> <20170822054603.GT10621@dastard> <20170822090603.vufl5ncoequ5ag6x@hirez.programming.kicks-ass.net> <20170822092236.GI20323@X58A-UD3R> <20170822093703.vuuxvxaytna5im33@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170822093703.vuuxvxaytna5im33@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 22, 2017 at 11:37:03AM +0200, Peter Zijlstra wrote: > On Tue, Aug 22, 2017 at 06:22:36PM +0900, Byungchul Park wrote: > > On Tue, Aug 22, 2017 at 11:06:03AM +0200, Peter Zijlstra wrote: > > > So I did the below little hack, which basically wipes the entire lock > > > history when we start a work and thereby disregards/looses the > > > dependency on the work 'lock'. > > > > > > It makes my test box able to boot and build a kernel on XFS, so while I > > > see what you're saying (I think), it doesn't appear to instantly show. > > > > > > Should I run xfstests or something to further verify things are OK? Does > > > that need a scratch partition (I keep forgetting how to run that stuff > > > :/). > > > > > > --- > > > diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c > > > index 66011c9f5df3..de91cdce9460 100644 > > > --- a/kernel/locking/lockdep.c > > > +++ b/kernel/locking/lockdep.c > > > @@ -4756,10 +4756,14 @@ void crossrelease_hist_start(enum xhlock_context_t c) > > > { > > > struct task_struct *cur = current; > > > > > > - if (cur->xhlocks) { > > > - cur->xhlock_idx_hist[c] = cur->xhlock_idx; > > > - cur->hist_id_save[c] = cur->hist_id; > > > - } > > > + if (!cur->xhlocks) > > > + return; > > > + > > > + if (c == XHLOCK_PROC) > > > + invalidate_xhlock(&xhlock(cur->xhlock_idx)); > > > > We have to detect dependecies if it exists, even in the following case: > > > > oooooooiiiiiiiiiiiiiiiiiii......... > > |<- range for commit ->| > > > > where > > o: acquisition outside of each work, > > i: acquisition inside of each work, > > > > With yours, we can never detect dependecies wrt 'o'. > > There really shouldn't be any o's when you call There can be any o's. > crossrelease_hist_start(XHLOCK_PROC), it should denote the bottom of a No, I don't think so. It can be either the bottom or not. hist_start() and hist_end() is only for special contexts which need roll back on exit e.g. irq, work and so on. Normal kernel context should work well w/o hist_start() or hist_end(). > context, see: > > https://lkml.kernel.org/r/20170301104328.GD6515@twins.programming.kicks-ass.net Actually, I don't agree with that. > And in that respect you placed the calls wrongly in process_one_work(), Why is it wrong? It's intended. Could you tell me why?