linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Andi Kleen <andi@firstfloor.org>,
	Jan Stancek <jstancek@redhat.com>
Subject: Re: [BUG] msr-trace.h:42 suspicious rcu_dereference_check() usage!
Date: Thu, 23 Feb 2017 13:24:34 +0100	[thread overview]
Message-ID: <20170223122434.GA20127@krava> (raw)
In-Reply-To: <20161121092850.GF3102@twins.programming.kicks-ass.net>

On Mon, Nov 21, 2016 at 10:28:50AM +0100, Peter Zijlstra wrote:
> On Mon, Nov 21, 2016 at 01:53:43AM +0100, Jiri Olsa wrote:
> > hi,
> > Jan hit following output when msr tracepoints are enabled on amd server:
> > 
> > [   91.585653] ===============================
> > [   91.589840] [ INFO: suspicious RCU usage. ]
> > [   91.594025] 4.9.0-rc1+ #1 Not tainted
> > [   91.597691] -------------------------------
> > [   91.601877] ./arch/x86/include/asm/msr-trace.h:42 suspicious rcu_dereference_check() usage!
> > [   91.610222] 
> > [   91.610222] other info that might help us debug this:
> > [   91.610222] 
> > [   91.618224] 
> > [   91.618224] RCU used illegally from idle CPU!
> > [   91.618224] rcu_scheduler_active = 1, debug_locks = 0
> > [   91.629081] RCU used illegally from extended quiescent state!
> > [   91.634820] no locks held by swapper/1/0.
> > [   91.638832] 
> > [   91.638832] stack backtrace:
> > [   91.643192] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.9.0-rc1+ #1
> > [   91.649457] Hardware name: empty empty/S3992, BIOS 'V2.03   ' 05/09/2008
> > [   91.656159]  ffffc900018fbdf8 ffffffff813ed43c ffff88017ede8000 0000000000000001
> > [   91.663637]  ffffc900018fbe28 ffffffff810fdcd7 ffff880233f95dd0 00000000c0010055
> > [   91.671107]  0000000000000000 0000000000000000 ffffc900018fbe58 ffffffff814297ac
> > [   91.678560] Call Trace:
> > [   91.681022]  [<ffffffff813ed43c>] dump_stack+0x85/0xc9
> > [   91.686164]  [<ffffffff810fdcd7>] lockdep_rcu_suspicious+0xe7/0x120
> > [   91.692429]  [<ffffffff814297ac>] do_trace_read_msr+0x14c/0x1b0
> > [   91.698349]  [<ffffffff8106ddb2>] native_read_msr+0x32/0x40
> > [   91.703921]  [<ffffffff8103b2be>] amd_e400_idle+0x7e/0x110
> > [   91.709407]  [<ffffffff8103b78f>] arch_cpu_idle+0xf/0x20
> > [   91.714720]  [<ffffffff8181cd33>] default_idle_call+0x23/0x40
> > [   91.720467]  [<ffffffff810f306a>] cpu_startup_entry+0x1da/0x2b0
> > [   91.726387]  [<ffffffff81058b1f>] start_secondary+0x17f/0x1f0
> > 
> > 
> > it got away with attached change.. but this rcu logic
> > is far beyond me, so it's just wild guess.. ;-)
> 
> I think I prefer something like the below, that only annotates the one
> RDMSR in question, instead of all of them.
> 
> 
> diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
> index 0888a879120f..d6c6aa80675f 100644
> --- a/arch/x86/kernel/process.c
> +++ b/arch/x86/kernel/process.c
> @@ -357,7 +357,7 @@ static void amd_e400_idle(void)
>  	if (!amd_e400_c1e_detected) {
>  		u32 lo, hi;
>  
> -		rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi);
> +		RCU_NONIDLE(rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi));
>  
>  		if (lo & K8_INTP_C1E_ACTIVE_MASK) {
>  			amd_e400_c1e_detected = true;

hum, I might have missed some other solution in discussion,
and can't see this one being pulled in.. should I resend this?

thanks,
jirka

  parent reply	other threads:[~2017-02-23 12:24 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21  0:53 [BUG] msr-trace.h:42 suspicious rcu_dereference_check() usage! Jiri Olsa
2016-11-21  9:02 ` Paul E. McKenney
2016-11-21  9:43   ` Peter Zijlstra
2016-11-21 11:00     ` Paul E. McKenney
2016-11-21  9:28 ` Peter Zijlstra
2016-11-21  9:34   ` Jiri Olsa
2016-11-21  9:42     ` Peter Zijlstra
2016-11-21 11:22       ` Jiri Olsa
2016-11-21 11:31         ` Peter Zijlstra
2016-11-21 12:49           ` Jiri Olsa
2016-11-21 12:58     ` Peter Zijlstra
2016-11-21 14:15       ` Steven Rostedt
2016-11-21 14:37         ` Peter Zijlstra
2016-11-21 15:35           ` Borislav Petkov
2016-11-21 15:41             ` Peter Zijlstra
2016-11-21 16:06               ` Borislav Petkov
2016-11-29 13:16                 ` Borislav Petkov
2016-11-29 13:59                   ` Thomas Gleixner
2016-11-30  8:48                     ` Borislav Petkov
2016-11-30  8:54                       ` Thomas Gleixner
2016-11-30  9:07                         ` Borislav Petkov
2016-11-30  9:14                           ` Thomas Gleixner
2016-11-29 14:04                   ` Jiri Olsa
2016-11-21 14:20       ` Steven Rostedt
2016-11-21 17:06   ` Andi Kleen
2016-11-21 17:18     ` Peter Zijlstra
2016-11-21 17:45       ` Andi Kleen
2016-11-21 18:01         ` Steven Rostedt
2016-11-21 18:06           ` Andi Kleen
2016-11-21 18:22             ` Steven Rostedt
2016-11-21 18:37               ` Andi Kleen
2016-11-21 19:06                 ` Steven Rostedt
2016-11-21 19:15                 ` Steven Rostedt
2016-11-21 20:44                   ` Andi Kleen
2016-11-22  8:19                     ` Paul E. McKenney
2016-11-22 14:39                 ` Steven Rostedt
2016-11-22 19:05                   ` Andi Kleen
2016-11-24  2:06                 ` Steven Rostedt
2016-11-28 21:48                   ` Andi Kleen
2016-11-28 22:46                     ` Steven Rostedt
2016-11-28 23:10                       ` Andi Kleen
2016-11-21 17:55       ` Steven Rostedt
2016-11-21 18:24         ` Steven Rostedt
2016-11-21 20:12           ` Paul E. McKenney
2017-02-23 12:24   ` Jiri Olsa [this message]
2017-02-23 17:11     ` Andi Kleen
2017-02-23 17:28     ` Peter Zijlstra
2017-02-23 17:56       ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170223122434.GA20127@krava \
    --to=jolsa@redhat.com \
    --cc=andi@firstfloor.org \
    --cc=josh@joshtriplett.org \
    --cc=jstancek@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).