Lenovo's lackluster linux support makes my 4800U quite slow in some applications
I have an Ideapad 5 15ARE05 equipped with a 4800U. It's quite a beast, and I knew going in that it's not validated for Linux, but saw a lot of evidence around the internet that it did fine.
I have a specific application (won't advertise it) that was strangely performing about 2x slower than my i5-6600 equipped server, sometimes worse.
(Programming sidenote) after some profiling I tracked it down to slow mutex handling and, the worst of all, getting the current clock time.
After some digging I found that the system's clock source was `hpet` not `tsc` (which my other system had). dmesg shows:
kernel: tsc: Marking TSC unstable due to check_tsc_sync_source failed
A simple program profiling how long it takes to get the current time yields 1 microsecond for this system with a 4800U, and 100x faster (10 nanoseconds) for the i5-6600 system. Holy crap!
In the end it served to learn that our application does way too much time polling, though I'm not sure if this can also affect mutex handling / context switching. I'd imagine yes, depending on how linux handles that? Some of the things can be changed to re-use time polls, others not so much. I don't think it will be faster than my i5-6600 for this application any time soon, bah.
I found this thread with a similar issue on an older Ryzen CPU: https://bugzilla.kernel.org/show_bug.cgi?id=202525 . I tried to patch the kernel myself but no luck, it's possible I'm not doing it right as I'm very outside my comfort zone.
This is very much on Lenovo's side according to the OP in that thread, and they fixed the BIOS for his older laptop so the clock source is stable. Perhaps I should contact them... or will have to end up switching to windows :|
I haven't found any reports of this issue on reddit so I guess this can serve as a sort of PSA on using these new Lenovo laptops on linux. And if anyone has a Renoir CPU, check what this program says for you. It takes ~1000 nanoseconds / iter on my new system. https://godbolt.org/z/rao51d
Or if anyone can provide assistance on the issue, of course that's even better. Thanks for reading!
Posted Jul 9, 2020, 1:41 PM UTC