ayaz ali Micro & Macro Scheduling Techniques Ayaz Ali Department of Computer Science University of Houston Houston, TX

Similar documents
Chapter 5: CPU Scheduling

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University

Lecture 17: Threads and Scheduling. Thursday, 05 Nov 2009

Properties of Processes

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems, 3rd edition. Uses content with permission from Assoc. Prof. Florin Fortis, PhD

Lecture 5 / Chapter 6 (CPU Scheduling) Basic Concepts. Scheduling Criteria Scheduling Algorithms

Scheduling of processes

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Lecture Topics. Announcements. Today: Uniprocessor Scheduling (Stallings, chapter ) Next: Advanced Scheduling (Stallings, chapter

CPU Scheduling Algorithms

OS Assignment II. The process of executing multiple threads simultaneously is known as multithreading.

CS418 Operating Systems

Chapter 6: CPU Scheduling

CS370 Operating Systems

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

CS370 Operating Systems

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far.

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

Chapter 5: CPU Scheduling

Course Syllabus. Operating Systems

Operating Systems Unit 3

CISC 7310X. C05: CPU Scheduling. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 3/1/2018 CUNY Brooklyn College

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

8: Scheduling. Scheduling. Mark Handley

Last Class: Processes

Ch 4 : CPU scheduling

Preview. Process Scheduler. Process Scheduling Algorithms for Batch System. Process Scheduling Algorithms for Interactive System

Operating System Concepts Ch. 5: Scheduling

Operating Systems. Lecture Process Scheduling. Golestan University. Hossein Momeni

COSC243 Part 2: Operating Systems

CPU Scheduling. Rab Nawaz Jadoon. Assistant Professor DCS. Pakistan. COMSATS, Lahore. Department of Computer Science

3. CPU Scheduling. Operating System Concepts with Java 8th Edition Silberschatz, Galvin and Gagn

CS370 Operating Systems

Operating Systems. Process scheduling. Thomas Ropars.

1.1 CPU I/O Burst Cycle

CPU Scheduling: Objectives

Practice Exercises 305

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

LECTURE 3:CPU SCHEDULING

CHAPTER 2: PROCESS MANAGEMENT

Process- Concept &Process Scheduling OPERATING SYSTEMS

Uniprocessor Scheduling. Aim of Scheduling

Uniprocessor Scheduling. Aim of Scheduling. Types of Scheduling. Long-Term Scheduling. Chapter 9. Response time Throughput Processor efficiency

CPU Scheduling. CSE 2431: Introduction to Operating Systems Reading: Chapter 6, [OSC] (except Sections )

8th Slide Set Operating Systems

Chapter 6: CPU Scheduling

CPU THREAD PRIORITIZATION USING A DYNAMIC QUANTUM TIME ROUND-ROBIN ALGORITHM

Frequently asked questions from the previous class survey

Assignment 3 (Due date: Thursday, 10/15/2009, in class) Part One: Provide brief answers to the following Chapter Exercises questions:

Start of Lecture: February 10, Chapter 6: Scheduling

Scheduling. The Basics

Process Scheduling. Copyright : University of Illinois CS 241 Staff

Operating Systems. Scheduling

FCM 710: Architecture of Secure Operating Systems

Operating System Review Part

CPU Scheduling. Schedulers. CPSC 313: Intro to Computer Systems. Intro to Scheduling. Schedulers in the OS

Comp 310 Computer Systems and Organization

Last class: Today: CPU Scheduling. CPU Scheduling Algorithms and Systems

CSE 120 Principles of Operating Systems Spring 2017

CS3733: Operating Systems

CPU Scheduling (1) CPU Scheduling (Topic 3) CPU Scheduling (2) CPU Scheduling (3) Resources fall into two classes:

Lecture 2 Process Management

Announcements. Program #1. Program #0. Reading. Is due at 9:00 AM on Thursday. Re-grade requests are due by Monday at 11:59:59 PM.

Uniprocessor Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Three level scheduling

Chapter 5 CPU scheduling

Advanced Operating Systems (CS 202) Scheduling (1)

Chapter 5: Process Scheduling

OPERATING SYSTEMS. UNIT II Sections A, B & D. An operating system executes a variety of programs:

CPU scheduling. Alternating sequence of CPU and I/O bursts. P a g e 31

Announcements. Program #1. Reading. Due 2/15 at 5:00 pm. Finish scheduling Process Synchronization: Chapter 6 (8 th Ed) or Chapter 7 (6 th Ed)

Unit 3 : Process Management

Job Scheduling. CS170 Fall 2018

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

CSE 4/521 Introduction to Operating Systems

Chapter 5: CPU Scheduling

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date:

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

Review. Preview. Three Level Scheduler. Scheduler. Process behavior. Effective CPU Scheduler is essential. Process Scheduling

Chapter 5: CPU Scheduling. Operating System Concepts Essentials 8 th Edition

CSE120 Principles of Operating Systems. Prof Yuanyuan (YY) Zhou Scheduling

Operating Systems. CPU Scheduling ENCE 360

Scheduling. Multi-processing. Process Characterization. time. ...makes use of idle. COS450-F18-05-Scheduling - October 8, 2018

So far. Next: scheduling next process from Wait to Run. 1/31/08 CSE 30341: Operating Systems Principles

Frequently asked questions from the previous class survey

CSCE Operating Systems Scheduling. Qiang Zeng, Ph.D. Fall 2018

CPU Scheduling. The scheduling problem: When do we make decision? - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s)

