Slashdot Mirror


Why Is Linux Notebook Battery Life Still Poor?

Ganty writes "I recently purchased a Lenovo W500 notebook, and after 'downgrading' to XP and creating a dual partition, I found that I had a battery life of nearly three hours using the long-life battery, at this point I was a happy camper because it means that I can watch a DVD during a flight. I then tried various Linux distributions and found the battery life under FOS to be very disappointing, with an average of 45 minutes before a warning message. After settling on Ubuntu I then spent three days trying various hardware tweaks but I only managed to increase the battery life to one and a half hours. Unwanted services have been disabled, laptop mode has been enabled, the dual core CPU reduces speed when idle and the hard drive spins down when not needed. Obviously Apple with their X86 hardware and BSD based OS have got it right because the MacBooks last for hours, and a stock install of MS Windows XP gives me three hours of life. Why is battery life on notebooks so poor when using Linux? Some have suggested disabling various hardware items such as bluetooth and running the screen at half brightness but XP doesn't require me to do this and still gives a reasonable battery life."

19 of 907 comments (clear)

  1. Drivers by stei7766 · · Score: 5, Informative

    I was able to get my X41 tablet to have good battery life (a bit better than windows actually), but it took some doing. Powertop is a godsend, it pointed me to the i915 intel drivers as the culprit. Disabling DRI made a huge difference.

  2. Powertop by Uberdog · · Score: 5, Informative

    If you're running on an Intel platform, try running powertop. I can easily gain over an hour of battery life by disabling the services it recommends and reducing the screen brightness.

    1. Re:Powertop by RiotingPacifist · · Score: 4, Informative

      +1 powertop will also give suggestions, you can permanently configure sutff.

      on my Acer i also managed to get more battery life than windows by:
      switching my DE to fluxbox
      not running anything in the background (except kpowersave)
      turning off unused peripherals (wireless chips eat power with their scans, webcams hold charge in their CCD, etc)
      using buttons/keys over mouse where possible (I think most of the touchpad drivers run in software, thus prevents the CPU reaching lower sleep levels)

      --
      IranAir Flight 655 never forget!
    2. Re:Powertop by RiotingPacifist · · Score: 4, Informative

      your wlan scans the surroundings

      Windows has better ACPI stuff because most of the drivers are 3rd party, so while its not scanning the card sleeps, eventually NM+well supported cards will catch up, e.g ath5k now handles me turning the card on/off, this is a big improvement from custom rmmod scripts (if you want it sooner, go do it)

      it has tons of background stuff active

      The background stuff isn't "linux's" fault, its down to whatever distro/setup you have, e.g if doubt slackware/arch users bitch about battery life. For example, i run crap loads of background stuff that requires a net connection, it can't magically know that I've decided to watch a film on batteries without a net connection.

      you have a colorful UI with FX

      I think a lean KDE3 install might compete with XP, running fluxbox wasn't because the DE is particular efficient (which it is), it's because it didn't suit my setup.
      Perhaps KDE4 might compete with Vista, but i don't know i ran vista once and it ate my batteries.

      and full brightness,

      Again changing brightness affects both OSes equally or do you think linux has some allergy to light?

      you use the mouse

      While the linux touchpad drivers probably aren't as good as the windows driver, my advice stands for windows too, using keyboard/button inputs uses much less cpu than a touchpad.

      So what was the point of your post? To bitch about how the background processes and drivers in linux arn't as efficient as those in windows? How about you go fireup powertop and file some bug reports. If you'd understood the point of my post (which ill go out on a limb and say you had no fucking clue), it was that the problem doesn't lie in the kernel (although for the wlan scanning it may), but rather in the background processes (looks at pulseadudio, though it saves audio card power im sure it wastes more in CPU wakeups) and Desktop environment, which over time do actually improve (firefox is still a bad offender but its gone from ~100 wakeups/s to ~40 in 3.5), however if you want to see battery life improve quicker then do something (just filing bugreports helps [1] bitching about it on slashdot does not!)

      --
      IranAir Flight 655 never forget!
  3. Re:Do you have non anecdotal evidence? by paleshadows · · Score: 4, Informative

    Here's some concrete evidence. Take a look at http://event.asus.com/eeepc/comparison/eeepc_comparison.htm in which Asus compares their different eee netbooks. Go to the battery life column and observe how, unfortunately, XP consistently outperforms Linux :(

  4. Re:Do you have non anecdotal evidence? by Octorian · · Score: 5, Informative

    And I have plenty of anecdotal evidence that power management works really well with whatever OS the computer was intended to run, and is alright-to-crappy with any other OS.

    My MacBook Pro runs decently in OSX, and drains quickly in WinXP.
    My HP Compaq laptop runs really long in Vista, though its still alright in Linux. (haven't done a comparison, though... But Linux still whines when battery #1 is almost dead, even if I have battery #2 available, installed, and at 100%)

    The crux of the problem is that Linux is *rarely* the "intended OS" for any of these platforms, so the hardware manufacturer never invests any effort to make sure Linux power management drivers work correctly on them.

  5. Consider your hardware by pantherace · · Score: 5, Informative

    This really is an issue, and hardware support varies. Your notebook seems to include an ATI graphics card. That's probably your problem. Last I looked neither the open source, nor the ATI graphics drivers supported power savings on the ATI cards. I have an Asus F8Sv, which actually gets longer battery life in Linux, about 10 minutes, even though when running Linux, I have an external hard drive connected. It's got an Nvidia Geforce 8600 graphics card, with Nvidia's drivers. (Mind you, this is with OpenGL composting enabled, under Kubuntu (both 9.04 and 9.10) The other big one is Intel cards, which are supported for most of their power management features under the driver Intel helped write.

    1. Re:Consider your hardware by fuzzyfuzzyfungus · · Score: 4, Informative

      This page suggests that ATI chips can be made to support at least some powersaving measures under linux. It has been several years since I've had an ATI based laptop, so I can't personally vouch for this.

  6. Advanced Configuration and Power Interface... by anss123 · · Score: 4, Informative

    Some have suggested disabling various hardware items such as bluetooth and running the screen at half brightness but XP doesn't require me to do this and still gives a reasonable battery life

    Are you sure? My netbook dims the screen when I pull the power cord on both XP and Win7... though it might be the BIOS doing that.

    Anyway my suggestion is checking if ACPI works as it should. AFAIK laptops are notorious for buggy ACPI implementations that are only tested with Windows. Linux now pretends to be Windows XP when doing ACPI stuff, before that they noped out some part of the BIOS to make it work with Linux but that wasn't reliable. Look into if you can change how Linux does ACPI and try that.

  7. I have had the opposite results by erroneus · · Score: 5, Informative

    While I can't say that my Dell laptop's power management has been piss-poor under Windows (I can't really say that I used Windows on THIS particular computer that much, but I did on previous Dell models) and the power management was pretty excellent especially when the Intel speedstep software was running. If it helps, I run Fedora and Fedora and Dell laptops have been getting along fabulously for at least the past 6 or 7 version releases.

    But one thing about running Windows that has always been a complaint and that's it's estimation for "time remaining." Whether looking at file transfers or remaining battery life, Microsoft ALWAYS seems to over-estimate "time remaining" or has at least reported the most optimistic figure possible. What I'm getting at is that it is QUITE possible that the Windows battery life you are reading is either untrue or unrealistically optimistic.

    I know on my Dell Mini 9 running XP and watching video on battery power initially claims I have like 3 or 4 hours battery remaining, but before the two hour movie is complete, it wants to die.

    The biggest source of battery drain on my netbook is CPU processing. No doubt with my other notebook, it would be hard drive usage followed closely by processor/gpu usage. This leads me to the next suggestion when using Linux -- use the graphics driver provided by nvidia or ati. They manage power better because they have the "secrets" that the GPL drivers don't have access to. Remember that a GPU is still a processor and eats power when processing.

    Power management on laptops is all about paying attention to everything that draws power and being aware of it. For example, if it generates heat, it's using power... usually lots of it and cooling systems draw even more power as a consequence. Dial that speedstep down WAY low when unplugged.

  8. Re:Do you have non anecdotal evidence? by niiler · · Score: 4, Informative
    Here's another relatively good explanation of why linux laptops have such poor battery life. The summary is (in order):
    • Linux does much more in the way of disk IO than Windows due to how data is written out of the page cache using pdflush
    • Those of us who run journaling file systems will have more disk IO than those who don't
    • Memory management has generally done little to no prioritization of which pages are written to disk

    This is, of course a vast simplification, but it gets the point across. The linked to article also shows how to use laptop mode to address these issues and extend batterly life (although, it seems to me that there is a trade off in the ability of journaled file systems to perform correctly).

  9. No problem here... great power mgmt with Ubuntu by xeno · · Score: 4, Informative

    I'm surprised, my experience with Ubuntu 9.04 is very good on similar Thinkpad hardware. After upgrading from a decrepit IBM T42p to a Lenovo T61p (UXGA->WUXGA = similar screen size/power demands to the hi-res W500), I still get ~4:00 out of the Thinkpad extended battery.

    Some ideas; perhaps these will be useful:
    - There is a bios setting on the Lenovo-era Thinkpads where you can force the screen to high brightness. My Ubuntu install manages this correctly (i.e. turns it on when on line power, off when on battery). However if yours does not kick the brightness to the normal range off line power, it'll kill the battery faster than any other factor. On high display brightness, you will be lucky to get more than 90min on battery.
    - Hard drive power consumption does make a significant difference, and for that, Windows does tend to spin down the drive more frequently. With a high-load drive the difference can be pretty dramatic, but a more efficient drive closes the performance gap even if Linux isn't as aggressive with drive power management. For example, with the last upgrade to the T42, I replaced the old 1.1A IBM drive with a .45A Seagate, and my experience was dramatic: 30-45min more battery time from that change alone. When I upgraded the recent hdd, I made sure to select one with less than .5A consumption.
    - Check your display drivers. On the T61 with the default Ubuntu installation, the CPU load increased with the open-source video driver, because it's compensating for certain unknowns in the GPU by offloading to the CPU/being more inefficient. Loading the Nvidia driver not only increased performance (a lot), but (again) noticeably reduced power consumption.

    In short, optimize, optimize, optimize.... and sometimes that means installing the right driver, not stripping things down.

    --
    I think not...(*poof*)
  10. A Few More Pointers by cfriedt · · Score: 5, Informative
    • You should probably eliminate your screensaver altogether and set the windowing environment to power-off the monitor after a certain timeout occurs.
    • Your web browser (e.g. Firefox) should be set to use browser.disk.cache.parent_dir=/tmp in about:config (mount /tmp as tmpfs). Really anything creating or writing files periodically should write them to tmpfs. Also, you might want to just make a symbolic link from ~/.mozilla/firefox/[profile]/Cache -> /tmp.
    • Eliminate ALL logging - it will wake up the hard disks every time a message is logged, unless you log to tmpfs.
    • With Ubuntu 9.04, also keep in mind that video / 2D / 3D operations are not accelerated because Canonical chose to use FLOSS-only drivers on this release. That means, your CPU works overtime to account for all of Ubuntu's fancy compositing. Apparently with Ubuntu 8.10 restricted drivers are still allowed, so you might want to consider downgrading. They have the added benefit of lowering the work of the main CPU (i.e. less power is used), using silicon to accelerate graphics rather than software.
    • User powertop
    • Tweak the kernel to enable dynamic ticks (i.e. a 'tickless' system)
    • Really look through your ~/.xyz files to see which of them contain logs and caches. Redirect those to /tmp using a symbolic link.

    It's sadly true that almost all Linux applications / distributions have not taken writing-to-disk into account to reduce power. On the other hand, video / 2G / 3G graphics acceleration in hardware makes a huge difference, which is why I would really like to see more companies offering more in terms of stable hardware acceleration.

  11. Re:Do you have non anecdotal evidence? by Andy+Dodd · · Score: 4, Informative

    There are very few modern models where battery life is given as different from XP. In those cases the difference is rather small (not like what the article poster is experiencing). In at least one of those cases, the Linux hardware configuration is different than the XP hardware configuration. (Different flash drive size, there may be other changes such as a different WLAN card. For example, the Dells that have Ubuntu preinstalled have a different hardware configuration than non-Ubuntu Dells of the exact same model number.)

    For example:
    1101HA is given as being available with either XP or Linux. Only two battery life numbers are given, one for each possible battery configuration.

    The 1002H is XP-only and seems to be one of the worst performers in the 10" class (5 hours)

    In my experience, the most common causes of lower battery life under Linux:
    NVidia chipsets. The power management in their driver is one of their lowest priorities. If you want games, you're going to have to sacrifice battery life.
    Sometimes the "ondemand" cpu speed governor can be a little flaky and step to high speed way too quickly.

    Keep in mind that's Asus's own Linux distro which most people regard as not being that hot. It may be missing some power tweaks available to other users. With the exception of Nvidia-graphics based laptops, I've usually been able to get much better real-world battery life on a machine with Linux than Windows. (Exception being that I haven't gotten FSB clock changing working on the Ubuntu partition of my Eee 1000HE yet - downclocking the FSB is the core component of Asus's "Super Hybrid Engine" power management scheme.)

    --
    retrorocket.o not found, launch anyway?
  12. Re:Do you have non anecdotal evidence? by Beardo+the+Bearded · · Score: 5, Informative

    Well, DUH, it HAS to be perfectly optimized for the hardware.

    Battery management requires checking every single pin on your hardware and ensuring that you've set the i/o correctly for sleep mode.

    If you have even one pin with a pull-up resistor set as an output, then you'll get lower battery life than the nominal case. If you have just random I/O on unused pins, then you're going to get greater drain than ideal.

    I'll qualify that statement by saying I'm an Electrical Engineer with embedded experience. One of the products I worked on was a GPS / VHF tracker with a 12uA standby current. Another was a VHF tracker with an 8uA standby current. Slight modifications to the firmware would bring the standby current up to 50-100 mA. That's more than 1000x more standby current.

    My experience dealing with Linux developers (and realistically, software developers in general) is that they're all terrible at determining the link between hardware and software. Look at the derision you get online towards C. Linux devs are worse -- if you're not running their exact hardware on a machine you bought in the last month, then it's your problem, not theirs. "Weird, it works here. Have you tried recompiling the drivers?"

    It's fairly easy to map these pins, BTW. All you have to do is set everything to an output, set it to 0, and then turn everything to an input. Everything that's high has a pullup resistor. Do the same with 1 and everything that's low has a pull-down resistor. Now you know which pins must be inputs when you're not using them.

    Of course, since you taught yourself programming with Ruby on Rails, you know all this, right? It's not like you'd have to have some low-level knowledge of the hardware in order to effectively make a complete synergistic hardware and software package.~

    --

    ---
    ECHELON is a government program to find words like bomb, jihad, plutonium, assassinate, and anarchy.
  13. Re:Poor choice for screensaver? by bflong · · Score: 5, Informative

    A quick Google search shows that the basic kernel for all versions of Ubuntu has been tickless since 7.10.
    http://www.ubuntu.com/news/ubuntu-server710
    I know my system (karmic) does. You can check with:
    $ grep CONFIG_NO_HZ /boot/config-`uname -r`
    CONFIG_NO_HZ=y

    --
    Why is it so hot? Where am I going? What am I doing in this handbasket?
  14. Re:Poor choice for screensaver? by Runaway1956 · · Score: 4, Informative

    guy@guy-desktop:~$ grep CONFIG_NO_HZ /boot/config-`uname -r`
    CONFIG_NO_HZ=y
    guy@guy-desktop:~$

    That's Intrepid on a desktop. We're tickless by default, laptop or desktop.

    The GP who asked if the kernel is tickless asked a valid question, but it's been turned into a FUD campaign by the Linux bashers.

    --
    "Windows is like the faint smell of piss in a subway: it's there, and there's nothing you can do about it." - Charlie Br
  15. Re:Poor choice for screensaver? by Otto · · Score: 5, Informative

    First, Microsoft doesn't "do it". Without specific drivers provided by the OEM, the power-save functionality doesn't work well on Win either. The fact that all OEMs provide these is simply a matter of scale, Windows is 90% of the market, after all.

    Secondly, Apple controls the hardware. They can do what they like and make sure it works because it's a limited subset. You pay extra for that too.

    What you're basically asking for is "why can't this free software made by volunteers be as instantly capable with any hardware on the planet as the big corporate monopoly that spends zillions on the same thing"?

    Do you now see the idiocy of the question?

    Hey, the fact that it works at all is the miracle here. Okay, so you might have to tweak it. Generally speaking, you don't have to, but there's always edge cases.

    Also, the existence of differing distributions reflects different needs. There's stuff in any install of Windows that people often don't need. So why install it? Linux being customizable for the task at hand is a feature, not a drawback.

    --
    - Give a man a fire and he's warm for a day, but set him on fire and he's warm for the rest of his life.
  16. Re:Poor choice for screensaver? by DangerFace · · Score: 4, Informative

    Total agreement - I get a little more battery life from stock Ubuntu, and once I've locked the CPU at 800 MHz and turned off Compiz I can get two to three times more battery life for comparable activities - and six to eight hours of film watching on a 15" screen is not bad from a single charge.