##(see the SpecSpec for an explanation) * '''Launchpad Entry''': UbuntuSpec:foundations-lucid-laptop-mode-tools-integration * '''Created''': SteveLangasek * '''Packages affected''': laptop-mode-tools, acpi-support, update-manager * '''Related''': PowerManagement == Summary == The `laptop-mode-tools` package is installed by default, but provides a completely parallel interface for power management that duplicates functionality of `pm-utils` and the rest of the freedesktop.org stack, frequently tripping up users when one of the tools overrides the settings of the other. We should remove `laptop-mode-tools` from the default install, to have only one set of infrastructure in the default system for configuring and applying power management settings. == Release Note == The `laptop-mode-tools` package is no longer installed by default on the desktop in Ubuntu 10.04 LTS. Upgrading to 10.04 LTS with `update-manager` or `do-release-upgrade` will have the package automatically removed; users who upgrade manually with `apt-get` or other tools are advised to remove this package manually with `sudo apt-get purge laptop-mode-tools`. Users who wish to continue using laptop-mode-tools to administer their power management settings may reinstall the package from the Ubuntu universe repository. == Rationale == The `laptop-mode-tools` package provides a completely parallel mechanism for configuring power management, duplicating most of the functionality already provided by the fd.o stack in the `pm-utils` package and packages that hook into it, such as `hdparm`. Although it provides tweaks for many aspects of power management that aren't currently supported in `pm-utils`, having two separate configuration mechanisms for the same functionality is inappropriate and results in confusing behavior when one setting overrides the other. == User stories == * Fred has an oddball hard drive that locks up when using the default apm setting of '128'. He edits `/etc/hdparm.conf` to set `apm_battery=254` instead, so that he can use his system on battery without it crashing. * Mary knows that enabling the kernel's `laptop_mode` on her laptop is safe (because she uses ext3) and will extend her battery life by 20%. She installs the `laptop-mode-tools` package for this purpose, and expects this to automatically turn on `laptop_mode` when she's running on battery. == Assumptions == The `pm-utils` package, as part of the freedesktop.org stack, is the correct infrastructure to standardize on for power management options. == Implementation == * The `hdparm` and `pm-utils` packages already coordinate setting the hard drive APM value. The other features that are active by default when `laptop-mode-tools` is enabled are: * enabling kernel `laptop_mode` when on battery. This should not be implemented by default; according to Ted T'so, this causes adverse interactions with ext4 filesystems, which we use by default. * setting the disk readahead value. The value used in `laptop-mode-tools` is arbitrary, based on one user's experience with the size of typical mp3 files; this should not be implemented by default without more research. * setting the idle timeout for hard drives. This setting is, however, disabled when battery level is critical, which we don't have a way to emulate currently with pm-utils, so we should forego setting this by default currently. * remounting ext3, ext4 filesystems with commit=600. It's not clear whether this also has adverse effects, similar to `laptop_mode`, so this should not be enabled without further investigation. * adjusting the `dirty_writeback_centisecs`, `dirty_expire_centisecs`, `dirty_ratio`, and `dirty_background_ratio` settings in `/proc/sys/vm`. The `dirty_writeback_centisecs` setting, at least, is recommended by the powertop tool; configuring this setting should be addressed in connection with UbuntuSpec:desktop-lucid-powermanagement-tweaks * The `laptop-mode-tools` package is also not enabled by default despite being installed, so for the vast majority of users, removing it will be a no-op. For users that wish to use it, it should be easier to enable going forward because there's no longer a reason for the `acpi-support` package to forcibly disable it if it's not installed by default. * remove `laptop-mode-tools` from the seeds * add a quirk to `update-manager` to remove the package on upgrades * merge the latest Debian version of `laptop-mode-tools` * drop the code in `acpi-support` and `laptop-mode-tools` to disable `laptop_mode` by default * eliminate the Ubuntu delta from the Debian package related to the policy of not enabling `laptop-mode-tools` by default * delta related to making `laptop-mode-tools` integrate with `pm-utils` instead of directly with `acpid` should be retained and submitted upstream to Debian * add `dirty_writeback_centisecs` handling to `pm-utils` == Test/Demo Plan == It's important that we are able to test new features, and demonstrate them to users. Use this section to describe a short plan that anybody can follow that demonstrates the feature is working. This can then be used during testing, and to show off after release. Please add an entry to http://testcases.qa.ubuntu.com/Coverage/NewFeatures for tracking test coverage. This need not be added or completed until the specification is nearing beta. == BoF agenda and discussion == === Summary === The laptop-mode-tools package is installed by default, but if enabled it adds a completely separate power management overlay that doesn't integrate with any of the rest of the system packages (and doesn't respect preferences set in those packages). This should be rectified. === Discussion === Confusion: There is the kernel's laptop_mode (/proc/sys/vm/laptop_mode) and there is the laptop-mode-tools package. The latter perfoms several additonal tweaks to optimize disk idleing in addition to the kernel's laptoop_mode. Additionaly it is capable to handle most power management tasks. * This spec looks less like integration and more like droping plus reimplementation and repeating errors. laptop-mode-tools is a very well maintained package widely used on debian laptops. Mangling the three tasks of power management (https://wiki.ubuntu.com/PowerManagement) into one (acpi-support) already failed miserably once. Use small tools specialized for its task. Why not adeqately calling the laptop-mode-tools script from pm-utils so that they do not trip over each other. (possibly deactivating/changing and properly commenting some of the laptop-mode-tools options) But dropping laptop-mode-tools from the distribution really does not look like a solution at all, much more if crucial laptop_mode (disk idleing) gets no support. * It would actually be the fourth repetition of the failure not to use the maintained laptop-mode-tools script. 1st ubuntu used to have a rather outdated package "laptop-mode" http://ubuntuforums.org/showthread.php?t=36976, 2nd package "acpi-support" was messing with laptop-mode, 3rd pm-utils used to ship a buggy laptop-mode script messing with laptop_mode (Bug #241590). * Upstream notes: http://samwel.tk/laptop_mode/packages/ubuntu * laptop-mode should not be enabled because it causes power performance '''degradation''' on ext4 which is the default filesystem on new installs. Enabling it when on battery '''if''' the filesystem is ext3 would be ok (except for the data loss), but laptop-mode-tools doesn't handle this today and this is not straightforward to implement (and data loss, which upsets people) * Fuzzy writing. Please provide references. Bug #317781 does not serve as one. * Deliberately buffering disk writes with laptop-mode-tools of course means loosing data if system crashes (but not on battery run out because laptop-mode-tools will disable it when battery gets low.). A reason not to touch (disk idleing / laptop_mode) with pm-tools but make laptop-mode-tools work in a pm-tools environment (hook it appropriately into current apm/acpi/pm-utils event hooks). * ext4 is supported by laptop-mode-tools since 1.47-1. * Why is laptop-mode-tools installed? * to enable a script that enables the kernel laptop-mode (vm writeback changes) * except that this script is not enabled by default and certainly has not been for many releases * Whoever wants his laptop disk to spin down needs to enable this. * the package is neutered in karmic but it in available as a package * Note: The laptop-mode freeze/drive access bug on some machines seems fixed but ubuntu status was not updated. (Bug #12483, debbugs #426548) Anecdote: * NC10 failed to resume because of laptop-mode-tools taking an action on resume from suspend when it was disabled * pm-utils was shiping and using a broken laptop-mode script itself in the past. Bug #241590 ---- CategorySpec