Re: [PATCH 4/5] seccomp: add the synchronous mode for seccomp_unotify

From: Tycho Andersen
Date: Thu Jan 12 2023 - 10:12:21 EST


On Tue, Jan 10, 2023 at 01:30:09PM -0800, Andrei Vagin wrote:
> From: Andrei Vagin <avagin@xxxxxxxxx>
>
> seccomp_unotify allows more privileged processes do actions on behalf
> of less privileged processes.
>
> In many cases, the workflow is fully synchronous. It means a target
> process triggers a system call and passes controls to a supervisor
> process that handles the system call and returns controls to the target
> process. In this context, "synchronous" means that only one process is
> running and another one is waiting.
>
> There is the WF_CURRENT_CPU flag that is used to advise the scheduler to
> move the wakee to the current CPU. For such synchronous workflows, it
> makes context switches a few times faster.
>
> Right now, each interaction takes 12µs. With this patch, it takes about
> 3µs.
>
> This change introduce the SECCOMP_USER_NOTIF_FD_SYNC_WAKE_UP flag that
> it used to enable the sync mode.

What about just not having a flag and using the new primitives all the
time? Is there any reason not to?

Tycho