diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index c94baf2969e7..e4bb1dd7b308 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 | ||
@@ -6586,7 +6587,9 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu) | |||
6586 | req = list_entry(rq->migration_queue.next, | 6587 | req = list_entry(rq->migration_queue.next, |
6587 | struct migration_req, list); | 6588 | struct migration_req, list); |
6588 | list_del_init(&req->list); | 6589 | list_del_init(&req->list); |
6590 | spin_unlock_irq(&rq->lock); | ||
6589 | complete(&req->done); | 6591 | complete(&req->done); |
6592 | spin_lock_irq(&rq->lock); | ||
6590 | } | 6593 | } |
6591 | spin_unlock_irq(&rq->lock); | 6594 | spin_unlock_irq(&rq->lock); |
6592 | break; | 6595 | break; |
@@ -7789,13 +7792,14 @@ static int dattrs_equal(struct sched_domain_attr *cur, int idx_cur, | |||
7789 | * | 7792 | * |
7790 | * The passed in 'doms_new' should be kmalloc'd. This routine takes | 7793 | * The passed in 'doms_new' should be kmalloc'd. This routine takes |
7791 | * ownership of it and will kfree it when done with it. If the caller | 7794 | * ownership of it and will kfree it when done with it. If the caller |
7792 | * failed the kmalloc call, then it can pass in doms_new == NULL, | 7795 | * failed the kmalloc call, then it can pass in doms_new == NULL && |
7793 | * and partition_sched_domains() will fallback to the single partition | 7796 | * ndoms_new == 1, and partition_sched_domains() will fallback to |
7794 | * 'fallback_doms', it also forces the domains to be rebuilt. | 7797 | * the single partition 'fallback_doms', it also forces the domains |
7798 | * to be rebuilt. | ||
7795 | * | 7799 | * |
7796 | * If doms_new==NULL it will be replaced with cpu_online_map. | 7800 | * If doms_new == NULL it will be replaced with cpu_online_map. |
7797 | * ndoms_new==0 is a special case for destroying existing domains. | 7801 | * ndoms_new == 0 is a special case for destroying existing domains, |
7798 | * It will not create the default domain. | 7802 | * and it will not create the default domain. |
7799 | * | 7803 | * |
7800 | * Call with hotplug lock held | 7804 | * Call with hotplug lock held |
7801 | */ | 7805 | */ |