diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index ee61f454a98b..526d237b8ce5 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -1563,11 +1563,7 @@ static unsigned long cpu_avg_load_per_task(int cpu) | |||
1563 | 1563 | ||
1564 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1564 | #ifdef CONFIG_FAIR_GROUP_SCHED |
1565 | 1565 | ||
1566 | struct update_shares_data { | 1566 | static __read_mostly unsigned long *update_shares_data; |
1567 | unsigned long rq_weight[NR_CPUS]; | ||
1568 | }; | ||
1569 | |||
1570 | static DEFINE_PER_CPU(struct update_shares_data, update_shares_data); | ||
1571 | 1567 | ||
1572 | static void __set_se_shares(struct sched_entity *se, unsigned long shares); | 1568 | static void __set_se_shares(struct sched_entity *se, unsigned long shares); |
1573 | 1569 | ||
@@ -1577,12 +1573,12 @@ static void __set_se_shares(struct sched_entity *se, unsigned long shares); | |||
1577 | static void update_group_shares_cpu(struct task_group *tg, int cpu, | 1573 | static void update_group_shares_cpu(struct task_group *tg, int cpu, |
1578 | unsigned long sd_shares, | 1574 | unsigned long sd_shares, |
1579 | unsigned long sd_rq_weight, | 1575 | unsigned long sd_rq_weight, |
1580 | struct update_shares_data *usd) | 1576 | unsigned long *usd_rq_weight) |
1581 | { | 1577 | { |
1582 | unsigned long shares, rq_weight; | 1578 | unsigned long shares, rq_weight; |
1583 | int boost = 0; | 1579 | int boost = 0; |
1584 | 1580 | ||
1585 | rq_weight = usd->rq_weight[cpu]; | 1581 | rq_weight = usd_rq_weight[cpu]; |
1586 | if (!rq_weight) { | 1582 | if (!rq_weight) { |
1587 | boost = 1; | 1583 | boost = 1; |
1588 | rq_weight = NICE_0_LOAD; | 1584 | rq_weight = NICE_0_LOAD; |
@@ -1617,7 +1613,7 @@ static void update_group_shares_cpu(struct task_group *tg, int cpu, | |||
1617 | static int tg_shares_up(struct task_group *tg, void *data) | 1613 | static int tg_shares_up(struct task_group *tg, void *data) |
1618 | { | 1614 | { |
1619 | unsigned long weight, rq_weight = 0, shares = 0; | 1615 | unsigned long weight, rq_weight = 0, shares = 0; |
1620 | struct update_shares_data *usd; | 1616 | unsigned long *usd_rq_weight; |
1621 | struct sched_domain *sd = data; | 1617 | struct sched_domain *sd = data; |
1622 | unsigned long flags; | 1618 | unsigned long flags; |
1623 | int i; | 1619 | int i; |
@@ -1626,11 +1622,11 @@ static int tg_shares_up(struct task_group *tg, void *data) | |||
1626 | return 0; | 1622 | return 0; |
1627 | 1623 | ||
1628 | local_irq_save(flags); | 1624 | local_irq_save(flags); |
1629 | usd = &__get_cpu_var(update_shares_data); | 1625 | usd_rq_weight = per_cpu_ptr(update_shares_data, smp_processor_id()); |
1630 | 1626 | ||
1631 | for_each_cpu(i, sched_domain_span(sd)) { | 1627 | for_each_cpu(i, sched_domain_span(sd)) { |
1632 | weight = tg->cfs_rq[i]->load.weight; | 1628 | weight = tg->cfs_rq[i]->load.weight; |
1633 | usd->rq_weight[i] = weight; | 1629 | usd_rq_weight[i] = weight; |
1634 | 1630 | ||
1635 | /* | 1631 | /* |
1636 | * If there are currently no tasks on the cpu pretend there | 1632 | * If there are currently no tasks on the cpu pretend there |
@@ -1651,7 +1647,7 @@ static int tg_shares_up(struct task_group *tg, void *data) | |||
1651 | shares = tg->shares; | 1647 | shares = tg->shares; |
1652 | 1648 | ||
1653 | for_each_cpu(i, sched_domain_span(sd)) | 1649 | for_each_cpu(i, sched_domain_span(sd)) |
1654 | update_group_shares_cpu(tg, i, shares, rq_weight, usd); | 1650 | update_group_shares_cpu(tg, i, shares, rq_weight, usd_rq_weight); |
1655 | 1651 | ||
1656 | local_irq_restore(flags); | 1652 | local_irq_restore(flags); |
1657 | 1653 | ||
@@ -9406,6 +9402,10 @@ void __init sched_init(void) | |||
9406 | #endif /* CONFIG_USER_SCHED */ | 9402 | #endif /* CONFIG_USER_SCHED */ |
9407 | #endif /* CONFIG_GROUP_SCHED */ | 9403 | #endif /* CONFIG_GROUP_SCHED */ |
9408 | 9404 | ||
9405 | #if defined CONFIG_FAIR_GROUP_SCHED && defined CONFIG_SMP | ||
9406 | update_shares_data = __alloc_percpu(nr_cpu_ids * sizeof(unsigned long), | ||
9407 | __alignof__(unsigned long)); | ||
9408 | #endif | ||
9409 | for_each_possible_cpu(i) { | 9409 | for_each_possible_cpu(i) { |
9410 | struct rq *rq; | 9410 | struct rq *rq; |
9411 | 9411 | ||