From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752205AbdIFIs6 (ORCPT ); Wed, 6 Sep 2017 04:48:58 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:37478 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751814AbdIFIsv (ORCPT ); Wed, 6 Sep 2017 04:48:51 -0400 X-Google-Smtp-Source: ADKCNb6xM/7d1S7l/KWVPh5ByyiM6k4fHV8h6TQgZKGxDTqxbDQu66XB5KwVmL1TZnV7skCjulxTHg== Date: Wed, 6 Sep 2017 16:49:20 +0800 From: Boqun Feng To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Peter Zijlstra , Gautham R Shenoy , Byungchul Park Subject: Re: [RFC tip/locking v2 00/13] lockdep: Support deadlock detection for recursive read locks Message-ID: <20170906084920.GU11771@tardis> References: <20170906082824.16078-1-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="O3bhLwMadv7h6/J9" Content-Disposition: inline In-Reply-To: <20170906082824.16078-1-boqun.feng@gmail.com> 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 --O3bhLwMadv7h6/J9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 06, 2017 at 04:28:11PM +0800, Boqun Feng wrote: > Hi Ingo and Peter, >=20 > This is V2 for recursive read lock support in lockdep. I fix several > bugs in V1 and also add irq inversion detection support for recursive > read locks. >=20 > V1: https://marc.info/?l=3Dlinux-kernel&m=3D150393341825453 >=20 >=20 > As Peter pointed out: >=20 > https://marc.info/?l=3Dlinux-kernel&m=3D150349072023540 >=20 > The lockdep current has a limit support for recursive read locks, the > deadlock case as follow could not be detected: >=20 > read_lock(A); > lock(B); > lock(B); > write_lock(A); >=20 > I got some inspiration from Gautham R Shenoy: >=20 > https://lwn.net/Articles/332801/ >=20 > , and came up with this series. >=20 > The basic idea is: >=20 > * Add recursive read locks into the graph >=20 > * Classify dependencies into --(RR)-->, --(NR)-->, --(RN)-->, > --(NN)-->, where R stands for recursive read lock, N stands for > other locks(i.e. non-recursive read locks and write locks). >=20 > * Define strong dependency paths as the paths of dependencies > don't have two adjacent dependencies as --(*R)--> and --(R*)-->. >=20 > * Extend __bfs() to only traverse on strong dependency paths. >=20 > * If __bfs() finds a strong dependency circle, then a deadlock is > reported. >=20 > The whole series is based on current master branch of Linus' tree: >=20 > e7d0c41ecc2e ("Merge tag 'devprop-4.14-rc1' of git://git.kernel.org/pub/= scm/linux/kernel/git/rafael/linux-pm") >=20 > , and I also put it at: >=20 > git://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git arr-rfc-v2 Hmm.. should revert d82fed752942 ("locking/lockdep/selftests: Fix mixed read-write ABBA tests") for testing, as it is a work around because of we had limit support for recursive read lock before. I put a branch with that reverted at: git://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git arr-rfc-v2a Selftest passed for that branch, now run it for more time. Regards, Boqun --O3bhLwMadv7h6/J9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEj5IosQTPz8XU1wRHSXnow7UH+rgFAlmvto0ACgkQSXnow7UH +riEAgf/bANo+L5TwjEeon39oXY3NrPkURmYQwPHB3eVnkMAHeaj7Y1MVaIRvfcv Haj81MKnG6Vwqc5gPnjddCiTcXo9lDxCI4eSt61NYulFua0wgKMTjXRIwp/O7me8 0CQiVBgKuph9Z9xlXNVM5ch1Nv2Chqdc8ft863CA/XnzVDM2ZRrkl40lnPlFMVqR 3SHRzGcJOgM7+bRxnUMl2LeSJ48RJyFsFMauXgQUuB1Y1UMsLE+M4b4YVcoZiBfG 3aIFhcUa5re+sWKeZl3yLy60oee4TasMRg5IxLHBtBf0fzDJRrLo2i15u1P9k+wT Xg9CiFPjy4SWSh0/DVnXZOZmZLdX5Q== =dkSg -----END PGP SIGNATURE----- --O3bhLwMadv7h6/J9--