From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759996AbcINBBS (ORCPT ); Tue, 13 Sep 2016 21:01:18 -0400 Received: from mail-yw0-f171.google.com ([209.85.161.171]:33017 "EHLO mail-yw0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759490AbcINBBQ (ORCPT ); Tue, 13 Sep 2016 21:01:16 -0400 MIME-Version: 1.0 In-Reply-To: <20160913214244.GB5020@twins.programming.kicks-ass.net> References: <1473759914-17003-1-git-send-email-byungchul.park@lge.com> <1473759914-17003-8-git-send-email-byungchul.park@lge.com> <20160913150554.GI2794@worktop> <20160913193829.GA5016@twins.programming.kicks-ass.net> <20160913214244.GB5020@twins.programming.kicks-ass.net> From: Byungchul Park Date: Wed, 14 Sep 2016 10:01:14 +0900 Message-ID: Subject: Re: [PATCH v3 07/15] lockdep: Implement crossrelease feature To: Peter Zijlstra Cc: Byungchul Park , Ingo Molnar , tglx@linutronix.de, Michel Lespinasse , boqun.feng@gmail.com, kirill@shutemov.name, "linux-kernel@vger.kernel.org" , linux-mm@kvack.org, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, npiggin@gmail.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 14, 2016 at 6:42 AM, Peter Zijlstra wrote: > On Tue, Sep 13, 2016 at 09:38:29PM +0200, Peter Zijlstra wrote: > >> > > I _think_ you propose to keep track of all prior held locks and then use >> > > the union of the held list on the block-chain with the prior held list >> > > from the complete context. >> > >> > Almost right. Only thing we need to do to consider the union is to >> > connect two chains of two contexts by adding one dependency 'b -> a'. >> >> Sure, but how do you arrive at which connection to make. The document is >> entirely silent on this crucial point. >> >> The union between the held-locks of the blocked and prev-held-locks of >> the release should give a fair indication I think, but then, I've not >> thought too hard on this yet. > > s/union/intersection/ > > those that are in both sets. Precisely speaking, I introduces separate chains. For example, 1. Held-locks of the blocked, A -> B -> C (which original lockdep builds) 2. Prev-held-locks of the release G -> H -> I (which original lockdep builds, too) 3. Cross chain (which I introduced newly) C -> G Then the 'A -> B -> C -> G -> H -> I' can be traversed when bfs is performed. -- Thanks, Byungchul