News for hackers. Stuff that matters.
Re:Linux Kernel Fastboot [pdf] by jmccorm on Saturday September 14, 2019 @09:27PM (#20975001)
How nostalgic! Mind you, I say that in a good way!

This brings me back to the heydays of Sun Microsystems where they controlled both the hardware (SPARC) and the operating system (Solaris). Sun didn't hesitate to use this to their advantage. With Clear Linux, I see Intel doing some very similar things. Yes, this was just a story about boot time, but it led me to take a look at Clear Linux and it looks like it could be a star. I'm interested in how much more performance their distribtuion is able to squeeze out. I'm also wondering how they're dividing their focus here and what high notes they're trying to achieve.

At a strategic level, I'm assuming that they're wanting to distinguish themselves from ARM? Are they looking to create a well-tuned reference for other Linux distributions on Intel to adopt? At a tactical level, I see they're focusing on performance, availability (which boot time would be a function of)... but are they tweaking for other things such as reliability? Fault tolerance?

Until now, Clear Linux wasn't even on my radar. Today, it is. Anyone have some experiences with this distro (for better or worse) that they'd like to share?

Re:Linux Kernel Fastboot [pdf] by Filligree on Saturday September 14, 2019 @09:39PM (#20975042)
> Anyone have some experiences with this distro (for better or worse) that they'd like to share?

Not much of one, but for a while I was playing with multiple distros trying to find the best possible power management for my laptop. (XPS 13 9380.)

Clear did better than the Ubuntu installation that came with it -- but a dead octopus would have done better than that. It was sitting at 6W for non-CPU-intensive work, and was also noticeably snapppier. Windows on the same hardware sits at 8W when idling; same as Ubuntu.

More recently I've tried Arch, though. Which somehow got that same workload down to 3.3W, albeit with a lot of adjustments... that didn't seem to affect performance, but did affect power use, clearly.

It's just too bad that all of this optimization goes out the window if I fire up a browser, but I've had a fun time finding ways to avoid that.

Apart from that, obviously Clear's software repository is far more limited than Arch's, and it also seems harder to contribute to. I don't think that problem will be going away soon.

Re:Linux Kernel Fastboot [pdf] by aidenn0 on Saturday September 14, 2019 @11:01PM (#20975310)
Firefox will suspend running pages when it is unmapped, so I put it on its own virtual desktop and only switch to that desktop when I need a webpage.
Re:Linux Kernel Fastboot [pdf] by jlgaddis on Sunday September 15, 2019 @03:59AM (#20976115)
And, if you're like me and have dozens of tabs open for weeks on end, the OneTab extension is pretty awesome too.
Re:Linux Kernel Fastboot [pdf] by 0xAF on Monday September 23, 2019 @08:20AM (#21048185)
I'm using "Auto Tab Discard" and I'm happy with it. It "unloads" the unused tabs and reloads them once you switch back to them.
Re:Linux Kernel Fastboot [pdf] by nobleach on Saturday September 14, 2019 @09:43PM (#20975057)
I'd love to hear more about the tweaks you've done to Arch. I've gone little beyond a few power management things myself (On a Thinkpad X1C Gen 6). I get decent battery life, but I know it could be better. And giving up Arch would be a tough sell to myself.
Re:Linux Kernel Fastboot [pdf] by yaantc on Sunday September 15, 2019 @04:03AM (#20976130)
I have the same laptop as you. Just install the "tlp" package (The Laptop Project). I'm using Debian but the Arch package should have the same name. You can tweak the settings (/etc/default/tlp on Debian) but out of the box that should get you arround ~4W depending on what is running on your laptop. With light usage that gives more than 10 hours of battery life, even if you don't charge the battery to the max to increase its life (see START/STOP_CHARGE_THRESH_BAT0 for Thinkpads in the tlp configuration).

If you have a SSD you can be aggressive on the disk suspend timeout, as there's no spin up/down wear issue as with mechanical disks.

With this the battery life is good enough that I never felt the need to optimize further.

[1] https://linrunner.de/en/tlp/tlp.html

Re:Linux Kernel Fastboot [pdf] by nobleach on Sunday September 15, 2019 @09:58AM (#20977223)
Fantastic. Thanks for the info. I've installed tlp, but I never really looked too deeply into it (yet). Most days at the office I'm plugged in - and that can be a problem too with the battery constantly receiving a charge.
Re:Linux Kernel Fastboot [pdf] by Filligree on Saturday September 14, 2019 @10:12PM (#20975146)
Very little was needed at all, and what I did do is mostly working around firmware bugs.

- Force deep sleep mode, as s2idle doesn't work.

- Set the ASPM policy. To anything. Basically the default doesn't work. (I went with 'powersave', obviously.)

- Run powertop --auto-tune on boot.

- Set the cool-bottom thermal profile, but that's just to make it work as a lap top.

- Run a BIOS upgrade. :V

(fwupdmgr did the whole job for me~)

Re:Linux Kernel Fastboot [pdf] by nobleach on Sunday September 15, 2019 @10:01AM (#20977231)
Awesome, thanks. My BIOS upgrades are such a mess. I get notified that I have them.... but they always fail. I haven't dug into the logs to see why. This is honestly the most lazy I've ever been with a Linux install in 20 years, mostly because everything is working "well enough" that I haven't spent time tweaking it. Better battery life/cooler bottom does sound like something I should strive for though.
Re:Linux Kernel Fastboot [pdf] by nullify88 on Sunday September 15, 2019 @04:27AM (#20976190)
I run Fedora on a Thinkpad X1C Gen 3. tlp[1] has been, by far, the best tool in optimising my power usage. powertop for some monitoring, as these days it recommends some less than ideal tunables, especially with regards to SATA power management ("med_power_with_dipm" vs "min_power" [2][3]).

Some modules also have blacklists that prevent certain power saving modes from being enabled. This is true for the snd-hda-intel module to prevent a well known popping sound. Since disabling the blacklist, I haven't encountered the issue however YMMV. Similarly to enable ASPM on the PCIE bus, I've had to force it via a kernel parameter.

With regards to the GPU, I noticed my Intel GPU can scale its frequency between 300mhz and 950mhz but the default minimum was set to 350mhz. Other such tweaks such as enabling frame buffer compression [4], can save you a few more watts.

While the Linux defaults does its best to be suitable across different hardware configurations, you'll have to meddle with many parameters to get it customised to your configuration, and that could bring some instability with it so exercise some caution.

Oh, and also be mindful of the apps you run. The Great Suspender for Chrome can save you some watts, cpu and memory by suspending tabs that are not in use. And switching to a light desktop such as Sway or i3 can also do wonders.

As I type this, my battery is reporting a draw of 3.1 watts, 30% battery remaining with 4:40 of operating time at the current workload.

[1] - https://wiki.archlinux.org/index.php/TLP

[2] - https://hansdegoede.livejournal.com/18412.html

[3] - https://wiki.archlinux.org/index.php/Power_management#SATA_A...

[4] - https://wiki.archlinux.org/index.php/Intel_graphics#Framebuf...

Re:Linux Kernel Fastboot [pdf] by nobleach on Sunday September 15, 2019 @10:06AM (#20977254)
Thanks! Yeah, Just running Slack and Chrome (not to mention Spotify sometimes) can send my resource usage fairly high. I went back to Vim (from a couple of Electron-based editors running in vim-emulation mode). I used i3 a bit for about a year and never quite got it to my liking. Things like bluetooth and audio management seemed kinda hacked together - because they were. i3 isn't an environment, it's just a window manager. That's totally great, but KDE seems so seamless in this area. Worth looking into again though.
Re:Linux Kernel Fastboot [pdf] by tbrock on Saturday September 14, 2019 @10:06PM (#20975121)
The thing with arch is it’s mostly not more tweaks that give you better battery, it’s not having all the crap that Ubuntu preloads running that makes that happen.
Re:Linux Kernel Fastboot [pdf] by nobleach on Sunday September 15, 2019 @10:07AM (#20977260)
Folks think I'm crazy for using Arch as my main dev machine. I'm not an Ubuntu hater at all (it runs my main server in the basement at home)... but it'd be awfully hard to go back to using it as my main machine.
Re:Linux Kernel Fastboot [pdf] by doubleunplussed on Sunday September 15, 2019 @11:49AM (#20977749)
Really? Arch is... boring. Once you've set it up, nothing happens without your permission and you can just keep developing away. Sure you have updates imposed on you, but you can delay them a bit if you dont have time right now, and its not like upgrades are indefinitely avoidable on any other OS.

Using Arch often gives me advance warning that my apps will break on users machines due to changes in libraries. I see the changes first and can add compatibility for the new library version such that it's fixed before affecting my users.

I love it as a daily driver.

Re:Linux Kernel Fastboot [pdf] by nobleach on Sunday September 15, 2019 @08:57PM (#20980354)
Yeah, for me, it's "just right". Most detractors claim it's "bleeding edge". What? just because it's got something newer than Postgres 9.1 available?? (this was my argument against Debian/Ubuntu for a long time)

Totally agree that it's a great daily driver. It has EVERYTHING!

Re:Linux Kernel Fastboot [pdf] by UlisesAC4 on Sunday September 15, 2019 @03:34PM (#20979054)
Totally, Arch feels snappier in the same hardware that I am surprised that my machine can hold a lot of power for development.
Re:Linux Kernel Fastboot [pdf] by sydney6 on Sunday September 15, 2019 @12:21PM (#20977920)
IIRC Clear Linux's cpufreq governor defaults to performance in contrast to the powersave governor, which most other linux distributions appear to be using. Hence the difference in idle power consumption, i guess.
Re:Linux Kernel Fastboot [pdf] by voltagex_ on Saturday September 14, 2019 @10:06PM (#20975124)
How did you measure the power usage on Windows?

I'm assuming you used Powertop on Linux.

Re:Linux Kernel Fastboot [pdf] by Filligree on Saturday September 14, 2019 @10:10PM (#20975136)
I used Powertop on Linux, yes.

For Windows, I simply let the laptop run until it had used 50% of the battery. Watts = Joules / second.

On Linux, I used the same methodo to calibrate against powertop. (But found less than 5% of discrepancy anyway.)

Re:Linux Kernel Fastboot [pdf] by ComputerGuru on Saturday September 14, 2019 @11:23PM (#20975373)
The only valid approach is to remove the battery and plug it into a kill-a-watt or similar.
Re:Linux Kernel Fastboot [pdf] by tjoff on Sunday September 15, 2019 @09:55AM (#20977208)
Performance and power saving features are vastly different between battery and AC so I don't feel that is relevant at all.

If we are talking about battery-life at least.

Re:Linux Kernel Fastboot [pdf] by ComputerGuru on Monday September 16, 2019 @07:04PM (#20989444)
Yes, and that would be accounting for the wrong thing. Battery life can be stretched out with user hostile things like lowering the brightness to two-digit nits and disabling all background tasks, none of which really help gauge the efficiency.

In fact, what mobile device manufacturers have learned is that the best way to save power is to ramp up power to complete a non-IO task in as little time as possible then go back to a lower TDP as that is where peak efficiency (rather than minimal consumption) lies.

Re:Linux Kernel Fastboot [pdf] by tjoff on Tuesday September 17, 2019 @06:26AM (#20993445)
Accounting the wrong thing?

I think most people are interested in their battery life when they are measuring their battery life.

Numbers you get while plugged in won't have any relevance to battery life or performance. That even applies to mobile devices, despite their learnings.

Re:Linux Kernel Fastboot [pdf] by swiley on Sunday September 15, 2019 @12:37AM (#20975592)
Many laptops aren’t stable at full speed without a battery.
Re:Linux Kernel Fastboot [pdf] by ComputerGuru on Sunday September 15, 2019 @12:43AM (#20975606)
I’m not aware of anything other than a MacBook or some micro ultra books that do that because they try to keep the power brick size down. Any device with a user-removable battery should be able to do that, provided you’re using an adapter that provides sufficient current.
Re:Linux Kernel Fastboot [pdf] by lonelappde on Saturday September 14, 2019 @10:13PM (#20975150)
That's a good way to estimate but not appropriate for comparing to powertop, due to overhead. Also "50%" of energy is an estimate based on voltage, not actually energy usage. That's why Apple has stopped showing percentages in their OSes.

You should use the same methodology for both.

Re:Linux Kernel Fastboot [pdf] by aidenn0 on Saturday September 14, 2019 @11:03PM (#20975313)
I thought most laptop batteries use coulomb counting rather than voltage for estimating battery level?
Re:Linux Kernel Fastboot [pdf] by BeeOnRope on Sunday September 15, 2019 @12:37AM (#20975589)
Yes, any decent laptop for sure uses coulomb counting, not a simple voltage measurement.
Re:Linux Kernel Fastboot [pdf] by jimmaswell on Saturday September 14, 2019 @10:17PM (#20975170)
I'd assume the voltage->percentage function was worked out and the percentage displayed was thus accurate. It would be weird if that wasn't the case.
Re:Linux Kernel Fastboot [pdf] by konstmonst on Sunday September 15, 2019 @05:11AM (#20976308)
It us not. I programmed Accu controller. The best way is to track the enery coming in and out. Using only voltage is imprecise bevause the voltage/charge graph look a bit logarihmic, so the more charge you have, the more presision you need to have while measuring charge.This graph as well as total possible energy capacity and ability to Charge depend on Temperature. Also you normally have multiple cells that age differently.
Re:Linux Kernel Fastboot [pdf] by rabidrat on Saturday September 14, 2019 @10:27PM (#20975198)
I think it varies with the age of the battery and the operating temperature (probably other things too). Although if they were clever they could probably incorporate those parameters as well..
Re:Linux Kernel Fastboot [pdf] by Filligree on Sunday September 15, 2019 @12:39PM (#20978040)
They use coulomb counting, along with an estimate of how much safely-usable energy is left in the battery.

That estimate is usually accurate, but it can drift a bit over time if you never fully recharge or discharge the battery. Also, when the battery gets old it starts having trouble delivering full current when mostly discharged, which is why you'll sometimes see shutdowns at 5-15% remaining.

Re:Linux Kernel Fastboot [pdf] by mycall on Saturday September 14, 2019 @11:49PM (#20975473)
You could do further browser optimizations through about:about
Re:Linux Kernel Fastboot [pdf] by cerberusss on Sunday September 15, 2019 @06:59AM (#20976656)
The XPS 13 9380 is available with Linux pre-installed, why would you want to mess with that? Or was it a fun/hobby thing?
Re:Linux Kernel Fastboot [pdf] by Filligree on Sunday September 15, 2019 @11:27AM (#20977630)
I feel that going from 8W to 3W, while gaining a more usable system that also sits on ZFS instead of ext4, is more than enough reason.

ext4 doesn't detect corruption. How am I supposed to trust it?

Re:Linux Kernel Fastboot [pdf] by zlynx on Monday September 16, 2019 @09:17PM (#20990252)
And corruption actually happens.

My Dell has an Sk Hynix NVMe drive that apparently doesn't have safe write on power failure. I know because it somehow woke up in my bag and ran the laptop battery down to 0.

BTRFS was not happy with the state of anything on the drive. I was able to do a rescue copy and verify it with my backups, so after a full restore everything turned out OK.

Re:Linux Kernel Fastboot [pdf] by cerberusss on Sunday September 15, 2019 @01:53PM (#20978473)
It seems like a good deal but what about the support and the upgrade path from Dell?

I get what you're saying about the filesystem. Personally, I use par2 for the most important things (photos).

Re:Linux Kernel Fastboot [pdf] by Filligree on Sunday September 15, 2019 @03:09PM (#20978931)
What about it? It doesn't seem to be enormously useful, given I can do so much better on my own.

I got the laptop to have well-supported hardware, not because I was expecting a lot of help from Dell.

Re:Linux Kernel Fastboot [pdf] by cerberusss on Sunday September 15, 2019 @04:05PM (#20979204)
Is that all there is to it, just well supported hardware? Dell didn't configure Redhat in any way, to make better use of the hardware? I'm thinking trackpad, sleep and hibernation, graphics etc.?
Re:Linux Kernel Fastboot [pdf] by Filligree on Monday September 16, 2019 @09:07PM (#20990190)
Ubuntu, not Redhat.

And no, it seems they didn't. They haven't forced deep sleep, for example.

Re:Linux Kernel Fastboot [pdf] by cerberusss on Tuesday September 17, 2019 @12:19AM (#20991494)
Thanks, very interesting to know about these little shortcomings, and how you solved them.
Re:Linux Kernel Fastboot [pdf] by Twirrim on Sunday September 15, 2019 @02:28AM (#20975881)
> Until now, Clear Linux wasn't even on my radar. Today, it is. Anyone have some experiences with this distro (for better or worse) that they'd like to share?

I'd urge some caution. It depends on your use case and the accuracy requirements you have. Clear Linux gets a chunk of its speed boosts by using compiler optimisations that most distributions won't touch because of the possibility they'll reduce accuracy and move outside the bounds of various standards, e.g. --ffast-math. Clear Linux also sets it so that by default when you go to compile stuff, it ends up picking up their "optimised" set of compiler flags too.

It works, it's fine, it's fast. Just make sure you know what you're getting and what the consequences for your software might be (I'm sure most people _don't_ have strict IEEE standards to care about, for example)

Re:Linux Kernel Fastboot [pdf] by bt848 on Saturday September 14, 2019 @10:43PM (#20975241)
Booting a Sun in the 90s took so long that we had the janitor go and power up the CAD lab half an hour before anyone got to the office. Whatever you are nostalgic for wasn’t a Sun.
Re:Linux Kernel Fastboot [pdf] by loki49152 on Saturday September 14, 2019 @11:06PM (#20975321)
Our Sun lab ran on SunOS 4.1.1. Its NFS implementation was so unstable we'd get perhaps an hour and a half of use at a stretch before the file server would reboot... on an 8 machine network.
Re:Linux Kernel Fastboot [pdf] by webreac on Sunday September 15, 2019 @03:16AM (#20976010)
When I was student, we had around 80 machines without local disk. It was working fine. They added local disks the year after with a sensible gain of performance. I loved this machine.
Re:Linux Kernel Fastboot [pdf] by jcastro on Saturday September 14, 2019 @09:47PM (#20975078)
Been using it on my work laptop for about a year now, it's nice if you want a normal GNOME desktop and cloud tools. It silently updates itself in the background multiple times a day, which is really nice, there's really no need to do manual maintenance.

Most of the useful apps are available via flathub, which it comes with so you just install slack, vscode, etc. that way.

Re:Linux Kernel Fastboot [pdf] by tvst on Saturday September 14, 2019 @11:38PM (#20975436)
Clear Linux is blazing fast (compiled with Intel compilers), and supposedly has a strong security model -- but it also has an extremely limited package selection. To the point that it's just not usable for me.

Also, its package manager forces you to install "bundles" of somewhat related packages rather than just the specific packages you want and their deps. Maybe I'm missing something, but I find this very odd.

Re:Linux Kernel Fastboot [pdf] by zbjornson on Sunday September 15, 2019 @02:56AM (#20975957)
> compiled with Intel compilers

This is a common misconception. It's not built with ICC, it's built with GCC (and some parts maybe with Clang).

When did you try Clear? They have about 6200 packages now, but I'm not sure if that's still "limited" in relative terms.

Re:Linux Kernel Fastboot [pdf] by tvst on Tuesday September 17, 2019 @01:38AM (#20991941)
Oh interesting. I did not know it used GCC. It feels super snappy, nonetheless.

Last time I tried it was a couple of months ago. I don't recall what it was missing, but it was some core part of my normal python development environment.

Re:Linux Kernel Fastboot [pdf] by etaioinshrdlu on Saturday September 14, 2019 @09:40PM (#20975047)
My experience with Clear Linux maybe a year ago was that it was one of the more unusual linux distro's I've tinkered with. They seem to be reinventing the wheel in many places, for example, it has its own package manager, and its own unique implementation of containers. Stuff that would seem to not have much to do with performance.

Also, NVIDIA CUDA drivers didn't work. Not sure who's fault that is. Probably both NVIDIA and Intel's.

All in all, it did boot quickly on AWS, but it was not a fun time at all.

Re:Linux Kernel Fastboot [pdf] by alfiedotwtf on Sunday September 15, 2019 @07:47AM (#20976809)
I found it weird at first that you had to explicitly state Sparc and Solaris, but I guess we’re now at the point we’re a lot of users here weren’t around during Sun’s shine
Re:Linux Kernel Fastboot [pdf] by icedchai on Saturday September 14, 2019 @10:16PM (#20975165)
I think Sun must've tried and failed. Boot times on late 90's era Solaris/Sparc systems were atrocious compared to Linux/x86 systems of the day.
Re:Linux Kernel Fastboot [pdf] by bt848 on Monday September 16, 2019 @03:54PM (#20987933)
Just to underscore this, here's a video of some guy booting an Ultra 45, the last workstation Sun ever made. It takes 30s just to go from power-on to firmware initialized and another minute and a half to start Solaris. Older equipment such as a SPARCStation 20 would take much longer.

https://www.youtube.com/watch?v=BjshAKzhxTE

Re:Linux Kernel Fastboot [pdf] by icedchai on Monday September 16, 2019 @04:07PM (#20988061)
On their mid-range "Enterprise series" systems (Enterprise 3500, 450, etc.) it was much worse. I remember it taking a good 2 or 3 minutes just to get through firmware initialization...