aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/core.c
diff options
context:
space:
mode:
authorPeter Oskolkov <posk@google.com>2023-03-07 23:31:57 -0800
committerKees Cook <keescook@chromium.org>2023-07-17 16:08:08 -0700
commitab83f455f04df5b2f7c6d4de03b6d2eaeaa27b8a (patch)
tree7cd231764749291cd6cdd701065bdb2b6700aba8 /kernel/sched/core.c
parentseccomp: don't use semaphore and wait_queue together (diff)
downloadlinux-ab83f455f04df5b2f7c6d4de03b6d2eaeaa27b8a.tar.gz
linux-ab83f455f04df5b2f7c6d4de03b6d2eaeaa27b8a.zip
sched: add WF_CURRENT_CPU and externise ttwu
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@google.com> Signed-off-by: Andrei Vagin <avagin@google.com> Acked-by: "Peter Zijlstra (Intel)" <peterz@infradead.org> Link: https://lore.kernel.org/r/20230308073201.3102738-3-avagin@google.com Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r--kernel/sched/core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index c52c2eba7c73..1574989627b0 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4193,8 +4193,7 @@ bool ttwu_state_match(struct task_struct *p, unsigned int state, int *success)
* Return: %true if @p->state changes (an actual wakeup was done),
* %false otherwise.
*/
-static int
-try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
+int try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
{
unsigned long flags;
int cpu, success = 0;