From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751238AbdHXFGo (ORCPT ); Thu, 24 Aug 2017 01:06:44 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:45416 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140AbdHXFGm (ORCPT ); Thu, 24 Aug 2017 01:06:42 -0400 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Thu, 24 Aug 2017 14:06:39 +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: <20170824050639.GD6772@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> <20170823023118.GC3108@X58A-UD3R> <20170823104648.ltpwbiprzconz7ef@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170823104648.ltpwbiprzconz7ef@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 Wed, Aug 23, 2017 at 12:46:48PM +0200, Peter Zijlstra wrote: > On Wed, Aug 23, 2017 at 11:31:18AM +0900, Byungchul Park wrote: > > On Tue, Aug 22, 2017 at 11:06:03AM +0200, Peter Zijlstra wrote: > > > Currently, we do the following in process_one_work(), > > > > lockdep_map_acquire for a workqueue > > lockdep_map_acquire for a work > > > > But IMHO it should be, > > > > lockdep_map_acquire for a pair of workqueue and work. > > > > Right? > > No, it is right. We need the two 'locks'. > > The work one is for flush_work(), the workqueue one is for > flush_workqueue(). > > Just like how flush_work() must not depend on any lock taken inside the > work, flush_workqueue() callers must not hold any lock acquired inside > any work ran inside the workqueue. This cannot be done with a single > 'lock'. Thank you for explanation. > The reason flush_work() also depends on the wq 'lock' is because doing > flush_work() from inside work is a possible problem for single threaded > workqueues and workqueues with a rescuer. > > > > Agreed. The interaction with workqueues is buggered. > > > > I think original uses of lockdep_map were already wrong. I mean it's > > not a problem of newly introduced code. > > Not wrong per-se, the new code certainly places more constraints on it. "the new code places more constraints on it" is just the right expression.