[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y7+4S9umCo5I+Ty7@chenyu5-mobl1>
Date: Thu, 12 Jan 2023 15:35:39 +0800
From: Chen Yu <yu.c.chen@...el.com>
To: Andrei Vagin <avagin@...gle.com>
CC: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
<linux-kernel@...r.kernel.org>, Kees Cook <keescook@...omium.org>,
Christian Brauner <brauner@...nel.org>,
Andrei Vagin <avagin@...il.com>,
Andy Lutomirski <luto@...capital.net>,
Juri Lelli <juri.lelli@...hat.com>,
Peter Oskolkov <posk@...gle.com>,
Tycho Andersen <tycho@...ho.pizza>,
Will Drewry <wad@...omium.org>
Subject: Re: [PATCH 2/5] sched: add WF_CURRENT_CPU and externise ttwu
On 2023-01-10 at 13:30:07 -0800, Andrei Vagin wrote:
> From: Peter Oskolkov <posk@...gle.com>
>
> Add WF_CURRENT_CPU wake flag that advices the scheduler to
> move the wakee to the current CPU. This is useful for fast on-CPU
> context switching use cases.
>
> In addition, make ttwu external rather than static so that
> the flag could be passed to it from outside of sched/core.c.
>
> Signed-off-by: Peter Oskolkov <posk@...gle.com>
> Signed-off-by: Andrei Vagin <avagin@...il.com>
> @@ -7380,6 +7380,10 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
> if (wake_flags & WF_TTWU) {
> record_wakee(p);
>
> + if ((wake_flags & WF_CURRENT_CPU) &&
> + cpumask_test_cpu(cpu, p->cpus_ptr))
> + return cpu;
I agree that cross-CPU wake up brings pain to fast context switching
use cases, especially on high core count system. We suffered from this
issue as well, so previously we presented this issue as well. The difference
is that we used some dynamic "WF_CURRENT_CPU" mechanism[1] to deal with it.
That is, if the waker/wakee are both short duration tasks, let the waker wakes up
the wakee on current CPU. So not only seccomp but also other components/workloads
could benefit from this without having to set the WF_CURRENT_CPU flag.
Link [1]:
https://lore.kernel.org/lkml/cover.1671158588.git.yu.c.chen@intel.com/
thanks,
Chenyu
Powered by blists - more mailing lists