From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754655AbdJMH4l (ORCPT ); Fri, 13 Oct 2017 03:56:41 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:44103 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751497AbdJMH4k (ORCPT ); Fri, 13 Oct 2017 03:56:40 -0400 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Fri, 13 Oct 2017 16:56:33 +0900 From: Byungchul Park To: Peter Zijlstra Cc: Tejun Heo , johannes.berg@intel.com, mingo@kernel.org, tglx@linutronix.de, oleg@redhat.com, linux-kernel@vger.kernel.org, kernel-team@lge.com Subject: Re: [RESEND PATCH v2 2/2] lockdep: Remove unnecessary acquisitions wrt workqueue flush Message-ID: <20171013075633.GN3323@X58A-UD3R> References: <1507618297-27470-1-git-send-email-byungchul.park@lge.com> <1507618297-27470-2-git-send-email-byungchul.park@lge.com> <20171012075435.GK3323@X58A-UD3R> <20171012153817.GQ3301751@devbig577.frc2.facebook.com> <20171012155635.ntljsbmtq4mstb2f@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171012155635.ntljsbmtq4mstb2f@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 Thu, Oct 12, 2017 at 05:56:35PM +0200, Peter Zijlstra wrote: > On Thu, Oct 12, 2017 at 08:38:17AM -0700, Tejun Heo wrote: > > > > As long as we have the same level of protection, simpler code is of > > course preferable. That said, I haven't followed the discussion > > closely and don't want to apply it without Peter's ack. Peter? > > I'm really tied up atm; and feel we should be addressing the false > positives generated by the current code before we start doing new stuff > on top. We can never avoid adding false dependencies as long as we use acquisitions in that way the workqueue code does, even though you successfully replace write acquisitions with recursive-read ones after making them work, as you know. Speaking a bit more about the reason, it's because all write locks used in every work->func() obviously generate false dependencies(links) with 'work' lockdep_map and 'wq' lockdep_map, when they do not involve flush. This is why I used a word, 'speculative', whenever we were talking. At the beginning of this issue, I suggested to use recursive-read acquisitions instead of write ones, which you are working on, since anyway it reduces false ones. But, if it's allowed to add a new primitive that just suits that purpose, I want to propose it to be used instead, which makes false ones reduced more. A read acuisition is a real acquisition used for a read lock. Semantics are similar to but not same as what we need for that speculative purpose.