Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1428995 > unrolled thread
| Started by | Morten Rasmussen <morten.rasmussen@arm.com> |
|---|---|
| First post | 2016-06-22 19:10 +0200 |
| Last post | 2016-06-22 19:10 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 03/13] sched/fair: Optimize find_idlest_cpu() when there is no choice Morten Rasmussen <morten.rasmussen@arm.com> - 2016-06-22 19:10 +0200
| From | Morten Rasmussen <morten.rasmussen@arm.com> |
|---|---|
| Date | 2016-06-22 19:10 +0200 |
| Subject | [PATCH v2 03/13] sched/fair: Optimize find_idlest_cpu() when there is no choice |
| Message-ID | <rMTP4-6im-31@gated-at.bofh.it> |
In the current find_idlest_group()/find_idlest_cpu() search we end up
calling find_idlest_cpu() in a sched_group containing only one cpu in
the end. Checking idle-states becomes pointless when there is no
alternative, so bail out instead.
cc: Ingo Molnar <mingo@redhat.com>
cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com>
---
kernel/sched/fair.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index eec8e29104f9..216db302e87d 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5123,6 +5123,10 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
int shallowest_idle_cpu = -1;
int i;
+ /* Check if we have any choice */
+ if (group->group_weight == 1)
+ return cpumask_first(sched_group_cpus(group));
+
/* Traverse only the allowed CPUs */
for_each_cpu_and(i, sched_group_cpus(group), tsk_cpus_allowed(p)) {
if (idle_cpu(i)) {
--
1.9.1
Back to top | Article view | linux.kernel
csiph-web