My CPU is AMD A6-9220 RADEON R4. I use Ubuntu 16.04.1. No additional (proprietary) drivers available. CPU loads both in Chrome and Firefox, hardware acceleration is off in Chrome. It happens when I scroll page mostly. Or when browser open and I do something else (run some other tasks).
Something wrong exactly with browsing, I can do much more heavy tasks without such reaction from CPU (I can watch HD-videos for instance from HDD without making it load more than 23%).
As top
command showed it's mostly Xorg
process that eats a lot (50%).
So, you got me curious, and I decided to profile Xorg a bit. Note: I don't have debug symbols installed (and you can't really trust them with optimized code anyway), so the output I got is somewhat scarce, but nonetheless…
Here even more time than in Xorg itself being spent in r600_dri, which is a userspace graphics driver.
The conclusion we can make is that to reduce CPU overhead you need to upgrade your drivers, because there (as in any project, FWIW) constantly new optimizations are going. Of course you hardly notice a difference from a few months of work, but maan, the 11.2.x Mesa version that your 16.04 is using is ancient!
For comparison I pulled up Firefox on youtube, and scrolled for a bit there. Results are below; a number of samples is a bit bigger, perhaps because I scrolled more intensively, or longer, or both.
This time the difference between graphics driver and Xorg is even bigger, in preference of the driver.
However, interestingly, the most dominating entry was glibc's
arena_get2.part.4
. What could that be? I couldn't find the exact result on google, but I did find this source file which suggests it's most likely about memory allocation.To reduce the impact of this one you would probably be interested in per-thread malloc cache optimization that is part of glibc 2.26 release. Nowadays, after all that Spectre and Meltdown stuff happened, the optimization matters even more as it becomes even more important to not go into kernel space too often.
I presume, it's libc6 package that Ubuntu Xenial has at 2.23 version. You might be tempted to upgrade this specific one package, but be admonished that it might break something, because this library is at the very core of the system. The best way to get it would be upgrading to 18.04 which has 2.27 version.
Interestingly I have an r300-era card (Mobility Radeon 200M) and much more ancient CPU in my laptop and both were faster than the problem case described here and without CPU spikes - until I have upgraded my system!
First I thought it is the kernel, but downgrading to old Xorg and mesa made everything faster than ever.
I do not know what is going on, but for some reason, GPU acceleration became much more CPU-intensive. Also in my perf output, I mostly see memory movements taking place in most of the times. On my single core CPU that makes 100% CPU usage, while reverting to an old mesa+xorg I get at most 25-40% and not in the GPU drivers. Something clearly got wrong at one point.
See here for full analysis: https://www.phoronix.com/forums/forum/linux-graphics-x-org-drivers/open-source-amd-linux/1099745-how-to-tell-if-a-driver-is-gallium-or-just-mesa-slow-renderng-with-radeon/.
You have a low-end slow CPU. It's gonna show high load even in general use. Benchmark sites list it as significantly slower than traditional low end CPU's such as Intel I5 5200u.