The Serenity of -j1
It’s another post about our thinkpad :). We’ve been using gentoo on our x220 for a few years now. The x220 is a thinkpad from 2011, and ours is rolling with an i7-2620M processor, 2 cores 4 threads. When all the threads are saturated, the fans really start to scream a bit, and it’s not a pleasant sound. Fine for a few minutes, certainly not for longer. What’s there to do about it?
Early on we wrote a custom fan control script to implement different fan curves from stock. The stock curves idle the fan one speed step higher than it really needs to be and we didn’t like that. But under load the fans are screaming either way so the script isn’t really impactful there.
Then we disabled turbo. We still have turbo disabled actually. This keeps it from being forced into the max fan state under load unless ambient temperature is particularly high; particularly nice if we do happen to keep it under load for awhile. For example, OSRS and Minecraft run fine on this thing, but they’ll keep it pegged at turbo clocks. Turning off turbo means less heat, and it also means more power efficiency, which is great for this era of laptop where battery life is not really a strong suit.
Ok but it’s still loud, ultimately. We would stick to running package updates over night, which meant we had to think to do that, and meant we had a cutoff for when we had to stop actually using the laptop, unless we wanted to be wearing headphones to block out the sound. I’ll wear headphones while gaming but I don’t want them on my entire time using a computer. And of course we’d have to interrupt them again in the morning to use our computer. Quite obnoxious really.
The ultimate the solution, it turns out, is quite simple: relax and use -j1
.
No, really.
With -j1
, this laptop’s fans stay well within the quiet RPMs. But on top of that, it means that software compilation is not eating all the system resources, we have 3 threads and more ram for the rest of our computing needs. Combined, this means that software updates can happen whenever, not just over night, and it’s no problem.
So now, when I want to update our system, I just run an update, whenever, regardless of what we’re doing. I set it aside to run in the background, and then I forget about it. It may take longer in wall-clock time, but it is out of sight, out of hearing, out of mind. So in terms of how much of our mental space it takes up, much much less, and that matters far more. We will interrupt it if we need to be on battery for an extended period, but that’s about it.
I’ve taken this from software updates to other parts of my life. If I need to work on a rust or haskell project, I will start off by installing all the dependencies with -j1
and going away to do something else for awhile. Then I come back later to do the work I actually need to do. And for that I will use -j4
probably, because really I do not want to make my iteration times longer than they already are. But the initial build of the dependency tree takes so long that I need to go do something else while I wait anyway, so it taking 10 or 20 minutes more is really quite fine, especially since our computer is not annoying me in the process.
As for why we are using gentoo on an old laptop like this in the first place… would you believe me if I said it saves us time and mental energy compared to the alternatives? Hah. Such is the curse of the adept rock talker.