Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp131398imm; Thu, 2 Aug 2018 15:27:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpctujhbD5QVVNJjZ3AXtGTxg24/62LlLtT0FmNfrIKaVfDIHrE8qHxmrYLJFCPfqEmnO8nd X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr1093551plb.274.1533248866978; Thu, 02 Aug 2018 15:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533248866; cv=none; d=google.com; s=arc-20160816; b=E+ZLHQnL2oKGjhcJEZqJC0Y19iSv4ijnzi/9FxrgKtF+5pMXqWE6OybDkAx5V9rEKi 0jWjhfA10a5+tdwJjLFGvorSAoZxbI4KiQyeCb1uxMxLHYOhtO3vpjMSaf19E67iYDcq ZymLWkde2xGYXZNg6UdnVtU9jwqhxtfB06FJyFTqh3YieDqFpGxpBogybe8VTYn0dqZS BWs+u8ZKknJTv/fQvEWEY5EzQqDOkOyvOMyDNzhYlfLJ2gw75OEhzi3WPfOrynW1nFl1 /mYmJiLk5XkaMK6UvG3kYXAO4/NG/3X8mkxpcdGCrZxmbMROdZZn1g3zNazuSOjiLyde e/bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=jdz84GmGmBIMyW35AmOaW9JcfRAtQ++aD/YEn/8Sa4g=; b=PRVzSXr+WAj9gJvNlp54zIkds4gpXYVnXArHe6k54nMvPY6kBN9OC6o1M77RkwgchS x/NdvZR09W4AHinPmHVS57zn518fpGyEi7ndM996T+RJpupRG0Mf2JEJqMIiBDM2ma8D I8J9KOv/mF1vFhgDgyaey1lZ1iDjouS3HdONnxCM8fEyp/1WkUiKynbLNg5ekTYmC/bs L4aaiq9+2EIx5LCl/3sGmsk5VEy7VNlDw8V60hdGzEyHCP+B26EKkeGbEbuYz1ASUaDt EHmHayg+H362u4tkuxozHYGFW5uabcHp8EUOJfi+jcaoONvCA6yQgBsjc2KEk5/6fNon 09mQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3-v6si2186257plr.214.2018.08.02.15.27.32; Thu, 02 Aug 2018 15:27:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732129AbeHCATk (ORCPT + 99 others); Thu, 2 Aug 2018 20:19:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:34854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726702AbeHCATj (ORCPT ); Thu, 2 Aug 2018 20:19:39 -0400 Received: from localhost.localdomain (c-98-220-238-81.hsd1.il.comcast.net [98.220.238.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E273A215E5; Thu, 2 Aug 2018 22:26:27 +0000 (UTC) From: Tom Zanussi To: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org Cc: rostedt@goodmis.org, tglx@linutronix.de, C.Emde@osadl.org, jkacur@redhat.com, bigeasy@linutronix.de, daniel.wagner@siemens.com, julia@ni.com, Philipp Schrader , stable-rt@vger.kernel.org, Tom Zanussi Subject: [PATCH 04/15] tracing: Fix rcu splat from idle CPU on boot Date: Thu, 2 Aug 2018 17:25:19 -0500 Message-Id: <22a1b5d78156e46ecd575079f9b7f29b117c26e7.1533242791.git.tom.zanussi@linux.intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Philipp Schrader With PREEMPT_RT and most of the lockdep-related options enabled I encountered this splat when booting our DRA7 evaluation module: [ 0.055073] [ 0.055076] =============================== [ 0.055079] [ INFO: suspicious RCU usage. ] [ 0.055084] 4.1.6+ #2 Not tainted [ 0.055086] ------------------------------- [ 0.055090] include/trace/events/hist.h:31 suspicious rcu_dereference_check() usage! [ 0.055093] [ 0.055093] other info that might help us debug this: [ 0.055093] [ 0.055097] [ 0.055097] RCU used illegally from idle CPU! [ 0.055097] rcu_scheduler_active = 1, debug_locks = 1 [ 0.055100] RCU used illegally from extended quiescent state! [ 0.055104] no locks held by swapper/0/0. [ 0.055106] [ 0.055106] stack backtrace: [ 0.055112] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.1.6+ #2 [ 0.055116] Hardware name: Generic DRA74X (Flattened Device Tree) [ 0.055130] [] (unwind_backtrace) from [] (show_stack+0x20/0x24) [ 0.055146] [] (show_stack) from [] (dump_stack+0x84/0xa0) [ 0.055160] [] (dump_stack) from [] (lockdep_rcu_suspicious+0xb0/0x110) [ 0.055172] [] (lockdep_rcu_suspicious) from [] (time_hardirqs_off+0x2b8/0x3c8) [ 0.055184] [] (time_hardirqs_off) from [] (trace_hardirqs_off_caller+0x2c/0xf4) [ 0.055194] [] (trace_hardirqs_off_caller) from [] (trace_hardirqs_off+0x14/0x18) [ 0.055204] [] (trace_hardirqs_off) from [] (rcu_idle_enter+0x78/0xcc) [ 0.055213] [] (rcu_idle_enter) from [] (cpu_startup_entry+0x190/0x518) [ 0.055222] [] (cpu_startup_entry) from [] (rest_init+0x13c/0x17c) [ 0.055231] [] (rest_init) from [] (start_kernel+0x320/0x380) [ 0.055238] [] (start_kernel) from [<8000807c>] (0x8000807c) As per Steve Rotstedt's suggestion I changed the trace_* calls to trace_*_rcuidle calls. He pointed out that the trace points were getting triggered when rcu wasn't watching. Signed-off-by: Thomas Gleixner Cc: Steven Rostedt Cc: stable-rt@vger.kernel.org (cherry picked from commit ac56e4167d84ada099f2af0d1d53f4742d577ce9) Signed-off-by: Tom Zanussi --- kernel/trace/trace_irqsoff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c index d1940b095d85..9cbc38722905 100644 --- a/kernel/trace/trace_irqsoff.c +++ b/kernel/trace/trace_irqsoff.c @@ -452,7 +452,7 @@ EXPORT_SYMBOL_GPL(stop_critical_timings); #ifdef CONFIG_PROVE_LOCKING void time_hardirqs_on(unsigned long a0, unsigned long a1) { - trace_preemptirqsoff_hist(IRQS_ON, 0); + trace_preemptirqsoff_hist_rcuidle(IRQS_ON, 0); if (!preempt_trace() && irq_trace()) stop_critical_timing(a0, a1); } @@ -461,7 +461,7 @@ void time_hardirqs_off(unsigned long a0, unsigned long a1) { if (!preempt_trace() && irq_trace()) start_critical_timing(a0, a1); - trace_preemptirqsoff_hist(IRQS_OFF, 1); + trace_preemptirqsoff_hist_rcuidle(IRQS_OFF, 1); } #else /* !CONFIG_PROVE_LOCKING */ -- 2.14.1