Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
I have a stupid question . Linux kernel has its own process scheduler algorithms and it grants processes the chance to run based on credit algorithm, according to this algorithm the more cpu time a process accumulates the lower its priority becomes.
My question: based on the above information, why we see sometimes one process eating up all CPU ? does it take high credit from the kernel ? or its instructions need more CPU cycles ?
specially java programs it takes alot of cpu utilization.
IIRC the CFS uses a r-b tree to track process usage - if there is no process more "deserving" of using the processor, a "hungry" task will continue to get scheduled.
java is a CPU pig - well, it's just a piece of crap all round I guess ...
I have a stupid question . Linux kernel has its own process scheduler algorithms and it grants processes the chance to run based on credit algorithm
Not a stupid question at all. If you really want to know the answer, you probably need to look at this book (now horrendously outdated) - Understanding the Linux Kernel - Process Scheduling - and then diving into the kernel source itself. Most of the relevant code is in linux/kernel/sched.c. There are different scheduling policies depending on your kernel version and whether they're enabled or not. I'd be curious to know how the 2.6.x kernel does it as I only mucked around with the kernel when it was 2.2.x and I was in school...
Anatomy of the Linux kernel: 'The Linux® kernel is the core of a large and complex operating system, and while it's huge, it is well organized in terms of subsystems and layers. In this article, you explore the general structure of the Linux kernel and get to know its major subsystems and core interfaces. Where possible, you get links to other IBM articles to help you dig deeper'
In the above you will find loads of definitive information. Some will be dated but relative to the current kernel. If you look at Kernel Newbies Frontpage you can keep up to date with changes.
Thank you all very much, I will go through the links you provided and read more, you were a great help.
The idea of my question was to try to understand when it is bad to have high CPU load and when this load affects server performance as long as there is a scheduling algorithm that takes care of giving the opportunity for each process to run and this algorithm want to utilize the CPU as much as possible. This is the source of my confusion I guess
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.