Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have ported a recent kernel (4.4.x branch) to one of our custom ARM ( imx53-based ) boards.
This board has been running kernel 2.6.35.x for some years, and at this time we decided we needed newer kernel ( for wifi operation). so far so good
When running this a NEW ( recent ) kernel 4.4.61 ( and/or 4.4.73) I see a HIGH CPU load compared to the older 2.6.35 kernel ( when running the same applications)
Comparing systems is difficult I know.. but... What has been changed ? only the KERNEL ( same hardware, same gcc-compiler, same C-lib, same user-space applications) only the KERNEL has been upgraded (nothing else) , both boards I compare are identical .. running at the same clock-speed... same amount of ram / storage. ! 100% sure on this ! .
When comparing 2.6.35.x to 4.4.x kernels I see that a LARGE fraction of the CPU power is consumed into system ( looking at TOP)
Means : 9% system vs 35% system ( 100% sure running same userspace app's )
When comparing the number of interrupts on the old versus the new kernels.. I get approx.the same 'number' of interrupts on both kernels.
cool smiley The New kernel seems to be very slow for ‘kernel’-calls … For example 10 million clock_gettime(CLOCK_MONOTONIC, &tp) calls on the
2.6.35 kernel takes 98 seconds
4.4.61 kernel takes 280 seconds.
When for example doing 10 million calculations ( add or multiply) I do have the same ‘calculation time’ on both kernels.
C) For the new kernel there are a LOT of ‘alignment’ fixes… ( may this is a reason of being slow to)
Any one able to pinpoint me in a direction ? why the new 4.4.61 kernel consumes so much system time ??????
Eve been searching into the kernel code .. for weeks now.. hoping to find any possible explanation why the NEW 4.4.x kernels take so much CPU power. ( configuration of both kernel is matching as good as possible, same scheduler-config, same timer config.. etc etc.)
But I cant not find / explain why so much cpu power is consumed by the new 4.4.x kernel itself.
Thanks for the Hint.. I did patch ( as described in your link) ... which leads to less alignment error ... ( alignment errors occasionally count... 2 a 3 times second, which is quite reasonable , before it was counting 200 alignment errors a sec.)
BUT .. sill no improvement in CPU load ...
at this time I have compared... 2 empty systems... ( running NOTHING) except HTOP / top.
You moved two major-versions ahead in one swoop. The CPU-handling, and the reporting of the same, can be expected to be very substantially different between the two. You are, in this case, comparing apples to oranges. "Yes, it's still Linux. No, it's not."
I know that I moved couple of versions ( 2.6.35 -> 4.4.x is quite a big step there is no discussion about that, we all know that, and want to understand that )
BUT I did not expect the same 'user application' (for example TOP / HTOP , or my custom application) to use that MUCH CPU ( running on 100% the same hardware configuration ). { did not recompile any application, the only thing that has been upgraded is the kernel nothing else , same compiler, same Clib, etc..}
Reaction speed/time of my custom app is very bad.. when I compare .. 2.6.35 to 4.4.x ( even with the same (aprox the same) kernel configuration)
I do not compare apples with oranges, I do compare the reaction speed of both kernels on the same user application, and I can not understand that an 'empty/clean' Linux system (custom app being removed) just running TOP (or HTOP) on a ARM CPU (running at 1GHZ) is causing 31% of cpu load on a 4.4 l kernel and 1% on 2.6.35-kernel.
{ I show you here the results on top/htop because everyone know this, but the 'real' issue I'm fighting with is the fact that all is responding very badly on those 4.4.x kernels ! }
I don't know if you did take a good look at the numbers I showed you in the reporting before but, keeping a 1GHZ CPU busy for more then 31%, will require some 'heavy' looping in the kernel ( I did not recompile TOP / HTOP ) which leads me to the fact that the recent kernels are eating .. LOTS of CPU power... ( FYI: the system was nearly empty , just init, shell, and TOP/HTOP, and sshd)
whatever you seem to do on a 4.4.x kernel .. it seems to be using that much cpu very quickly, and due to this high cpu load all applications ( even bare basic system application like top/htop / watch .. etc ... ) are NOT running smooth !
Both system I compare have been stripped down to a 'bare' minimum required ( When I compare both.)
( I could send you a screenshot .. of both if you want.. 100% the same processes are running... same builds, same versions, build with same compiler, running on the same HARDWARE , the SINGLE change is the kernel-version 2.6.35 vs 4.4.x ! )
I have exactly the same number of TASKS/processes (in htop) and I have exactly the same process layout (when comparing both).
On the 4.4.x kernel I see HIGH CPU load, 'system load' ( what means kernel load) on the 2.6.35 kernel.. I have way less cpu load. ( Running exactly the same number of applications)
On the 4.4.x system I see a load up to +31% (system) on HTOP/TOP while I see for the 2.6.35 kernel... a load of 1% ... with the SAME processes running ! ( you can count on that )
Spending 31% load on a 1GHZ CPU ... with a system that is nearly 'empty' while on the same hardware and a 2.6.35. kernel ( 100% same setup , same process tree ) I nearly have 1% CPU load.
And the load is that different on both kernels you can 'feel' this ( you can see this in almost every action you take, for example on display drawing, reaction on key-input.. etc etc...)
(since I can not include pictures here I've include some 'live' textual info)
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
It's probably a cpu kernel config issue. One wrong move and you can really slow down a system. Did you generate a new kernel config based on the new kernel?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.