Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756189AbaJXOeE (ORCPT ); Fri, 24 Oct 2014 10:34:04 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:50273 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755262AbaJXOeC (ORCPT ); Fri, 24 Oct 2014 10:34:02 -0400 Date: Fri, 24 Oct 2014 16:33:45 +0200 From: Peter Zijlstra To: Jiri Kosina Cc: Ingo Molnar , "Rafael J. Wysocki" , Pavel Machek , Steven Rostedt , Dave Jones , "Paul E. McKenney" , Daniel Lezcano , Nicolas Pitre , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: lockdep splat in CPU hotplug Message-ID: <20141024143345.GL12706@worktop.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed, Oct 22, 2014 at 11:53:49AM +0200, Jiri Kosina wrote: > > The reason for CCing Ingo and Peter is that I can't make any sense of one > > of the stacktraces lockdep is providing. > > > > Please have a look at the very first stacktrace in the dump, where lockdep > > is trying to explain where cpu_hotplug.lock#2 has been acquired. It seems > > to imply that cpuidle_pause() is taking cpu_hotplug.lock, but that's not > > the case at all. > > > > What am I missing? > Still, the lockdep stacktrace is bogus and didn't really help > understanding this. Any idea why it's wrong? > > -> #1 (cpu_hotplug.lock#2){+.+.+.}: > > [] lock_acquire+0xac/0x130 > > [] mutex_lock_nested+0x5c/0x3b0 > > [] cpuidle_pause+0x12/0x30 > > [] dpm_suspend_noirq+0x44/0x340 > > [] dpm_suspend_end+0x38/0x80 > > [] hibernation_snapshot+0xcd/0x370 > > [] hibernate+0x168/0x210 > > [] state_store+0xe4/0xf0 > > [] kobj_attr_store+0xf/0x20 > > [] sysfs_kf_write+0x43/0x60 > > [] kernfs_fop_write+0xe7/0x170 > > [] vfs_write+0xb2/0x1f0 > > [] SyS_write+0x44/0xb0 > > [] system_call_fastpath+0x16/0x1b Right, so I've seen it more often, and I'm not sure I can explain either. Lockdep uses save_stack_trace() with trace->skip=3, typically if you get ->skip wrong you'd not even see the lock_acquire, so that can't be it. The only thing I can come up with is that for some reason the intermediate entries are !reliable, save_stack_trace() skips those for CONFIG_FRAME_POINTER=y, see arch/x86/kernel/stacktrace.c:__save_stack_address(). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/