Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751941AbdH3Bxn (ORCPT ); Tue, 29 Aug 2017 21:53:43 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:33371 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751887AbdH3Bxm (ORCPT ); Tue, 29 Aug 2017 21:53:42 -0400 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Wed, 30 Aug 2017 10:53:39 +0900 From: Byungchul Park To: Peter Zijlstra Cc: Byungchul Park , Tejun Heo , johannes.berg@intel.com, Ingo Molnar , 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: <20170830015338.GD3240@X58A-UD3R> References: <1503650463-14582-1-git-send-email-byungchul.park@lge.com> <20170825133442.GU491396@devbig577.frc2.facebook.com> <20170829185727.GY32112@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170829185727.GY32112@worktop.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 Content-Length: 1578 Lines: 45 On Tue, Aug 29, 2017 at 08:57:27PM +0200, Peter Zijlstra wrote: > On Sat, Aug 26, 2017 at 12:49:26AM +0900, Byungchul Park wrote: > > > However, how would it distinguish things like flushing another work > > > > I think it must be distinguished with what it actually waits for, e.i. > > completion > > variables instead of work or wq. I will make it next week and let you know. > > So no. The existing annotations are strictly better than relying on > cross-release. Thank you for exaplanation but, as I already said, this is why I said "I don't think it's the same level currently. But, I can make it with some modification." to TJ: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1479560.html And also I mentioned we might need the current code inevitably but, the existing annotations are never good and why here: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1480173.html > As you know the problem with cross-release is that it is timing > dependent. You need to actually observe the problematic sequence before > it can warn, and only the whole instance->class mapping saves us from > actually hitting the deadlock. Of course. > The same would be true for using cross-release for workqueues as well, > something like: > > W: > mutex_lock(A) > > mutex_lock(A) > flush_work(W) > > would go unreported whereas the current workqueue annotation will > generate a splat. Of course. That's why I said we need to work on it. But it should be modified so that the wq code becomes more clear instead of abusing weird acquire()s.