From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933096AbcCRN6H (ORCPT ); Fri, 18 Mar 2016 09:58:07 -0400 Received: from [198.137.202.10] ([198.137.202.10]:43468 "EHLO terminus.zytor.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S932916AbcCRN6E (ORCPT ); Fri, 18 Mar 2016 09:58:04 -0400 Date: Fri, 18 Mar 2016 06:54:35 -0700 From: tip-bot for Dave Jones Message-ID: Cc: ak@linux.intel.com, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de, davej@codemonkey.org.uk, mingo@kernel.org Reply-To: mingo@kernel.org, davej@codemonkey.org.uk, tglx@linutronix.de, hpa@zytor.com, ak@linux.intel.com, linux-kernel@vger.kernel.org In-Reply-To: <20160315012054.GA17765@codemonkey.org.uk> References: <20160315012054.GA17765@codemonkey.org.uk> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/apic: Fix suspicious RCU usage in smp_trace_call_function_interrupt() Git-Commit-ID: 7834c10313fb823e538f2772be78edcdeed2e6e3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 7834c10313fb823e538f2772be78edcdeed2e6e3 Gitweb: http://git.kernel.org/tip/7834c10313fb823e538f2772be78edcdeed2e6e3 Author: Dave Jones AuthorDate: Mon, 14 Mar 2016 21:20:54 -0400 Committer: Thomas Gleixner CommitDate: Fri, 18 Mar 2016 14:51:06 +0100 x86/apic: Fix suspicious RCU usage in smp_trace_call_function_interrupt() Since 4.4, I've been able to trigger this occasionally: =============================== [ INFO: suspicious RCU usage. ] 4.5.0-rc7-think+ #3 Not tainted Cc: Andi Kleen Link: http://lkml.kernel.org/r/20160315012054.GA17765@codemonkey.org.uk Signed-off-by: Thomas Gleixner ------------------------------- ./arch/x86/include/asm/msr-trace.h:47 suspicious rcu_dereference_check() usage! other info that might help us debug this: RCU used illegally from idle CPU! rcu_scheduler_active = 1, debug_locks = 1 RCU used illegally from extended quiescent state! no locks held by swapper/3/0. stack backtrace: CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.5.0-rc7-think+ #3 ffffffff92f821e0 1f3e5c340597d7fc ffff880468e07f10 ffffffff92560c2a ffff880462145280 0000000000000001 ffff880468e07f40 ffffffff921376a6 ffffffff93665ea0 0000cc7c876d28da 0000000000000005 ffffffff9383dd60 Call Trace: [] dump_stack+0x67/0x9d [] lockdep_rcu_suspicious+0xe6/0x100 [] do_trace_write_msr+0x127/0x1a0 [] native_apic_msr_eoi_write+0x23/0x30 [] smp_trace_call_function_interrupt+0x38/0x360 [] trace_call_function_interrupt+0x90/0xa0 [] ? cpuidle_enter_state+0x1b4/0x520 Move the entering_irq() call before ack_APIC_irq(), because entering_irq() tells the RCU susbstems to end the extended quiescent state, so that the following trace call in ack_APIC_irq() works correctly. Suggested-by: Andi Kleen Fixes: 4787c368a9bc "x86/tracing: Add irq_enter/exit() in smp_trace_reschedule_interrupt()" Signed-off-by: Dave Jones Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org --- arch/x86/include/asm/apic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 0899cfc..98f25bb 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -643,8 +643,8 @@ static inline void entering_irq(void) static inline void entering_ack_irq(void) { - ack_APIC_irq(); entering_irq(); + ack_APIC_irq(); } static inline void ipi_entering_ack_irq(void)