Re: prev->has_cpu

Andrea Arcangeli (andrea@e-mind.com)
Fri, 13 Nov 1998 23:50:01 +0100 (CET)


On Fri, 13 Nov 1998, Linus Torvalds wrote:

>one. That always works - even if next == prev, in which case it doesn't

If next == prev we don' t switch_to() another task. But the other task
(not going to be scheduled yet) will just have next->has_cpu == 1 even if
will not run soon. I think _only_ running (currents) tasks should have
->has_cpu == 1.

>actually do anything. I don't see the problem: schedule() is always
>guaranteed to be entered with "current->has_cpu == 1" (because otherwise
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Where? I can' t find such piece of code. I think instead that if `prev ==
next', we' ll exit from the scheule() without changing the current process
and with current->has_cpu == 0.

>it couldn't have scheduled in the first place) and schedule() will always
>exit with "current->has_cpu" still set to one (except "current" can be
>different).

I think that right now (without my patch) we exit from schedule() with
current->has_cpu == 1 _only_ if prev != next...

>I guess I still don't see what your worry is.

Eventually I am not understanding very well the scheduler :-). In such
case excuse me.

Andrea Arcangeli

-
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/