laptop-mode crashes taking up 100% CPU with IOWait when polling for battery level is enabled

Bug #371525 reported by Valentin Neacsu
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
laptop-mode-tools (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Karmic by Kwinz

Bug Description

Binary package hint: laptop-mode-tools

When enabling battery polling in /etc/laptop-mode/conf.d/battery-level-polling.conf, switching to battery results in crashing the laptop with 100% CPU usage, most of it being IOWait. Using htop I was able to see a lot of laptop-mode battery-related processes running just before crashing. When the laptop crashes, it usually has very high HDD usage and is unresponsive to any keys. Magic SysRq key always works in rebooting the laptop. I was able to fix this by disabling battery level polling.

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
Package: laptop-mode-tools 1.47-1ubuntu1
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: laptop-mode-tools
Uname: Linux 2.6.28-11-generic i686

Revision history for this message
Valentin Neacsu (valentin.neacsu) wrote :
Revision history for this message
Tim Althoff (timalthoff) wrote :

I have a problem which could be related to this issue.
 I'm running Ubuntu 9.04 on a Thinkpad x200s. After some minutes (also in idle, when I'm not using the computer) processes spawn and spawn. This goes on until there are like 2k-3k processes and the computer will hang (and I need to "hard"reset it). You'll see in my attachments that "lm-polling-daem" and "laptop-mode" are somehow related to this.
The attachments are outputs of "pstree -p" and are indexed by the number of total processes (which i got from "top").

Which additional information/logs/etc can I provide?

Revision history for this message
Tim Althoff (timalthoff) wrote :
Revision history for this message
Ritesh Raj Sarraf (rrs) wrote :

I am not sure why you would need to enable polling. It is disabled by default.

For x86, where acpi is available, in most cases battery status will be provided to acpi which in return will execute laptop-mode accordingly.

Revision history for this message
Tim Althoff (timalthoff) wrote :

Disabling battery polling in /etc/laptop-mode/conf.d/battery-level-polling.conf seems to do the trick for me. To be honest, I don't know why it was enabled in the first place. So far I haven't had the problem again.

Kwinz (ldm)
Changed in laptop-mode-tools (Ubuntu):
status: New → Confirmed
Revision history for this message
Kwinz (ldm) wrote :

I can confirm this.

I fixed this for myself a long time ago by simply adding -X to the pidof command in laptop-mode-tools/modules/battery-level-polling.
Yesterday I did an aptitude safe-upgrade and the file was overwritten with the buggy version without the -X switch again.

~/ aptitude show laptop-mode-tools
Package: laptop-mode-tools
State: installed
Automatically installed: no
Version: 1.47-1ubuntu2

I attached the correct version. Fix it!

Revision history for this message
Tormod Volden (tormodvolden) wrote :

There is no -X option in the current pidof. Do you mean -x?

Revision history for this message
Ritesh Raj Sarraf (rrs) wrote : Re: [Bug 371525] Re: laptop-mode crashes taking up 100% CPU with IOWait when polling for battery level is enabled

On Wednesday 21 Oct 2009 15:00:46 Tormod Volden wrote:
> There is no -X option in the current pidof. Do you mean -x?
>

Hi Tormod,

Yes, it is the -x option.
This was fixed upstream already.

revno: 142
committer: Ritesh Raj Saarraf <email address hidden>
branch nick: LMT-Main
timestamp: Mon 2009-07-13 11:37:49 +0545
message:
  Run pidof with the -x Script Mode switch. Thanks Matthijs Kooijman

  while debugging another issue, I noticed that the check for running lm-
polling
  daemons is not working.
  /usr/share/laptop-mode-tools/modules/battery-level-polling uses
  "pidof lm-polling-daemon" to see if the daemon is already running, but this
  does not work. The actual process is /bin/sh, which is running the
  lm-polling-daemon script. To make this work properly, pidof supports a -x
  option:

         -x Scripts too - this causes the program to also return process
                id’s of shells running the named scripts.

  When passing -x, laptop-mode stops spawning new on every restart (and
probably
  in other cases as well). It seems that the killall line used does work
  properly.

Ritesh
--
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."

Revision history for this message
Kwinz (ldm) wrote :

It is "-x" switch. That happens if you write your comments hasty. :) I apologize for the confusion.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

I don't know if it will be possible to get this into Karmic before the release, but here is a debdiff.

Revision history for this message
Fabrice Coutadeur (fabricesp) wrote :

Hi,

This has been fixed in Lucid, so closing the main bug report as fixed.

If you want to get it fixed in Karmic, please follow the SRU process, described at https://wiki.ubuntu.com/StableReleaseUpdates.
Unsubscibing sponsors meanwhile.

Also keep in mind that this package is in main in Karmic, so Main sponsors should be subscribed to the SRU.

Thanks,
Fabrice

Changed in laptop-mode-tools (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.