[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y1Hrg/sqPhuSr+PY@gmail.com>
Date: Thu, 20 Oct 2022 17:44:51 -0700
From: Andrei Vagin <avagin@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org,
Andy Lutomirski <luto@...capital.net>,
Christian Brauner <brauner@...nel.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Kees Cook <keescook@...omium.org>,
Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Peter Oskolkov <posk@...gle.com>,
Tycho Andersen <tycho@...ho.pizza>,
Will Drewry <wad@...omium.org>,
Vincent Guittot <vincent.guittot@...aro.org>
Subject: Re: [PATCH 3/5] sched: add a few helpers to wake up tasks on the
current cpu
On Thu, Oct 20, 2022 at 04:15:04PM +0200, Peter Zijlstra wrote:
> On Wed, Oct 19, 2022 at 06:10:46PM -0700, Andrei Vagin wrote:
> > Add complete_on_current_cpu, wake_up_poll_on_current_cpu helpers to wake
> > up processes on the current CPU.
>
> There is an astounding lack of *why* in this changelog.
I use them in the next patch to handle seccomp user notify requests
faster.
The seccomp notify mechanism allows less privileged processes to offload
specific syscalls to more privileged processes. In many cases, the
workflow is fully synchronous. It means a target process triggers a
system call, the kernel stops it and wakes up a supervisor process that
handles the system call and returns controls back to the target process.
In this context, "synchronous" means that only one process is running
and another one is waiting.
New helpers advices the scheduler to move the wakee to the current CPU.
For synchronous workflows like described above, these helpers makes
context switches a few times faster.
For example, using these helpers allows to reduce a seccomp user notify
rountdrip time from 12µs to 3µs.
Thanks,
Andrei
Powered by blists - more mailing lists