Page 1 of 1
Battery drains too fast on X240 Thinkpad RHEL 6.5 platform
Posted: Sat Jan 10, 2015 5:10 am
by dexterous_21
I'm having an issue with the battery of my X240 Thinkpad. It is a newly issued TP and I noticed that the battery won't last more than 2 hours upon full charge. I asked my colleagues who use X240 but on a Windows platform, and they said their battery lasts about 5-6 hours.
Is this a bug on Linux? I am using RHEL 6.5 OS with Windows 7 KVM.
I would appreciate your help and insights on this.
Thanks!
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platfo
Posted: Sat Jan 10, 2015 7:56 am
by RealBlackStuff
Please don't double-post, thank you.
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platfo
Posted: Sat Jan 10, 2015 8:38 am
by ajkula66
dexterous_21 wrote:I'm having an issue with the battery of my X240 Thinkpad. It is a newly issued TP and I noticed that the battery won't last more than 2 hours upon full charge. I asked my colleagues who use X240 but on a Windows platform, and they said their battery lasts about 5-6 hours.
Is this a bug on Linux? I am using RHEL 6.5 OS with Windows 7 KVM.
I would appreciate your help and insights on this.
Thanks!
Welcome to the forum!
You can expect a significantly worse battery life under almost any *nix flavour when compared to Windows, at least in my experience.
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platfo
Posted: Sat Jan 10, 2015 12:39 pm
by dexterous_21
Thanks for the reply ajkula66.
My old X230 lasts 5 hours with RHEL 6.5 and Windows 7 KVM on top. As per Lenovo, battery performance of X240 should be better than X230.
Any thoughts?
Thanks again!
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platfo
Posted: Sat Jan 10, 2015 1:05 pm
by ajkula66
dexterous_21 wrote:Thanks for the reply ajkula66.
You're very welcome.
My old X230 lasts 5 hours with RHEL 6.5 and Windows 7 KVM on top. As per Lenovo, battery performance of X240 should be better than X230.
Any thoughts?
I've never worked for Lenovo so I can't speak for them BUT the only way to test the battery life properly as per Lenovo's guidelines would be to install a Windows OS of some kind and check how the battery behaves there. Behaviour in an "alternate" OS is not something they would care about one iota.
Is there a way of telling the battery wear (in percents) through some utility in RHEL?
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platfo
Posted: Sat Jan 10, 2015 1:26 pm
by dexterous_21
My colleagues who use X240 with Windows 7 OS would say their batteries last 5-6 hours and I have verified it.
Battery info from battery icon in RHEL shows excellent status upon full charge, but only lasts 2 hours.
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platfo
Posted: Sat Jan 10, 2015 2:48 pm
by RealBlackStuff
Try your battery in that friend's X240 and see how long yours lasts there...
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platfo
Posted: Sat Jan 10, 2015 4:38 pm
by ajkula66
dexterous_21 wrote:
Battery info from battery icon in RHEL shows excellent status upon full charge, but only lasts 2 hours.
Does it show battery condition as in wear level or anything along those lines?
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platfo
Posted: Sat Jan 10, 2015 5:04 pm
by ch27
It looks like powertop will tell you how many watts each process is using. Probably need to run 'yum install powertop'.
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platfo
Posted: Sat Jan 10, 2015 5:47 pm
by Dekks
TP batteries usually perform about 20% less in stock Linux compared to Windows in my experience. You can reduce it by installing TLP & deps if older an older CPU or laptopmodetools if the last 2 Gen Intel CPU's. Then install Thinkfan and powertop.
Run Su Powertop --html, view the printout and change the power settings as required.
Then configure Thinkfan and TLP/LMT as required, googling will help as will archwiki which is a good starting place for that but be prepared to know how to edit text files as root. Thinkfan in particular needs plenty of work to optimise fan speeds. As your running whats considered a server OS then optimise what modules you want to run and shut off those that are not needed.
Also my general rule of thumb is if your CPU temp is approaching 50C under office type loads - not surfing flash websites - then you may need to clean the fan assy and re-apply paste on the heatsinks. I wouldnt expect it your case but if you live with a pack of shedding pets that are heavy smokers you never know

Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platform
Posted: Tue Dec 08, 2015 7:52 pm
by jaspen-meyer
If your cpu is always running at it's max frequency that can eat away at your battery.
A 'cpu governor' needs to be running.
Check the files in these directories:
/sys/devices/system/cpu/cpu0
/sys/devices/system/cpu/cpu0/cpufreq
Paths may be different on RHEL.
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platform
Posted: Tue Dec 08, 2015 10:33 pm
by axur-delmeria
Maybe RHEL 6.5 isn't a good match for your X240. I mean, the kernel is old (2.6.32), among other things.
And as others have suggested, TLP and other power management tools help a lot.
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platform
Posted: Wed Dec 09, 2015 1:26 am
by kony
You need to install TLP or other power management as someone already mentioned, Linux distributions don't include them by default or at least I haven't ever seen one that does. With TLP your battery life should be as long as in Windows 7.
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platform
Posted: Wed Dec 09, 2015 8:37 am
by hhhd1
x240 should last for a bit less than 2 hours when under maximum load and maximum brightness.
2 hours means there is either something stressing the laptop to near its limits all the time, or there is something wrong with the batteries (it should have 2 batteries, one internal, and another removable).
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platform
Posted: Wed Dec 09, 2015 10:29 am
by axur-delmeria
hhhd1 wrote:x240 should last for a bit less than 2 hours when under maximum load and maximum brightness.
2 hours means there is either something stressing the laptop to near its limits all the time, or there is something wrong with the batteries (it should have 2 batteries, one internal, and another removable).
Alternatively, some components of his Linux distro is not new enough to properly handle the power management features of a Haswell-based machine.
This can be diagnosed by monitoring CPU usage (using top or any other task manager), and power consumption (powertop).

Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platform
Posted: Wed Dec 09, 2015 4:49 pm
by Pokrzept
OP definitely need to update his kernel and distro at this point. At this moment it is like installing Windows 2000 on a brand new machine. Most of CPUs and power-saving features are inactive due to [censored]-old kernel.
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platform
Posted: Wed Dec 09, 2015 8:48 pm
by hhhd1
axur-delmeria wrote:hhhd1 wrote:x240 should last for a bit less than 2 hours when under maximum load and maximum brightness.
2 hours means there is either something stressing the laptop to near its limits all the time, or there is something wrong with the batteries (it should have 2 batteries, one internal, and another removable).
Alternatively, some components of his Linux distro is not new enough to properly handle the power management features of a Haswell-based machine.
This can be diagnosed by monitoring CPU usage (using top or any other task manager), and power consumption (powertop).

