]> git.karo-electronics.de Git - karo-tx-linux.git/commit
rcu: Make exit_rcu() more precise and consolidate
authorPaul E. McKenney <paul.mckenney@linaro.org>
Fri, 13 Apr 2012 19:54:22 +0000 (12:54 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 25 Apr 2012 03:55:30 +0000 (20:55 -0700)
commit90aec3b06194393c909e3e5a47b6ed99bb8caba5
tree0abb244619d9402fdcebbbcba984141ff4289b66
parent0938bda338fd8dfbedde7f340be340ae3f1e18a7
rcu: Make exit_rcu() more precise and consolidate

When running preemptible RCU, if a task exits in an RCU read-side
critical section having blocked within that same RCU read-side critical
section, the task must be removed from the list of tasks blocking a
grace period (perhaps the current grace period, perhaps the next grace
period, depending on timing).  The exit() path invokes exit_rcu() to
do this cleanup.

However, the current implementation of exit_rcu() needlessly does the
cleanup even if the task did not block within the current RCU read-side
critical section, which wastes time and needlessly increases the size
of the state space.  Fix this by only doing the cleanup if the current
task is actually on the list of tasks blocking some grace period.

While we are at it, consolidate the two identical exit_rcu() functions
into a single function.

Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/rcupdate.h
include/linux/rcutiny.h
include/linux/rcutree.h
kernel/rcupdate.c
kernel/rcutiny_plugin.h
kernel/rcutree_plugin.h