From 10d6e374ae2e96a43033cf7cf289e0411cf25fe7 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 4 Jan 2005 05:38:28 -0800 Subject: [PATCH] move waitchld_exit from task_struct to signal_struct There is really no point in each task_struct having its own waitchld_exit. In the only use of it, the waitchld_exit of each thread in a group gets woken up at the same time. So, there might as well just be one wait queue for the whole thread group. This patch does that by moving the field from task_struct to signal_struct. It should have no effect on the behavior, but saves a little work and a little storage in the multithreaded case. Signed-off-by: Roland McGrath Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/init_task.h | 2 +- include/linux/sched.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 803d8efb1c4a..714a678fc6c4 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -46,6 +46,7 @@ #define INIT_SIGNALS(sig) { \ .count = ATOMIC_INIT(1), \ + .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ .shared_pending = { \ .list = LIST_HEAD_INIT(sig.shared_pending.list), \ .signal = {{0}}}, \ @@ -88,7 +89,6 @@ extern struct group_info init_groups; .children = LIST_HEAD_INIT(tsk.children), \ .sibling = LIST_HEAD_INIT(tsk.sibling), \ .group_leader = &tsk, \ - .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(tsk.wait_chldexit),\ .real_timer = { \ .function = it_real_fn \ }, \ diff --git a/include/linux/sched.h b/include/linux/sched.h index 3971c27b47e1..fe3e325923a1 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -274,6 +274,8 @@ struct signal_struct { atomic_t count; atomic_t live; + wait_queue_head_t wait_chldexit; /* for wait4() */ + /* current thread group signal load-balancing target: */ task_t *curr_target; @@ -586,7 +588,6 @@ struct task_struct { /* PID/PID hash table linkage. */ struct pid pids[PIDTYPE_MAX]; - wait_queue_head_t wait_chldexit; /* for wait4() */ struct completion *vfork_done; /* for vfork() */ int __user *set_child_tid; /* CLONE_CHILD_SETTID */ int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */ -- cgit v1.2.3