Today s class. Scheduling. Informationsteknologi. Tuesday, October 9, 2007 Computer Systems/Operating Systems - Class 14 1

CS307: Operating Systems

COMP 3361: Operating Systems 1 Final Exam Winter 2009

Department of Computer applications. [Part I: Medium Answer Type Questions]

Round Robin (RR) ACSC 271 Operating Systems. RR Example. RR Scheduling. Lecture 9: Scheduling Algorithms

Scheduling in the Supermarket

FCM 710: Architecture of Secure Operating Systems

Subject Teacher: Prof. Sheela Bankar

OPERATING SYSTEMS: Lesson 4: Process Scheduling

Chapter 9. Uniprocessor Scheduling

TDIU25: Operating Systems II. Processes, Threads and Scheduling

CPU Scheduling: Part I ( 5, SGG) Operating Systems. Autumn CS4023

Transcription:

ayaz ali Micro & Macro Scheduling Techniques Ayaz Ali Department of Computer Science University of Houston Houston, TX 77004 ayaz@cs.uh.edu

1. INTRODUCTION Scheduling techniques has historically been one of the most important research areas of operating systems. However little could be added to the performance of existing scheduling policies, as the underlying hardware architecture remained stagnant over the years. In order to provide high performance computation power to serve the increasing need of large applications, people strive to improve the single machine's capacity or construct a distributed system composed of a scalable set of machines. Recent developments in system architecture and rebirth of cluster computing are bound to demand some changes of current scheduling implementations. The project is divided into two distinct sections. Section1, which talks about micro scheduling, deals with current scheduling strategies and their analysis for two main classes of applications (interactive and CPU). Second part of the project focuses on a rather new area called macro scheduling. It discusses the possibilities of changes that could be made in operating system executives/kernels in order to get the best scheduling policy (load balanced task distribution) for multiprocessor architectures. Ayaz Ali (ayaz@cs.uh.edu) 2/14

2. MICRO SCHEDULING Existing scheduling policies employed by operating systems to allocate processor resource to tasks are termed as micro scheduling policies. One of the two main features of this project was to study those micro scheduling techniques and extend their ideas into better strategies suitable for both micro and macro schedulers. Scheduling policies can be measured based on following factors: Turnaround time Latency Throughput. Two main strategies can be employed for task scheduling, preemptive and nonpreemptive. In this project I have focused on the analysis of three scheduling policies: Round Robin preemptive First Come First serve non-preemptive A third strategy Shortest Job first requires prior knowledge of processes but theoretically is more efficient that the other two. It is important to note that a scheduling policy is not suitable for all types of processes. There is variety of application with variety of response time requirements. Before we could understand the application of a certain algorithm we need to understand what separates one class of application from another. 2.1 Process characteristics Performance of a scheduling policy greatly depends on the characteristics of tasks being scheduled and their interdependencies. There is no universally best scheduling policy that gives ideal performance for all sorts of tasks. In the project I have focused on interactive and cpu processes. Another main class of processes, the real-time processes is not discussed in this report. However techniques outlined here can be extended to work for processes with temporal constraints. Ayaz Ali (ayaz@cs.uh.edu) 3/14

Micro scheduling techniques have to take into account task characteristics in order to select best policy for a given scenario. Process inter-relationship takes center stage in selecting macro-scheduling policy. Based on inter-dependency of tasks, a set of tasks can be characterized as: Data dependant Resource dependant Precedence dependant Conditionally dependant. 2.2 Algorithms 2.2.1 Round Robin Most modern computer systems use a variation on the Round-Robin scheduling algorithm. The term 'preemptive multitasking' basically means switching between tasks by giving them equal share of resources. The way that the RR algorithm works is that the operating system lets each task run for a certain amount of time, called a time quantum, and then interrupts that task and passes control of the CPU on to some other task. For interactive systems, this scheme is generally best because it reduces latency on heavily loaded systems. The disadvantage to the Round Robin algorithm is that it has lower throughput. Every time the operating system interrupts a running task and gives the CPU to another task, it takes up a little bit of CPU time. 2.2.2 FIFO or FCFS (non-preemptive) First Come First Serve is useful only for a limited number of applications where throughput is more critical and latency and response time are virtually unimportant. It is generally not used on home computers, although the Linux scheduler can run this way if you tell it to. The FCFS algorithm is the most basic one, and it is similar to the way older systems such as MS-DOS used to schedule. Basically, the first program that comes along gets the CPU. No other process can have it until the first process is done. When it finishes, control Ayaz Ali (ayaz@cs.uh.edu) 4/14

