Just reading about Linux Scheduling system

For stuff that really doesn't have ANYTHING to do with Puppy
Post Reply
Message
Author
User avatar
clarf
Posts: 613
Joined: Wed 13 Jun 2007, 19:22
Location: The old Lone Wolf

Just reading about Linux Scheduling system

#1 Post by clarf »

Just reading about Linux Scheduling system and found this URL:
http://bitsum.com/about_probalance.php

Take care about the following notes on this site, pointing to a robust Linux scheduler system against the poorly one on Windows:

"What's the problem?

Windows has a particularly bad problem dealing with threads that decide they want to consume every bit of CPU time they can get their hands on (a CPU bound thread). A single 'CPU bound' thread running at Normal priority can bring an entire single-CPU system to a stall, as demonstrated by our graphical proof of concept below. Yes, it is true - believe it or not! It is this worst case scenario that Process Lasso was originally written to address. By temporarily lowering the priority of the offending process, your PC can be saved from a virtual stall....

Some schedulers, such as the default one of the Linux kernel, penalize CPU bound processes while rewarding I/O bound processes. Processes is said because unlike the Windows scheduler, linux schedulers handle processes. The Windows scheduler just sees threads, each running at a different priority that is derived from the parent process's priority class. Anyway, this concept of punishing I/O bound processes/threads is similar to what ProBalance effectively does. You see, on Windows *most* threads are I/O bound. They give up their time slices pre-maturely as they enter a wait state for some type of I/O. Sadly, CPU bound (CPU hungry) threads also exist from time to time, and do a real number of the less greedy I/O bound threads."
Everything you never wanted to know about OS multi-tasking (and why out of control processes need priority adjustment)

"I should also note that Windows has other scheduling complications, such as "foreground" and "background" tasks [...] However, the bottom line, in my humble opinion, is that the operating system is more concerned in ensuring that a task that is not ready to run does not, than making sure all tasks get a fair shake. [...] We can, however, detect thread and process CPU utilization, and help the operating system to adjust the prioritizations."
-(c) Tim Murgent of TMergent Technologies

Hardware Virtualization: the Nuts and Bolts

"One process that takes up 100% of the CPU time may slow the other applications to snail speed for example, despite the fact that modern OSes use preemptive multitasking."
-(c) Johan De Gelas, AnandTech

From a former competitor that popped up briefly:

"Priorities and their purpose are often poorly understood. Usually the misapprehension exists that if a process is taking a long time to complete then, if anything, its priority should be increased with the intent to make it finish faster. In most cases the CPU is spending near to all of its time executing the process anyway, so increasing the priority is only going to tell the scheduler to do what it is already doing. It may seem paradox but it is in fact more sensible to reduce the priority of the busy process so that the system is prepared to let other processes have some time thus allowing them to remain functional. In most cases other processes will not be using a significant amount of the CPU's time and allowing them to execute when they want to will not slow the busy process by any notable amount. Computer applications simply have to be idle practically all of the time in order for them to react quickly when the user interacts with them. Therefore, allowing a well behaved application to continue to respond in such a way will not take a significant amount of time away from the busy process."
-(c) Peter Ball

Quote from Inside the Linux scheduler (IBM) - an example of another OS scheduler's attempt to address this

To prevent tasks from hogging the CPU and thus starving other tasks that need CPU access, the Linux 2.6 scheduler can dynamically alter a task's priority. It does so by penalizing tasks that are bound to a CPU and rewarding tasks that are I/O bound. I/O-bound tasks commonly use the CPU to set up an I/O and then sleep awaiting the completion of the I/O. This type of behavior gives other tasks access to the CPU.

Regards,
clarf

Post Reply