Bug 45889 - incompatible with /etc/sysctrl.conf and not obvious
Summary: incompatible with /etc/sysctrl.conf and not obvious
Status: RESOLVED WONTFIX
Alias: None
Product: pm-utils
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-10 04:58 UTC by Osamu Aoki
Modified: 2018-06-29 19:57 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
pm-utils/pm/power.d/laptop-mode (4.50 KB, application/octet-stream)
2012-02-10 04:58 UTC, Osamu Aoki
Details

Description Osamu Aoki 2012-02-10 04:58:06 UTC
Created attachment 56863 [details]
pm-utils/pm/power.d/laptop-mode

Version: 1.4.1
As I reported to Debian: http://bugs.debian.org/659260

Since laptop-mode can be executed after or before sysctl.conf depending on the system on AC or Battery, it is not good idea to overwite /proc/sys/vm/* with the fixed default kernel values which is hardcoded in laptop-mode script in a bit hidden way.

Simple fix (solution 1)
--- a/pm/power.d/laptop-mode
+++ b/pm/power.d/laptop-mode
@@ -65,8 +65,6 @@
     # disable laptop mode, set vm parameters back to sane defaults
     if state_exists laptop_mode_default; then
        write_values $(restorestate laptop_mode_default)
-    else
-       write_values 0 10 5 500
     fi
     echo "Laptop mode disabled."
 }


But this may be a bit fragile since this code may have had some reason to be here.

If you hardcode them in this script, I wish you to make it more obvious which people will be changing easily.  Also, i realize using battery mode even under AC is good if you have SSD.  Replacing this script with attached code may be good idea.


====== EXPERIMENTAL RESULT OF DEBIAN SYSTEM WITH pm-utils =====

= Normal system =

== Normal - start on AC ==

• boot on AC
• hard-coded AC setting in laptop_mode of pm-utils (no state file)
• unplug
• hard-coded BATT setting in laptop_mode of pm-utils (state file with hard-coded AC setting in laptop_mode of pm-utils) 
• plug
• hard-coded AC setting in laptop_mode of pm-utils

== Normal - start on BATT ==

• boot on BATT
• hard-coded BATT setting in laptop_mode of pm-utils (state file with sysctrl.conf)
• plug
• setting in /etc/sysctrl.conf content (state file with sysctrl.conf)
• unplug
• hard-coded BATT setting in laptop_mode of pm-utils (state file with sysctrl.conf)

= Disable hard-coded AC - solution 1 applied =

= Disable hard-coded AC - start on AC =

• boot on AC
• setting in /etc/sysctrl.conf content (no state file)
• unplug
• hard-coded BATT setting in laptop_mode of pm-utils (state file with sysctrl.conf)
• plug
• setting in /etc/sysctrl.conf content (state file with sysctrl.conf)

= Disable hard-coded AC - start on BATT =

• boot on BATT
• hard-coded BATT setting in laptop_mode of pm-utils (state file with sysctrl.conf)
• plug
• setting in /etc/sysctrl.conf content (state file with sysctrl.conf)
• unplug
Comment 1 Adam Jackson 2018-06-29 19:57:28 UTC
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.