Linux - General This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
03-30-2011, 02:51 AM
|
#1
|
|
LQ Newbie
Registered: Mar 2011
Posts: 4
Rep:
|
Linux process scheduling and CPU utilization
Hi All,
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.
Thanks.
|
|
|
|
03-30-2011, 04:16 AM
|
#2
|
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,223
|
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 ...
|
|
|
|
03-30-2011, 05:02 AM
|
#3
|
|
Member
Registered: Mar 2011
Distribution: Slack64
Posts: 107
Rep:
|
Quote:
|
Originally Posted by jigsaw207
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...
|
|
|
|
03-30-2011, 08:27 AM
|
#4
|
|
Moderator
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 10,342
|
Hi,
Welcome to LQ!
Kernel Interactive Map will help you to understand visually.
If you look at Linux Kernel section of Slackware®-Links
you can find several good reference links;
Quote:
|
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'
|
IBM's white-paper provides some useful insight.
Two good links to books;
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.

|
|
|
|
03-31-2011, 02:16 AM
|
#5
|
|
LQ Newbie
Registered: Mar 2011
Posts: 4
Original Poster
Rep:
|
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
Thanks alot guys you are the best 
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:27 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|