aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2018-02-13 08:37:28 -0500
committerIngo Molnar <mingo@kernel.org>2018-02-21 02:49:42 -0500
commit24d0c1d6e65f635b2c0684d0a42ff6c0674aa0e6 (patch)
tree6d715d3a54be133703d8273324d61398ef8f0570
parent082f764a2f3f2968afa1a0b04a1ccb1b70633844 (diff)
sched/fair: Do not migrate due to a sync wakeup on exit
When a task exits, it notifies the parent that it has exited. This is a sync wakeup and the exiting task may pull the parent towards the wakers CPU. For simple workloads like using a shell, it was observed that the shell is pulled across nodes by exiting processes. This is daft as the parent may be long-lived and properly placed. This patch special cases a sync wakeup on exit to avoid pulling tasks across nodes. Testing on a range of workloads and machines showed very little differences in performance although there was a small 3% boost on some machines running a shellscript intensive workload (git regression test suite). Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Giovanni Gherdovich <ggherdovich@suse.cz> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Matt Fleming <matt@codeblueprint.co.uk> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20180213133730.24064-5-mgorman@techsingularity.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/sched/fair.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a07920f3a2fd..302dda81e192 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6350,7 +6350,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int sd_flag, int wake_f
6350 int cpu = smp_processor_id(); 6350 int cpu = smp_processor_id();
6351 int new_cpu = prev_cpu; 6351 int new_cpu = prev_cpu;
6352 int want_affine = 0; 6352 int want_affine = 0;
6353 int sync = wake_flags & WF_SYNC; 6353 int sync = (wake_flags & WF_SYNC) && !(current->flags & PF_EXITING);
6354 6354
6355 if (sd_flag & SD_BALANCE_WAKE) { 6355 if (sd_flag & SD_BALANCE_WAKE) {
6356 record_wakee(p); 6356 record_wakee(p);