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. NVIDIA GeForce GTX 970 Offers Great Linux Performance
  2. CompuLab Intense-PC2: An Excellent, Fanless, Mini PC Powered By Intel's i7 Haswell
  3. From The Atom 330 To Haswell ULT: Intel Linux Performance Benchmarks
  4. AMD Radeon R9 285 Tonga Performance On Linux
Latest Linux Articles
  1. Ubuntu 14.10 XMir System Compositor Benchmarks
  2. Btrfs RAID HDD Testing On Ubuntu Linux 14.10
  3. Ubuntu 14.10 Linux 32-bit vs. 64-bit Performance
  4. AMD Moves Forward With Unified Linux Driver Strategy, New Kernel Driver
Latest Linux News
  1. Intel GVT-g GPU Virtualization Moves Closer
  2. GTK+ 3.16 To Bring Several New Features
  3. Debian 8.0 Jessie Has Many Multimedia Improvements
  4. What Linux Benchmarks Would You Like To See Next?
  5. Open-Source, Linux Support For Corsair Link Devices Slowly Materializing
  6. Cairo-Dock 3.4 Shows A Lot Of Progress, Works Toward EGL/Wayland Support
  7. Mesa 10.4 Tentatively Planned For Early December
  8. SteamOS Update 145 Brings Compositor, Update Fixes
  9. GStreamer 2014 Conference Videos Posted: Wayland, HTML5, 3D
  10. Nouveau Now Supports DRI3 Without GLAMOR
Latest Forum Discussions
  1. HOPE: The Ease Of Python With The Speed Of C++
  2. Updated and Optimized Ubuntu Free Graphics Drivers
  3. Linux hacker compares Solaris kernel code:
  4. Users/Developers Threatening Fork Of Debian GNU/Linux
  5. Ubuntu 16.04 Might Be The Distribution's Last 32-Bit Release
  6. AMD Releases UVD Video Decode Support For R600 GPUs
  7. Proof that strlcpy is un-needed
  8. xbox one tv tuner