Messages in this thread | | | Date | Tue, 13 Mar 2007 11:12:41 +0530 | From | Srivatsa Vaddagiri <> | Subject | Re: [PATCH] kthread_should_stop_check_freeze (was: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread) |
| |
On Tue, Mar 13, 2007 at 10:57:16AM +0530, Gautham R Shenoy wrote: > CPU_DEAD: > thaw_process(p); > kthread_stop(p); > p = NULL;
This neednt guarantee that the thread will see the stop request before it exits the kthread_should_stop_freeze() function. There will always be races .. So the only safe way for a thread to know whether it is time to exit is:
while (!kthread_should_stop_freeze()) { if (!cpu_online(home_cpu)) goto wait_to_die;
...
}
wait_to_die:
while (!kthread_should_stop()) { /* sleep */ }
-- Regards, vatsa - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |