diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 5998222f901c..d42992bccdfa 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -3714,7 +3714,7 @@ void scheduler_tick(void) | |||
3714 | curr->sched_class->task_tick(rq, curr, 0); | 3714 | curr->sched_class->task_tick(rq, curr, 0); |
3715 | raw_spin_unlock(&rq->lock); | 3715 | raw_spin_unlock(&rq->lock); |
3716 | 3716 | ||
3717 | perf_event_task_tick(curr); | 3717 | perf_event_task_tick(); |
3718 | 3718 | ||
3719 | #ifdef CONFIG_SMP | 3719 | #ifdef CONFIG_SMP |
3720 | rq->idle_at_tick = idle_cpu(cpu); | 3720 | rq->idle_at_tick = idle_cpu(cpu); |
@@ -4772,7 +4772,7 @@ recheck: | |||
4772 | } | 4772 | } |
4773 | 4773 | ||
4774 | if (user) { | 4774 | if (user) { |
4775 | retval = security_task_setscheduler(p, policy, param); | 4775 | retval = security_task_setscheduler(p); |
4776 | if (retval) | 4776 | if (retval) |
4777 | return retval; | 4777 | return retval; |
4778 | } | 4778 | } |
@@ -5023,7 +5023,7 @@ long sched_setaffinity(pid_t pid, const struct cpumask *in_mask) | |||
5023 | if (!check_same_owner(p) && !capable(CAP_SYS_NICE)) | 5023 | if (!check_same_owner(p) && !capable(CAP_SYS_NICE)) |
5024 | goto out_unlock; | 5024 | goto out_unlock; |
5025 | 5025 | ||
5026 | retval = security_task_setscheduler(p, 0, NULL); | 5026 | retval = security_task_setscheduler(p); |
5027 | if (retval) | 5027 | if (retval) |
5028 | goto out_unlock; | 5028 | goto out_unlock; |
5029 | 5029 | ||
@@ -5473,7 +5473,19 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu) | |||
5473 | idle->se.exec_start = sched_clock(); | 5473 | idle->se.exec_start = sched_clock(); |
5474 | 5474 | ||
5475 | cpumask_copy(&idle->cpus_allowed, cpumask_of(cpu)); | 5475 | cpumask_copy(&idle->cpus_allowed, cpumask_of(cpu)); |
5476 | /* | ||
5477 | * We're having a chicken and egg problem, even though we are | ||
5478 | * holding rq->lock, the cpu isn't yet set to this cpu so the | ||
5479 | * lockdep check in task_group() will fail. | ||
5480 | * | ||
5481 | * Similar case to sched_fork(). / Alternatively we could | ||
5482 | * use task_rq_lock() here and obtain the other rq->lock. | ||
5483 | * | ||
5484 | * Silence PROVE_RCU | ||
5485 | */ | ||
5486 | rcu_read_lock(); | ||
5476 | __set_task_cpu(idle, cpu); | 5487 | __set_task_cpu(idle, cpu); |
5488 | rcu_read_unlock(); | ||
5477 | 5489 | ||
5478 | rq->curr = rq->idle = idle; | 5490 | rq->curr = rq->idle = idle; |
5479 | #if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW) | 5491 | #if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW) |