Skip to content

Commit bffb276

Browse files
committed
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
2 parents f7b548f + 05ca62c commit bffb276

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

‎kernel/sched_fair.c‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -722,10 +722,10 @@ static void update_cfs_load(struct cfs_rq *cfs_rq, int global_update)
722722
u64 now, delta;
723723
unsigned long load = cfs_rq->load.weight;
724724

725-
if (!cfs_rq)
725+
if (cfs_rq->tg == &root_task_group)
726726
return;
727727

728-
now = rq_of(cfs_rq)->clock;
728+
now = rq_of(cfs_rq)->clock_task;
729729
delta = now - cfs_rq->load_stamp;
730730

731731
/* truncate load history at 4 idle periods */
@@ -830,9 +830,6 @@ static void update_cfs_shares(struct cfs_rq *cfs_rq, long weight_delta)
830830
struct sched_entity *se;
831831
long shares;
832832

833-
if (!cfs_rq)
834-
return;
835-
836833
tg = cfs_rq->tg;
837834
se = tg->se[cpu_of(rq_of(cfs_rq))];
838835
if (!se)
@@ -1432,7 +1429,7 @@ static inline unsigned long effective_load(struct task_group *tg, int cpu,
14321429

14331430
static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync)
14341431
{
1435-
unsigned long this_load, load;
1432+
s64 this_load, load;
14361433
int idx, this_cpu, prev_cpu;
14371434
unsigned long tl_per_task;
14381435
struct task_group *tg;
@@ -1471,8 +1468,8 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, int sync)
14711468
* Otherwise check if either cpus are near enough in load to allow this
14721469
* task to be woken on this_cpu.
14731470
*/
1474-
if (this_load) {
1475-
unsigned long this_eff_load, prev_eff_load;
1471+
if (this_load > 0) {
1472+
s64 this_eff_load, prev_eff_load;
14761473

14771474
this_eff_load = 100;
14781475
this_eff_load *= power_of(prev_cpu);

0 commit comments

Comments
 (0)