[PATCH] USB: fix show_modalias() function due to attribute change
[deliverable/linux.git] / Documentation / power / kernel_threads.txt
CommitLineData
1da177e4
LT
1KERNEL THREADS
2
3
4Freezer
5
6Upon entering a suspended state the system will freeze all
7tasks. This is done by delivering pseudosignals. This affects
8kernel threads, too. To successfully freeze a kernel thread
9the thread has to check for the pseudosignal and enter the
10refrigerator. Code to do this looks like this:
11
12 do {
13 hub_events();
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));
18
19from drivers/usb/core/hub.c::hub_thread()
20
21
22The Unfreezable
23
24Some kernel threads however, must not be frozen. The kernel must
25be able to finish pending IO operations and later on be able to
26write the memory image to disk. Kernel threads needed to do IO
27must stay awake. Such threads must mark themselves unfreezable
28like this:
29
30 /*
31 * This thread doesn't need any user-level access,
32 * so get rid of all our resources.
33 */
34 daemonize("usb-storage");
35
36 current->flags |= PF_NOFREEZE;
37
38from drivers/usb/storage/usb.c::usb_stor_control_thread()
39
40Such drivers are themselves responsible for staying quiet during
41the actual snapshotting.
This page took 0.054971 seconds and 5 git commands to generate.