diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cpuset.c | 2 | ||||
-rw-r--r-- | kernel/sched.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index da7ff6137f37..96c0ba13b8cd 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -585,7 +585,7 @@ static int generate_sched_domains(cpumask_t **domains, | |||
585 | int i, j, k; /* indices for partition finding loops */ | 585 | int i, j, k; /* indices for partition finding loops */ |
586 | cpumask_t *doms; /* resulting partition; i.e. sched domains */ | 586 | cpumask_t *doms; /* resulting partition; i.e. sched domains */ |
587 | struct sched_domain_attr *dattr; /* attributes for custom domains */ | 587 | struct sched_domain_attr *dattr; /* attributes for custom domains */ |
588 | int ndoms; /* number of sched domains in result */ | 588 | int ndoms = 0; /* number of sched domains in result */ |
589 | int nslot; /* next empty doms[] cpumask_t slot */ | 589 | int nslot; /* next empty doms[] cpumask_t slot */ |
590 | 590 | ||
591 | doms = NULL; | 591 | doms = NULL; |
diff --git a/kernel/sched.c b/kernel/sched.c index 9b1e79371c20..b7480fb5c3dc 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -1453,9 +1453,10 @@ static int task_hot(struct task_struct *p, u64 now, struct sched_domain *sd); | |||
1453 | static unsigned long cpu_avg_load_per_task(int cpu) | 1453 | static unsigned long cpu_avg_load_per_task(int cpu) |
1454 | { | 1454 | { |
1455 | struct rq *rq = cpu_rq(cpu); | 1455 | struct rq *rq = cpu_rq(cpu); |
1456 | unsigned long nr_running = ACCESS_ONCE(rq->nr_running); | ||
1456 | 1457 | ||
1457 | if (rq->nr_running) | 1458 | if (nr_running) |
1458 | rq->avg_load_per_task = rq->load.weight / rq->nr_running; | 1459 | rq->avg_load_per_task = rq->load.weight / nr_running; |
1459 | else | 1460 | else |
1460 | rq->avg_load_per_task = 0; | 1461 | rq->avg_load_per_task = 0; |
1461 | 1462 | ||