From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752674AbcC3JuP (ORCPT ); Wed, 30 Mar 2016 05:50:15 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:34046 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751964AbcC3JuL (ORCPT ); Wed, 30 Mar 2016 05:50:11 -0400 Date: Wed, 30 Mar 2016 11:50:06 +0200 From: Peter Zijlstra To: Ingo Molnar Cc: Alfredo Alvarez Fernandez , Linus Torvalds , Sedat Dilek , "Theodore Ts'o" , linux-fsdevel , LKML Subject: Re: [Linux-v4.6-rc1] ext4: WARNING: CPU: 2 PID: 2692 at kernel/locking/lockdep.c:2017 __lock_acquire+0x180e/0x2260 Message-ID: <20160330095006.GC11035@twins.programming.kicks-ass.net> References: <20160327204810.GW6356@twins.programming.kicks-ass.net> <20160329084701.GA9393@gmail.com> <20160330093659.GS3408@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160330093659.GS3408@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 30, 2016 at 11:36:59AM +0200, Peter Zijlstra wrote: > On Tue, Mar 29, 2016 at 10:47:02AM +0200, Ingo Molnar wrote: > > > > You are right; this is lockdep running into a hash collision; which is a new > > > DEBUG_LOCKDEP test. See 9e4e7554e755 ("locking/lockdep: Detect chain_key > > > collisions"). > > > > I've Cc:-ed Alfredo Alvarez Fernandez who added that test. > > OK, so while the code in check_no_collision() seems sensible, it relies > on borken bits. > > The whole chain_hlocks and /proc/lockdep_chains stuff appears to have > been buggered from the start. > > The below patch should fix this. Note that unless we had more than 65536 chain_hlocks consumed the patch would not make a difference. > Furthermore, our hash function has definite room for improvement. And no matter how good we make it, a u64 hash is bound to collide at some point (or of any size really). Also, we could make them non-fatal, returning true from lookup_chain_cache() is always correct (_very_ expensive, but correct), so in case of doubt we could just return true.