From: Oleg Nesterov Date: Wed, 20 Aug 2008 23:54:44 +0000 (-0700) Subject: wait_task_inactive(): don't consider task->nivcsw X-Git-Tag: v2.6.28-rc1~725^2~2^2~26 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f31e11d87a5d7601636710195891ba462ad99f11;p=pandora-kernel.git wait_task_inactive(): don't consider task->nivcsw If wait_task_inactive() returns success the task was deactivated. In that case schedule() always increments ->nvcsw which alone can be used as a "generation counter". If the next call returns the same number, we can be sure that the task was unscheduled. Otherwise, because we know that .on_rq == 0 again, ->nvcsw should have been changed in between. Q: perhaps it is better to do "ncsw = (p->nvcsw << 1) | 1" ? This decreases the possibility of "was it unscheduled" false positive when ->nvcsw == 0. Signed-off-by: Oleg Nesterov Signed-off-by: Andrew Morton Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed