lkml.org 
[lkml]   [1998]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: prev->has_cpu
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/

\
 
 \ /
  Last update: 2005-03-22 13:45    [from the cache]
©2003-2011 Jasper Spaans