linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC/TEST] sched: make sync affine wakeups work
@ 2014-05-02  4:42 Rik van Riel
  2014-05-02  5:32 ` Mike Galbraith
  2014-05-02  6:13 ` Mike Galbraith
  0 siblings, 2 replies; 46+ messages in thread
From: Rik van Riel @ 2014-05-02  4:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: morten.rasmussen, mingo, peterz, george.mccollister, ktkhai,
	umgwanakikbuti

Currently sync wakeups from the wake_affine code cannot work as
designed, because the task doing the sync wakeup from the target
cpu will block its wakee from selecting that cpu.

This is despite the fact that whether or not the wakeup is sync
determines whether or not we want to do an affine wakeup...

This patch allows sync wakeups to pick the waker's cpu.

Whether or not this is the right thing to do remains to be seen,
but it does allow us to verify whether or not the wake_affine
strategy of always doing affine wakeups and only disabling them
in a specific circumstance is sound, or needs rethinking...

Not-yet-signed-off-by: Rik van Riel <riel@redhat.com>
---
 kernel/sched/fair.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 7570dd9..7f8fe16 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4358,13 +4358,13 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
 /*
  * Try and locate an idle CPU in the sched_domain.
  */
-static int select_idle_sibling(struct task_struct *p, int target)
+static int select_idle_sibling(struct task_struct *p, int target, int sync)
 {
 	struct sched_domain *sd;
 	struct sched_group *sg;
 	int i = task_cpu(p);
 
-	if (idle_cpu(target))
+	if (idle_cpu(target) || (sync && cpu_rq(target)->nr_running == 1))
 		return target;
 
 	/*
@@ -4453,7 +4453,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f
 		if (cpu != prev_cpu && wake_affine(affine_sd, p, sync))
 			prev_cpu = cpu;
 
-		new_cpu = select_idle_sibling(p, prev_cpu);
+		new_cpu = select_idle_sibling(p, prev_cpu, sync);
 		goto unlock;
 	}
 
.

^ permalink raw reply related	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2014-05-22 12:28 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-02  4:42 [PATCH RFC/TEST] sched: make sync affine wakeups work Rik van Riel
2014-05-02  5:32 ` Mike Galbraith
2014-05-02  5:41   ` Mike Galbraith
2014-05-02  5:58   ` Mike Galbraith
2014-05-02  6:08     ` Rik van Riel
2014-05-02  6:36       ` Mike Galbraith
2014-05-02  6:51         ` Mike Galbraith
2014-05-02  6:13 ` Mike Galbraith
2014-05-02  6:30   ` Rik van Riel
2014-05-02  7:37     ` Mike Galbraith
2014-05-02 10:56       ` Rik van Riel
2014-05-02 11:27         ` Mike Galbraith
2014-05-02 12:51           ` Mike Galbraith
     [not found]           ` <5363B793.9010208@redhat.com>
2014-05-06 11:54             ` Peter Zijlstra
2014-05-06 20:19               ` Rik van Riel
2014-05-06 20:39                 ` Peter Zijlstra
2014-05-06 23:46                   ` Rik van Riel
2014-05-09  2:20                   ` Rik van Riel
2014-05-09  5:27                     ` [PATCH] sched: wake up task on prev_cpu if not in SD_WAKE_AFFINE domain with cpu Rik van Riel
2014-05-09  6:04                       ` [PATCH] sched: clean up select_task_rq_fair conditionals and indentation Rik van Riel
2014-05-09  7:34                       ` [PATCH] sched: wake up task on prev_cpu if not in SD_WAKE_AFFINE domain with cpu Mike Galbraith
2014-05-09 14:22                         ` Rik van Riel
2014-05-09 15:24                           ` Mike Galbraith
2014-05-09 15:24                             ` Rik van Riel
2014-05-09 17:55                               ` Mike Galbraith
2014-05-09 18:16                                 ` Rik van Riel
2014-05-10  3:54                                   ` Mike Galbraith
2014-05-13 14:08                                     ` Rik van Riel
2014-05-14  4:08                                       ` Mike Galbraith
2014-05-14 15:40                                         ` [PATCH] sched: call select_idle_sibling when not affine_sd Rik van Riel
2014-05-14 15:45                                           ` Peter Zijlstra
2014-05-19 13:08                                           ` [tip:sched/core] " tip-bot for Rik van Riel
2014-05-22 12:27                                           ` [tip:sched/core] sched: Call select_idle_sibling() " tip-bot for Rik van Riel
2014-05-04 11:44     ` [PATCH RFC/TEST] sched: make sync affine wakeups work Preeti Murthy
2014-05-04 12:04       ` Mike Galbraith
2014-05-05  4:38         ` Preeti U Murthy
2014-05-04 12:41       ` Rik van Riel
2014-05-05  4:50         ` Preeti U Murthy
2014-05-05  6:43           ` Preeti U Murthy
2014-05-05 11:28           ` Rik van Riel
2014-05-06 13:26           ` Peter Zijlstra
2014-05-06 13:25         ` Peter Zijlstra
2014-05-06 20:20           ` Rik van Riel
2014-05-06 20:41             ` Peter Zijlstra
2014-05-07 12:17               ` Ingo Molnar
2014-05-06 11:56       ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).