IMO, that is unlikely, 2 hours is way to slow, even if power management is not fully enabled.
I second the use of software like powertop, because it should display rate of discharge of the battery.
with a battery capacity of 47 Wh, a power usage of 23.5w, should give you 2 hours of runtime.
Re: Battery drains too fast on X240 Thinkpad RHEL 6.5 platform
Posted: Thu Dec 10, 2015 5:38 am
by evening_hunger
Linux distributions have abundance of power-control and power-saving software, especially for thinkpads.
Powertop, exposes more than 40 tunables (to a user with admin rights that is). Show me a M$ software that does it. Now, the problem is that with great power, comes great responsibility. In Windows you have zero power (I mean freedom), but you have nearly zero responsbility, as everything has been done for you. And, I admit, has been done wery well! That goes to show the world is not an adventure built upon binary choices.
Okay, enough philosophy:)
Now to get more down to it, you can try (as first step) obviously:
$acpi -V
which will yield as standard something like this:
Code: Select all
Battery 0: Unknown, 83%
Battery 0: design capacity 7115 mAh, last full capacity 3528 mAh = 49%
Adapter 0: on-line
Thermal 0: ok, 47.0 degrees C
Thermal 0: trip point 0 switches to mode critical at temperature 99.0 degrees C
Cooling 0: x86_pkg_temp no state information available
Cooling 1: LCD 15 of 15
Cooling 2: intel_powerclamp no state information available
Cooling 3: Processor 0 of 10
Cooling 4: Processor 0 of 10
Cooling 5: Processor 0 of 10
Cooling 6: Processor 0 of 10
That's a prequsite if we're gonna have any serious conversation about battery usage in linux. Then, using tp_smapi (a module available e.g. in Debian) one can get even more knowledge. For example, realtime data of power drain per battery:
Code: Select all
# tail -f /sys/devices/platform/smapi/BAT0/power_now
-10773 mW -906 mA
-10773 mW -906 mA
-10773 mW -906 mA
-10985 mW -922 mA
-10985 mW -922 mA
-10985 mW -922 mA
and so on. It is also posible to set custom thresholds for battery charging to prolong its life (e.g. avoid charging the battery to 100%, stop at say 90% and only go up to 100% when preparing for a long flight...). tp_smapi also exposes an utter mountain of data concerning the battery (the make, date of first use, software version... )
All in all, there is a bunch of toys and the way is paved.