After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 586582 - Disk spindown support
Disk spindown support
Status: RESOLVED OBSOLETE
Product: gnome-power-manager
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-06-22 00:26 UTC by David Zeuthen (not reading bugmail)
Modified: 2020-11-06 20:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Zeuthen (not reading bugmail) 2009-06-22 00:26:20 UTC
Matthew and I've been talking about spinning down disks. I just added the feature to DeviceKit-disks, see

http://cgit.freedesktop.org/DeviceKit/DeviceKit-disks/commit/?id=e24bf4a7522fb1738d37d6b674dc3cab81d078e3

for the commit and API. To verify it's working try something like


 $ devkit-disks --set-spindown-all --spindown-timeout 5

This is very useful in at least two use cases

 - you have a workstation with a bunch of disks and you want to
   conserve power / reduce heat / reduce noise

 - you are using a laptop

The interface to DKD is simple; it's described here

I think the user interface in gpm should be something like a simple check-box

 [ ] Spin down hard disks when possible

and it should be available in both "On AC Power" and in "On Battery Power". Maybe we should default to checking the box in "On Battery Power".

The timeouts should probably be configurable from gconf (and only from gconf) and be different for AC vs battery. For AC, I suggest a timeout of 10 minutes and for battery probably something like a minute. Maybe we can even use some adaptive scheme to figure this out. Matthew?
Comment 1 David Zeuthen (not reading bugmail) 2009-06-22 00:27:56 UTC
Ugh, this is the link to the DeviceKit-disks API

http://cgit.freedesktop.org/DeviceKit/DeviceKit-disks/commit/?id=e24bf4a7522fb1738d37d6b674dc3cab81d078e3
Comment 2 Richard Hughes 2009-06-22 08:03:19 UTC
cookie is a string? In all the other interfaces I've used it's a uint32...

But sure, I can add this to g-p-m, no problem.
Comment 3 Richard Hughes 2009-06-22 10:26:36 UTC
Also, timeout_seconds is a int type, rather than a uint type in the method definition. I'm not sure it makes sense to have negative spindown values.
Comment 4 Richard Hughes 2009-06-22 10:47:05 UTC
commit bdb7a3a8ff8269037e5093fd7dabcfba76f9a3c8
Author: Richard Hughes <richard@hughsie.com>
Date:   Mon Jun 22 11:45:49 2009 +0100

    Add manager policy to change the disk spindown based on timeouts set in GConf

:100644 100644 ca943fe... 1632946... M  src/Makefile.am
:000000 100644 0000000... d8b5d24... A  src/gpm-disks.c
:000000 100644 0000000... f3d4589... A  src/gpm-disks.h
:100644 100644 0806598... 7b5375a... M  src/gpm-manager.c

commit 5829e59a8628aa2ad5a8c9f658ef3444c981bac7
Author: Richard Hughes <richard@hughsie.com>
Date:   Mon Jun 22 11:01:24 2009 +0100

    Add preferences checkboxes for the disk spindown functionality

:100644 100644 47b8352... 35ddd01... M  data/gpm-prefs.ui
:100644 100644 943e600... 5332173... M  src/gpm-prefs-core.c

commit 53b604c0f43bb6c81483ad6b8538c0598508af38
Author: Richard Hughes <richard@hughsie.com>
Date:   Mon Jun 22 11:00:48 2009 +0100

    Add GConf keys for the disk spindown functionality

:100644 100644 4b84e16... d234abd... M  data/gnome-power-manager.schemas.in
:100644 100644 096fa07... 1fb42db... M  src/gpm-common.h
Comment 5 Eloy Paris 2009-07-14 02:01:48 UTC
Hi Richard,

I don't know if you are aware, and I searched the list of open bugs against g-p-m and didn't find anything, so I thought I'd bring this to your attention: something that g-p-m is calling, or g-p-m itself, is apparently calling fsync() when writing data to the files that keep power history. This is causing problems for people that have already configured their hard disks to spindown using non-g-p-m tools, like the laptop-mode-tools suite, and will cause problems once people start to take advantage of the new disk spindown support for g-p-m that you commited recently (via this bug.)

This bug against Ubuntu's g-p-m has a good discussion about the issue and contains links to a bug and a blog entry regarding a similar problem in Firefox:

https://bugs.launchpad.net/bugs/315970

Would you consider this behavior a bug; and if so, would you like to have a bug to track the issue? I'm happy to file one if you think it's necessary.

By the way, regarding #586582 (this bug), what made you change your mind? The g-p-m FAQ mentions that this has been discussed before and was not deemed appropriate for HAL (don't know if that's different from g-p-m): 

http://live.gnome.org/GnomePowerManager/FAQ#head-e6d48e4196eb363908fb71975a5311f11f8dd9e4
Comment 6 Richard Hughes 2009-07-14 07:08:09 UTC
(In reply to comment #5)
> I don't know if you are aware, and I searched the list of open bugs against
> g-p-m and didn't find anything, so I thought I'd bring this to your attention:
> something that g-p-m is calling, or g-p-m itself, is apparently calling fsync()
> when writing data to the files that keep power history.

It should only do that when the system is low on power, if not, please open a new bug and we'll debug there.

> By the way, regarding #586582 (this bug), what made you change your mind? The
> g-p-m FAQ mentions that this has been discussed before and was not deemed
> appropriate for HAL (don't know if that's different from g-p-m): 

Rather than a simple timeout (which is going to be broken and cause damage) we can now just hint DeviceKit-disks to do something sensible, so if we keep waking up, we stop trying to spin down. It's using a more sensible heuristic.

Richard.
Comment 7 André Klapper 2020-11-06 20:14:11 UTC
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old bug reports in Bugzilla which have not seen updates for many years.

If you can still reproduce this issue in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/gnome-power-manager/-/issues/

Thank you for reporting this issue and we are sorry it could not be fixed.