From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932547AbdHVKIu (ORCPT ); Tue, 22 Aug 2017 06:08:50 -0400 Received: from merlin.infradead.org ([205.233.59.134]:51804 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932414AbdHVKIs (ORCPT ); Tue, 22 Aug 2017 06:08:48 -0400 Date: Tue, 22 Aug 2017 12:08:40 +0200 From: Peter Zijlstra To: Byungchul Park Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, kernel-team@lge.com, Arnaldo Carvalho de Melo , Dave Chinner , Tejun Heo , johannes@sipsolutions.net Subject: Re: [PATCH v3 1/3] lockdep: Make LOCKDEP_CROSSRELEASE configs all part of PROVE_LOCKING Message-ID: <20170822100840.eababgjcu76iois5@hirez.programming.kicks-ass.net> References: <1502960261-16206-1-git-send-email-byungchul.park@lge.com> <20170821154600.asyzqs2zg6w6o4pg@hirez.programming.kicks-ass.net> <20170822051438.GD20323@X58A-UD3R> <20170822075238.uyfmhgxeal2bwcdg@hirez.programming.kicks-ass.net> <20170822085100.GH20323@X58A-UD3R> <20170822092141.fjmr74xhfid7vu7h@hirez.programming.kicks-ass.net> <20170822093337.GJ20323@X58A-UD3R> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170822093337.GJ20323@X58A-UD3R> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 22, 2017 at 06:33:37PM +0900, Byungchul Park wrote: > On Tue, Aug 22, 2017 at 11:21:41AM +0200, Peter Zijlstra wrote: > > On Tue, Aug 22, 2017 at 05:51:00PM +0900, Byungchul Park wrote: > > > On Tue, Aug 22, 2017 at 09:52:38AM +0200, Peter Zijlstra wrote: > > > > That wouldn't work. That annotation is to help find deadlocks like: > > > > > > > > > > > > mutex_lock(&A) > > > > > > > > mutex_lock(&A) > > > > > > > > flush_work(&work) > > > > > > > > > > I meant: > > > > > > mutex_lock(&A) > > > > > > lockdep_map_acquire_read(&work) > > > mutex_lock(&A) > > > > > > lockdep_map_acquire(&work) > > > flush_work(&work) > > > > > > I mean it can still be detected with a read acquisition in work. > > > Am I wrong? > > > > Think so, although there's something weird with read locks that I keep > > forgetting. But I'm not sure it'll actually solve the problem. But I can > > I mean, read acquisitions are nothing but ones allowing read ones to be > re-acquired legally, IOW, we want to check entrance of flush_work() and > works, not between works. That's why I suggested to use read ones in work > in that case. Does seem to work.