After changing to backports kernel 3.2.0-0.bpo.3-amd64 there is no longer a wake of all drives between issuing reboot
and message Will now restart.
appears, with or without swap being enabled.
Note that the console "end_request I/O error, dev sdb, sector {0, 8, 16, 128, 4096}" error messages are still there when the drives are in standby state.
Update #1
The "Synchronizing SCSI cache before rebooting" issue re-appears in 3.2.0-0.bpo.4-amd64. Although both seem to share the same version of the mpt2sas module:
# modinfo /lib/modules/3.2.0-0.bpo.{3,4}-amd64/kernel/drivers/scsi/mpt2sas/mpt2sas.ko | grep ^version
version: 10.100.00.00
version: 10.100.00.00
Update #2
The issue doesn't seem to be kernel and storage module related. After changing back to kernel 2.6.32-5-amd64, setting all drives to standby, and commanding a reboot, there were no "Synchronizing SCSI cache", no drive spin ups, and therefore no delays.
Update #3
When turning off write cache hdparm -W0 /dev/sd?
and flushing the write cache with sync && sdparm --command=sync /dev/sd? && sleep 1
and finally setting the drive to standby using hdparm -y /dev/sd?
then there is no "Synchronizing SCSI cache" for every drive after running reboot
and seeing output "Mounting root filesystem read-only...done." and "Will now restart." when using:
- Linux debian 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64
- Linux debian 3.2.0-0.bpo.3-amd64 #1 SMP Thu Aug 23 07:41:30 UTC 2012 x86_64
Kernel 3.2.0-0.bpo.4-amd64 is faulty and does "Synchronizing SCSI cache" for every drive on every reboot
.
I think your experiences are very common for the hibernation aka. suspend-to-disk, especially when using a rotating disk.
From the kernel documentation, there is a workaround mentioned which seems to be related to the idea of the link you have posted. If I got it right, this would just empty the swap at once instead of step by step on resume. But it still has to read all the used swap and might take some time.
Q: After resuming, system is paging heavily, leading to very bad
interactivity.
A: Try running
cat /proc/[0-9]/maps | grep / | sed 's:. /:/:' | sort -u | while
read file do test -f "$file" && cat "$file" > /dev/null done
after resume. swapoff -a; swapon -a may also be useful.
What you might want to test is suspend-to-ram or suspend-to-both which is pretty good explained in the Arch Wiki. Basically:
- suspend-to-ram does not power off the computer, but puts it in a power save mode. If battery is depleted the state is lost and might lead to problems
- suspend-to-both is similar to suspend-to-ram but also saves the state into swap, which makes it possible to resume after battery is depleted
Depending on your environment, how the suspend/hibernate method is initiated you can configure this e.g. in XFCE with the xfce4-power-manager GUI.
Best Answer
Everything is well explained in the Wikipedia page you gave.
At this point, the system will manage the swap like you just configured it, BUT if you reboot NOW, your change will be forgotten and the system will work with the default value (assuming 60, meaning than it will start to swap at 40% occupation of RAM).
You have to add the line below in
/etc/sysctl.conf
to keep your change permanently:Hope it’s more clear for you now!