I changed my mind :) The problem is general, I am starting to believe
it is better to change kthread_stop().
Probably yes... In that case it makes sense to move PF_FREEZER_SKIP/PF_FROZEN
to the new field as well.
Perhaps we can ignore this problem for now. Freezer is not 100% reliable
anyway. For example,
worker_thread:
for (;;) {
try_to_freeze();
prepare_to_wait();
if (...)
schedule();
finish_wait();
}
This is racy, we can miss freeze_process()->signal_wake_up() if it happens
between try_to_freeze() and prepare_to_wait(). We have to check TIF_FREEZE
before entering schedule() if we want to fix this race.
Should we? I don't know. This will uglify the code, and the probability
of this race is very low.
Oleg.
-