Commit bffb276f authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'sched-fixes-for-linus' of...

Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched: Use rq->clock_task instead of rq->clock for correctly maintaining load averages
  sched: Fix/remove redundant cfs_rq checks
  sched: Fix sign under-flows in wake_affine
parents f7b548fa 05ca62c6
...@@ -722,10 +722,10 @@ static void update_cfs_load(struct cfs_rq *cfs_rq, int global_update) ...@@ -722,10 +722,10 @@ static void update_cfs_load(struct cfs_rq *cfs_rq, int global_update)
u64 now, delta; u64 now, delta;
unsigned long load = cfs_rq->load.weight; unsigned long load = cfs_rq->load.weight;
if (!cfs_rq) if (cfs_rq->tg == &root_task_group)
return; return;
now = rq_of(cfs_rq)->clock; now = rq_of(cfs_rq)->clock_task;
delta = now - cfs_rq->load_stamp; delta = now - cfs_rq->load_stamp;
/* truncate load history at 4 idle periods */ /* truncate load history at 4 idle periods */
...@@ -830,9 +830,6 @@ static void update_cfs_shares(struct cfs_rq *cfs_rq, long weight_delta) ...@@ -830,9 +830,6 @@ static void update_cfs_shares(struct cfs_rq *cfs_rq, long weight_delta)
struct sched_entity *se; struct sched_entity *se;
long shares; long shares;
if (!cfs_rq)
return;
tg = cfs_rq->tg; tg = cfs_rq->tg;
se = tg->se[cpu_of(rq_of(cfs_rq))]; se = tg->se[cpu_of(rq_of(cfs_rq))];
if (!se) if (!se)
...@@ -1432,7 +1429,7 @@ static inline unsigned long effective_load(struct task_group *tg, int cpu, ...@@ -1432,7 +1429,7 @@ static inline unsigned long effective_load(struct task_group *tg, int cpu,
static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync) static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync)
{ {
unsigned long this_load, load; s64 this_load, load;
int idx, this_cpu, prev_cpu; int idx, this_cpu, prev_cpu;
unsigned long tl_per_task; unsigned long tl_per_task;
struct task_group *tg; struct task_group *tg;
...@@ -1471,8 +1468,8 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync) ...@@ -1471,8 +1468,8 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync)
* Otherwise check if either cpus are near enough in load to allow this * Otherwise check if either cpus are near enough in load to allow this
* task to be woken on this_cpu. * task to be woken on this_cpu.
*/ */
if (this_load) { if (this_load > 0) {
unsigned long this_eff_load, prev_eff_load; s64 this_eff_load, prev_eff_load;
this_eff_load = 100; this_eff_load = 100;
this_eff_load *= power_of(prev_cpu); this_eff_load *= power_of(prev_cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment