[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180829115954.GS24124@hirez.programming.kicks-ass.net>
Date: Wed, 29 Aug 2018 13:59:54 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Dietmar Eggemann <dietmar.eggemann@....com>
Cc: Steve Muckle <smuckle@...gle.com>,
Miguel de Dios <migueldedios@...gle.com>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
kernel-team@...roid.com, Todd Kjos <tkjos@...gle.com>,
Paul Turner <pjt@...gle.com>,
Quentin Perret <quentin.perret@....com>,
Patrick Bellasi <Patrick.Bellasi@....com>,
Chris Redpath <Chris.Redpath@....com>,
Morten Rasmussen <Morten.Rasmussen@....com>,
John Dias <joaodias@...gle.com>
Subject: Re: [PATCH] sched/fair: vruntime should normalize when switching
from fair
On Wed, Aug 29, 2018 at 11:54:58AM +0100, Dietmar Eggemann wrote:
> I forgot to mention that since fair_task's cpu affinity is restricted to
> CPU4, there is no call to set_task_cpu()->migrate_task_rq_fair() since if
> (task_cpu(p) != cpu) fails.
>
> I think the combination of cpu affinity of the fair_task to CPU4 and the
> fact that the scheduler runs on CPU1 when waking fair_task (with the two
> cpus not sharing LLC) while TTWU_QUEUE is enabled is the situation in which
> this vruntime issue can happen.
Ohhh, D'0h. A remote wakeup that doesn't migrate.
That would suggest something like so:
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index b39fb596f6c1..b3b62cf37fb6 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9638,7 +9638,8 @@ static inline bool vruntime_normalized(struct task_struct *p)
* - A task which has been woken up by try_to_wake_up() and
* waiting for actually being woken up by sched_ttwu_pending().
*/
- if (!se->sum_exec_runtime || p->state == TASK_WAKING)
+ if (!se->sum_exec_runtime ||
+ (p->state == TASK_WAKING && p->sched_remote_wakeup))
return true;
return false;
Powered by blists - more mailing lists