Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2991775imm; Tue, 4 Sep 2018 13:27:34 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda47rvcJs7PazRWN+ShsVXpFh5ZM961JRB3BkwSSzfyKXYEQX1nh3aVTHbphA/ZltsU+F6i X-Received: by 2002:a63:4e25:: with SMTP id c37-v6mr32586535pgb.6.1536092854798; Tue, 04 Sep 2018 13:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536092854; cv=none; d=google.com; s=arc-20160816; b=v76xI8Lcvo7UgyymFLqmReIyzV7bxCJsWv4+eXNwQR5YmF3bLx9pRcuch5Caacb93e 8+G2lCETNdV7QadIWveIWwoPa1d1qXAug7yevm3MFEXTzox4DKKShAUTdyB18Qzq3PDp +fF0gSz23+kixIdHu+NnvOT5usiA3Pv6yF3v91l+dhWcXDvHPE7TAvXvjq1kGVkiD7Yo wG6+S1wawAVS8PoGCLrj5pNMr1ZQ9mZCQFHnalK/VKxeKKeBLAxTZbrq0G+QuLhhWyRG RQUytaaBloxpNfp7yF/8RrIhPI+AuyISRNCgrzyp0+a8xRslAq0aEZNVBUSBb50CCLRo TLxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=gnmWp8XBxEK2Rg7Us5GT/ndstJNBK8xjf7s/RP3cLJA=; b=khSJ54AsklUQIS9dJHqtl5hIb5VEAbZE1Wib//qio77H8grK8R/Igv0d47SHMFwBjM yogs0pdz/wZGuEJz3MjESs3EaS5S2JQtSPfgUyEg7QJjdXg+dRtquMJ0LXmgWRf5DVBt 5lARVeHGMnO+/ckBeKBfMmhewGeU1s4KkPUeJ6gIj2M+8CmUgds2MgCEFMP3yQdEcwcV lwDWegrq5QViQ0alfBajO9kAub+oZqRBsnrt2uSXP4KAuionek7VQePKnl7mLxi8PYc3 vTgKDr1zAHigoFzoD8MpTDZI6i93KDi4CpPTPGD3RKNugabTK1k1RxPa2WqqLvO4HiyL DnkA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7-v6si22237963pgm.677.2018.09.04.13.27.19; Tue, 04 Sep 2018 13:27:34 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726426AbeIEAw6 (ORCPT + 99 others); Tue, 4 Sep 2018 20:52:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:44420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbeIEAw6 (ORCPT ); Tue, 4 Sep 2018 20:52:58 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E8A4E20658; Tue, 4 Sep 2018 20:26:12 +0000 (UTC) Date: Tue, 4 Sep 2018 16:26:11 -0400 From: Steven Rostedt To: "Paul E. McKenney" Cc: Borislav Petkov , x86-ml , Peter Zijlstra , lkml , joel@joelfernandes.org Subject: Re: 4.19-rc1: ./include/linux/rcupdate.h:631 rcu_read_lock() used illegally while idle! Message-ID: <20180904162611.6a120068@gandalf.local.home> In-Reply-To: <20180902041639.GQ4225@linux.vnet.ibm.com> References: <20180901173559.GC26871@zn.tnic> <20180901175442.GO4225@linux.vnet.ibm.com> <20180901184531.72ffb792@vmware.local.home> <20180902041639.GQ4225@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 1 Sep 2018 21:16:39 -0700 "Paul E. McKenney" wrote: > On Sat, Sep 01, 2018 at 06:45:31PM -0400, Steven Rostedt wrote: > > On Sat, 1 Sep 2018 10:54:42 -0700 > > "Paul E. McKenney" wrote: > > > > > On Sat, Sep 01, 2018 at 07:35:59PM +0200, Borislav Petkov wrote: > > > > This is a huge splat! It haz some perf* and sched* in it, I guess for > > > > peterz to stare at. And lemme add Paul for good measure too :) > > > > > > > > Kernel is -rc1 + 3 microcode loader patches ontop which should not be > > > > related. > > > > > > It really is tracing from the idle loop. But I thought that the event > > > tracing took care of that. Adding Steve and Joel for their thoughts. > > > > > > Thanx, Paul > > > > > > > Thx. > > > > > > > > --- > > > > [ 62.409125] ============================= > > > > [ 62.409129] WARNING: suspicious RCU usage > > > > [ 62.409133] 4.19.0-rc1+ #1 Not tainted > > > > [ 62.409136] ----------------------------- > > > > [ 62.409140] ./include/linux/rcupdate.h:631 rcu_read_lock() used illegally while idle! > > > > [ 62.409143] > > > > other info that might help us debug this: > > > > > > > > [ 62.409147] > > > > RCU used illegally from idle CPU! > > > > rcu_scheduler_active = 2, debug_locks = 1 > > > > [ 62.409151] RCU used illegally from extended quiescent state! > > > > [ 62.409155] 1 lock held by swapper/0/0: > > > > [ 62.409158] #0: 000000004557ee0e (rcu_read_lock){....}, at: perf_event_output_forward+0x0/0x130 > > > > [ 62.409175] > > > > stack backtrace: > > > > [ 62.409180] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.0-rc1+ #1 > > > > [ 62.409183] Hardware name: LENOVO 2320CTO/2320CTO, BIOS G2ET86WW (2.06 ) 11/13/2012 > > > > [ 62.409187] Call Trace: > > > > [ 62.409196] dump_stack+0x85/0xcb > > > > [ 62.409203] perf_event_output_forward+0xf6/0x130 > > > > I think this is because we switched the trace point code to be > > protected by srcu instead of rcu_lock_sched() and a song and dance to > > "make RCU watch again" if it is not, but perf is using normal > > rcu_read_lock() internally even though it is hooked into the > > tracepoint code. Should perf switch to SRCU, or perhaps it can do the > > song and dance to make RCU watch again? > > Well, this is a regression, so in theory we could push my three SRCU > patches into the current merge window, which would allow perf going > to SRCU, thus fixing the above splat. I am OK either way. What would > you prefer? > > I wonder if this partial revert will fix things? -- Steve diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 7f2e16e76ac4..041f7e56a289 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -158,8 +158,10 @@ extern void syscall_unregfunc(void); * For rcuidle callers, use srcu since sched-rcu \ * doesn't work from the idle path. \ */ \ - if (rcuidle) \ + if (rcuidle) { \ idx = srcu_read_lock_notrace(&tracepoint_srcu); \ + rcu_irq_enter_irqson(); \ + } \ \ it_func_ptr = rcu_dereference_raw((tp)->funcs); \ \ @@ -171,8 +173,10 @@ extern void syscall_unregfunc(void); } while ((++it_func_ptr)->func); \ } \ \ - if (rcuidle) \ + if (rcuidle) { \ + rcu_irq_exit_irqson(); \ srcu_read_unlock_notrace(&tracepoint_srcu, idx);\ + } \ \ preempt_enable_notrace(); \ } while (0)