Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1449496

[PATCH v3 03/13] sched/fair: Optimize find_idlest_cpu() when there is no choice

From Morten Rasmussen <morten.rasmussen@arm.com>
Newsgroups linux.kernel
Subject [PATCH v3 03/13] sched/fair: Optimize find_idlest_cpu() when there is no choice
Date 2016-07-25 15:40 +0200
Message-ID <rYOgW-584-45@gated-at.bofh.it> (permalink)
References <rYOgV-584-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>

Acked-by: Vincent Guittot <vincent.guittot@linaro.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 e7d50acd6028..c1c0aa8b300b 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5229,6 +5229,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 linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v3 00/13] sched: Clean-ups and asymmetric cpu capacity support Morten Rasmussen <morten.rasmussen@arm.com> - 2016-07-25 15:40 +0200
  [PATCH v3 09/13] sched/fair: Let asymmetric cpu configurations balance at wake-up Morten Rasmussen <morten.rasmussen@arm.com> - 2016-07-25 15:40 +0200
  [PATCH v3 13/13] sched/fair: Avoid pulling tasks from non-overloaded higher capacity groups Morten Rasmussen <morten.rasmussen@arm.com> - 2016-07-25 15:40 +0200
  [PATCH v3 06/13] sched/core: Pass child domain into sd_init Morten Rasmussen <morten.rasmussen@arm.com> - 2016-07-25 15:40 +0200
  [PATCH v3 05/13] sched: Introduce SD_ASYM_CPUCAPACITY sched_domain topology flag Morten Rasmussen <morten.rasmussen@arm.com> - 2016-07-25 15:40 +0200
  [PATCH v3 08/13] sched: Store maximum per-cpu capacity in root domain Morten Rasmussen <morten.rasmussen@arm.com> - 2016-07-25 15:40 +0200
  [PATCH v3 10/13] sched/fair: Compute task/cpu utilization at wake-up more correctly Morten Rasmussen <morten.rasmussen@arm.com> - 2016-07-25 15:40 +0200
  [PATCH v3 04/13] sched/core: Remove unnecessary null-pointer check Morten Rasmussen <morten.rasmussen@arm.com> - 2016-07-25 15:40 +0200
  [PATCH v3 03/13] sched/fair: Optimize find_idlest_cpu() when there is no choice Morten Rasmussen <morten.rasmussen@arm.com> - 2016-07-25 15:40 +0200

csiph-web