
X1 Carbon 6th gen about 50% slower on Linux - preek
https://200ok.ch/posts/2018-09-26_X1_carbon_6th_gen_about_50_percent_slower_on_Linux.html
======
amluto
Wait, what? From reading the git repos a bit, it seems that Lenovo and Intel
have created some framework that is, in its default state, modifying the
thermal MSRs every five seconds via SMI (presumably).

Let that sink in. Somehow, rather than letting the CPU run with reasonable
parameters and letting the EC control fans as needed, they are forcing the
system into SMM (which interrupts _everything_ on all cores) to fiddle with
thermal parameters. And they want some ridiculous user space library (DPTF) to
reconfigure this mess to actually do something sensible.

WTF

edit: Wow, the Intel code in question is hilariously enterprisey. Check this
out:

[https://github.com/intel/dptf/blob/master/DPTF/Sources/Polic...](https://github.com/intel/dptf/blob/master/DPTF/Sources/Policies/ActivePolicy/ActivePolicy.cpp)

and that repo is full of files like SuchAndSuchFacadeInterface.h.

I swear that at least 95% of the code doesn’t do anything. Maybe 99%.

~~~
m_mueller
I’ve looked at this code a bit and.... seems relatively straightforward to me.
Am I too much used to enterprise code? Do you just mean the verbose naming?

~~~
amluto
I mean the sheer amount of abstraction. On a brief inspection, this code
essentially does:

when temp > upper_threshold: turn fan on until temp < lower_threshold

For a vendor-provided set of tuples (temperature, fan, upper_threshold,
lower_threshold). And it’s not really clear whether the code is intended to
handle the same temperature or fan occurring more than once.

This logic could be written in maybe 100 lines of code if all the abstraction
were removed, and that’s if full support for repeats is needed.

Instead there are layers and layers of abstraction. Also, this code doesn’t
belong in a user program or even on the main CPU at all. It belongs in the
embedded controller.

------
angelsl
As far as I understand, the thermal limit at 80C and TDP limit at 15W on Linux
is what Lenovo actually intended, and the limits on Windows are broken.

At least according to this Ubuntu maintainer:
[https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1763144...](https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1763144/comments/28)

~~~
nixpulvis
In tomorrow's news: "Lenovo's recent BIOS patch reduces performance of 6th gen
ThinkPads by up to 50%!"

~~~
mooman219
Next week: "Lenovo doubles 6th gen ThinkPad performance in recent BIOS patch"

------
nixpulvis
At first was prepared to be upset by this post (as a user of a 6th gen
ThinkPad), but now I'm quite happy. I already knew about the thermal setting
difference between Windows and Linux and I've been VERY irritated by the sleep
state issue. I didn't know there was a BIOS update! Thank for the heads up.

~~~
Amygaz
Current 5th gen user, coming from a MacBook Air 2013, I can’t believe people
think the thinkpad is a great laptop. Running Linux on this never even crossed
my mind.

(Edit: specified Mac vs thinkpad I don’t like)

~~~
nixpulvis
Are you saying the Thinkpad is a bad laptop? I'm a bit confused.

I also have the 5th edition (my first new Linux laptop) and I can't even begin
to say how happy with it I've been. Setting up all my UIs and learning how to
use Linux as a "User" not an "Administrator" has been a lot of fun. I now
start the network instinctively with a quick terminal command (fish history is
great). I quickly got used to (and now much prefer) a tiling window manager
like i3. And above all, I've gotten used to the extra work of reading through
changes to packages as they come in with Arch.

This laptop feels "just right" as a recent Apple user. It's got that anti-
apple vibe, without feeling like a crap piece of plastic.

Now all Lenovo/Linux needs to do is match Apple's trackpad feel, and I'll call
this is wash.

~~~
lgunsch
I second this setup! I run Arch Linux on a Lenovo X1 Carbon 5th gen, I use i3
wm, and my shell is Fish. I've used Arch, i3, and Fish for about 4 years now.

------
archi42
I think ThinkPads are renown for the earlier products (eg T410 or the x200
series). Much like the Dell D630 used to be a Linux favourite.

The BIOS sleep state issue seems common with modern Lenovos though (my 2nd Gen
Helix is also a mess), which is a real shame because the hardware is great.

~~~
dfox
It is funny how the definition of what is "the last true ThinkPad" shifts with
time.

~~~
berbec
Used to be the E series. The the T60p. Then the x260. Soon The X1 Carbon
Extreme will be the last jedi

~~~
dfox
It used to be "anything before letter-series", then T42, then X41, then T60,
then X200...

In essence the main thing that tends to shift is what is the "defining
feature" of thinkpad. For T42 an X41 it was keyboard without windows keys and
with textured trackpoint buttons, then it was 5-row keyboard and so on...

Another point in regards to this is that at least for me the really good
ThinkPads started with the letter series, which is also the time when IBM
started to outsource both design and manufacture. And the difference is
plainly visible with traditional IBM's overengineering (eg. 600E, which is
supposed to be low-cost model, is pain to disassemble and contains two
handfuls of various weird and wonderful machined aluminium brackets,
mainframe-style) being replaced with design that meaningfully balances cost,
reliability and serviceability.

