]> git.baikalelectronics.ru Git - kernel.git/commit
rcu: Remove extraneous READ_ONCE()s from rcu_irq_{enter,exit}()
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 26 Sep 2017 03:19:02 +0000 (20:19 -0700)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 3 Oct 2017 14:27:32 +0000 (10:27 -0400)
commit968899d066dda98894a0f28144ab5b40ca12dd17
tree6d6a68a41259843d4d6563a3a97f22219d6d72c4
parent1350132f05a60a4d5f9f45c2301e68e0adf00aed
rcu: Remove extraneous READ_ONCE()s from rcu_irq_{enter,exit}()

The read of ->dynticks_nmi_nesting in rcu_irq_enter() and rcu_irq_exit()
is currently protected with READ_ONCE().  However, this protection is
unnecessary because (1) ->dynticks_nmi_nesting is updated only by the
current CPU, (2) Although NMI handlers can update this field, they reset
it back to its old value before return, and (3) Interrupts are disabled,
so nothing else can modify it.  The value of ->dynticks_nmi_nesting is
thus effectively constant, and so no protection is required.

This commit therefore removes the READ_ONCE() protection from these
two accesses.

Link: http://lkml.kernel.org/r/20170926031902.GA2074@linux.vnet.ibm.com
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/rcu/tree.c