Karim Vaes

Why chop at leaves, when one must dig at roots
  • Home
  • About me
    • Curriculum Vitae
  • Scripts
    • OWA Most Popular
  • Search
  • License
  • Contact

The scheduling algorithm in regards to the nice value of a process

http://www.oreilly.com/catalog/linuxkernel/chapter/ch10.html

Summarized
The kernel does timeslicing of it’s cpu resource. Each process is given a certain slice. Yet the size of this size is determined by the priority (nice value). The priority is handled dynamically. So when a process hasn’t had enough cpu time, it’ll receive a higher priority. This also works the other way around, a process that had been running for a long time, will receive a low priority (cfr with a higher nice value).

The ‘Starvation’ protection

“In Linux, process priority is dynamic. The scheduler keeps track of what processes are doing and adjusts their priorities periodically; in this way, processes that have been denied the use of the CPU for a long time interval are boosted by dynamically increasing their priority. Correspondingly, processes running for a long time are penalized by decreasing their priority.”


Het scheduling concept

“Linux scheduling is based on the time-sharing technique already introduced in the section “CPU’s Time Sharing” in Chapter 5, Timing Measurements: several processes are allowed to run “concurrently,” which means that the CPU time is roughly divided into “slices,” one for each runnable process.[1] Of course, a single processor can run only one process at any given instant. If a currently running process is not terminated when its time slice or quantum expires, a process switch may take place. ”
…
“The Linux scheduling algorithm works by dividing the CPU time into epochs. In a single epoch, every process has a specified time quantum whose duration is computed when the epoch begins. In general, different processes have different time quantum durations. The time quantum value is the maximum CPU time portion assigned to the process in that epoch.”
…
“Each process has a base time quantum: it is the time-quantum value assigned by the scheduler to the process if it has exhausted its quantum in the previous epoch. The users can change the base time quantum of their processes by using the nice( ) and setpriority( ) system calls.”

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • Slashdot
  • LinkedIn
  • RSS
  • StumbleUpon
  • Twitter
Categories
Unix/Linux
Comments rss
Comments rss
Trackback
Trackback
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

« Ubuntu 7.04 feisty & Vmware Server Solaris – Measuring CPU : mpstat vs sar »

2 responses

HI nice to know this infor. I want in detail

Siva

HI nice to know this infor. I want in detail about the Scheduling alogrithms in linux

Check out kerneltrap.org, that might help you out... (as the

Karim Vaes

Check out kerneltrap.org, that might help you out… (as the kernel algorithm’s have changed a lot “recently”)

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Recent Posts

  • Treating the root cause to cancer
  • Is “entrepreneur” a bad word?
  • Where physics meets marketing
  • Where USSR meets IT?
  • Accepting our limitations, is giving us the opportunity to overcome them!

Similar Posts

  • The basics behind the Completely Fair Scheduler
  • Nice
  • Unix processes
  • Bigip: tmm process
  • Linux vs Solaris Runlevels

Recent Comments

  • Karim Vaes on Accept every offer!
  • Danny on The teachings of Budo in Business
  • Pascal on The Service Catalog
  • Shubert on WordPress widget : Most popular posts
  • Dermana Agrı Kesici Krem on OWA Most Popular

Commercial

Categories

2.0 Ads Agile Bash Blogroll Book Brain Business Career Change CIO Collaboration Communication Corner Creative CRM Culture Desktop Development Dreambox Drupal Education Entrepreneur F5 Firefox Food Freelance Fun General Green Growth High Availability Human Resources Idea Infrastructure Insightful Interesting IT ITIL Java Lesson License Life Malware Management Mind Model Motivation MythTV Network NLP OpenSource Performance PHP PM Presentation Project Proverb Quote Remote Scrum Security SEO Social Spam Storage Stress Tactical Team Tech TED Time Management Tip Tool TV Ubuntu Unix/Linux Vids Vim Virtual VmWare Voip Web Wordpress

Archives

  • August 2010
  • July 2010
  • May 2010
  • April 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • August 2009
  • July 2009
  • June 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
rss Comments rss valid xhtml 1.1 design by jide licensed as Creative Commons Attribution