aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kthread.h
diff options
context:
space:
mode:
authorMatthias Kaehlcke <mka@chromium.org>2019-01-28 15:46:24 -0800
committerThomas Gleixner <tglx@linutronix.de>2019-02-10 21:51:39 +0100
commit0121805d9d2b1fff371e195c28e9b86ae38b5e47 (patch)
tree0df07f6984426c1adc9ca8f779f4b2b96b2677f9 /include/linux/kthread.h
parentproc/stat: Make the interrupt statistics more efficient (diff)
downloadlinux-dev-0121805d9d2b1fff371e195c28e9b86ae38b5e47.tar.xz
linux-dev-0121805d9d2b1fff371e195c28e9b86ae38b5e47.zip
kthread: Add __kthread_should_park()
kthread_should_park() is used to check if the calling kthread ('current') should park, but there is no function to check whether an arbitrary kthread should be parked. The latter is required to plug a CPU hotplug race vs. a parking ksoftirqd thread. The new __kthread_should_park() receives a task_struct as parameter to check if the corresponding kernel thread should be parked. Call __kthread_should_park() from kthread_should_park() to avoid code duplication. Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Douglas Anderson <dianders@chromium.org> Cc: Stephen Boyd <swboyd@chromium.org> Link: https://lkml.kernel.org/r/20190128234625.78241-2-mka@chromium.org
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 c1961761311d..1577a2d56e9d 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -56,6 +56,7 @@ void kthread_bind_mask(struct task_struct *k, const struct cpumask *mask);
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_freezable_should_stop(bool *was_frozen);
void *kthread_data(struct task_struct *k);
void *kthread_probe_data(struct task_struct *k);