]> git.baikalelectronics.ru Git - kernel.git/commit
rcu: Simplify RCU_STATE_INITIALIZER() macro
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Fri, 12 Jul 2013 21:00:28 +0000 (17:00 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 29 Jul 2013 21:08:03 +0000 (17:08 -0400)
commit9555e9910b2242280efb377b3bbaf62582d7692b
tree817205e6e4f3e5119c2f5786cb1ff2659053aadb
parent8d466f71e85784af5393ec5c755a01b7052ffa8e
rcu: Simplify RCU_STATE_INITIALIZER() macro

The RCU_STATE_INITIALIZER() macro is used only in the rcutree.c file
as well as the rcutree_plugin.h file. It is passed as a rvalue to
a variable of a similar name. A per_cpu variable is also created
with a similar name as well.

The uses of RCU_STATE_INITIALIZER() can be simplified to remove some
of the duplicate code that is done. Currently the three users of this
macro has this format:

struct rcu_state rcu_sched_state =
RCU_STATE_INITIALIZER(rcu_sched, call_rcu_sched);
DEFINE_PER_CPU(struct rcu_data, rcu_sched_data);

Notice that "rcu_sched" is called three times. This is the same with
the other two users. This can be condensed to just:

RCU_STATE_INITIALIZER(rcu_sched, call_rcu_sched);

by moving the rest into the macro itself.

This also opens the door to allow the RCU tracepoint strings and
their addresses to be exported so that userspace tracing tools can
translate the contents of the pointers of the RCU tracepoints.
The change will allow for helper code to be placed in the
RCU_STATE_INITIALIZER() macro to export the name that is used.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/rcutree.c
kernel/rcutree_plugin.h