Debian Bug report logs - #659260
incompatible with /etc/sysctl.conf and not obvious

version graph

Package: pm-utils; Maintainer for pm-utils is Tim Dijkstra <tim@famdijkstra.org>; Source for pm-utils is src:pm-utils.

Reported by: Osamu Aoki <osamu@debian.org>

Date: Thu, 9 Feb 2012 16:12:01 UTC

Severity: normal

Tags: patch

Found in version pm-utils/1.4.1-9

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Tim Dijkstra <tim@famdijkstra.org>:
Bug#659260; Package pm-utils. (Thu, 09 Feb 2012 16:12:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Osamu Aoki <osamu@debian.org>:
New Bug report received and forwarded. Copy sent to Tim Dijkstra <tim@famdijkstra.org>. (Thu, 09 Feb 2012 16:12:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Osamu Aoki <osamu@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: pm-utils: incompatible with /etc/sysctrl.conf and not obvious
Date: Fri, 10 Feb 2012 01:06:23 +0900
Package: pm-utils
Version: 1.4.1-9
Severity: normal
Tags: patch

=== Problem and consideration ===

I was trying to set slow updates for my SSD on my laptop even under AC
power
====
# ssd_ac_mode default (for testing)
vm.laptop_mode      = 5
vm.dirty_ratio      = 60
vm.background_ratio = 40
vm.dirty_writeback_centisecs = 60000
====
It did not work.

Reading manpage  of pm-powersave did not give me any hints.

Reading pm-utils source and few experiments lead me to realize that the
hard-coded numbers embedded in the laptop_mode as "write_values 0 10 5
500" was the place to edit such configuration.  This is absurd.

This may be somewhat of regression of parallel init script.  This script
was executed after /etc/syscyrl.conf now and since there were no state
file this hard-coded value was used when booted under AC.
/etc/syscyrl.conf was used for AC when booted under battery and plugged.

=== Solution 1: simple fix ===

In laptop_mode, change laptop_mode_ac() function as follows.

===
laptop_mode_ac() {
    # disable laptop mode, set vm parameters back to sane defaults
    if state_exists laptop_mode_default; then
        write_values $(restorestate laptop_mode_default)
    fi
    echo "Laptop mode disabled."
}
===
If you wish to change via /etc/syscyrl.conf for AC setting, it works.

=== Solution 2: robust fix with added feature ===

Since above hard-coded segment may have been introduced for some other
interference, I think simple solution of providing legible and fixed
code setting both AC and battery mode should be safer and more stable
for /usr/lib/pm-utils/power.d/laptop-mode.

This code has additional benefit of using slow battery mode for SSD on
laptop as default.

If you think this is too much for default configuration, please consider
to add this to /usr/share/pm-utils/examples/laptop_mode

====== EXPERIMENTAL RESULT =====
= 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


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pm-utils depends on:
ii  powermgmt-base  1.31

Versions of packages pm-utils recommends:
ii  hdparm   9.32-1
ii  kbd      1.15.3-7
ii  procps   1:3.3.2-3
ii  vbetool  1.1-2

Versions of packages pm-utils suggests:
ii  cpufrequtils    007-2
ii  ethtool         1:3.1-1
ii  radeontool      1.6.2-1.1
ii  wireless-tools  30~pre9-8

-- no debconf information




Removed tag(s) patch. Request was from Michael Biebl <biebl@debian.org> to control@bugs.debian.org. (Thu, 09 Feb 2012 20:57:30 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Tim Dijkstra <tim@famdijkstra.org>:
Bug#659260; Package pm-utils. (Fri, 10 Feb 2012 12:39:22 GMT) Full text and rfc822 format available.

Acknowledgement sent to Osamu Aoki <osamu@debian.org>:
Extra info received and forwarded to list. Copy sent to Tim Dijkstra <tim@famdijkstra.org>. (Fri, 10 Feb 2012 12:39:28 GMT) Full text and rfc822 format available.

Message #12 received at 659260@bugs.debian.org (full text, mbox):

From: Osamu Aoki <osamu@debian.org>
To: 659260@bugs.debian.org
Subject: laptop-mode fix: solution 1
Date: Fri, 10 Feb 2012 21:05:16 +0900
[Message part 1 (text/plain, inline)]
Hi,

I forgot to attach patch for solution 1 which is more appropriate for
Debian package activity.

Here we go.

Osamu
[pm-utils-1.4.1.diff (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Tim Dijkstra <tim@famdijkstra.org>:
Bug#659260; Package pm-utils. (Fri, 10 Feb 2012 12:39:33 GMT) Full text and rfc822 format available.

Acknowledgement sent to Osamu Aoki <osamu@debian.org>:
Extra info received and forwarded to list. Copy sent to Tim Dijkstra <tim@famdijkstra.org>. (Fri, 10 Feb 2012 12:39:40 GMT) Full text and rfc822 format available.

Message #17 received at 659260@bugs.debian.org (full text, mbox):

From: Osamu Aoki <osamu@debian.org>
To: 659260@bugs.debian.org
Subject: pm-utils: (laptop-mode) solution 2 (SSD+Laptop)
Date: Fri, 10 Feb 2012 21:31:16 +0900
[Message part 1 (text/plain, inline)]
Hi,

Just in case people worry what I meant by solution 2, here is a script I
propose to replace laptop-mode.

If you are lokking for a quick fix to the situation such as SDD+laptop
as user, drop this into /etc/pm/power.d/ directory with 
 "-rwxr-xr-x 1 root root".

Regards,

Osamu
[laptop-mode (text/plain, attachment)]

Added tag(s) patch. Request was from Osamu Aoki <osamu@debian.org> to control@bugs.debian.org. (Fri, 10 Feb 2012 12:39:54 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Tim Dijkstra <tim@famdijkstra.org>:
Bug#659260; Package pm-utils. (Fri, 10 Feb 2012 13:03:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Osamu Aoki <osamu@debian.org>:
Extra info received and forwarded to list. Copy sent to Tim Dijkstra <tim@famdijkstra.org>. (Fri, 10 Feb 2012 13:03:12 GMT) Full text and rfc822 format available.

Message #24 received at 659260@bugs.debian.org (full text, mbox):

From: Osamu Aoki <osamu@debian.org>
To: 659260@bugs.debian.org
Subject: pm-utils:laptop-mode
Date: Fri, 10 Feb 2012 21:58:25 +0900
Hi,

I reported this to upstream.
https://bugs.freedesktop.org/show_bug.cgi?id=45889

Osamu




Changed Bug title to 'incompatible with /etc/sysctl.conf and not obvious' from 'pm-utils: incompatible with /etc/sysctrl.conf and not obvious' Request was from Jon Dowland <jmtd@debian.org> to control@bugs.debian.org. (Mon, 26 Nov 2012 20:57:15 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Tim Dijkstra <tim@famdijkstra.org>:
Bug#659260; Package pm-utils. (Tue, 26 Feb 2013 15:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "David Fred" <debianbug659260@dfred.net>:
Extra info received and forwarded to list. Copy sent to Tim Dijkstra <tim@famdijkstra.org>. (Tue, 26 Feb 2013 15:09:03 GMT) Full text and rfc822 format available.

Message #31 received at 659260@bugs.debian.org (full text, mbox):

From: "David Fred" <debianbug659260@dfred.net>
To: 659260@bugs.debian.org
Subject: incompatible with /etc/sysctl.conf and not obvious
Date: Tue, 26 Feb 2013 09:16:45 -0500
I've hit this bug after installing wheezy rc1 on a desktop system with a
large amount of memory.  It requires manual tuning of the kernel
defaults for vm.dirty* in /etc/sysctl.conf.

It took me some time to determine what was overriding my sysctl
settings.  I don't claim to know the best solution, but I agree with the
original reporter that the current situation is not good.

The so-called sane defaults "0 10 5 500" should just be removed ASAP
from the script, as suggested in the first solution.  This is going to
bite everyone who has pm-utils installed and overrides these vm settings
with sysctl.

In general, it would be polite behavior if the script did not change
anything if it has never been invoked with a "true" argument.  If the
"state_exists laptop_mode_default" check does not satisfy this
requirement, then explicit logic should be added to guarantee it.

A more complete solution, including moving *all* the hard-coded values
to somewhere in /etc, seems like it would be highly desirable.  When I
eventually install wheezy on a laptop I will certainly need a reasonable
way to change the 40/60% dirty settings included in this script.  (JMHO,
but those settings seem like complete madness as a default.)

Allowing the laptop-mode script to manipulate the dirty*bytes settings
instead of *ratio would also be a feature to consider...

Thanks for all your work!

Regards,

David




Information forwarded to debian-bugs-dist@lists.debian.org, Tim Dijkstra <tim@famdijkstra.org>:
Bug#659260; Package pm-utils. (Sat, 11 May 2013 20:51:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to SoTiri <torentsis@gmx.de>:
Extra info received and forwarded to list. Copy sent to Tim Dijkstra <tim@famdijkstra.org>.

Your message did not contain a Subject field. They are recommended and useful because the title of a $gBug is determined using this field. Please remember to include a Subject field in your messages in future.

(Sat, 11 May 2013 20:51:10 GMT) Full text and rfc822 format available.


Message #36 received at 659260@bugs.debian.org (full text, mbox):

From: SoTiri <torentsis@gmx.de>
To: "659260@bugs.debian.org" <659260@bugs.debian.org>
Date: Sat, 11 May 2013 22:48:09 +0200
[Message part 1 (text/plain, inline)]


Von Samsung Mobile gesendet
[Message part 2 (text/html, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 05:20:54 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.