aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2009-09-23 18:56:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-24 10:20:59 -0400
commita2322e1d272938d192d8c24cdacf57c0c7a2683f (patch)
treef53bbed32d44a190df42cddc9f3635371272e329
parenta7f0765edfd53aed09cb7b0e15863688b39447de (diff)
do_wait() wakeup optimization: shift security_task_wait() from eligible_child() to wait_consider_task()
Preparation, no functional changes. eligible_child() has a single caller, wait_consider_task(). We can move security_task_wait() out from eligible_child(), this allows us to use it for filtered wake_up(). Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Roland McGrath <roland@redhat.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Ratan Nalumasu <rnalumasu@gmail.com> Cc: Vitaly Mayatskikh <vmayatsk@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/exit.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 782b2e1f7ca2..ef2dfa818bf1 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1112,8 +1112,6 @@ static struct pid *task_pid_type(struct task_struct *task, enum pid_type type)
1112 1112
1113static int eligible_child(struct wait_opts *wo, struct task_struct *p) 1113static int eligible_child(struct wait_opts *wo, struct task_struct *p)
1114{ 1114{
1115 int err;
1116
1117 if (wo->wo_type < PIDTYPE_MAX) { 1115 if (wo->wo_type < PIDTYPE_MAX) {
1118 if (task_pid_type(p, wo->wo_type) != wo->wo_pid) 1116 if (task_pid_type(p, wo->wo_type) != wo->wo_pid)
1119 return 0; 1117 return 0;
@@ -1128,10 +1126,6 @@ static int eligible_child(struct wait_opts *wo, struct task_struct *p)
1128 && !(wo->wo_flags & __WALL)) 1126 && !(wo->wo_flags & __WALL))
1129 return 0; 1127 return 0;
1130 1128
1131 err = security_task_wait(p);
1132 if (err)
1133 return err;
1134
1135 return 1; 1129 return 1;
1136} 1130}
1137 1131
@@ -1492,6 +1486,7 @@ static int wait_consider_task(struct wait_opts *wo, struct task_struct *parent,
1492 if (!ret) 1486 if (!ret)
1493 return ret; 1487 return ret;
1494 1488
1489 ret = security_task_wait(p);
1495 if (unlikely(ret < 0)) { 1490 if (unlikely(ret < 0)) {
1496 /* 1491 /*
1497 * If we have not yet seen any eligible child, 1492 * If we have not yet seen any eligible child,