1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Memory
  5. Motherboards
  6. Processors
  7. Software
  8. Storage
  9. Operating Systems


Facebook RSS Twitter Twitter Google Plus


Phoronix Test Suite

OpenBenchmarking.org

Samsung Laptops Will Soon See Better Linux Performance, Less Bugs

Hardware

Published on 05 March 2014 03:15 PM EST
Written by Michael Larabel in Hardware
7 Comments

The performance of several different Samsung laptop models will soon improve under Linux thanks to an important kernel fix that will appear in the Linux 3.15 kernel. This important patch addresses some ACPI issues and system performance issues for multiple Samsung laptops that have plagued Linux for at least two years.

Going back to the first half of 2013 has been Kernel.org Bug #57271. The bug initially describes an issue when an AC adapter is connected to a Samsung laptop that the system suddenly becomes a lot less responsive, but the system turns back to being more responsive if removing the AC adapter.

The system responsiveness when changing power states also correlated to differences in system performance for real-world benchmarks. The reporter of Bug #57271 was commonly using the Phoronix Test Suite and OpenBenchmarking.org for illustrating the performance issues. Here's one of the result files showing the performance drop when the Linux kernel gets confused on Samsung hardware:


The Samsung laptop Linux performance issue was initially believed to be a common Samsung laptop problem with a EC bug in their ACPI table. When a power adapter is connected after boot, Linux believes there's no power adapter attached, and vice versa. When Linux thinks the laptop is running on battery power, the CPU performance goes into its power-saving mode that generally leads the CPU frequency to being run in its lowest power state and thus affecting the overall system performance. However, this didn't end up being the reason for this latest round of Samsung Linux laptop troubles.

Samsung Laptops Will Soon See Better Linux Performance, Less Bugs


While the original thought made sense, a discovery last month for the issue is more complicated, per this bug comment on a related open Samsung Linux laptop bug. Kernel.org Bug #44161 dates back to 2012 and has seen more than 160 comments. The root cause of all these issues come down to the embedded controller on several Samsung laptops -- when the EC receives too many events, the embedded controller decides to no longer interrupt the OS with any more events until they have been queried. Linux, on the other hand, isn't proactively querying the controller since it receives no interrupts that there are new events to handle. These EC events are generated while the laptop is in its S3 sleep state, which end up being useless when the system resumes, and aren't queried by Linux when they occur with the laptop being asleep.

Essentially the embedded controller is getting stuffed with too many queries, the buffer is full, and is not emptying these events, even after reboots. The fix to the reported bug is removing the battery and hitting the reset button (on laptops with removable batteries and a reset button hidden behind there), flashing the BIOS to ultimately reset the EC, or a simple debug user-space utility was written that forces queries of the embedded controller. When that utility is run, the Samsung performance is fixed.

Besides performance, this bug was tracked down to issues of AC power not being detected, lid closures not triggering suspend, ambient light sensors not triggering the keyboard backlight, and other issues.

The work now being done within the Linux kernel is for stopping embedded controllers from generating events while sleeping and also for clearing events when the system wakes, with Microsoft Windows currently employing the former approach. Besides Kernel.org bugs #57271 and #44161, LaunchPad Bug 971061 is also in regards to a related Samsung ACPI problem and that issue has been open since 2012. Among the models believed to be impacted by this issue include the Samsung Series 5 NP530U3C / NP535U3C / NP530U3B / NP550P5C and Samsung Series 9 NP900X3F / NP900X4B / NP900X4C / NP900X4D / NP900X3C.

As of this week, there's now a patch accepted into the linux-pm next Git tree to clear stale EC events on Samsung systems. This patch will be introduced into the Linux 3.15 kernel (not 3.14) and should fix this problem for many Samsung Linux users.
A number of Samsung notebooks (530Uxx/535Uxx/540Uxx/550Pxx/900Xxx/etc) continue to log events during sleep (lid open/close, AC plug/unplug, battery level change), which accumulate in the EC until a buffer fills. After the buffer is full (tests suggest it holds 8 events), GPEs stop being triggered for new events. This state persists on wake or even on power cycle, and prevents new events from being registered until the EC is manually polled.

This is the root cause of a number of bugs, including AC not being detected properly, lid close not triggering suspend, and low ambient light not triggering the keyboard backlight. The bug also seemed to be responsible for performance issues on at least one user's machine.

About The Author
Michael Larabel is the principal author of Phoronix.com and founded the web-site in 2004 with a focus on enriching the Linux hardware experience and being the largest web-site devoted to Linux hardware reviews, particularly for products relevant to Linux gamers and enthusiasts but also commonly reviewing servers/workstations and embedded Linux devices. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics hardware drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated testing software. He can be followed via and or contacted via .
Latest Linux Hardware Reviews
  1. Scythe Mugen MAX
  2. Intel Core i7 5960X Haswell-E On Linux
  3. Intel 80GB 530 Series M.2 SSD On Linux
  4. With A New Motherboard, The Core i7 5960X Haswell-E Lights Up
Latest Linux Articles
  1. A Tour Of The New Phoronix Office
  2. 7-Way Linux Desktop Gaming Comparison On Ubuntu 14.10
  3. Intel P-State vs. CPUFreq Benchmarks On The i7-5960X
  4. RadeonSI GLAMOR Benchmarks With X.Org Server 1.16
Latest Linux News
  1. Linux 3.17-rc6 Released; Linux 3.17 Final Might Come In One Week
  2. X.Org Server 1.16.1 Released
  3. Mesa Gets Closer To Having OpenGL 4.0 Tessellation Support
  4. Uselessd: A Stripped Down Version Of Systemd
  5. F2FS Tools Gain FSCK Support
  6. FreeBSD 10.1 Has The New VT Driver, Hardware Improvements
  7. AntiMicro 2.6 Yields Greater Compatibility For Gamepads On Linux
  8. OpenGL 3.3 / GLSL 3.30 Lands For Intel Sandy Bridge On Mesa
  9. AMD's RadeonSI Gallium3D Driver Sees Some Improvements
  10. Mesa 10.3 Released With The Latest Open-Source GPU Driver Improvements
Latest Forum Discussions
  1. Wasteland 2 Officially Launched Today, Including For Linux Gamers
  2. Trolling on the Phoronix forums
  3. X.Org Women Outreach Program Only Turns Up Two Applicants So Far
  4. New stress testing utility for GPU's
  5. ASRock AM1H-ITX: One Of The Best AM1 Mini-ITX Motherboards
  6. Can Linux kill a motherboard?
  7. Stop grabbing my keyboard :(
  8. New Group Calls For Boycotting Systemd