Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751271AbdH2AXg (ORCPT ); Mon, 28 Aug 2017 20:23:36 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:36492 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbdH2AXf (ORCPT ); Mon, 28 Aug 2017 20:23:35 -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: Tue, 29 Aug 2017 09:23:33 +0900 From: Byungchul Park To: Tejun Heo Cc: johannes.berg@intel.com, peterz@infradead.org, mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, kernel-team@lge.com Subject: Re: [RFC] workqueue: remove manual lockdep uses to detect deadlocks Message-ID: <20170829002333.GA3240@X58A-UD3R> References: <1503650463-14582-1-git-send-email-byungchul.park@lge.com> <20170825133442.GU491396@devbig577.frc2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170825133442.GU491396@devbig577.frc2.facebook.com> 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 Content-Length: 1485 Lines: 38 On Fri, Aug 25, 2017 at 06:34:43AM -0700, Tejun Heo wrote: > On Fri, Aug 25, 2017 at 05:41:03PM +0900, Byungchul Park wrote: > > Hello all, > > > > This is _RFC_. > > > > I want to request for comments about if it's reasonable conceptually. If > > yes, I want to resend after working it more carefully. > > > > Could you let me know your opinions about this? > > > > ----->8----- > > From 448360c343477fff63df766544eec4620657a59e Mon Sep 17 00:00:00 2001 > > From: Byungchul Park > > Date: Fri, 25 Aug 2017 17:35:07 +0900 > > Subject: [RFC] workqueue: remove manual lockdep uses to detect deadlocks > > > > We introduced the following commit to detect deadlocks caused by > > wait_for_completion() in flush_{workqueue, work}() and other locks. But > > now LOCKDEP_COMPLETIONS is introduced, such works are automatically done > > by LOCKDEP_COMPLETIONS. So it doesn't have to be done manually anymore. > > Removed it. > > I'm not following lockdep development, so can't really comment but if > you're saying that wq can retain the same level of protection while > not having explicit annotations, conceptually, it's of course great. > However, how would it distinguish things like flushing another work > item on a workqueue w/ max_active of 1? Do you mean the following? process_one_work() acquire(W1) <---------+- distinguishable? work->fn() | flush_work(W2) | acquire(W2) <---+ release(W2) release(W1)