Seminar on Linux Process Management Presentation by Manoj Dhage MTech 1 st Year, SIT, IIT Kharagpur.

Slides:



Advertisements
Similar presentations
Operating Systems Process Scheduling (Ch 3.2, )
Advertisements

Linux Scheduling Algorithm -Ashish Singh. Introduction History and Background Linux Scheduling Modification in Linux Scheduling Results Conclusion References.
Abdulrahman Idlbi COE, KFUPM Jan. 17, Past Schedulers: 1.2 & : circular queue with round-robin policy. Simple and minimal. Not focused on.
Linux Scheduler. Linux is a multitasking OS Deciding what process runs next, given a set of runnable processes, is a fundamental decision a scheduler.
Process Scheduling in Linux (Chap.7 in Understanding the Linux Kernel) J. H. Wang Oct. 1, 2009.
Sogang University Advanced Operating Systems (Process Scheduling - Linux) Advanced Operating Systems (Process Scheduling - Linux) Sang Gue Oh, Ph.D. .
BFS: Brain F*ck Scheduler Jacob Chan. Objectives  Brain F*ck Scheduling  What it is  How it works  Features  Scalability  Limitations  Definition.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 9 th Edition Chapter 6: CPU Scheduling.
CS591 (Spring 2001) The Linux Kernel: Process Management.
Scheduling. Unix Scheduling Allocating CPU to a Process The amount of time that a process is allocated the CPU is called a time quantum Processes are.
Structure of Processes
Operating Systems (CSCI2413) Lecture 4 Process Scheduling phones off (please)
Scheduling in Linux COMS W4118 Spring Scheduling Goals O(1) scheduling; 2.4 scheduler iterated through Run queue on each invocation Task queue.
Linux Review COMS W4118 Spring Linux Overview History Distributions Licensing Components Kernel, daemons, libraries, utilities, etc Modules Build.
Chapter 5.2: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Chapter 5.1 Basic Concepts Scheduling.
Process by Dr. Amin Danial Asham. References Operating System Concepts ABRAHAM SILBERSCHATZ, PETER BAER GALVIN, and GREG GAGNE.
Operating system Structure and Operation
Processes and Threads Case studies: Windows and Linux Lecture 6 ~ Fall, 2007 ~
 Scheduling  Linux Scheduling  Linux Scheduling Policy  Classification Of Processes In Linux  Linux Scheduling Classes  Process States In Linux.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
