diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 6c819f338b11..f0ccb8b926c8 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -1538,6 +1538,26 @@ static unsigned long target_load(int cpu, int type) | |||
1538 | return max(rq->cpu_load[type-1], total); | 1538 | return max(rq->cpu_load[type-1], total); |
1539 | } | 1539 | } |
1540 | 1540 | ||
1541 | static struct sched_group *group_of(int cpu) | ||
1542 | { | ||
1543 | struct sched_domain *sd = rcu_dereference(cpu_rq(cpu)->sd); | ||
1544 | |||
1545 | if (!sd) | ||
1546 | return NULL; | ||
1547 | |||
1548 | return sd->groups; | ||
1549 | } | ||
1550 | |||
1551 | static unsigned long power_of(int cpu) | ||
1552 | { | ||
1553 | struct sched_group *group = group_of(cpu); | ||
1554 | |||
1555 | if (!group) | ||
1556 | return SCHED_LOAD_SCALE; | ||
1557 | |||
1558 | return group->cpu_power; | ||
1559 | } | ||
1560 | |||
1541 | static int task_hot(struct task_struct *p, u64 now, struct sched_domain *sd); | 1561 | static int task_hot(struct task_struct *p, u64 now, struct sched_domain *sd); |
1542 | 1562 | ||
1543 | static unsigned long cpu_avg_load_per_task(int cpu) | 1563 | static unsigned long cpu_avg_load_per_task(int cpu) |
@@ -3982,26 +4002,6 @@ ret: | |||
3982 | return NULL; | 4002 | return NULL; |
3983 | } | 4003 | } |
3984 | 4004 | ||
3985 | static struct sched_group *group_of(int cpu) | ||
3986 | { | ||
3987 | struct sched_domain *sd = rcu_dereference(cpu_rq(cpu)->sd); | ||
3988 | |||
3989 | if (!sd) | ||
3990 | return NULL; | ||
3991 | |||
3992 | return sd->groups; | ||
3993 | } | ||
3994 | |||
3995 | static unsigned long power_of(int cpu) | ||
3996 | { | ||
3997 | struct sched_group *group = group_of(cpu); | ||
3998 | |||
3999 | if (!group) | ||
4000 | return SCHED_LOAD_SCALE; | ||
4001 | |||
4002 | return group->cpu_power; | ||
4003 | } | ||
4004 | |||
4005 | /* | 4005 | /* |
4006 | * find_busiest_queue - find the busiest runqueue among the cpus in group. | 4006 | * find_busiest_queue - find the busiest runqueue among the cpus in group. |
4007 | */ | 4007 | */ |