These will be used in next patches.

Signed-off-by: Kirill Tkhai <[email protected]>
---
 kernel/exit.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index c84f3e4..bb9d165 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -953,6 +953,7 @@ struct wait_opts {
 
        wait_queue_t            child_wait;
        int                     notask_error;
+       rwlock_t                *held_lock;
 };
 
 static inline
@@ -1034,7 +1035,7 @@ static int wait_task_zombie(struct wait_opts *wo, struct 
task_struct *p)
                int why;
 
                get_task_struct(p);
-               read_unlock(&tasklist_lock);
+               read_unlock(wo->held_lock);
                sched_annotate_sleep();
 
                if ((exit_code & 0x7f) == 0) {
@@ -1056,7 +1057,7 @@ static int wait_task_zombie(struct wait_opts *wo, struct 
task_struct *p)
        /*
         * We own this thread, nobody else can reap it.
         */
-       read_unlock(&tasklist_lock);
+       read_unlock(wo->held_lock);
        sched_annotate_sleep();
 
        /*
@@ -1246,7 +1247,7 @@ static int wait_task_stopped(struct wait_opts *wo,
        get_task_struct(p);
        pid = task_pid_vnr(p);
        why = ptrace ? CLD_TRAPPED : CLD_STOPPED;
-       read_unlock(&tasklist_lock);
+       read_unlock(wo->held_lock);
        sched_annotate_sleep();
 
        if (unlikely(wo->wo_flags & WNOWAIT))
@@ -1309,7 +1310,7 @@ static int wait_task_continued(struct wait_opts *wo, 
struct task_struct *p)
 
        pid = task_pid_vnr(p);
        get_task_struct(p);
-       read_unlock(&tasklist_lock);
+       read_unlock(wo->held_lock);
        sched_annotate_sleep();
 
        if (!wo->wo_info) {
@@ -1538,6 +1539,7 @@ static long do_wait(struct wait_opts *wo)
 
        set_current_state(TASK_INTERRUPTIBLE);
        read_lock(&tasklist_lock);
+       wo->held_lock = &tasklist_lock;
        for_each_thread(current, tsk) {
                retval = do_wait_thread(wo, tsk);
                if (retval)



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to