diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-08-14 13:28:23 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-09-07 19:18:20 -0400 |
commit | 73a860cd58a1eb258e889b615cebf738ab33aa23 (patch) | |
tree | 9eacb2ac5f6331f3249778c685da7f26c8ed0488 /kernel/rcu/tree_plugin.h | |
parent | 2aa792e6faf1a00f5accf1f69e87e11a390ba2cd (diff) |
rcu: Replace flush_signals() with WARN_ON(signal_pending())
Currently, when RCU awakens from a wait_event_interruptible() that
might have awakened prematurely, it does a flush_signals(). This is
done on the off-chance that someone figured out how to deliver a signal
to a kthread, which is supposed to be impossible. Given that this
is supposed to be impossible, this commit changes the flush_signals()
calls into WARN_ON(signal_pending()).
Reported-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tree_plugin.h')
-rw-r--r-- | kernel/rcu/tree_plugin.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index d67cc5c375c5..bbb0a0cd091b 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h | |||
@@ -2237,7 +2237,7 @@ static void rcu_nocb_wait_gp(struct rcu_data *rdp) | |||
2237 | (d = ULONG_CMP_GE(ACCESS_ONCE(rnp->completed), c))); | 2237 | (d = ULONG_CMP_GE(ACCESS_ONCE(rnp->completed), c))); |
2238 | if (likely(d)) | 2238 | if (likely(d)) |
2239 | break; | 2239 | break; |
2240 | flush_signals(current); | 2240 | WARN_ON(signal_pending(current)); |
2241 | trace_rcu_future_gp(rnp, rdp, c, TPS("ResumeWait")); | 2241 | trace_rcu_future_gp(rnp, rdp, c, TPS("ResumeWait")); |
2242 | } | 2242 | } |
2243 | trace_rcu_future_gp(rnp, rdp, c, TPS("EndWait")); | 2243 | trace_rcu_future_gp(rnp, rdp, c, TPS("EndWait")); |
@@ -2296,7 +2296,7 @@ wait_again: | |||
2296 | if (!rcu_nocb_poll) | 2296 | if (!rcu_nocb_poll) |
2297 | trace_rcu_nocb_wake(my_rdp->rsp->name, my_rdp->cpu, | 2297 | trace_rcu_nocb_wake(my_rdp->rsp->name, my_rdp->cpu, |
2298 | "WokeEmpty"); | 2298 | "WokeEmpty"); |
2299 | flush_signals(current); | 2299 | WARN_ON(signal_pending(current)); |
2300 | schedule_timeout_interruptible(1); | 2300 | schedule_timeout_interruptible(1); |
2301 | 2301 | ||
2302 | /* Rescan in case we were a victim of memory ordering. */ | 2302 | /* Rescan in case we were a victim of memory ordering. */ |
@@ -2375,7 +2375,7 @@ static void nocb_follower_wait(struct rcu_data *rdp) | |||
2375 | if (!rcu_nocb_poll) | 2375 | if (!rcu_nocb_poll) |
2376 | trace_rcu_nocb_wake(rdp->rsp->name, rdp->cpu, | 2376 | trace_rcu_nocb_wake(rdp->rsp->name, rdp->cpu, |
2377 | "WokeEmpty"); | 2377 | "WokeEmpty"); |
2378 | flush_signals(current); | 2378 | WARN_ON(signal_pending(current)); |
2379 | schedule_timeout_interruptible(1); | 2379 | schedule_timeout_interruptible(1); |
2380 | } | 2380 | } |
2381 | } | 2381 | } |