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: prevent divide by zero error in cpu_avg_load_per_task, update
sched, cpusets: fix warning in kernel/cpuset.c
sched: prevent divide by zero error in cpu_avg_load_per_task

+4 -3
+1 -1
kernel/cpuset.c
··· 585 int i, j, k; /* indices for partition finding loops */ 586 cpumask_t *doms; /* resulting partition; i.e. sched domains */ 587 struct sched_domain_attr *dattr; /* attributes for custom domains */ 588 - int ndoms; /* number of sched domains in result */ 589 int nslot; /* next empty doms[] cpumask_t slot */ 590 591 doms = NULL;
··· 585 int i, j, k; /* indices for partition finding loops */ 586 cpumask_t *doms; /* resulting partition; i.e. sched domains */ 587 struct sched_domain_attr *dattr; /* attributes for custom domains */ 588 + int ndoms = 0; /* number of sched domains in result */ 589 int nslot; /* next empty doms[] cpumask_t slot */ 590 591 doms = NULL;
+3 -2
kernel/sched.c
··· 1453 static unsigned long cpu_avg_load_per_task(int cpu) 1454 { 1455 struct rq *rq = cpu_rq(cpu); 1456 1457 - if (rq->nr_running) 1458 - rq->avg_load_per_task = rq->load.weight / rq->nr_running; 1459 else 1460 rq->avg_load_per_task = 0; 1461
··· 1453 static unsigned long cpu_avg_load_per_task(int cpu) 1454 { 1455 struct rq *rq = cpu_rq(cpu); 1456 + unsigned long nr_running = ACCESS_ONCE(rq->nr_running); 1457 1458 + if (nr_running) 1459 + rq->avg_load_per_task = rq->load.weight / nr_running; 1460 else 1461 rq->avg_load_per_task = 0; 1462