diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-24 08:41:41 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-06-24 13:07:53 -0400 |
commit | 816724e65c72a90a44fbad0ef0b59b186c85fa90 (patch) | |
tree | 421fa29aedff988e392f92780637553e275d37a0 /Documentation/power/swsusp.txt | |
parent | 70ac4385a13f78bc478f26d317511893741b05bd (diff) | |
parent | d384ea691fe4ea8c2dd5b9b8d9042eb181776f18 (diff) |
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Conflicts:
fs/nfs/inode.c
fs/super.c
Fix conflicts between patch 'NFS: Split fs/nfs/inode.c' and patch
'VFS: Permit filesystem to override root dentry on mount'
Diffstat (limited to 'Documentation/power/swsusp.txt')
-rw-r--r-- | Documentation/power/swsusp.txt | 84 |
1 files changed, 66 insertions, 18 deletions
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt index d7814a113ee1..823b2cf6e3dc 100644 --- a/Documentation/power/swsusp.txt +++ b/Documentation/power/swsusp.txt | |||
@@ -18,10 +18,11 @@ Some warnings, first. | |||
18 | * | 18 | * |
19 | * (*) suspend/resume support is needed to make it safe. | 19 | * (*) suspend/resume support is needed to make it safe. |
20 | * | 20 | * |
21 | * If you have any filesystems on USB devices mounted before suspend, | 21 | * If you have any filesystems on USB devices mounted before software suspend, |
22 | * they won't be accessible after resume and you may lose data, as though | 22 | * they won't be accessible after resume and you may lose data, as though |
23 | * you have unplugged the USB devices with mounted filesystems on them | 23 | * you have unplugged the USB devices with mounted filesystems on them; |
24 | * (see the FAQ below for details). | 24 | * see the FAQ below for details. (This is not true for more traditional |
25 | * power states like "standby", which normally don't turn USB off.) | ||
25 | 26 | ||
26 | You need to append resume=/dev/your_swap_partition to kernel command | 27 | You need to append resume=/dev/your_swap_partition to kernel command |
27 | line. Then you suspend by | 28 | line. Then you suspend by |
@@ -204,7 +205,7 @@ Q: There don't seem to be any generally useful behavioral | |||
204 | distinctions between SUSPEND and FREEZE. | 205 | distinctions between SUSPEND and FREEZE. |
205 | 206 | ||
206 | A: Doing SUSPEND when you are asked to do FREEZE is always correct, | 207 | A: Doing SUSPEND when you are asked to do FREEZE is always correct, |
207 | but it may be unneccessarily slow. If you want USB to stay simple, | 208 | but it may be unneccessarily slow. If you want your driver to stay simple, |
208 | slowness may not matter to you. It can always be fixed later. | 209 | slowness may not matter to you. It can always be fixed later. |
209 | 210 | ||
210 | For devices like disk it does matter, you do not want to spindown for | 211 | For devices like disk it does matter, you do not want to spindown for |
@@ -349,25 +350,72 @@ Q: How do I make suspend more verbose? | |||
349 | 350 | ||
350 | A: If you want to see any non-error kernel messages on the virtual | 351 | A: If you want to see any non-error kernel messages on the virtual |
351 | terminal the kernel switches to during suspend, you have to set the | 352 | terminal the kernel switches to during suspend, you have to set the |
352 | kernel console loglevel to at least 5, for example by doing | 353 | kernel console loglevel to at least 4 (KERN_WARNING), for example by |
353 | 354 | doing | |
354 | echo 5 > /proc/sys/kernel/printk | 355 | |
356 | # save the old loglevel | ||
357 | read LOGLEVEL DUMMY < /proc/sys/kernel/printk | ||
358 | # set the loglevel so we see the progress bar. | ||
359 | # if the level is higher than needed, we leave it alone. | ||
360 | if [ $LOGLEVEL -lt 5 ]; then | ||
361 | echo 5 > /proc/sys/kernel/printk | ||
362 | fi | ||
363 | |||
364 | IMG_SZ=0 | ||
365 | read IMG_SZ < /sys/power/image_size | ||
366 | echo -n disk > /sys/power/state | ||
367 | RET=$? | ||
368 | # | ||
369 | # the logic here is: | ||
370 | # if image_size > 0 (without kernel support, IMG_SZ will be zero), | ||
371 | # then try again with image_size set to zero. | ||
372 | if [ $RET -ne 0 -a $IMG_SZ -ne 0 ]; then # try again with minimal image size | ||
373 | echo 0 > /sys/power/image_size | ||
374 | echo -n disk > /sys/power/state | ||
375 | RET=$? | ||
376 | fi | ||
377 | |||
378 | # restore previous loglevel | ||
379 | echo $LOGLEVEL > /proc/sys/kernel/printk | ||
380 | exit $RET | ||
355 | 381 | ||
356 | Q: Is this true that if I have a mounted filesystem on a USB device and | 382 | Q: Is this true that if I have a mounted filesystem on a USB device and |
357 | I suspend to disk, I can lose data unless the filesystem has been mounted | 383 | I suspend to disk, I can lose data unless the filesystem has been mounted |
358 | with "sync"? | 384 | with "sync"? |
359 | 385 | ||
360 | A: That's right. It depends on your hardware, and it could be true even for | 386 | A: That's right ... if you disconnect that device, you may lose data. |
361 | suspend-to-RAM. In fact, even with "-o sync" you can lose data if your | 387 | In fact, even with "-o sync" you can lose data if your programs have |
362 | programs have information in buffers they haven't written out to disk. | 388 | information in buffers they haven't written out to a disk you disconnect, |
389 | or if you disconnect before the device finished saving data you wrote. | ||
363 | 390 | ||
364 | If you're lucky, your hardware will support low-power modes for USB | 391 | Software suspend normally powers down USB controllers, which is equivalent |
365 | controllers while the system is asleep. Lots of hardware doesn't, | 392 | to disconnecting all USB devices attached to your system. |
366 | however. Shutting off the power to a USB controller is equivalent to | ||
367 | unplugging all the attached devices. | ||
368 | 393 | ||
369 | Remember that it's always a bad idea to unplug a disk drive containing a | 394 | Your system might well support low-power modes for its USB controllers |
370 | mounted filesystem. With USB that's true even when your system is asleep! | 395 | while the system is asleep, maintaining the connection, using true sleep |
371 | The safest thing is to unmount all USB-based filesystems before suspending | 396 | modes like "suspend-to-RAM" or "standby". (Don't write "disk" to the |
372 | and remount them after resuming. | 397 | /sys/power/state file; write "standby" or "mem".) We've not seen any |
398 | hardware that can use these modes through software suspend, although in | ||
399 | theory some systems might support "platform" or "firmware" modes that | ||
400 | won't break the USB connections. | ||
373 | 401 | ||
402 | Remember that it's always a bad idea to unplug a disk drive containing a | ||
403 | mounted filesystem. That's true even when your system is asleep! The | ||
404 | safest thing is to unmount all filesystems on removable media (such USB, | ||
405 | Firewire, CompactFlash, MMC, external SATA, or even IDE hotplug bays) | ||
406 | before suspending; then remount them after resuming. | ||
407 | |||
408 | Q: I upgraded the kernel from 2.6.15 to 2.6.16. Both kernels were | ||
409 | compiled with the similar configuration files. Anyway I found that | ||
410 | suspend to disk (and resume) is much slower on 2.6.16 compared to | ||
411 | 2.6.15. Any idea for why that might happen or how can I speed it up? | ||
412 | |||
413 | A: This is because the size of the suspend image is now greater than | ||
414 | for 2.6.15 (by saving more data we can get more responsive system | ||
415 | after resume). | ||
416 | |||
417 | There's the /sys/power/image_size knob that controls the size of the | ||
418 | image. If you set it to 0 (eg. by echo 0 > /sys/power/image_size as | ||
419 | root), the 2.6.15 behavior should be restored. If it is still too | ||
420 | slow, take a look at suspend.sf.net -- userland suspend is faster and | ||
421 | supports LZF compression to speed it up further. | ||