6 Upon entering a suspended state the system will freeze all
7 tasks. This is done by delivering pseudosignals. This affects
8 kernel threads, too. To successfully freeze a kernel thread
9 the thread has to check for the pseudosignal and enter the
10 refrigerator. Code to do this looks like this:
14 wait_event_interruptible(khubd_wait, !list_empty(&hub_event_list));
15 if (current->flags & PF_FREEZE)
16 refrigerator(PF_FREEZE);
17 } while (!signal_pending(current));
19 from drivers/usb/core/hub.c::hub_thread()
24 Some kernel threads however, must not be frozen. The kernel must
25 be able to finish pending IO operations and later on be able to
26 write the memory image to disk. Kernel threads needed to do IO
27 must stay awake. Such threads must mark themselves unfreezable
31 * This thread doesn't need any user-level access,
32 * so get rid of all our resources.
34 daemonize("usb-storage");
36 current->flags |= PF_NOFREEZE;
38 from drivers/usb/storage/usb.c::usb_stor_control_thread()
40 Such drivers are themselves responsible for staying quiet during
41 the actual snapshotting.