On Mon, 2004-09-13 at 11:02, Jan Hudec wrote: > It does not categorize them. It does not need to. > It's really simple. When a process is running, it's priority is > incremented. When it's waiting to run, it's priority is decremented. The > lowest priority process is scheduled. Not entirely true: "The interactivity estimator in the 2.5 scheduler is designed to find which tasks are interactive versus those that are batch (pure cpu hogs). How it works is on the premise that batch tasks never sleep but use up all the cpu time offered to them, whereas interactive tasks occasionally sleep. A sleep_avg was stored for each task, where every tick of the jiffy (1 millisecond in 2.5) the task earns a sleep_avg point if it's sleeping, or loses a sleep_avg point while it's running. Tasks with high sleep_avg are considered interactive and low sleep_avg are cpu hogs. The scheduler takes the information from the interactivity estimator and then assigns a dynamic priority to the task. The variation from the static priority is dependent on the value in PRIORITY_BONUS, set to 25% meaning a task's priority can change +/- 5 from it's static. Interactive tasks get a 5 bonus and cpu hogs get a 5 penalty. If a task uses up it's full timeslice, the scheduler can choose to not expire if it is still TASK_INTERACTIVE which works out to about a priority bonus of 3+ for nice 0 tasks." http://lwn.net/Articles/46713/ -- Florin Malita -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/