From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753278AbbDPPus (ORCPT ); Thu, 16 Apr 2015 11:50:48 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:40852 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753173AbbDPPuj (ORCPT ); Thu, 16 Apr 2015 11:50:39 -0400 Date: Thu, 16 Apr 2015 17:50:28 +0200 From: Peter Zijlstra To: Sebastian Andrzej Siewior Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andreas Messerschmid Subject: Re: [PATCH] lockdep: make print_lock_name() robust against non-existing lock_class Message-ID: <20150416155028.GT27490@worktop.programming.kicks-ass.net> References: <1429104276-22412-1-git-send-email-bigeasy@linutronix.de> <20150415141440.GQ23123@twins.programming.kicks-ass.net> <552FCC2D.4050304@linutronix.de> <20150416153503.GC12676@worktop.ger.corp.intel.com> <20150416153936.GA7093@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150416153936.GA7093@linutronix.de> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 16, 2015 at 05:39:36PM +0200, Sebastian Andrzej Siewior wrote: > * Peter Zijlstra | 2015-04-16 17:35:03 [+0200]: > > >On Thu, Apr 16, 2015 at 04:50:21PM +0200, Sebastian Andrzej Siewior wrote: > > > >> Andreas confirmed that it works for him on v3.18 with minor adjustment. > >> > >> <--- > >> + struct held_lock lock = READ_ONCE(*hlock); > >> + unsigned int class_idx = lock.class_idx; > >> ---> > >> > > > >I'm confused by the need for that. What was the failure with the > >proposed patch? > > It was tested on v3.18, there might have been a change between v3.18 & > 4.0. The patch as-is did no compile: Yeah, I might not have compiled it.. > in file included from arch/x86/include/asm/current.h:4:0, > from include/linux/mutex.h:13, > from kernel/locking/lockdep.c:29: > kernel/locking/lockdep.c: In function ‘print_lock’: > kernel/locking/lockdep.c:558:37: error: ‘typeof’ applied to a bit-field > unsigned int class_idx = READ_ONCE(hlock->class_idx); Ah! Indeed so, copying all of the hlock is overdoing it a bit but would work I suppose. Thanks!