rcu.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Zhouyi Zhou <zhouzhouyi@gmail.com>
Cc: 340442286@qq.com, josh@joshtriplett.org, rostedt@goodmis.org,
	mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com,
	joel@joelfernandes.org, rcu@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcu: remove surplus instrumentation_end in rcu_nmi_enter
Date: Tue, 12 Jan 2021 09:50:55 -0800	[thread overview]
Message-ID: <20210112175055.GI2743@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <20210111010859.7778-1-zhouzhouyi@gmail.com>

On Mon, Jan 11, 2021 at 09:08:59AM +0800, Zhouyi Zhou wrote:
> In function rcu_nmi_enter, there is a surplus instrumentation_end
> in second branch of if statement, although objtool check -f vmlinux.o will
> not complain because of its inability to correctly cover all cases
> (objtool will visit the third branch first, which markes
>  following trace_rcu_dyntick as visited), I think remove the surplus
> instrumentation_end will make the code better.
> 
> 
> Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>

Good catch, applied, thank you!  As usual, I edited a bit, so please
check below to see if I messed anything up.

I did add Neeraj Upadhyay's Reported-by because he noted this, though you
beat him with a public posting, though mostly because I asked him whether
he could make this happen.  I also added the Fixes, but could you please
do that in the future?  You can use "git blame" or either "git log" and
"gitk" with appropriate options to find the offending commit.

							Thanx, Paul

------------------------------------------------------------------------

commit 3f91ff7fd4f76e7eb48bad79666c466bc3530324
Author: Zhouyi Zhou <zhouzhouyi@gmail.com>
Date:   Mon Jan 11 09:08:59 2021 +0800

    rcu: Remove spurious instrumentation_end() in rcu_nmi_enter()
    
    In rcu_nmi_enter(), there is an erroneous instrumentation_end() in the
    second branch of the "if" statement.  Oddly enough, "objtool check -f
    vmlinux.o" fails to complain because it is unable to correctly cover
    all cases.  Instead, objtool visits the third branch first, which marks
    following trace_rcu_dyntick() as visited.  This commit therefore removes
    the spurious instrumentation_end().
    
    Fixes: 04b25a495bd6 ("rcu: Mark rcu_nmi_enter() call to rcu_cleanup_after_idle() noinstr")
    Reported-by Neeraj Upadhyay <neeraju@codeaurora.org>
    Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 63c6dba..e04e336 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1050,7 +1050,6 @@ noinstr void rcu_nmi_enter(void)
 	} else if (!in_nmi()) {
 		instrumentation_begin();
 		rcu_irq_enter_check_tick();
-		instrumentation_end();
 	} else  {
 		instrumentation_begin();
 	}

  reply	other threads:[~2021-01-12 17:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11  1:08 [PATCH] rcu: remove surplus instrumentation_end in rcu_nmi_enter Zhouyi Zhou
2021-01-12 17:50 ` Paul E. McKenney [this message]
2021-01-13  3:46   ` Zhouyi Zhou

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=20210112175055.GI2743@paulmck-ThinkPad-P72 \
    --to=paulmck@kernel.org \
    --cc=340442286@qq.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=zhouzhouyi@gmail.com \
    /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).