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

version graph

Package: pm-utils; Maintainer for pm-utils is Debian QA Group <packages@qa.debian.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: important

Tags: patch

Found in version pm-utils/1.4.1-9

Fixed in version pm-utils/1.4.1-15

Done: Martin Pitt <mpitt@debian.org>

Bug is archived. No further changes may be made.

Forwarded to https://bugs.freedesktop.org/show_bug.cgi?id=45889

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, reply):

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, reply):

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, reply):

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, reply):

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, reply):

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, reply):

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)]

Severity set to 'important' from 'normal' Request was from Patrick Häcker <pat_h@web.de> to control@bugs.debian.org. (Wed, 28 May 2014 14:48:10 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. (Wed, 28 May 2014 14:51:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Patrick Häcker <pat_h@web.de>:
Extra info received and forwarded to list. Copy sent to Tim Dijkstra <tim@famdijkstra.org>. (Wed, 28 May 2014 14:51:04 GMT) Full text and rfc822 format available.

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

From: Patrick Häcker <pat_h@web.de>
To: 659260@bugs.debian.org
Subject: This bug is even more serious
Date: Wed, 28 May 2014 16:48:53 +0200
[Message part 1 (text/plain, inline)]
I've also been hit by this bug which wasted not only my, but also a 
developer's time (see #749330).

I can only agree with the other reporters: Arbitrarily resetting kernel 
variables (even on a desktop computer) is out of scope of this package. 
Implementing solution 1 from message #5 needs about 5 minutes and could save 
so much time.

More importantly, changing the DIRTY values to the given values is a bug 
itself. With these values notebooks with a lot of RAM get stalled (see 
http://lwn.net/Articles/572911/ for an explanation). As this is an even larger 
problem (as the solution is identical I didn't open a new bug) because the 
package renders the notebook unusable in some situations (use the link above 
as a manual to reproduce this), I increased the bug's priority.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Tim Dijkstra <tim@famdijkstra.org>:
Bug#659260; Package pm-utils. (Mon, 02 Jun 2014 09:39:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Martin Pitt <mpitt@debian.org>:
Extra info received and forwarded to list. Copy sent to Tim Dijkstra <tim@famdijkstra.org>. (Mon, 02 Jun 2014 09:39:04 GMT) Full text and rfc822 format available.

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

From: Martin Pitt <mpitt@debian.org>
To: Osamu Aoki <osamu@debian.org>, 659260@bugs.debian.org
Subject: Re: Bug#659260: pm-utils: incompatible with /etc/sysctrl.conf and not obvious
Date: Mon, 2 Jun 2014 11:36:14 +0200
Hey Osamu,

Osamu Aoki [2012-02-10  1:06 +0900]:
> === 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."
> }

Indeed I think that's the right way to do it. I verified that the
kernel defaults are exactly the hardcoded values (at least with recent
ones, 3.13 and 3.15), so that else branch is unnecessary.

I'll apply your patch, thanks!

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)



Added tag(s) pending. Request was from Martin Pitt <martin.pitt@ubuntu.com> to control@bugs.debian.org. (Mon, 02 Jun 2014 09:45:07 GMT) Full text and rfc822 format available.

Set Bug forwarded-to-address to 'https://bugs.freedesktop.org/show_bug.cgi?id=45889'. Request was from Bob Bib <bobbib@ukr.net> to control@bugs.debian.org. (Mon, 02 Jun 2014 23:15:04 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, 06 Jun 2014 18:09:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Osamu Aoki <osamu_aoki_home@nifty.com>:
Extra info received and forwarded to list. Copy sent to Tim Dijkstra <tim@famdijkstra.org>. (Fri, 06 Jun 2014 18:09:10 GMT) Full text and rfc822 format available.

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

From: Osamu Aoki <osamu_aoki_home@nifty.com>
To: 659260@bugs.debian.org, Martin Pitt <mpitt@debian.org>
Subject: re: pm-utils: incompatible with /etc/sysctrl.conf and not obvious
Date: Sat, 7 Jun 2014 03:08:16 +0900
Hi,

Thanks for applying my first patch.  It has been 2 years.  It is about
time to fix this.  

I agree this first patch is the best option as I rethink.

Let me comment on the hardcoded values.  They were the same values
in kernel then (2012/Feb) which should be 3.2.0 or 3.1.0.

Osamu



Reply sent to Martin Pitt <mpitt@debian.org>:
You have taken responsibility. (Thu, 10 Jul 2014 13:06:05 GMT) Full text and rfc822 format available.

Notification sent to Osamu Aoki <osamu@debian.org>:
Bug acknowledged by developer. (Thu, 10 Jul 2014 13:06:05 GMT) Full text and rfc822 format available.

Message #62 received at 659260-close@bugs.debian.org (full text, mbox, reply):

From: Martin Pitt <mpitt@debian.org>
To: 659260-close@bugs.debian.org
Subject: Bug#659260: fixed in pm-utils 1.4.1-15
Date: Thu, 10 Jul 2014 13:03:48 +0000
Source: pm-utils
Source-Version: 1.4.1-15

We believe that the bug you reported is fixed in the latest version of
pm-utils, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 659260@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Martin Pitt <mpitt@debian.org> (supplier of updated pm-utils package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 10 Jul 2014 14:58:31 +0200
Source: pm-utils
Binary: pm-utils
Architecture: source all
Version: 1.4.1-15
Distribution: unstable
Urgency: medium
Maintainer: Tim Dijkstra <tim@famdijkstra.org>
Changed-By: Martin Pitt <mpitt@debian.org>
Description:
 pm-utils   - utilities and scripts for power management
Closes: 659260
Changes:
 pm-utils (1.4.1-15) unstable; urgency=medium
 .
   * laptop-mode: If there is no state file (such as at boot), don't overwrite
     /proc/sys/vm/ values with fixed kernel defaults, simply do nothing. This
     allows sysctl.conf to set these values. Thanks to Osamu Aoki!
     (Closes: #659260)
   * Add 17-fix-wireless-hook.patch: Fix typo in wireless hook to make enabled
     check actually work. Thanks to Whoopie! (LP: #1299975)
Checksums-Sha1:
 8fa5da8f7997892f6da8c49f1389575d2fd4fee3 1923 pm-utils_1.4.1-15.dsc
 856c311edc16a41909fabf1962788f36e8ee6eb3 26748 pm-utils_1.4.1-15.debian.tar.xz
 036b84bbd55c41c5043c1f860a3c095d651b2c23 120538 pm-utils_1.4.1-15_all.deb
Checksums-Sha256:
 ff9419f88c5d9e887b5ab59281ab855b65ccdd81de5747afd31bf6918a4821f0 1923 pm-utils_1.4.1-15.dsc
 cd408d1af824a1fcf5dcac65e66c9adae7cf1e3a48c87aaf888dc228b1dfdfc1 26748 pm-utils_1.4.1-15.debian.tar.xz
 2f915aebc15b1e816f4d0a7d81795b07bbf241d03ecd00acc73a4c0867e09219 120538 pm-utils_1.4.1-15_all.deb
Files:
 81797870b698b665ed1ca4b89ed4f269 120538 admin optional pm-utils_1.4.1-15_all.deb
 1fcb586c8cbec4acbce36eb41d051e58 1923 admin optional pm-utils_1.4.1-15.dsc
 ffd8a055a7433deae9355be85cf54a84 26748 admin optional pm-utils_1.4.1-15.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJTvo6CAAoJENFO8V2v4RNHyGMQAMliC4kUyJETCb1hm+BxNlDx
q4DZJgXa5Z8KQatriN/D1gxhYyRbpEaH01wBcv6nP81h7wwMFApzrATje6SNIy6g
dFRVbE1zzydXePBeohYOSO/EEILb5D8egF4o85l8tFpTsNqt2liizMv1CTgBkPyb
kbrSHPvtYJPIPUC9aQl6U37pxWKR4G3NVELJao7rKlpt0XpSY6ICXQBQhvYxt6fb
SCLFV9jY5gtAW4Xdq4ThC6pHnOZhjkQJtK2L5yT47tYlQPGoJ1TnXtqim58NTUKj
C7C1KZplLubZLbEVax0tmerBqR6DOOIfU7EcqG8PMAxliqbfjcLRwdUo9vvWErLg
NJxCGXudYVc4HQWyYMSCzvqjtikeqBS4z72CQlI9oiVcbAzElXDzPsoI2uOwuJZ+
dpubeWRS1U0tldaTCPmE441VlDX+wXvi7YKXRq14zdZt3UWMSRu0dyEAfutHjzbQ
0wF50JaMgxo4ZdCkUoobuOK4FLVbDnU8VraFMJtDlE+4s9//hJh0upGbTI7R7nHC
quEzRr5zuCR+fhTKkH29yR/MU9Fexuqb9qftuEwCId81HHL8mBZ+lktcJ1KD1ftq
ZEa0PbpC17UeBISpkV6WPTQ+HPKp0ti+YykVotjClYbZ5mXh7D06i9tugUA2DkYv
YOWwrt9bZgullET4Ducv
=98FZ
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 13 Aug 2014 07:31:51 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Mar 20 04:00:50 2017; Machine Name: buxtehude

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