| Date | Tue, 31 Jul 2012 21:12:05 +0200 | From | Peter Zijlstra <> | Subject | [PATCH 01/19] task_work: Remove dependency on sched.h |
| |
Remove the need for sched.h from task_work.h so that we can use struct task_work in struct task_struct in a later patch.
Cc: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> --- include/linux/task_work.h | 7 ------- kernel/exit.c | 5 ++++- 2 files changed, 4 insertions(+), 8 deletions(-) --- a/include/linux/task_work.h +++ b/include/linux/task_work.h @@ -2,7 +2,6 @@ #define _LINUX_TASK_WORK_H #include <linux/list.h> -#include <linux/sched.h> typedef void (*task_work_func_t)(struct callback_head *); @@ -16,10 +15,4 @@ int task_work_add(struct task_struct *ta struct callback_head *task_work_cancel(struct task_struct *, task_work_func_t); void task_work_run(void); -static inline void exit_task_work(struct task_struct *task) -{ - if (unlikely(task->task_works)) - task_work_run(); -} - #endif /* _LINUX_TASK_WORK_H */ --- a/kernel/exit.c +++ b/kernel/exit.c @@ -992,7 +992,10 @@ void do_exit(long code) exit_shm(tsk); exit_files(tsk); exit_fs(tsk); - exit_task_work(tsk); + + if (unlikely(tsk->task_works)) + task_work_run(); + check_stack_usage(); exit_thread();
|