lkml.org 
[lkml]   [2012]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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();




\
 
 \ /
  Last update: 2012-08-01 10:41    [W:0.286 / U:0.876 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site