Process PriorityĪ common type of scheduling algorithm is priority-based scheduling. As you willsee, this is done in a way that does not neglect processor-bound processes. Linux, toprovide good interactive response, optimizes for process response (low latency),thus favoring I/O-bound processes over processor-bound processors. Favoring I/O-bound processes provides improvedprocess response time, because interactive processes are I/O-bound. Tosatisfy these requirements, schedulers often employ complex algorithms todetermine the most worthwhile process to run, while not compromising fairness toother, lower priority, processes. The scheduling policy in a system must attempt to satisfy two conflictinggoals: fast process response time (low latency) and high process throughput. The scheduler policy in Unix variants tends to explicitlyfavor I/O-bound processes. Of course, these classifications are notmutually exclusive. The scheduler policy forprocessor-bound processes, therefore, tends to run such processes lessfrequently but for longer periods. Because they are not I/O-driven, however, system responsedoes not dictate that the scheduler run them often. Consequently, such a process is often runnable, butonly for short periods, because it will eventually block waiting on more I/O(this is any type of I/O, such as keyboard activity, and not just disk I/O).Conversely, processor-bound processes spend much of their time executing code.They tend to run until they are preempted because they do not block on I/Orequests very often. Theformer is characterized as a process that spends much of its time submitting andwaiting on I/O requests. Processes can be classified as either I/O-bound or processor-bound. I/O-Bound Versus Processor-Bound Processes Ascheduler's policy often determines the overall feel of a system and isresponsible for optimally utilizing processor time. Policy is the behavior of the scheduler that determines what runs when. In this section, we will discuss the fundamentals of scheduler design and how they apply to the new O(1) scheduler and its goals, design, implementation, algorithms, and related system calls. A new scheduler, commonly called the O(1) scheduler because of its algorithmic behavior 1, solved the shortcomings of the previous Linux scheduler and introduced powerful new features and performance characteristics. Of course, Unix has been preemptively multitasked since the beginning.ĭuring the 2.5 kernel series, the Linux kernel received a scheduler overhaul. Thankfully, most operating systems designed in the last decade have provided preemptive multitasking, with Mac OS 9 and earlier being the most notable exceptions. The shortcomings of this approach are numerous: The scheduler cannot make global decisions regarding how long processes run, processes can monopolize the processor for longer than the user desires, and a hung process that never yields can potentially bring down the entire system. The act of a process voluntarily suspending itself is called yielding. As we will see, this timeslice is dynamically calculated in the Linux scheduler to provide some interesting benefits.Ĭonversely, in cooperative multitasking, a process does not stop running until it voluntary decides to do so. It also prevents any one process from monopolizing the system. Managing the timeslice enables the scheduler to make global scheduling decisions for the system. The timeslice, in effect, gives each process a slice of the processor's time. The time a process runs before it is preempted is predetermined, and is called the timeslice of the process. The act of involuntarily suspending a running process is called preemption. In preemptive multitasking, the scheduler decides when a process is to cease running and a new process is to resume running. Linux, like all Unix variants and most modern operating systems, provides preemptive multitasking. Multitasking operating systems come in two flavors: cooperative multitasking and preemptive multitasking. Deciding what process runs next, given a set of runnable processes, is a fundamental decision the scheduler must make. If there are more processes than processors in a system, some processes will not always be running. To best utilize processor time, assuming there are runnable processes, a process should always be running. By deciding what process can run, the scheduler is responsible for best utilizing the system and giving the impression that multiple processes are simultaneously executing. The scheduler is the basis of a multitasking operating system such as Linux. The scheduler (or process scheduler, as it is sometimes called) can be viewed as the code that divides the finite resource of processor time between the runnable processes on a system. The scheduler is the component of the kernel that selects which process to run next.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |