Consider what happens when the exiting process is scheduled for the
last time (when it is still runnable, not when it has changed its state
to zombie). The wmb() in __schedule_tail() should make all CPUs see
that has_cpu=1 for this process. This is before the process becomes a
zombie, so when a process sees that p->state= TASK_ZOMBIE it cannot
have a stale p->has_cpu=0. I don't see the need for a barrier in this
piece of code. It appears to me that
while (p->has_cpu)
;
should be enough.
------
Dimitris Michailidis dimitris@engr.sgi.com
-
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/