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.c | |
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.c')
-rw-r--r-- | kernel/rcu/tree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 9e83cd9a32f1..3e002c1cb441 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -1796,7 +1796,7 @@ static int __noreturn rcu_gp_kthread(void *arg) | |||
1796 | if (rcu_gp_init(rsp)) | 1796 | if (rcu_gp_init(rsp)) |
1797 | break; | 1797 | break; |
1798 | cond_resched(); | 1798 | cond_resched(); |
1799 | flush_signals(current); | 1799 | WARN_ON(signal_pending(current)); |
1800 | trace_rcu_grace_period(rsp->name, | 1800 | trace_rcu_grace_period(rsp->name, |
1801 | ACCESS_ONCE(rsp->gpnum), | 1801 | ACCESS_ONCE(rsp->gpnum), |
1802 | TPS("reqwaitsig")); | 1802 | TPS("reqwaitsig")); |
@@ -1842,7 +1842,7 @@ static int __noreturn rcu_gp_kthread(void *arg) | |||
1842 | } else { | 1842 | } else { |
1843 | /* Deal with stray signal. */ | 1843 | /* Deal with stray signal. */ |
1844 | cond_resched(); | 1844 | cond_resched(); |
1845 | flush_signals(current); | 1845 | WARN_ON(signal_pending(current)); |
1846 | trace_rcu_grace_period(rsp->name, | 1846 | trace_rcu_grace_period(rsp->name, |
1847 | ACCESS_ONCE(rsp->gpnum), | 1847 | ACCESS_ONCE(rsp->gpnum), |
1848 | TPS("fqswaitsig")); | 1848 | TPS("fqswaitsig")); |