------
nikki93
The T480s is a great alternative, been using it for a bit, no Linux issues at
all. Works great with NixOS.

------
Havoc
That's an issue for sure, the logic here is pretty damn terrible though.

For a <1 min test yeah it's slower. (Essentially a race from "cold" temp to
the respective temp limits - the one has more runway). Run both at full
throttle for 5 mins and I suspect you'll find they'll both perform equally
(since they're both repeatedly bumping up against their respective thermal
throttling).

...still shouldn't be happening at all though.

~~~
preek
Actually, it's exactly the same - and mentioned in the article.

I ran the tests for 20min, as well. But then the screen shot of s-tui won't
cover the whole length of the test, so I chose to show those screen shots
while only mentioning that longer benchmarks perform exactly the same.

------
Symmetry
It's not unusual for things to still be getting sorted out on Linux a few
months after a new laptop hits the market but to me this seems awfully late
for these issues to not be sorted out yet. Didn't this laptop come out early
in the spring?

~~~
preek
I agree that this is typically the case and generally is totally OK! I was
assuming that the issue has been fixed because BIOS version 1.28 said
something about "power issues" that were fixed, but didn't go into detail.
However, it's obviously still an issue - and I know of people who asked
support weeks ago and haven't heard back, yet. So it's good to have a reminder
out. The fix is rather easy to apply and it's worth it - considering the
gains(;

The 6th gen came out in January '18:
[https://en.wikipedia.org/wiki/ThinkPad_X1_Carbon#2018_%E2%80...](https://en.wikipedia.org/wiki/ThinkPad_X1_Carbon#2018_%E2%80%93_6th_generation)

------
desireco42
I actually think that having a cooler laptop is advantage and often I would
like to be able to make the choice. So to me, this is not a bad thing, wish
there was a setting where you can say how cool/hot you would allow your laptop
to run.

~~~
cannonedhamster
You can write a script to check the CPU temps in linux and set the fans to
kick on at different power levels for certain temps and just run it as a timer
event. I did this for a Macbook I had Arch running on when it was running
hotter than I liked.

~~~
oever
Could you share your setup? There are so many tools available for tuning of
power use and fans. It's hard to pick the right one.

I'd prefer to run my laptop with as few fan activity as possible without
overheating. So when the CPU gets too hot, clock it down instead of starting
the fan.

------
sandov
Can anyone point me to a good resource on updating the BIOS/firmware under
Linux?.

I know absolutely nothing about it, and it looks like the user has to manually
do it. And the obvious question: How do Windows users do it? When they are
even less knowledgeable than me (generally speaking).

~~~
bubblethink
Newer laptops supported by fwupd (fwupd.org) are more straightforward on
linux. For the older ones, you take their windows bios image, and use
Geteltorito
([https://wiki.archlinux.org/index.php/Flashing_BIOS_from_Linu...](https://wiki.archlinux.org/index.php/Flashing_BIOS_from_Linux)).
Windows users open an exe file.

------
mbell
This should make for an interesting test of the level of anti-Apple group
think out there as this is the same fundamental issue that caused the 2018 MBP
fiasco. MBP power limit was set too high, this laptop has it set too low.

~~~
nixpulvis
Except, correct me if I'm wrong. Here it's much MUCH easier to fix/change
yourself.

~~~
mbell
In the MBP case you just waited for ~7 days for the fix to be delivered to you
automatically. In this case you figure out how to update your BIOS under linux
which is often non-trivial and then figure out how to install this which has a
bunch of caveats: [https://github.com/erpalma/lenovo-throttling-
fix](https://github.com/erpalma/lenovo-throttling-fix) . There doesn't seem to
be any indication what a 'real' fix is and whom is going to provide it.

Which one is 'MUCH easier' is up to you.

~~~
kjeetgill
How well did Linux run out of the box on the new MacBooks on shipping day?

~~~
RL_Quine
They simply don't, and are unlikely to every comfortably do so due to how
custom the hardware is getting (ie, the keyboard is a SPI device).

~~~
kjeetgill
I agree, and that's exactly my point. They're comparing a stumble in Lenovo's
Linux support to Apple's MacOS support.

------
rayascott
What software is that on the right in the screenshots with the graphs? Anyone
know?

~~~
preek
s-tui, a good tool for top-down checks like the one in the article.

~~~
rayascott
Thanks! :-)

------
Bayart
On an unrelated note, what's the monitoring software you've been using on the
right ? It seems quite nice.

~~~
mifix
It is s-tui
([https://github.com/amanusk/s-tui](https://github.com/amanusk/s-tui)).

------
rickdg
Why is AMD taking so long to beat up Intel and take their lunch money?

------
pbhjpbhj
TLDR - due to conservative temperature levels at which to initiate CPU
throttling; and the article links to a fix (as well as saying sleep is fixed
with a "BIOS" update).

------
jryan49
Things like this is one of the reasons why I gave up trying to put linux on
laptops.

~~~
cannonedhamster
Never had a problem with my Thinkpad or my System76 laptop. If something has
Windows support directly it's not surprising that it it would run better than
something done in the spare time of developers. I've never had terrible luck
with any linux on laptops though, aside from the Macbook. What kinds of
problems did you run into and on what types of laptops?

~~~
jryan49
Two think pads. They just didn't even come close to the battery life that
Windows did. And I'm a very advanced used, been using Arch Linux since 2008,
and have every part of my system tweaked. It just seemed like the hardware
support and drivers weren't there. Specifically the T440s. I forget what model
it was before that one. I'd also get suspend issues on both. I dumped a lot of
time into it.

------
Retr0spectrum
[comment complaining about low contrast text]

Edit: I'm curious - this comment has a good number of upvotes, but it's
sitting right at the bottom of the page, below greyed-out downvoted comments.
Do moderators have a "super downvote" option or something? To be clear, I'm
not complaining about moderation (this is a low quality comment), just curious
exactly how this works.

------
carlivar
So for those that don't do cpu intensive tasks on their laptop, there is no
performance difference?

Works for me.

~~~
Retr0spectrum
Is this sarcasm?

Why spend $$$$ on a laptop with a beefy CPU if you aren't going to use it?

~~~
Brakenshire
A beefy CPU which quickly hits its thermal limit is pointless.

~~~
Retr0spectrum
I'm not disagreeing with that.

~~~
Brakenshire
That often seems to be the case with ultrabook type laptops. They try to
charge $100 more for a CPU you can only use for 2 minutes.

