diff options
| author | Oleg Nesterov <[email protected]> | 2016-11-29 18:50:57 +0100 |
|---|---|---|
| committer | Thomas Gleixner <[email protected]> | 2016-12-08 14:36:18 +0100 |
| commit | 1da5c46fa965ff90f5ffc080b6ab3fae5e227bc3 (patch) | |
| tree | 907dd44b43d3cf5f49be920c46a5592364bcb1e8 /include/linux | |
| parent | 7c4788950ba5922fde976d80b72baf46f14dee8d (diff) | |
kthread: Make struct kthread kmalloc'ed
commit 23196f2e5f5d "kthread: Pin the stack via try_get_task_stack() /
put_task_stack() in to_live_kthread() function" is a workaround for the
fragile design of struct kthread being allocated on the task stack.
struct kthread in its current form should be removed, but this needs
cleanups outside of kthread.c.
As a first step move struct kthread away from the task stack by making it
kmalloc'ed. This allows to access kthread.exited without the magic of
trying to pin task stack and the try logic in to_live_kthread().
Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Cc: Chunming Zhou <[email protected]>
Cc: Roman Pen <[email protected]>
Cc: Petr Mladek <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: Andrew Morton <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/kthread.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index a6e82a69c363..c1c3e63d52c1 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h @@ -48,6 +48,7 @@ struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data), __k; \ }) +void free_kthread_struct(struct task_struct *k); void kthread_bind(struct task_struct *k, unsigned int cpu); void kthread_bind_mask(struct task_struct *k, const struct cpumask *mask); int kthread_stop(struct task_struct *k); |