From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933137AbcBPQjE (ORCPT ); Tue, 16 Feb 2016 11:39:04 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:47847 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933102AbcBPQjC (ORCPT ); Tue, 16 Feb 2016 11:39:02 -0500 Subject: Re: [PATCH 0/3] lockdep: liblockdep: Prevent chain_key collisions To: Alfredo Alvarez Fernandez , mingo@redhat.com, peterz@infradead.org References: <1455147212-2389-1-git-send-email-alfredoalvarezernandez@gmail.com> Cc: linux-kernel@vger.kernel.org From: Sasha Levin Message-ID: <56C35082.1000001@oracle.com> Date: Tue, 16 Feb 2016 11:38:26 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1455147212-2389-1-git-send-email-alfredoalvarezernandez@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/10/2016 06:33 PM, Alfredo Alvarez Fernandez wrote: > This patch series prevents possible collisions in the chain_key > hashing macro iterate_chain_key(key1, key2) that can lead to lockdep > not detecting very simple deadlocks such as AA or ABBA. > > The problem only affects the first allocated lock classes. That could > explain why it was not seen while running lockdep's test suite, since > by the time the test suite runs there are already registered lock > classes and the indexes allocated for the lock classes under test are > high enough to avoid collisions. > > The patch series also extends the tools/liblockdep test suite with > tests covering the offending cases. > > I came across the problem while testing a simple AA deadlock scenario > in userspace using a pthread_mutex and tools/liblockdep. In that > context it is fairly easy to have a clean and deterministic initial > state where the problem can be reproduced. > > The proposed solution was tested with the newly introduced tests and > also with lockdep's test suite: > [ 0.000000] Good, all 253 testcases passed! | Thanks Alfredo, I'll grab the first two. Peter/Ingo, will you take the lockdep one or do you want it to go through my tree? Thanks, Sasha