Re: [maybe fixed.. i hope i hope i hope] Re: snipe hunt

From: David Howells (David.Howells@nexor.co.uk)
Date: Fri May 05 2000 - 03:33:43 EST


Wouldn't something like the following be better:

        FOREACH open_file
        DO
            close(open_file)
        DONE
        FOREACH mapped_mem_segment
        DO
            unmap(mapped_mem_segment)
        DONE
        task_lock(tsk);
        __exit_mm(tsk);
        __exit_files(tsk);
        __exit_fs(tsk);
        __exit_sighand(tsk);
        exit_thread();
        tsk->state = TASK_ZOMBIE;
        tsk->exit_code = code;

So the kernel takes all the long duration steps without the task_lock held,
and then uses the task_lock to wrap the quick steps that actually modify the
task structure itself.

David Howells

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:17 EST