diff options
author | Andrei Vagin <avagin@google.com> | 2023-03-08 10:31:58 +0300 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2023-07-18 02:08:08 +0300 |
commit | 6f63904c8f3edb65bd85c1be01d69214ff8ca4c5 (patch) | |
tree | 1411084a185f099140b25f05f0bbfd7104abf702 /include/linux/completion.h | |
parent | ab83f455f04df5b2f7c6d4de03b6d2eaeaa27b8a (diff) | |
download | linux-6f63904c8f3edb65bd85c1be01d69214ff8ca4c5.tar.xz |
sched: add a few helpers to wake up tasks on the current cpu
Add complete_on_current_cpu, wake_up_poll_on_current_cpu helpers to wake
up tasks on the current CPU.
These two helpers are useful when the task needs to make a synchronous context
switch to another task. In this context, synchronous means it wakes up the
target task and falls asleep right after that.
One example of such workloads is seccomp user notifies. This mechanism allows
the supervisor process handles system calls on behalf of a target process.
While the supervisor is handling an intercepted system call, the target process
will be blocked in the kernel, waiting for a response to come back.
On-CPU context switches are much faster than regular ones.
Signed-off-by: Andrei Vagin <avagin@google.com>
Acked-by: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230308073201.3102738-4-avagin@google.com
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'include/linux/completion.h')
-rw-r--r-- | include/linux/completion.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/completion.h b/include/linux/completion.h index 62b32b19e0a8..fb2915676574 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -116,6 +116,7 @@ extern bool try_wait_for_completion(struct completion *x); extern bool completion_done(struct completion *x); extern void complete(struct completion *); +extern void complete_on_current_cpu(struct completion *x); extern void complete_all(struct completion *); #endif |