From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755393AbbCRJMu (ORCPT ); Wed, 18 Mar 2015 05:12:50 -0400 Received: from casper.infradead.org ([85.118.1.10]:53475 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753351AbbCRJMq (ORCPT ); Wed, 18 Mar 2015 05:12:46 -0400 Date: Wed, 18 Mar 2015 10:12:36 +0100 From: Peter Zijlstra To: Huang Ying Cc: LKML , LKP ML Subject: Re: [LKP] [lockdep] ef9db2383c7: WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:3538 check_flags+0x22d/0x240() Message-ID: <20150318091236.GL23123@twins.programming.kicks-ass.net> References: <1426666507.5570.32.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426666507.5570.32.camel@intel.com> 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 18, 2015 at 04:15:07PM +0800, Huang Ying wrote: > [ 0.043211] ------------[ cut here ]------------ > [ 0.043778] WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:3538 check_flags+0x22d/0x240() > [ 0.044000] DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled) > [ 0.044000] [] check_flags+0x22d/0x240 > [ 0.044000] [] lock_is_held+0x36/0x90 > [ 0.044000] [] rcu_read_lock_held+0x65/0x70 > [ 0.044000] [] lockdep_init_map+0x336/0x6f0 I'm not entirely sure how we get from lockdep_init_map() into rcu_read_lock_held() without going through another call like is_module_address(). But the error is clear enough; I added the below on top of this patch. Thanks! --- --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2996,8 +2996,13 @@ void lockdep_init_map(struct lockdep_map if (subclass) { unsigned long flags; + if (DEBUG_LOCKS_WARN_ON(current->lockdep_recursion)) + return; + raw_local_irq_save(flags); + current->lockdep_recursion = 1; register_lock_class(lock, subclass, 1); + current->lockdep_recursion = 0; raw_local_irq_restore(flags); } }