summaryrefslogtreecommitdiff
path: root/include/linux/kthread.h
diff options
context:
space:
mode:
authorLeon Romanovsky <leon@kernel.org>2026-03-30 12:02:58 +0300
committerLeon Romanovsky <leon@kernel.org>2026-03-30 20:47:44 +0300
commite6fd2491789745ed8c3df86a660dfa7207129d22 (patch)
tree62d79e06a87f78a9949c1e695386dec2ad0fcf22 /include/linux/kthread.h
parentadc09d7fbbb9d286057c98675994c445d81c27fa (diff)
parent7aaa8047eafd0bd628065b15757d9b48c5f9c07d (diff)
downloadlinux-e6fd2491789745ed8c3df86a660dfa7207129d22.tar.xz
Merge branch 'master' into rdma-next
Let's bring v7.0-rc6 to the -next branch, so we can merge the DMA attributes fix [1] without merge conflicts. [1] https://lore.kernel.org/all/20260323-umem-dma-attrs-v1-1-d6890f2e6a1e@nvidia.com Signed-off-by: Leon Romanovsky <leon@kernel.org> * master: (1688 commits) Linux 7.0-rc6 ...
Diffstat (limited to 'include/linux/kthread.h')
-rw-r--r--include/linux/kthread.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index c92c1149ee6e..a01a474719a7 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -7,6 +7,24 @@
struct mm_struct;
+/* opaque kthread data */
+struct kthread;
+
+/*
+ * 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.
+ *
+ * Return NULL for any task that is not a kthread.
+ */
+static inline struct kthread *tsk_is_kthread(struct task_struct *p)
+{
+ if (p->flags & PF_KTHREAD)
+ return p->worker_private;
+ return NULL;
+}
+
__printf(4, 5)
struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
void *data,
@@ -98,9 +116,10 @@ void *kthread_probe_data(struct task_struct *k);
int kthread_park(struct task_struct *k);
void kthread_unpark(struct task_struct *k);
void kthread_parkme(void);
-void kthread_exit(long result) __noreturn;
+#define kthread_exit(result) do_exit(result)
void kthread_complete_and_exit(struct completion *, long) __noreturn;
int kthreads_update_housekeeping(void);
+void kthread_do_exit(struct kthread *, long);
int kthreadd(void *unused);
extern struct task_struct *kthreadd_task;