The patch titled wait_task_inactive(): don't consider task->nivcsw has been removed from the -mm tree. Its filename was wait_task_inactive-dont-consider-task-nivcsw.patch This patch was dropped because an alternative patch was merged The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: wait_task_inactive(): don't consider task->nivcsw From: Oleg Nesterov <oleg@xxxxxxxxxx> 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 <oleg@xxxxxxxxxx> Cc: Roland McGrath <roland@xxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/sched.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff -puN kernel/sched.c~wait_task_inactive-dont-consider-task-nivcsw kernel/sched.c --- a/kernel/sched.c~wait_task_inactive-dont-consider-task-nivcsw +++ a/kernel/sched.c @@ -1925,11 +1925,8 @@ unsigned long wait_task_inactive(struct running = task_running(rq, p); on_rq = p->se.on_rq; ncsw = 0; - if (!match_state || p->state == match_state) { - ncsw = p->nivcsw + p->nvcsw; - if (unlikely(!ncsw)) - ncsw = 1; - } + if (!match_state || p->state == match_state) + ncsw = p->nvcsw ?: 1; task_rq_unlock(rq, &flags); /* _ Patches currently in -mm which might be from oleg@xxxxxxxxxx are linux-next.patch posix-timers-dont-switch-to-group_leader-if-it_process-dies.patch posix-timers-always-do-get_task_structtimer-it_process.patch posix-timers-sys_timer_create-remove-the-buggy-pf_exiting-check.patch posix-timers-sys_timer_create-simplify-and-s-tasklist-rcu.patch posix-timers-move-the-initialization-of-timer-sigq-from-send-to-create-path.patch posix-timers-sys_timer_create-cleanup-the-error-handling.patch posix-timers-kill-it_sigev_signo-and-it_sigev_value.patch posix-timers-lock_timer-kill-the-bogus-it_id-check.patch posix-timers-lock_timer-make-it-readable.patch wait_task_inactive-dont-consider-task-nivcsw.patch wait_task_inactive-improve-the-returned-value-for-nvcsw-==-0.patch posix-timers-use-struct-pid-instead-of-struct-task_struct.patch posix-timers-check-it_signal-instead-of-it_pid-to-validate-the-timer.patch posix-timers-simplify-de_thread-exit_itimers-path.patch make-ptrace_untrace-static.patch coredump-format_corename-dont-append-%pid-if-multi-threaded.patch kthread_bind-use-wait_task_inactivetask_uninterruptible.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html