aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-05-22 05:36:10 -0400
committerIngo Molnar <mingo@kernel.org>2014-05-22 05:36:10 -0400
commite14505a8d50882ff3bdd4b791b14d90a0881fa4d (patch)
treed2c3e9846b82b02187d33ebafb44fd6934bcd81f /kernel/sched
parent4b660a7f5c8099d88d1a43d8ae138965112592c7 (diff)
parent61f38db3e3c0e4c3be0858750e2cabeadaecac0c (diff)
Merge branch 'rcu/next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/rcu
Pull RCU updates from Paul E. McKenney: " 1. Update RCU documentation. These were posted to LKML at https://lkml.org/lkml/2014/4/28/634. 2. Miscellaneous fixes. These were posted to LKML at https://lkml.org/lkml/2014/4/28/645. 3. Torture-test changes. These were posted to LKML at https://lkml.org/lkml/2014/4/28/667. 4. Variable-name renaming cleanup, sent separately due to conflicts. This was posted to LKML at https://lkml.org/lkml/2014/5/13/854. 5. Patch to suppress RCU stall warnings while sysrq requests are being processed. This patch is the RCU portions of the patch that Rik posted to LKML at https://lkml.org/lkml/2014/4/29/457. The reason for pushing this patch ahead instead of waiting until 3.17 is that the NMI-based stack traces are messing up sysrq output, and in some cases also messing up the system as well." Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index d9d8ece46a15..64f71f183aad 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4051,6 +4051,7 @@ static void __cond_resched(void)
4051 4051
4052int __sched _cond_resched(void) 4052int __sched _cond_resched(void)
4053{ 4053{
4054 rcu_cond_resched();
4054 if (should_resched()) { 4055 if (should_resched()) {
4055 __cond_resched(); 4056 __cond_resched();
4056 return 1; 4057 return 1;
@@ -4069,15 +4070,18 @@ EXPORT_SYMBOL(_cond_resched);
4069 */ 4070 */
4070int __cond_resched_lock(spinlock_t *lock) 4071int __cond_resched_lock(spinlock_t *lock)
4071{ 4072{
4073 bool need_rcu_resched = rcu_should_resched();
4072 int resched = should_resched(); 4074 int resched = should_resched();
4073 int ret = 0; 4075 int ret = 0;
4074 4076
4075 lockdep_assert_held(lock); 4077 lockdep_assert_held(lock);
4076 4078
4077 if (spin_needbreak(lock) || resched) { 4079 if (spin_needbreak(lock) || resched || need_rcu_resched) {
4078 spin_unlock(lock); 4080 spin_unlock(lock);
4079 if (resched) 4081 if (resched)
4080 __cond_resched(); 4082 __cond_resched();
4083 else if (unlikely(need_rcu_resched))
4084 rcu_resched();
4081 else 4085 else
4082 cpu_relax(); 4086 cpu_relax();
4083 ret = 1; 4087 ret = 1;
@@ -4091,6 +4095,7 @@ int __sched __cond_resched_softirq(void)
4091{ 4095{
4092 BUG_ON(!in_softirq()); 4096 BUG_ON(!in_softirq());
4093 4097
4098 rcu_cond_resched(); /* BH disabled OK, just recording QSes. */
4094 if (should_resched()) { 4099 if (should_resched()) {
4095 local_bh_enable(); 4100 local_bh_enable();
4096 __cond_resched(); 4101 __cond_resched();