diff options
| author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-01-30 18:37:19 -0500 |
|---|---|---|
| committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-02-23 12:01:11 -0500 |
| commit | 4622b487ecf0094401ac10e504606e5cbdea5a6e (patch) | |
| tree | d3548e9eca81a35029cf889ed4713743f08be4c8 /kernel/rcu | |
| parent | 3c626237eb359cf125051f2fe8b419ddae0f5291 (diff) | |
rcutorture: Abstract torture_shutdown_notify()
Because handling the race between rmmod and system shutdown is not
specific to RCU, this commit abstracts torture_shutdown_notify(),
placing this code into kernel/torture.c. This change also allows
fullstop_mutex to be private to kernel/torture.c.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcu')
| -rw-r--r-- | kernel/rcu/rcutorture.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 68a689fc6ffa..2560e9313887 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c | |||
| @@ -190,23 +190,6 @@ static DECLARE_WAIT_QUEUE_HEAD(barrier_wq); | |||
| 190 | static void rcu_torture_cleanup(void); | 190 | static void rcu_torture_cleanup(void); |
| 191 | 191 | ||
| 192 | /* | 192 | /* |
| 193 | * Detect and respond to a system shutdown. | ||
| 194 | */ | ||
| 195 | static int | ||
| 196 | rcutorture_shutdown_notify(struct notifier_block *unused1, | ||
| 197 | unsigned long unused2, void *unused3) | ||
| 198 | { | ||
| 199 | mutex_lock(&fullstop_mutex); | ||
| 200 | if (fullstop == FULLSTOP_DONTSTOP) | ||
| 201 | fullstop = FULLSTOP_SHUTDOWN; | ||
| 202 | else | ||
| 203 | pr_warn(/* but going down anyway, so... */ | ||
| 204 | "Concurrent 'rmmod rcutorture' and shutdown illegal!\n"); | ||
| 205 | mutex_unlock(&fullstop_mutex); | ||
| 206 | return NOTIFY_DONE; | ||
| 207 | } | ||
| 208 | |||
| 209 | /* | ||
| 210 | * Allocate an element from the rcu_tortures pool. | 193 | * Allocate an element from the rcu_tortures pool. |
| 211 | */ | 194 | */ |
| 212 | static struct rcu_torture * | 195 | static struct rcu_torture * |
| @@ -1098,10 +1081,6 @@ rcu_torture_print_module_parms(struct rcu_torture_ops *cur_ops, const char *tag) | |||
| 1098 | onoff_interval, onoff_holdoff); | 1081 | onoff_interval, onoff_holdoff); |
| 1099 | } | 1082 | } |
| 1100 | 1083 | ||
| 1101 | static struct notifier_block rcutorture_shutdown_nb = { | ||
| 1102 | .notifier_call = rcutorture_shutdown_notify, | ||
| 1103 | }; | ||
| 1104 | |||
| 1105 | static void rcutorture_booster_cleanup(int cpu) | 1084 | static void rcutorture_booster_cleanup(int cpu) |
| 1106 | { | 1085 | { |
| 1107 | struct task_struct *t; | 1086 | struct task_struct *t; |
| @@ -1428,7 +1407,6 @@ rcu_torture_cleanup(void) | |||
| 1428 | cur_ops->cb_barrier(); | 1407 | cur_ops->cb_barrier(); |
| 1429 | return; | 1408 | return; |
| 1430 | } | 1409 | } |
| 1431 | unregister_reboot_notifier(&rcutorture_shutdown_nb); | ||
| 1432 | 1410 | ||
| 1433 | rcu_torture_barrier_cleanup(); | 1411 | rcu_torture_barrier_cleanup(); |
| 1434 | rcu_torture_stall_cleanup(); | 1412 | rcu_torture_stall_cleanup(); |
| @@ -1774,7 +1752,6 @@ rcu_torture_init(void) | |||
| 1774 | firsterr = i; | 1752 | firsterr = i; |
| 1775 | goto unwind; | 1753 | goto unwind; |
| 1776 | } | 1754 | } |
| 1777 | register_reboot_notifier(&rcutorture_shutdown_nb); | ||
| 1778 | i = rcu_torture_stall_init(); | 1755 | i = rcu_torture_stall_init(); |
| 1779 | if (i != 0) { | 1756 | if (i != 0) { |
| 1780 | firsterr = i; | 1757 | firsterr = i; |
