Hi Justin,
On 01-10-18 16:14, Justin Forbes wrote:
On Sun, Sep 30, 2018 at 1:52 PM, Hans de Goede hdegoede@redhat.com wrote:
Hello Fedora kernel team,
On the Fedora desktop list there has been a discussion about systemd now offering a new suspend-then-hibernate option and gnome-settings-daemon's media-keys plugin using this when the power-button gets pressed and systemd saying this is available on the system.
What this does is suspend the system normally and set a RTC wakeup 3 hours in the future, then when the RTC wake happens it hibernates the system.
As discussed on the desktop list this is not really desirable as default behavior for F29 (and later) since the hibernate code is not really something which gets used enough to be well tested and is really not something which we can support.
So after that the discussion has gone in the direction of how to disable the new suspend-then-hibernate behavior.
Lennart made a really interesting observation here, systemd is just proxying if "cat /sys/power/disk" indicates that hibernate is supported.
No, that is not what systemd is doing. The kernel provides a mechanism, it does absolutely nothing with that mechanism unless told to do so. What systemd is actually doing is creating a policy around that mechanism.
systemd is really *not* creating policy here, it has a DBUS API call called CanHibernate which really just proxies what the kernel advertises.
What is new is that GNOME (g-s-d) now uses it be default through by choosing suspend-then-hibernate as suspend action when hibernation is available.
So if we really don't want to support hibernation as a normal option, while still allowing adventurous user to use it, what really should happen is for the kernel to stop advertising hibernate support. Thinking about this I agree, if we say that we cannot support it, the kernel really should not be advertising support for it by default.
"We have decided that the policy created is not desirable, so we want to disable the mechanism"
Default to off is a different thing then disabling this.
TBH I'm a bit surprised about your objections against this:
1) We all seem to agree that this is something which may or may not work, but is not something which we want to advertise as a "supported" Fedora feature
2) Given 1) we also all agree that we should not use it by default
3) If we should not use it by default then shouldn't the feature default to off ? That is all what is being suggested, basically the equivalent of adding "nohibernate" to the kernel commandline by default.
I expect the kernel changes for this to be about 3 lines of actual code (+a 15 lines or so Kconfig addition) and I expect this to go upstream without much issues as this seems like an entirely reasonable thing to do.
Reading further along the discussion you say that if this were a new feature you would likely agree to defaulting it to off. But since this has been there for years we should not change it ? That seems like a weak argument to me, we have always been doing this in a sub-optimal way so lets continue doing this in a sub-optimal way ?
I agree that we should not change it in the middle of a Fedora cycle. Hence I wrote:
Against:
Currently we do have some users using hibernation without adding any options to the kernel commandline. These users will have to now add "hibernate=yes" to their kernel commandline.
I'm thinking that yes we want this, but maybe this needs to go through the change process for proper communication, so for F29 we need another fix, and we can do this for F30?
I believe that if we put this through the change process, we can make sure that we properly communicate the need to add "hinernate=yes" to the kernel commandline for people who use it and want to keep using it.
I also expect this to, if anything, lower the load for the Fedora kernel team, since it avoids users enabling hibernation without really knowing what they are doing and then filing bugs as a result of this. E.g.: * ATM in F28 hibernation is a simple click in gnome-tweaks away. * Even if we revert the GNOME change which triggered this discussion many other DEs will still advertise hibernate support in some way.
Can you please elaborate a bit on your objections against this?
Regards,
Hans