Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752744AbdIFAlu (ORCPT ); Tue, 5 Sep 2017 20:41:50 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:35369 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752578AbdIFAlr (ORCPT ); Tue, 5 Sep 2017 20:41:47 -0400 X-Google-Smtp-Source: ADKCNb6PJ+O+km1DMt+5NGHqIymCcf756RsVS1CB/dtw3+bljnuI5FxYCmQA2wUgbYXe9a5jwkRrEQ== Date: Wed, 6 Sep 2017 08:42:11 +0800 From: Boqun Feng To: Byungchul Park Cc: Peter Zijlstra , Byungchul Park , Ingo Molnar , Tejun Heo , david@fromorbit.com, Johannes Berg , oleg@redhat.com, "linux-kernel@vger.kernel.org" , kernel-team@lge.com Subject: Re: [PATCH 4/4] lockdep: Fix workqueue crossrelease annotation Message-ID: <20170906004211.GT11771@tardis> References: <20170904114248.kls4jv2ggsv46mli@hirez.programming.kicks-ass.net> <20170905003844.GO3240@X58A-UD3R> <20170905070825.tovfkqvxpwosh5oa@hirez.programming.kicks-ass.net> <20170905071930.h6t2f4guvmswibnv@hirez.programming.kicks-ass.net> <20170905085727.GV3240@X58A-UD3R> <20170905093624.zlwhvg32ahkpnamk@hirez.programming.kicks-ass.net> <20170905103144.GW3240@X58A-UD3R> <20170905105838.GX3240@X58A-UD3R> <20170905134643.mbjjphn2obwkzpzx@hirez.programming.kicks-ass.net> <20170905235235.GZ3240@X58A-UD3R> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mjrw6G9AoRBv8oQK" Content-Disposition: inline In-Reply-To: <20170905235235.GZ3240@X58A-UD3R> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3005 Lines: 83 --mjrw6G9AoRBv8oQK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 06, 2017 at 08:52:35AM +0900, Byungchul Park wrote: > On Tue, Sep 05, 2017 at 03:46:43PM +0200, Peter Zijlstra wrote: > > On Tue, Sep 05, 2017 at 07:58:38PM +0900, Byungchul Park wrote: > > > On Tue, Sep 05, 2017 at 07:31:44PM +0900, Byungchul Park wrote: > > > > Recursive-read and the hint I proposed(a.k.a. might) should be used= for > > > > their different specific applications. Both meaning and constraints= of > > > > them are totally different. > > > >=20 > > > > Using a right function semantically is more important than making it > > > > just work, as you know. Wrong? > >=20 > > > Of course, in the following cases, the results are same: > > >=20 > > > recursive-read(A) -> recursive-read(A), is like nothing, and also > > > might(A) -> might(A) , is like nothing. > > >=20 > > > recursive-read(A) -> lock(A), end in a deadlock, and also > > > might(A) -> lock(A), end in a deadlock. > >=20 > > And these are exactly the cases we need. > >=20 > > > Futhermore, recursive-read-might() can be used if needed, since their > > > semantics are orthogonal so they can be used in mixed forms. > > >=20 > > > I really hope you accept the new semantics... I think current workque= ue > > > code exactly needs the semantics. > >=20 > > I really don't want to introduce this extra state if we don't have to. >=20 > OK. If the workqueue is only user of the weird lockdep annotations, then > it might be better to defer introducing the extra state until needed. >=20 > But, the 'might' thing I introduced would be necessary if more users > want to report deadlocks at the time for crosslocks with speculative > acquisitions like the workqueue does, since the recursive-read thing > would generate false dependencies much more than we want, while the What do you mean by "false dependencies"? AFAICT, recursive-read could have dependencies to the following cross commit, for example: A(a) ARR(a) RRR(a) WFC(X) C(X) This is a deadlock, no? In my upcoming v2 for recursive-read support, I'm going to make this detectable. But please note as crossrelease doesn't have any selftests as normal lockdep stuffs, I may miss something subtle. Regards, Boqun > 'might' thing generate them just as many as we want. >=20 --mjrw6G9AoRBv8oQK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEj5IosQTPz8XU1wRHSXnow7UH+rgFAlmvRF8ACgkQSXnow7UH +rg2Wgf/YWdxcybhToanUXYFi/iqQO9xFdDJvccRup2icT9mfiX89eSC0PcoULK5 oGUj6snEVrJi3bAr1mbsh1IPUhuJmO8/Ug3GDOJJEwVmmpWSQLCsT+WY7cyt7uL6 P/F+ebFgGY3oqUN2FzEGoKgbtjdp3IefDgrdbs1CphCxGgm2NIH6sAM/C21R3urC pd5GKI4BGmfkOvBk1vgQHQA2JJls0KmyC02bp9FeXu06r8UY0WC9pfmf23dhuTzi XJzl9pw45EEgsz+fnvhAKzzbJH4b+XKBV+waGEkJf1c7NjNr650LlxcUq4ogILBk PjHXcPSOtBpJ9mcpGi7sfwqDMKnUAw== =rM7A -----END PGP SIGNATURE----- --mjrw6G9AoRBv8oQK--