Upon entering a suspended state the system will freeze all
tasks. This is done by delivering pseudosignals. This affects
kernel threads, too. To successfully freeze a kernel thread
the thread has to check for the pseudosignal and enter the
refrigerator. Code to do this looks like this:
if (current->flags & PF_FREEZE)
} while (!signal_pending(current));
Some kernel threads however, must not be frozen. The kernel must
be able to finish pending IO operations and later on be able to
write the memory image to disk. Kernel threads needed to do IO
must stay awake. Such threads must mark themselves unfreezable
* This thread doesn't need any user-level access,
* so get rid of all our resources.
current->flags |= PF_NOFREEZE;
Such drivers are themselves responsible for staying quiet during
the actual snapshotting.