I currently have pm-utils 1.3.0 installed. Looking ahead in the changelog, I saw: Current hooks when switching to battery: [...] - [harddrive] More aggressive harddrive spindown times [...] - [journal-commit, xfs_buffer] Delay ext[34]/ext journal/metadata writeback - [laptop-mode] Delay hard disk writeback times of dirty caches, to avoid spin ups (Later versions may not necessarily enable the harddrive hook, at least in the Debian package.) In general, this seems like a bad idea to do automatically without the user's knowledge; it makes the system far less robust against sudden failures. I haven't worried about losing data due to a system crash (usually self-inflicted due to kernel hacking) in a long time. I don't want to have to start now. But in any case, none of these hooks need to run on a non-rotational device such as an SSD. SSDs can idle very effectively the moment they have no work to do, without a long spin-up/spin-down transition. So, you don't need to make the system less safe to minimize spin-ups on such systems. Delaying "spin-up" on an SSD doesn't actually lead to power savings, but it still increases the risk of data loss. You can detect non-rotational devices by looking at /sys/block/$device/queue/rotational , which will contain a 1 (rotational) or 0 (non-rotational such as an SSD). For instance, on my system: ~$ cat /sys/block/sda/queue/rotational 0 (Note that these files only exist for the top-level devices like sda, not partition devices like sda1.) So, if you see rotational -eq 0 on a device, you shouldn't run the harddrive, journal-commit, xfs_buffer, or laptop-mode hooks for the filesystems on that device. (I'd argue more generally against running those hooks on *any* device, but this seems like the right place to start, and it solves my immediate problem. :) ) Originally reported as http://bugs.debian.org/612950 .
Created attachment 45967 [details] [review] Patch to disable spinup-avoidance hooks if no rotational devices present I've attached a patch implementing this request; with this patch, the spinup-avoidance hooks exit $NA if the system has no rotational disks.
Agreed. SSDs will use no additional power if you write right away.
(In reply to comment #1) > Created an attachment (id=45967) [details] > Patch to disable spinup-avoidance hooks if no rotational devices present > > I've attached a patch implementing this request; with this patch, the > spinup-avoidance hooks exit $NA if the system has no rotational disks. On my system the dm-crypt device always reports rotational: dm-0/queue/rotational:1 dm-1/queue/rotational:1 sda/queue/rotational:0
On Tue, Jun 21, 2011 at 06:35:18PM -0700, bugzilla-daemon@freedesktop.org wrote: > https://bugs.freedesktop.org/show_bug.cgi?id=34936 > > --- Comment #3 from Kan-Ru Chen <kanru@kanru.info> 2011-06-21 18:35:18 PDT --- > (In reply to comment #1) > > Created an attachment (id=45967) > View: https://bugs.freedesktop.org/attachment.cgi?id=45967 > Review: https://bugs.freedesktop.org/review?bug=34936&attachment=45967 > > > Patch to disable spinup-avoidance hooks if no rotational devices present > > > > I've attached a patch implementing this request; with this patch, the > > spinup-avoidance hooks exit $NA if the system has no rotational disks. > > On my system the dm-crypt device always reports rotational: > > dm-0/queue/rotational:1 > dm-1/queue/rotational:1 > sda/queue/rotational:0 Same here, on 2.6.39. That seems like a kernel bug; dm devices should inherit the rotational property from the device(s) that contain them. - Josh Triplett
pm-utils hasn't been touched in eight years, none of this is likely to get addressed. Closing bugs and disabling the bz product.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.