summaryrefslogtreecommitdiff
path: root/include/linux/kthread.h
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2023-06-03 00:23:46 +0300
committerPeter Zijlstra <peterz@infradead.org>2023-06-16 18:08:01 +0300
commitef73d6a4ef0b35524125c3cfc6deafc26a0c966a (patch)
treec7c854cb2d8ed6157dc87733d955a36947e17fd8 /include/linux/kthread.h
parent0cce0fde499a92c726cd2e24f7763644f7c9f971 (diff)
downloadlinux-ef73d6a4ef0b35524125c3cfc6deafc26a0c966a.tar.xz
sched/wait: Fix a kthread_park race with wait_woken()
kthread_park and wait_woken have a similar race that kthread_stop and wait_woken used to have before it was fixed in commit cb6538e740d7 ("sched/wait: Fix a kthread race with wait_woken()"). Extend that fix to also cover kthread_park. [jstultz: Made changes suggested by Peter to optimize memory loads] Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: John Stultz <jstultz@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Valentin Schneider <vschneid@redhat.com> Link: https://lore.kernel.org/r/20230602212350.535358-1-jstultz@google.com
Diffstat (limited to 'include/linux/kthread.h')
-rw-r--r--include/linux/kthread.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 30e5bec81d2b..f1f95a71a4bc 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -89,6 +89,7 @@ int kthread_stop(struct task_struct *k);
bool kthread_should_stop(void);
bool kthread_should_park(void);
bool __kthread_should_park(struct task_struct *k);
+bool kthread_should_stop_or_park(void);
bool kthread_freezable_should_stop(bool *was_frozen);
void *kthread_func(struct task_struct *k);
void *kthread_data(struct task_struct *k);