Same here; while I can still buy a working battery for the main bay on my X301, working batteries available for the auxiliary bay cannot be bought at all, only cheap knockoffs that balloon up and lose all life after a month.
Each clock cycle uses a little bit of power, and if all I’m doing is typing out Latex documents, then I don’t need that many clock cycles. I don’t need one thousand four hundred of them to be precise.
I recall there being some paper or article that shows doing the work quicker with a higher frequency/power draw then moving into the low frequency is less costly for power savings that doing the work slower at a lower frequency. Basically the CPU would spend more time in sleep states in an ‘on demand’ type governor (run at low freq, but elevate to high freq when utilization is high) vs a governor that always ran at the highest p-state (lowest freq) all the time. I’m having trouble finding the specific paper/article though.. I’ll keep searching.
I remember reading the same thing, but I think it had the added context of being on mobile. Having the CPU awake also meant having other hardware like the radios awake, because it was processing notifications and stuff. In this case, the rest of the hardware is staying awake regardless, so I think it’s really just reducing the number of wasted CPU cycles.
I’d be interested if you or someone else could find the original source for this again to fact check!
So factors around race-to-idle include how that power-frequency curve looks, how much stuff you can turn off when idle (often not just the cores; see artemis’s comment) and how CPU-bound you are (2x freq doesn’t guarantee 2x speed because you spend some time waiting on main memory/storage/network).
Some of that’s workload-dependent, and the frequency governor doesn’t always know the workload when it picks a frequency. Plus you’ve got other goals (like try to be snappy when it affects user-facing latency, but worry less about background work) and other limits (power delivery, thermals, min and max freq the silicon can do). So optimizing battery life ends up really, uh, “fun”!
(Less related to race-to-idle, but the shape of the power curve also complicates things at the low end; you can’t keep a big chip running at all at 1mW. So modern phones (and a chip Intel is planning) can switch to smaller cores that can draw less power at low load. Also, since they’re tiny you can spam the chip with more of them, so e.g. Intel’s planning one large core and four small. Fun times.)
Ooh, today somebody happened to post a couple pretty charts of recent high-end Intel desktop chips’ power/frequency curves, and charted speed per watt as a bonus. They also fit a logarithmic curve to it, modeling power needs as growing exponentially to hit a given level of perf, and it looks like it worked reasonably well.
Yes, I remember reading the same thing. But, maybe on a CPU this old it isn’t as efficient as transitioning in and out of low power states? Just a guess, assuming his claim of +1 hour is true.
Maybe it’s not linear. The comparison between ‘low freq’ and ‘high freq’ for that study could be comparing something like 40% (of the available clock range) vs 90%? And maybe at 1% the CPU power draw is so much lower that it’s even better than race-to-idle (but perhaps considered to be an unlikely/uncommon configuration).
The power consumption of a CMOS circuit scales with the square of the operating voltage, though, so intuitively I would expect that 100 ms at 0.5V to be more energy-efficient then 50ms at 1.0V. Chips are extremely complex devices, though, and I’m probably ignorant about a power-saving strategy or physical effect that side-steps this. Please let me know when you find that article - I’m curious to see which of my assumptions have been violated.
This makes a lot of sense and mirrors my experience with an X220 on OpenBSD. I got about one more hour of battery life (about 5 hours -> 6 hours ish) just by allowing it to run at a higher frequency but still spend 95% of its time at a lower one.
Also, while the tools built into OpenBSD do a good job of controlling power usage, I found I was getting even better battery life in a standard Arch Linux instal with no configuration of powertop or anything else.
In my experience, unless you insist on using unnecessary animations and other computationally intensive “gimmicks”, the CPU will rarely be a problem. RAM, on the other hand tends to limit me far more often that I would want it to. A few days ago I was doing some research on ActivityPub, and I had a few more tabs open that I usually do (10-12 compared to 2-3). Suddenly my system monitor applet was showing me that I was using 80%-90% of my RAM, whereas I’m usually around 30%, depending on which sites I have opened. Back when I had a x41 with 1G (a year ago) of RAM, I still remember that I had to pay much more attention to how I used the browser, or generally what I had opened.
…Wow! I very sadly moved on from my X40 waaaaaaay back in 2011. (I replaced it with an X300.) Screen resolution was probably a bigger motivator for me than performance, but it was already very noticeably slow on significant portions of the web.
I’m now using an X62, so maybe “moved on” isn’t quite the right phrase. ;)
Well I bought mine a little less than two years ago on Ebay for 33€, but you’re right the screen resolution was quite limiting. Though to be fair, if I had managed to find a X61/2, I would probably also still be using it – the reason I had to move on was that the charger started melting, and the first replacement I bought broke after a few weeks, so it didn’t make sense to invest any more money into it.
The only caveat is that modern web browsing is definitely much more taxing than “typing out latex documents.” You are running almost an entire graphical OS in each tab. And, if I’m not mistaken, most frequency managers actually slow down CPUs to a crawl when they’re idle. Other than that, I’m all in on this.
In my own experience, disabling Turbo Boost is barely noticeable and extends battery life for about an hour, which translates to around 20% extra life. I actually have a script called lpm.sh, for “low power mode” that essentially stops syncthing, an important source of CPU wakeups, and disables turbo boost to grant me those extra minutes. CPU frequency is properly managed in my case and I don’t have the need to run cpupower manually.
I use an 8 year old Thinkpad X220 every day and the only upgrades are a solid state drive, linux and some extra RAM (which I need because some of my datasets are obnoxiously large and I keep too many tabs open).
It would be real nice to have a better screen, though.
I’ve let my X220 get so bashed up that I should probably buy a new one to do the mod in.
I suppose I could put the mod in this and then take it out again later if this laptop ever dies, but I’m kinda bad at soldering, so I’m not sure that’s likely ;)
The last time I looked (~1 year ago) there were still a surprising number of X220 and X230 laptops for sale on ebay some as cheap as $100. I picked up an X230 to use for spare parts.
The mod was a little tricky to solder, especially getting the solder to sink down the through-holes to hit the pins sticking out of the motherboard. I ended up re-applying solder 3 times to finally get good connections there. The previous attempts seemed to work but then the display would cut out after using it for a few hours, or moving it, etc. Other than that, it has been solid ever since (I run Linux on it, not windows, so I cannot speak to the windows experience..)
Thank you for posting this. A while back I had only seen the mod for the X220 and there was uncertainty about whether something similar would emerge for the X230. Finally I might be free of the only part of this laptop that I don’t care for…
Pretty much the same. 6 year old X230, no SSD, Linux, and extra RAM. The only thing I miss is a better screen. And I frequently use a much less powerful laptop than this one when I want to save some weight (an ASUS eeePC 1015).
Numerous hours of being left plugged into the mains meant the battery developed a terrible memory
It hasn’t worked like that for quite a while. Li-ion batteries don’t have a memory. The only thing they do is degrade over time, some more than others. Batteries have had good measures against overcharging for quite some time, so leaving it plugged in probably didn’t make things worse either. Batteries just don’t have eternal life and their aging manifests as the ability to power your device for shorter times. The main thing you can do to keep it as healthy as possible is to keep it as full as possible.
then I would suggest taking a look at Manjaro, Lubuntu or Damn Small Linux, each has its perks for use on older hardware
Does choice of distro, independent of other factors, actually have that much of an effect on battery life? Intuitively, it would seem like power consumption from your desktop environment and the programs you run on it would dominate distro-dependent factors like package manager or init system. Is this not actually the case?
I believe the main factor is that those linuxes ship with low power desktop environments by default. Additionally, they tend to bundle fewer applications by default, leading to a smaller iso that may work better with old hardware’s space restraints.
I love the sentiment of this post. I find that my laptop uses around 15-20W (according to powertop) when not doing much with the default governor and default speeds, but simply by installing TLP (which limits CPU speeds when on battery power), I see my power usage drop to closer to 7-10W. The laptop also runs noticeably cooler, and the fans generally don’t even spin up.
The nice thing about doing it automatically with TLP is that when I plug in to power and want to do something intensive, I automatically have my laptop’s full potential available without even having to think about it. Also, just running systemctl stop tlp will return all power settings to normal, so returning to full power on battery doesn’t even require remembering where and how to change any settings.
What does become clear though is the huge difference there is between fast software and slow software. You notice that starting an Electron app, or even a GTK3 app, is noticeably slower than starting an app using a more lightweight framework. You notice when some web page has ridiculous javascript which blocks interaction. As programmers, I think it’s vital that we too get to experience how it is to use a computer with less powerful hardware; to not just write something which works on our $3000 behemoths but doesn’t really work for the poorest 60% of our users.
I typically keep my laptop connected to the wall 24/7. Only my latest laptop have I cared about battery because I’ve become sick of 25 minutes of battery when disconnected.
The e403sa by Asus is the best laptop I’ve purchased. The price is incredible.
They could use an external display + mouse/keyboard. It wasn’t a horrible idea in the past, when laptop sizes were easily smaller than desktops, but now with things like the NUC from intel, etc, you can get a desktop computer that is substantially smaller than any laptop.
“the price of replacement batteries have had time to decrease”
My experience has been the opposite, in that availability of batteries for laptops that old drops sharply, leading to much higher prices.
Same here; while I can still buy a working battery for the main bay on my X301, working batteries available for the auxiliary bay cannot be bought at all, only cheap knockoffs that balloon up and lose all life after a month.
You have use the old plastic shells and build your own battery.
I recycle laptop batteries. They’re very hard to open without doing massive damage to the shell!
We should try, but just saying that manufacturers don’t care about this being easy :(
I just started modeling a 3d printed replacement battery for a Makita drill. Folks are doing similar things here.
One might have to mod the laptop itself to bring power out to pogo pins or larger contacts that aren’t so custom.
Are ThinkPad batteries (like X220/X230 era) easier than the average? They seem like they should be, but I haven’t opened one to find out.
I recall there being some paper or article that shows doing the work quicker with a higher frequency/power draw then moving into the low frequency is less costly for power savings that doing the work slower at a lower frequency. Basically the CPU would spend more time in sleep states in an ‘on demand’ type governor (run at low freq, but elevate to high freq when utilization is high) vs a governor that always ran at the highest p-state (lowest freq) all the time. I’m having trouble finding the specific paper/article though.. I’ll keep searching.
Search for “race to idle”
Thanks for the hint, this is exactly the thing I read a while back: https://www.researchgate.net/publication/220779726_Race_to_Idle_New_Algorithms_for_Speed_Scaling_with_a_Sleep_State
I remember reading the same thing, but I think it had the added context of being on mobile. Having the CPU awake also meant having other hardware like the radios awake, because it was processing notifications and stuff. In this case, the rest of the hardware is staying awake regardless, so I think it’s really just reducing the number of wasted CPU cycles.
I’d be interested if you or someone else could find the original source for this again to fact check!
The counterbalance here is the increasing cost for each 100MHz as frequencies get higher. This is old, but https://images.anandtech.com/doci/9330/a53-power-curve.png shows the measured shape of a real curve. This StackExchange response helps explain why it isn’t flat.
So factors around race-to-idle include how that power-frequency curve looks, how much stuff you can turn off when idle (often not just the cores; see artemis’s comment) and how CPU-bound you are (2x freq doesn’t guarantee 2x speed because you spend some time waiting on main memory/storage/network).
Some of that’s workload-dependent, and the frequency governor doesn’t always know the workload when it picks a frequency. Plus you’ve got other goals (like try to be snappy when it affects user-facing latency, but worry less about background work) and other limits (power delivery, thermals, min and max freq the silicon can do). So optimizing battery life ends up really, uh, “fun”!
(Less related to race-to-idle, but the shape of the power curve also complicates things at the low end; you can’t keep a big chip running at all at 1mW. So modern phones (and a chip Intel is planning) can switch to smaller cores that can draw less power at low load. Also, since they’re tiny you can spam the chip with more of them, so e.g. Intel’s planning one large core and four small. Fun times.)
Ooh, today somebody happened to post a couple pretty charts of recent high-end Intel desktop chips’ power/frequency curves, and charted speed per watt as a bonus. They also fit a logarithmic curve to it, modeling power needs as growing exponentially to hit a given level of perf, and it looks like it worked reasonably well.
Yes, I remember reading the same thing. But, maybe on a CPU this old it isn’t as efficient as transitioning in and out of low power states? Just a guess, assuming his claim of +1 hour is true.
Maybe it’s not linear. The comparison between ‘low freq’ and ‘high freq’ for that study could be comparing something like 40% (of the available clock range) vs 90%? And maybe at 1% the CPU power draw is so much lower that it’s even better than race-to-idle (but perhaps considered to be an unlikely/uncommon configuration).
The power consumption of a CMOS circuit scales with the square of the operating voltage, though, so intuitively I would expect that 100 ms at 0.5V to be more energy-efficient then 50ms at 1.0V. Chips are extremely complex devices, though, and I’m probably ignorant about a power-saving strategy or physical effect that side-steps this. Please let me know when you find that article - I’m curious to see which of my assumptions have been violated.
I found it and put the link in another comment
This makes a lot of sense and mirrors my experience with an X220 on OpenBSD. I got about one more hour of battery life (about 5 hours -> 6 hours ish) just by allowing it to run at a higher frequency but still spend 95% of its time at a lower one.
Also, while the tools built into OpenBSD do a good job of controlling power usage, I found I was getting even better battery life in a standard Arch Linux instal with no configuration of
powertop
or anything else.In my experience, unless you insist on using unnecessary animations and other computationally intensive “gimmicks”, the CPU will rarely be a problem. RAM, on the other hand tends to limit me far more often that I would want it to. A few days ago I was doing some research on ActivityPub, and I had a few more tabs open that I usually do (10-12 compared to 2-3). Suddenly my system monitor applet was showing me that I was using 80%-90% of my RAM, whereas I’m usually around 30%, depending on which sites I have opened. Back when I had a x41 with 1G (a year ago) of RAM, I still remember that I had to pay much more attention to how I used the browser, or generally what I had opened.
…Wow! I very sadly moved on from my X40 waaaaaaay back in 2011. (I replaced it with an X300.) Screen resolution was probably a bigger motivator for me than performance, but it was already very noticeably slow on significant portions of the web.
I’m now using an X62, so maybe “moved on” isn’t quite the right phrase. ;)
Well I bought mine a little less than two years ago on Ebay for 33€, but you’re right the screen resolution was quite limiting. Though to be fair, if I had managed to find a X61/2, I would probably also still be using it – the reason I had to move on was that the charger started melting, and the first replacement I bought broke after a few weeks, so it didn’t make sense to invest any more money into it.
Nice article and I agree with the sentiment.
The only caveat is that modern web browsing is definitely much more taxing than “typing out latex documents.” You are running almost an entire graphical OS in each tab. And, if I’m not mistaken, most frequency managers actually slow down CPUs to a crawl when they’re idle. Other than that, I’m all in on this.
In my own experience, disabling Turbo Boost is barely noticeable and extends battery life for about an hour, which translates to around 20% extra life. I actually have a script called
lpm.sh
, for “low power mode” that essentially stops syncthing, an important source of CPU wakeups, and disables turbo boost to grant me those extra minutes. CPU frequency is properly managed in my case and I don’t have the need to run cpupower manually.I use an 8 year old Thinkpad X220 every day and the only upgrades are a solid state drive, linux and some extra RAM (which I need because some of my datasets are obnoxiously large and I keep too many tabs open).
It would be real nice to have a better screen, though.
If you are comfortable with soldering, I highly recommend this mod to add support for a 1080p display. I did this mod about 9 months ago to my X230 and I’m so glad I did.
I’ve let my X220 get so bashed up that I should probably buy a new one to do the mod in.
I suppose I could put the mod in this and then take it out again later if this laptop ever dies, but I’m kinda bad at soldering, so I’m not sure that’s likely ;)
The last time I looked (~1 year ago) there were still a surprising number of X220 and X230 laptops for sale on ebay some as cheap as $100. I picked up an X230 to use for spare parts.
The mod was a little tricky to solder, especially getting the solder to sink down the through-holes to hit the pins sticking out of the motherboard. I ended up re-applying solder 3 times to finally get good connections there. The previous attempts seemed to work but then the display would cut out after using it for a few hours, or moving it, etc. Other than that, it has been solid ever since (I run Linux on it, not windows, so I cannot speak to the windows experience..)
As if I use Windows ;)
Know about the ebay sales. Thanks for the insight on the soldering experience, though. Might come in handy.
Heh, I didn’t check your profile before replying. Sorry for insinuating you might use windows :P
Thank you for posting this. A while back I had only seen the mod for the X220 and there was uncertainty about whether something similar would emerge for the X230. Finally I might be free of the only part of this laptop that I don’t care for…
Thinkpad w530 here, great machine. Similar, SSD, add ram, linux. The Thinkpad driver for linux situation has alway been great.
Adding an SSD makes a lot of sense, since the bottleneck for performance is rarely the CPU & usually the disk.
Pretty much the same. 6 year old X230, no SSD, Linux, and extra RAM. The only thing I miss is a better screen. And I frequently use a much less powerful laptop than this one when I want to save some weight (an ASUS eeePC 1015).
My T420 has been great so far. They’re about $230-250 on eBay. Supports most OS’s.
It hasn’t worked like that for quite a while. Li-ion batteries don’t have a memory. The only thing they do is degrade over time, some more than others. Batteries have had good measures against overcharging for quite some time, so leaving it plugged in probably didn’t make things worse either. Batteries just don’t have eternal life and their aging manifests as the ability to power your device for shorter times. The main thing you can do to keep it as healthy as possible is to keep it as full as possible.
Does choice of distro, independent of other factors, actually have that much of an effect on battery life? Intuitively, it would seem like power consumption from your desktop environment and the programs you run on it would dominate distro-dependent factors like package manager or init system. Is this not actually the case?
I believe the main factor is that those linuxes ship with low power desktop environments by default. Additionally, they tend to bundle fewer applications by default, leading to a smaller iso that may work better with old hardware’s space restraints.
I love the sentiment of this post. I find that my laptop uses around 15-20W (according to powertop) when not doing much with the default governor and default speeds, but simply by installing TLP (which limits CPU speeds when on battery power), I see my power usage drop to closer to 7-10W. The laptop also runs noticeably cooler, and the fans generally don’t even spin up.
The nice thing about doing it automatically with TLP is that when I plug in to power and want to do something intensive, I automatically have my laptop’s full potential available without even having to think about it. Also, just running
systemctl stop tlp
will return all power settings to normal, so returning to full power on battery doesn’t even require remembering where and how to change any settings.What does become clear though is the huge difference there is between fast software and slow software. You notice that starting an Electron app, or even a GTK3 app, is noticeably slower than starting an app using a more lightweight framework. You notice when some web page has ridiculous javascript which blocks interaction. As programmers, I think it’s vital that we too get to experience how it is to use a computer with less powerful hardware; to not just write something which works on our $3000 behemoths but doesn’t really work for the poorest 60% of our users.
I typically keep my laptop connected to the wall 24/7. Only my latest laptop have I cared about battery because I’ve become sick of 25 minutes of battery when disconnected.
The e403sa by Asus is the best laptop I’ve purchased. The price is incredible.
So you basically have a desktop with terrible ergonomics & a tiny screen?
They could use an external display + mouse/keyboard. It wasn’t a horrible idea in the past, when laptop sizes were easily smaller than desktops, but now with things like the NUC from intel, etc, you can get a desktop computer that is substantially smaller than any laptop.
15 inch screen at 1080p is actually pretty nice, and I use an ergonomic wireless keyboard and mouse.
I use dwm, dmenu, slock, and nothing else for the GUI. It fits my needs of “handling windows” without a bug.
My colleagues are running KDE, and doubled their size of RAM and still complain. I have not this problem ! :)
OTOH, the computer that feel the fastest is the laptop I use for compiling, with an NVMe.
An idea for a followup to this article: measuring battery drain precisely, and testing the impact of powertop or different desktop environments.
Nice idea :) Thanks