Scheduling in Linux and Windows 2000
Linux Scheduling CS Scheduling Policy ► The scheduling algorithm of traditional Unix systems must fulfill several conflicting objectives  Fast.
Operating System Concepts and Techniques Lecture 5 Scheduling-1 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.
Operating System Examples - Scheduling
Scheduling Basic scheduling policies, for OS schedulers (threads, tasks, processes) or thread library schedulers Review of Context Switching overheads.
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
The Structure of Processes (Chap 6 in the book “The Design of the UNIX Operating System”)
Linux Kernel introduction COSC 513 Xiaoping Yang.
Scheduling Example 3 (1) Assume: FIFO Job Scheduling 100 K Main Memory Processor Sharing Process Scheduling (Cont…)
Process by Dr. Amin Danial Asham. References Operating System Concepts ABRAHAM SILBERSCHATZ, PETER BAER GALVIN, and GREG GAGNE.
CPU Scheduling Presentation by Colin McCarthy. Runqueues Foundation of Linux scheduler algorithm Keeps track of all runnable tasks assigned to CPU One.
Multiprogramming. Readings r Silberschatz, Galvin, Gagne, “Operating System Concepts”, 8 th edition: Chapter 3.1, 3.2.
Process Scheduling in Linux (Chap. 11, Understanding the Linux Kernel) J. H. Wang Sep. 26, 2008.
Lec 3aOperating Systems1 Operating Systems Lecture 3a: Linux Schedulers William M. Mongan Material drawn in part from
CSC 660: Advanced Operating SystemsSlide #1 CSC 660: Advanced OS Scheduling.
BFSBFS by Con KolivasCon Kolivas Guruprasad Aphale. Real Time Lunch, 10/21/ Guruprasad Aphale.
1 Chapter 4 Processes R. C. Chang. 2 Linux Processes n Each process is represented by a task_struct data structure (task and process are terms that Linux.
Linux Processes Travis Willey Jeff Mihalik. What is a process? A process is a program in execution A process includes: –program counter –stack –data section.
1 Review of Process Mechanisms. 2 Scheduling: Policy and Mechanism Scheduling policy answers the question: Which process/thread, among all those ready.
CSC 660: Advanced Operating SystemsSlide #1 CSC 660: Advanced OS Processes.
4300 Lines Added 1800 Lines Removed 1500 Lines Modified PER DAY DURING SUSE Lab.
BY: ADAM BAIR Real-Time Operating Systems. What’s a Real-Time System? - A computer system that requires computation to be correct and done before a specified.
Periodic scheduler for Linux OS
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
MP2: RATE-MONOTONIC CPU SCHEDULING Based on slides by Gourav Khaneja, Raoul Rivas and Keun Yim University of Illinois at Urbana-Champaign Department of.
CSC 660: Advanced Operating Systems
1 Structure of Processes Chapter 6 Process State and Transition Data Structure for Process Layout of System Memory THE DESIGN OF THE UNIX OPERATING SYSTEM.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 3.
1 Akira Tsukamoto System Platform Laboratory NEC Corporation.
Linux Process Management. Linux Implementation of Threads Threads enable concurrent programming / true parallelism Linux implementation of threads.
Operating System Examples - Scheduling. References r er/ch10.html r bangalore.org/blug/meetings/200401/scheduler-
Process Scheduling. Scheduling Strategies Scheduling strategies can broadly fall into two categories  Co-operative scheduling is where the currently.
1.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 1: Introduction What Operating Systems Do √ Computer-System Organization.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 6: CPU Scheduling.
Processes and threads.
Memory Management Paging (continued) Segmentation
Process Management Process Concept Why only the global variables?
Intro to Processes CSSE 332 Operating Systems
CS 3204 Operating Systems Lecture 14 Godmar Back.
Linux kernel: Processes, threads and scheduling
Text Illustrations in PPT Chapter 5 CPU Scheduling
Chapter 2: The Linux System Part 3
LPC2148 ARM7 myKernel Details
CPU SCHEDULING SIMULATION
Linux Scheduler © DJ Foreman 3/8/2009.
Linux Process State Scheduling information Identifiers
Chapter 3: Processes Process Concept Process Scheduling
Linux Scheduling CSE 2431: Introduction to Operating Systems
Presentation transcript:

Seminar on Linux Process Management Presentation by Manoj Dhage MTech 1 st Year, SIT, IIT Kharagpur.

Outline  Process -process descriptor, process state, process switch.  The Linux Scheduler -Runqueues, priority arrays -Calcucalation of priorities and timeslices, -schedule() function -Scheduler tuning

Process  Process  Lightweight Process  Process Descriptor

Process Descriptor Ref: Understanding the Linux Kernel

Process State  TASK_RUNNING  TASK_INTERRUPTIBLE  TASK_UNINTERRUPTIBLE  TASK_STOPPED  TASK_ZOMBIE

Process Descriptor Handling  The Process List Ref: Understanding the Linux Kernel

continued…  List of Data Structure Ref: Understanding the Linux Kernel

Process Switch  Hardware Context  Happens only in schedule() function  Steps -switch page global directory -switch kernel mode stack and H/W context

The Linux CPU Scheduler  Runqueues  The O(1) Scheduling Algorithm - one Runqueue per CPU - active priority array - expired priority array

Use Priority Arrays  active priority array  bitmap[BITMAP_SIZE]

bitmap[BITMAP_SIZE]

Calculating priority  static priority -nice() system call -specified by user -never modified by scheduler - used to calculate timeslice

continued…  dynamic priority -subtracts –5 to +5 from static priority depending on the time spend in running or waiting -used for scheduling purpose

The schedule() function.  steps involved -find process with maximum dynamic priority -prev and next pointers to process descriptors -switch to next switch page global directory switch kernel mode stack

continued…  Called in prev, return in next  Why this is O(1)  Invoked by -scheduler_tick() -system call

scheduler_tick()  Invoked every 1 ms by timer interrupt  Do not always invoke schedule()  Whenever a task runs out of time slice, it is given new time slice and dynamic priority and put in expired array  Reinsert interactive task on active array  If there is no active task swap the pointers of active and expired arrays

System calls  Insert current task in a waitqueue  Change state to TASK_INTERRUPTABLE or TASK_UNINTERRUPTABLE  Invoke schedule()  If resource available remove from waitqueue

Handling real time tasks  Task priority range -20 to 19  SCHED_FIFO Scheduling  SCHED_RR Scheduling

Scheduler tuning  MIN_TIMESLICE AND MAXI_TIMESLICE  PRIO_BONUS_RATIO  STARVATION_LIMIT

Future scope  Scheduler modes -server mode, bigger timeslice -desktop mode, more responsiveness  Swappable schedulers -different scheduler for different users -basic kernel scheduler would be round robin

3. References Josh Aas, “Understanding the Linux CPU Scheduler”, February Abraham Silberschatz, Greg Gagne, Peter Galvin, “Operating System Concepts”, Wiley. Daniel P. Bovet, Marco Cesati, “Understanding the Linux Kernel”, 2ndEdition. O’Reilly, July

Thank You Thank You.