summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2005-01-04 05:38:28 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-04 05:38:28 -0800
commit10d6e374ae2e96a43033cf7cf289e0411cf25fe7 (patch)
treefc04ab0c2fbcb6616ae175330ecbbda26aa656fa /include/linux
parent66519f549ae516e7ff2f24a8a5134713411a4a58 (diff)
[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 <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/linux/sched.h3
2 files changed, 3 insertions, 2 deletions
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 */