If "next == prev", then there _is_ no other task.
> >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.
No, "current->has_cpu" is _always_ 1 (except inside the scheduler itself,
when it can temporarily drop down to zero while we hold the scheduler
lock). The only case "next == prev" happens is when "current == next ==
prev".
"has_cpu" essentially means that it is actually physcially running on some
CPU.
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/