aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-07-21 21:45:02 +0200
committerIngo Molnar <mingo@elte.hu>2010-07-21 21:45:08 +0200
commitdca45ad8af54963c005393a484ad117b8ba6150f (patch)
tree7c9a6966283a6bb12b54e5680a67d203be292930 /kernel/sched.c
parent68c38fc3cb4e5a60f502ee9c45f3dfe70e5165ad (diff)
parentcd5b8f8755a89a57fc8c408d284b8b613f090345 (diff)
downloadkernel_samsung_smdk4412-dca45ad8af54963c005393a484ad117b8ba6150f.zip
kernel_samsung_smdk4412-dca45ad8af54963c005393a484ad117b8ba6150f.tar.gz
kernel_samsung_smdk4412-dca45ad8af54963c005393a484ad117b8ba6150f.tar.bz2
Merge branch 'linus' into sched/core
Merge reason: Move from the -rc3 to the almost-rc6 base. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 7b443ee..16f3f77 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1277,6 +1277,12 @@ static void sched_avg_update(struct rq *rq)
s64 period = sched_avg_period();
while ((s64)(rq->clock - rq->age_stamp) > period) {
+ /*
+ * Inline assembly required to prevent the compiler
+ * optimising this loop into a divmod call.
+ * See __iter_div_u64_rem() for another example of this.
+ */
+ asm("" : "+rm" (rq->age_stamp));
rq->age_stamp += period;
rq->rt_avg /= 2;
}
@@ -1680,9 +1686,6 @@ static void update_shares(struct sched_domain *sd)
static void update_h_load(long cpu)
{
- if (root_task_group_empty())
- return;
-
walk_tg_tree(tg_load_down, tg_nop, (void *)cpu);
}
@@ -2564,7 +2567,16 @@ void sched_fork(struct task_struct *p, int clone_flags)
if (p->sched_class->task_fork)
p->sched_class->task_fork(p);
+ /*
+ * The child is not yet in the pid-hash so no cgroup attach races,
+ * and the cgroup is pinned to this child due to cgroup_fork()
+ * is ran before sched_fork().
+ *
+ * Silence PROVE_RCU.
+ */
+ rcu_read_lock();
set_task_cpu(p, cpu);
+ rcu_read_unlock();
#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
if (likely(sched_info_on()))
@@ -2934,9 +2946,9 @@ unsigned long nr_iowait(void)
return sum;
}
-unsigned long nr_iowait_cpu(void)
+unsigned long nr_iowait_cpu(int cpu)
{
- struct rq *this = this_rq();
+ struct rq *this = cpu_rq(cpu);
return atomic_read(&this->nr_iowait);
}