Re: why is p->state = TASK_UNINTERRUPTIBLE in do_fork()?

From: Tigran Aivazian (tigran@veritas.com)
Date: Tue Jun 20 2000 - 09:13:45 EST


On Tue, 20 Jun 2000, Linus Torvalds wrote:

> In article <Pine.LNX.4.21.0006200954010.1564-100000@saturn.homenet>,
> Tigran Aivazian <tigran@veritas.com> wrote:
> >
> >why is the process set to uninterruptible sleep for the short
> >(atomic) duration until it is set to TASK_RUNNING? I see no reason for
> >that.
>
> Entirely due to hysterical raisins.
>
> The thing is, that Linux originally had no run-queue: it just scanned
> the global task array when it needed to schedule something. Shoot me.
>
> And that task array slot was allocated early in fork.c for the new
> process to avoid races, and in order to make sure that schedule()
> ignored the new half-formed process, it needed to be marked
> non-runnable.
>
> Then, when everything was ready, we marked it runnable again.
>
> These days, of course, the run-queue makes this all a non-issue. The
> assignment still exists, and probably causes an extra instruction. You
> can remove it if you want,
>
> Linus

It is great to hear you are back, Linus!

Ok, it is nice to know that my observation wasn't misguided so I sent a
patch to Alan together with some other cleanups in kernel/fork.c - it is
not important, I will wait until you and Alan are synchronised and then
send a few more pieces.

Thanks for answering my question.

regards,
Tigran

-
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 : Fri Jun 23 2000 - 21:00:19 EST