rcu: remove surplus instrumentation_end in rcu_nmi_enter
PATCH 1/1 rcu: remove surplus instrumentation_end in rcu_nmi_enter
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 surplusinstrumentation_end will make the code better.
--- kernel/rcu/tree.c | 1 - 1 file changed, 1 deletion(-)
kernel/rcu/tree.c +0 -1
@@ -1021,7 +1021,6 @@ noinstr void rcu_nmi_enter(void) }else if (!in_nmi ()) {instrumentation_begin ();rcu_irq_enter_check_tick (); -instrumentation_end (); }else {instrumentation_begin (); }
Signature · 1 line
2.25.1
Paul E. McKenney
maintainerQuoted 9 lines · Zhouyi Zhou
In function
rcu_nmi_enter, there is a surplusinstrumentation_endin 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
followingtrace_rcu_dyntickas visited), I think remove the surplusinstrumentation_endwill make the code better.Signed-off-by Zhouyi Zhou <[email protected]>
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 <[email protected]> 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().
Reported-by Neeraj Upadhyay <[email protected]>
kernel/rcu/tree.c +0 -1
@@ -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 (); }
Thank Paul for your encouragement and valuable advice
I achieve great self improvement in studying and participating Linux RCU
Also thank Neeraj for mutual interest in Linux RCU, your contribution makes me believe
that even a small enhancement of code can still attract interest and draw favorable attention
from peers.
Cheers
Zhouyi
Quoted 43 lines · Paul E. McKenney
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
3f91ff7fd4f76e7eb48bad79666c466bc3530324Author: Zhouyi Zhou <[email protected]> Date: Mon Jan 11 09:08:59 2021 +0800rcu: Remove spurious
instrumentation_end()inrcu_nmi_enter()In
rcu_nmi_enter(), there is an erroneousinstrumentation_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 followingtrace_rcu_dyntick()as visited. This commit therefore removes the spuriousinstrumentation_end().Fixes 04b25a495bd6 ("rcu: Mark rcu_nmi_enter() call to rcu_cleanup_after_idle() noinstr")Reported-by Neeraj Upadhyay <[email protected]>
Signed-off-by Zhouyi Zhou <[email protected]>Signed-off-by Paul E. McKenney <[email protected]>kernel/rcu/tree.c +0
-1@@ -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 (); }