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

From: Linus Torvalds (torvalds@transmeta.com)
Date: Thu May 04 2000 - 18:35:37 EST


On Thu, 4 May 2000, Alexander Viro wrote:
>
> a) think what we really need to see for zombies. E.g. if we consider
> PF_EXITING as "dead" for maps, mem, fd/*, stat*, cmdline and environ -
> fine, we can get out with that.

I'd prefer an approach something like this:

        lock_task(current);
        fs = current->fs;
        mm = current->mm;
        files = current->files;
        signal = current->signal;
        current->fs = NULL;
        current->mm = NULL;
        current->files = NULL;
        current->signal = NULL;
        unlock_task(current);

        exit_mm(mm);
        exit_fs(fs);
        exit_files(files);
        exit_signal(signal);

At which point you can probably make "lock_task()" a spinlock instead of a
semaphore, which speeds things up and means that you don't have to worry
about scheduling latencies for other CPU's that try to lock the task and
by the time the lock succeeds the task no longer exists at all..

                Linus

-
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:16 EST