aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kthread.c
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>2025-08-07 09:55:19 +0200
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2025-08-07 09:55:19 +0200
commit0074281bb6316108e0cff094bd4db78ab3eee236 (patch)
tree9b5eeb12eed9fd2a8aa329043da7f5150ceb938c /kernel/kthread.c
parentgpio: mlxbf2: use platform_get_irq_optional() (diff)
parentMerge tag 'input-for-v6.17-rc0' of git://git.kernel.org/pub/scm/linux/kernel/... (diff)
downloadlinux-0074281bb6316108e0cff094bd4db78ab3eee236.tar.gz
linux-0074281bb6316108e0cff094bd4db78ab3eee236.zip
Merge commit '6e64f4580381e32c06ee146ca807c555b8f73e24' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into gpio/for-next
Diffstat (limited to 'kernel/kthread.c')
-rw-r--r--kernel/kthread.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 85fc068f0083..0e98b228a8ef 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -88,13 +88,12 @@ static inline struct kthread *to_kthread(struct task_struct *k)
/*
* Variant of to_kthread() that doesn't assume @p is a kthread.
*
- * Per construction; when:
+ * When "(p->flags & PF_KTHREAD)" is set the task is a kthread and will
+ * always remain a kthread. For kthreads p->worker_private always
+ * points to a struct kthread. For tasks that are not kthreads
+ * p->worker_private is used to point to other things.
*
- * (p->flags & PF_KTHREAD) && p->worker_private
- *
- * the task is both a kthread and struct kthread is persistent. However
- * PF_KTHREAD on it's own is not, kernel_thread() can exec() (See umh.c and
- * begin_new_exec()).
+ * Return NULL for any task that is not a kthread.
*/
static inline struct kthread *__to_kthread(struct task_struct *p)
{