diff options
author | Ingo Molnar <mingo@kernel.org> | 2014-07-28 04:03:00 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-07-28 04:03:00 -0400 |
commit | ca5bc6cd5de5b53eb8fd6fea39aa3fe2a1e8c3d9 (patch) | |
tree | 75beaae2d4b6bc654eb28994dd5906d8dcf5ef46 /kernel/sched | |
parent | c1221321b7c25b53204447cff9949a6d5a7ddddc (diff) | |
parent | d8d28c8f00e84a72e8bee39a85835635417bee49 (diff) |
Merge branch 'sched/urgent' into sched/core, to merge fixes before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/core.c | 12 | ||||
-rw-r--r-- | kernel/sched/debug.c | 2 |
2 files changed, 5 insertions, 9 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 8705125bb9b1..415ab0268b51 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -3573,9 +3573,10 @@ static int _sched_setscheduler(struct task_struct *p, int policy, | |||
3573 | }; | 3573 | }; |
3574 | 3574 | ||
3575 | /* | 3575 | /* |
3576 | * Fixup the legacy SCHED_RESET_ON_FORK hack | 3576 | * Fixup the legacy SCHED_RESET_ON_FORK hack, except if |
3577 | * the policy=-1 was passed by sched_setparam(). | ||
3577 | */ | 3578 | */ |
3578 | if (policy & SCHED_RESET_ON_FORK) { | 3579 | if ((policy != -1) && (policy & SCHED_RESET_ON_FORK)) { |
3579 | attr.sched_flags |= SCHED_FLAG_RESET_ON_FORK; | 3580 | attr.sched_flags |= SCHED_FLAG_RESET_ON_FORK; |
3580 | policy &= ~SCHED_RESET_ON_FORK; | 3581 | policy &= ~SCHED_RESET_ON_FORK; |
3581 | attr.sched_policy = policy; | 3582 | attr.sched_policy = policy; |
@@ -4162,7 +4163,6 @@ static void __cond_resched(void) | |||
4162 | 4163 | ||
4163 | int __sched _cond_resched(void) | 4164 | int __sched _cond_resched(void) |
4164 | { | 4165 | { |
4165 | rcu_cond_resched(); | ||
4166 | if (should_resched()) { | 4166 | if (should_resched()) { |
4167 | __cond_resched(); | 4167 | __cond_resched(); |
4168 | return 1; | 4168 | return 1; |
@@ -4181,18 +4181,15 @@ EXPORT_SYMBOL(_cond_resched); | |||
4181 | */ | 4181 | */ |
4182 | int __cond_resched_lock(spinlock_t *lock) | 4182 | int __cond_resched_lock(spinlock_t *lock) |
4183 | { | 4183 | { |
4184 | bool need_rcu_resched = rcu_should_resched(); | ||
4185 | int resched = should_resched(); | 4184 | int resched = should_resched(); |
4186 | int ret = 0; | 4185 | int ret = 0; |
4187 | 4186 | ||
4188 | lockdep_assert_held(lock); | 4187 | lockdep_assert_held(lock); |
4189 | 4188 | ||
4190 | if (spin_needbreak(lock) || resched || need_rcu_resched) { | 4189 | if (spin_needbreak(lock) || resched) { |
4191 | spin_unlock(lock); | 4190 | spin_unlock(lock); |
4192 | if (resched) | 4191 | if (resched) |
4193 | __cond_resched(); | 4192 | __cond_resched(); |
4194 | else if (unlikely(need_rcu_resched)) | ||
4195 | rcu_resched(); | ||
4196 | else | 4193 | else |
4197 | cpu_relax(); | 4194 | cpu_relax(); |
4198 | ret = 1; | 4195 | ret = 1; |
@@ -4206,7 +4203,6 @@ int __sched __cond_resched_softirq(void) | |||
4206 | { | 4203 | { |
4207 | BUG_ON(!in_softirq()); | 4204 | BUG_ON(!in_softirq()); |
4208 | 4205 | ||
4209 | rcu_cond_resched(); /* BH disabled OK, just recording QSes. */ | ||
4210 | if (should_resched()) { | 4206 | if (should_resched()) { |
4211 | local_bh_enable(); | 4207 | local_bh_enable(); |
4212 | __cond_resched(); | 4208 | __cond_resched(); |
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 695f9773bb60..627b3c34b821 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c | |||
@@ -608,7 +608,7 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) | |||
608 | 608 | ||
609 | avg_atom = p->se.sum_exec_runtime; | 609 | avg_atom = p->se.sum_exec_runtime; |
610 | if (nr_switches) | 610 | if (nr_switches) |
611 | do_div(avg_atom, nr_switches); | 611 | avg_atom = div64_ul(avg_atom, nr_switches); |
612 | else | 612 | else |
613 | avg_atom = -1LL; | 613 | avg_atom = -1LL; |
614 | 614 | ||