passes to the next process in line. That's it. This results in the highest possible throughput because the currently running process gets 100% of the CPU time until it is finished; lesser number of context switches. However, latency suffers the most. A user has to wait till all processes ahead of it are done before it could get a response to his key press or mouse drag or a display to appear. 2.2.3 Shortest Job First (non-preemptive) The two scheduling policies discussed above have contrasting features. Round Robin gives probably the best latency while the throughput suffers. In FCFS case latency is terrible while we have the best possible throughput. There have been plenty of variations to these algorithms; one of the better ones that try to balance latency and throughput requirements is Shortest Job First. It however is not suitable for all sorts of processes. It is particularly suitable for real-time processes and high performance computing tasks where we can reasonably guess about the size of such process ahead of time. The trick is to give the shortest processes a chance to run and get completed before allocating the CPU to others. Preemptive as well as non-preemptive strategies are possible for SJF algorithm. Ayaz Ali (ayaz@cs.uh.edu) 5/14

3. SIMULATION Two batches of tasks were run for the three types of scheduling algorithms and their data collected as shown in following pages. Batch1 Processes: 1-15 Duration of each process: Uniformly distributed between 10.0 and 15.0. CPU burst: 10.0 IO burst: uniformly distributed between 10 and 20 Batch2 Processes: 16-30 Duration of each process: constant 4.0 CPU burst: 1.0 IO burst: uniformly distributed between 10 and 20 Ayaz Ali (ayaz@cs.uh.edu) 6/14

Round Robin First Come First Serve Ayaz Ali (ayaz@cs.uh.edu) 7/14

Shortest Job First Statistics Ayaz Ali (ayaz@cs.uh.edu) 8/14

3.1 Analysis of Simulation Results In the scheduling policies simulation shown above, Round Robin uses preemptive scheduling with a quantum of 1.1 units. As we can see RR algorithm makes the most number of context switches resulting in increased overhead and less throughput. However its latency is better than FCFS because each process gets regular attention of processor and that makes the response time better and latency lower. The other important factor to note is improved turnaround time, which is the time it takes for a process to finish from the time it first gets started. SJF has the best of both latency and turnaround time; even the throughput is comparable to FCFS, which makes it the best algorithm to use if process characteristics are known ahead of time. However in a realistic scenario, given the fact that for most processes we cannot predict their execution time in advance, Round Robin has an obvious edge over other algorithms. Round Robin can be bettered even further if quantum is kept adaptive to load and requirement of a process. This has give birth to multilevel queues based on priority of processes, with each queue having different quantum of scheduling. Linux uses these variations of Round Robin in its kernel. Ayaz Ali (ayaz@cs.uh.edu) 9/14

4. MACRO SCHEDULING Second part of this project focuses on macro-scheduling techniques for systems capable of running multiple processes at any given time. Contrary to microscheduling policies, macro-schedulers have limited applications. Only a particular class of processes can be efficiently scheduled using these techniques. Most of the research in this field has been carried out in the form of load balancing and task distribution on clusters. 4.1 Host Architectures Performance and selection of a scheduling algorithm is dependant on the architecture that they are running on. While a set of micro scheduling policies may remain consistent throughout, macro-scheduling policies will vary depending on the variations in underlying system architecture. Single processor systems have been there for quite long and most operating systems have successfully employed set of scheduling policies to work efficiently on such architectures. Recent advances have brought cluster and grid architectures of computation in picture. Processor vendors like Intel, HP and AMD have already made their dual processor chips available. In order to get maximum out of those hyper-threading capable architectures, macro-scheduling policies need to be embedded in existing operating systems; perhaps as extensions or hooks. One of the most popular forms of extracting maximum computational power out of existing resources is by arranging the processing units in the form of clusters. However, most of the task distribution techniques have been employed outside of operating systems hence adding a layer between applications and operating system kernels. Ayaz Ali (ayaz@cs.uh.edu) 10/14

