aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2012-05-10 20:59:08 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-23 22:11:12 -0400
commit4d1d61a6b203d957777d73fcebf19d90b038b5b2 (patch)
tree8b597fa00168ee59e3abf5ec8cf4e92f8fd28d8a /include/linux
parente73f8959af0439d114847eab5a8a5ce48f1217c4 (diff)
genirq: reimplement exit_irq_thread() hook via task_work_add()
exit_irq_thread() and task->irq_thread are needed to handle the unexpected (and unlikely) exit of irq-thread. We can use task_work instead and make this all private to kernel/irq/manage.c, cleanup plus micro-optimization. 1. rename exit_irq_thread() to irq_thread_dtor(), make it static, and move it up before irq_thread(). 2. change irq_thread() to do task_work_add(irq_thread_dtor) at the start and task_work_cancel() before return. tracehook_notify_resume() can never play with kthreads, only do_exit()->exit_task_work() can call the callback and this is what we want. 3. remove task_struct->irq_thread and the special hook in do_exit(). Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Cc: David Howells <dhowells@redhat.com> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Alexander Gordeev <agordeev@redhat.com> Cc: Chris Zankel <chris@zankel.net> Cc: David Smith <dsmith@redhat.com> Cc: "Frank Ch. Eigler" <fche@redhat.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Larry Woodman <lwoodman@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/interrupt.h4
-rw-r--r--include/linux/sched.h10
2 files changed, 2 insertions, 12 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index c91171599cb6..e68a8e53bb59 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -142,8 +142,6 @@ request_any_context_irq(unsigned int irq, irq_handler_t handler,
142extern int __must_check 142extern int __must_check
143request_percpu_irq(unsigned int irq, irq_handler_t handler, 143request_percpu_irq(unsigned int irq, irq_handler_t handler,
144 const char *devname, void __percpu *percpu_dev_id); 144 const char *devname, void __percpu *percpu_dev_id);
145
146extern void exit_irq_thread(void);
147#else 145#else
148 146
149extern int __must_check 147extern int __must_check
@@ -177,8 +175,6 @@ request_percpu_irq(unsigned int irq, irq_handler_t handler,
177{ 175{
178 return request_irq(irq, handler, 0, devname, percpu_dev_id); 176 return request_irq(irq, handler, 0, devname, percpu_dev_id);
179} 177}
180
181static inline void exit_irq_thread(void) { }
182#endif 178#endif
183 179
184extern void free_irq(unsigned int, void *); 180extern void free_irq(unsigned int, void *);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 7930131abc1a..da013853a622 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1301,11 +1301,6 @@ struct task_struct {
1301 unsigned sched_reset_on_fork:1; 1301 unsigned sched_reset_on_fork:1;
1302 unsigned sched_contributes_to_load:1; 1302 unsigned sched_contributes_to_load:1;
1303 1303
1304#ifdef CONFIG_GENERIC_HARDIRQS
1305 /* IRQ handler threads */
1306 unsigned irq_thread:1;
1307#endif
1308
1309 pid_t pid; 1304 pid_t pid;
1310 pid_t tgid; 1305 pid_t tgid;
1311 1306
@@ -1313,10 +1308,9 @@ struct task_struct {
1313 /* Canary value for the -fstack-protector gcc feature */ 1308 /* Canary value for the -fstack-protector gcc feature */
1314 unsigned long stack_canary; 1309 unsigned long stack_canary;
1315#endif 1310#endif
1316 1311 /*
1317 /*
1318 * pointers to (original) parent process, youngest child, younger sibling, 1312 * pointers to (original) parent process, youngest child, younger sibling,
1319 * older sibling, respectively. (p->father can be replaced with 1313 * older sibling, respectively. (p->father can be replaced with
1320 * p->real_parent->pid) 1314 * p->real_parent->pid)
1321 */ 1315 */
1322 struct task_struct __rcu *real_parent; /* real parent process */ 1316 struct task_struct __rcu *real_parent; /* real parent process */