Kernel Global Macro Scheduling Server Micro Schedulers Cluster Node Information Process Selection Module Macro Scheduler VMM Load Balancing Module Resource Broker Module Machine N Task Migrator Module Task Migration / Node Information CPU 1.1 CPU 1.2 Task n CPU N.1 Task 1 Task 2 4.2 Components of a Macro-scheduler A primitive architecture diagram of macro scheduler extension inside the kernel and its interaction with other modules is given above. As given in the diagram the proposed system should typically have four components: 1) Selection Policy It determines which task should be run/transferred to a processing node. Not all processes are suitable for remote scheduling. Processes with high coupling with other processes need to be scheduled on same machines. Since migration of tasks adds to latency, interactive and IO dependent processes are better suited to run locally. Introduction of this module takes much of functionality out of micro scheduler as well. In an ideal scenario, selection policy module could completely replace micro-scheduler. Ayaz Ali (ayaz@cs.uh.edu) 11/14

This module makes all the decisions about which processes to select to run locally and which processes are suitable to run remotely. Tasks that could effectively run locally are directed to Local Load balancing module. For all other tasks, they are routed to go through Resource broker module, which then decides which machine to migrate the task to. For a given local task, thread level scheduling can be effectively performed in Selection policy module because of high coupling among threads of same processes. One of the variations of micro scheduling policies can be used for tasks suitable to run locally. For those tasks that could run remotely, Largest Job First algorithm could be more suitable as it has least communication time to service time ratio. 2) Resource Broker It determines the availability of resource for the task to be transferred. Resource broker forms the core of macro scheduler as it presents an abstraction of N processing units to micro scheduler. Each time the local task queue exceeds a threshold, selection policy module passes the task to load balancing module which in turn queries this module and gets updated information about available resource. Resource broker keeps all the information about available nodes by querying a central server. In case of server failure past static information (average) is used to predict load at registered nodes. 3) Load Balancing It determines the best node out of available local resources. Load balancing module uses resource availability information of resource broker to find the best node for task transfer. 4) Task Migratory It handles the migration of task and collection of results. One of the biggest handicaps of task distribution algorithms has been the communication overhead, which makes a big proportion of real service time. The other problem that has been addressed efficiently by PVM and MPI is marshalling of data and issues related to consistency. As discussed above only tasks with considerably large service time S are chosen, where t s is considerably larger than migration time t m. Ayaz Ali (ayaz@cs.uh.edu) 12/14

5. LESSONS LEARNT Nachos Experience The test bed to carry out this project was planned to be Nachos instructional operating system. There was a steep learning curve involved for getting acquainted to the Nachos architecture. Most of the initial time was spent learning about Nachos and porting it to Linux, which in itself was an uphill task involving installation of cross compiler for MIPS. However once Nachos was ported to Linux, there were plenty of other surprises because of unavailability of a fully functional Nachos distribution. Apparently all the distributions lacked thread and network module implementations. Although I could not use Nachos, a lot was learnt about the nachos architecture and cross compiler construction. Scheduling Simulator Instead of putting more time and effort building thread and networking features into Nachos, I tried to develop a scheduling simulator along with resource broker, which included a clock (to simulate machines of varying processor speeds), a scheduler with two policies FCFS and RR. Two classes of processes were defined - interactive and CPU process. Unfortunately I could not get time to implement macro-scheduling part (resource broker and task migration) of this considering that lots of time was spent on making this project run on nachos. Third Party Simulators The simulation and its results given above were generated using Scheduling simulator by Prof. Steve Robins of UT San Antonio http://vip.cs.utsa.edu/nsf/index.html. Another tool Cheddar was used to simulate multiple processor resources for variety of tasks. The tool however did not produce relevant results, which could be used to explain task distribution among processing units. Cheddar is maintained by university of Brest and can be found at http://beru.univbrest.fr/~singhoff/cheddar. Ayaz Ali (ayaz@cs.uh.edu) 13/14

6. REFERENCES [1] H.D. Karatza, A Simulation Model of Task Cluster Scheduling in Distributed Systems, The Seventh IEEE Workshop on Future Trends of Distributed Computing Systems, Tunisia, South Africa, December 20-20, 1999 [2] Marei S. Al-Amri and E. A. Rana, New job selection and location policies for load-distributing algorithms, Intl. J. Network Mgmt 2002; 12: 165-178 [3] M.A. Schaar, Kemal Efe and Weijia Shang, Queueing performance analysis of co-scheduling in a pool of processors environment, Proceedings of the 8th international conference on Supercomputing, 1994. [4] Steven Robbins and Kay A. Robbins, Empirical Exploration In Undergraduate Operating Systems. [5] F. Singhoff, J. Legrand, L. Nana, L. Marcé, Cheddar: an Open and Flexible Real Time Scheduling Framework. [6] G. A. Geist, V. S. Sunderam, The Evolution of the PVM Concurrent Computing System, 1993 Ayaz Ali (ayaz@cs.uh.edu) 14/14