Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Scheduling in Windows Zoltan Micskei

Slides:



Advertisements
Similar presentations
CPU Scheduling Tanenbaum Ch 2.4 Silberchatz and Galvin Ch 5.
Advertisements

Operating Systems Process Scheduling (Ch 3.2, )
© Neeraj Suri EU-NSF ICT March 2006 Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Zoltán Micskei
IT Systems Multiprocessor System EN230-1 Justin Champion C208 –
 A quantum is the amount of time a thread gets to run before Windows checks.  Length: Windows 2000 / XP: 2 clock intervals Windows Server systems: 12.
Chap 5 Process Scheduling. Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU–I/O Burst Cycle – Process execution consists of a.
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
CPU Scheduling CS 3100 CPU Scheduling1. Objectives To introduce CPU scheduling, which is the basis for multiprogrammed operating systems To describe various.
CPU Scheduling Basic Concepts Scheduling Criteria
© Neeraj Suri EU-NSF ICT March 2006 Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Zoltán Micskei
Operating System Process Scheduling (Ch 4.2, )
Operating System I Process Scheduling. Schedulers F Short-Term –“Which process gets the CPU?” –Fast, since once per 100 ms F Long-Term (batch) –“Which.
CS 311 – Lecture 23 Outline Kernel – Process subsystem Process scheduling Scheduling algorithms User mode and kernel mode Lecture 231CS Operating.
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
5: CPU-Scheduling1 Jerry Breecher OPERATING SYSTEMS SCHEDULING.
Operating Systems Process Scheduling (Ch 4.2, )
1 Inside the Windows NT Scheduler, Part 1 Assigning CPU time in a uniprocessor environment by Mark Russinovich Windows NT Magazine - July 1997 Inside the.
Chapter 5: CPU Scheduling (Continuation). 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Determining Length.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Cosc 4740 Chapter 5 Process Scheduling. CPU Scheduling Short-term Scheduler –Selects a process from the ready queue when current process releases the.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 5 Operating Systems.
Windows 2000 Scheduling Computing Department, Lancaster University, UK.
Windows OS Internals - Copyright © 2005 David A. Solomon, Mark E. Russinovich, and Andreas Polze Unit OS4: Scheduling and Dispatch 4.4. Windows Thread.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS3: Concurrency 3.5. Lab Slides & Lab Manual.
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 5: CPU Scheduling.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 5: CPU Scheduling Basic.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS4: Scheduling and Dispatch 4.5. Advanced Windows.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS3: Concurrency 3.3. Advanced Windows Synchronization.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Lecture 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
Operating System Examples - Scheduling. References r er/ch10.html r bangalore.org/blug/meetings/200401/scheduler-
CPU scheduling.  Single Process  one process at a time  Maximum CPU utilization obtained with multiprogramming  CPU idle :waiting time is wasted 2.
Basic Concepts Maximum CPU utilization obtained with multiprogramming
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 6: CPU Scheduling.
Guy Martin, OSLab, GNU Fall-09
EEE Embedded Systems Design Process in Operating Systems 서강대학교 전자공학과
Unit OS9: Real-Time and Embedded Systems
Chapter 5: CPU Scheduling
Unit OS4: Scheduling and Dispatch
Unit OS2: Operating System Principles
Unit OSB: Comparing the Linux and Windows Kernels
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter5: CPU Scheduling
TDC 311 Process Scheduling.
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
CPU SCHEDULING.
Outline Scheduling algorithms Multi-processor scheduling
Chapter 6: CPU Scheduling
Process Scheduling Decide which process should run and for how long
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Shortest-Job-First (SJR) Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Chapter 5: CPU Scheduling
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Presentation transcript:

Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Scheduling in Windows Zoltan Micskei Operating systems (vimia219)

Copyright Notice  These materials are part of the Windows Operating System Internals Curriculum Development Kit, developed by David A. Solomon and Mark E. Russinovich with Andreas Polze  Microsoft has licensed these materials from David Solomon Expert Seminars, Inc. for distribution to academic organizations solely for use in academic environments (and not for commercial use)   © David A. Solomon and Mark Russinovich 2

Basic concepts Thread Address space Resources Security token Memory Process Running instance of a program Execution environment CPU Unit of scheduling 1 1..n 3

Principles of Windows scheduling  Preemptive scheduler (both kernel and user!)  32 priority levels o (One of the) Thread with the highest priority runs o Round robin between threads with same priority  Threads run for a fixed time (quantum)  No central scheduler, scheduling is driven by events  Priority of threads can change runtime 4

Scheduling 5

Priority levels (kernel) 16 “real-time” 15 dynamic Idle i 15 1 NOT hard/soft real-time, just priority is constant Priority of the thread can be changed If nothing else to run, counts spare cycles 6

Priority levels (Windows API, GUI) Realtime High Above Normal Normal Below Normal Idle Name of priority levels Value of priority 7

Windows API vs. kernel names  Threads: 7 different relative priority  Mapping: 8

I/O priority  Since Vista  5 different I/O priority for requests, e.g. o Critical: Dirty page writer o Low: Desktop search indexer  I/O bandwidth allocation 9

DEMO  „Heat map”  Redesign based on telemetry  Groupping  „Friendly name” Windows 8 task manager 10

DEMO  Task manager Changing priority 11

Dispatcher ready queues 12

Quantum  Quantum: time slice for Round Robin  Measured in clock interval (clock tick) o 1 clock tick = ~ ms (before Windows 8) o 1 clokc tick = 0.5–15.6 ms (after Windos 8)  Storing quantum: “3 * number of clock tick ” o Easy to subtract fractions  At each tick quantum of the running thread decreases by 3 (~ before Vista) 13

Length of the quantum ShortLong Variable Fixed18 36 Adjust for programs Background services  Client (XP, Vista, Win 7, Win 8):  2-6 clock tick  foreground process longer  Server  Longer quantums  Equal quantum for everyone 14

DEMO  Clockres.exe utility o Length of Clock tick  Adjust quantum length  Perfmon  Windows Performance Analyzer o Timeline by Process, Thread view Length of the quantum 15

Contents  Windows scheduling (basics)  Windows 8: Windows Store applications  Windows scheduling (advanced) 16

Windows 8: new application model  Design goals: o Low powers and resource-consumption o Easier deployment and upgrade o Separated applications (security, reliability) o…o…  Solution: o New API: WinRT o App store: Windows Store o New application lifecycle o…o… 17

Windows Store application lifecycle 18 Use changes to other app. OS suspends the process (5 sec). App can change its state. Use changes to other app. OS suspends the process (5 sec). App can change its state. No CPU time OS can terminate app No CPU time OS can terminate app If saved state exists, can be restore; otherwise start from scratch Source: Terminating

DEMO  Windows Store  Changing between Windows Store apps  Process Explorer: Suspended state Windows Store applications 19

Contents  Windows scheduling (basics)  Windows 8: Windows Store applications  Windows scheduling (advanced) 20

Adjusting prority After wait is over, give a priority boost Decrease priority gradually back to base priority Give a change for those, who waited a long time! 21

Preventing starvation  OS checks runnable threads (every 1 sec)  If a thread has not been executed since 300 sec o change priority to 15 (max in dynamic), o increase quantum, o for 1 quantum. 22

Symmetric Multiprocessing (SMP)  All CPU is equal o Shared address space o Interrupts can be served by an CPU  Implementation limit (length of a bit vector): o 32 CPUs on 32 bit systems o 64 CPUs on 64 bit systems  Change in Windows 7 / Server 2008 R2 o Groups of logical processors o Supporting 4 * 64 CPU o NUMA support Memory I/O CPUs L2 Cache SMP 23

Multiprocessor scheduling  Threads can run on any CPU by default, but o OS tries to keep on CPU, where it run (“soft affinity”) o Can be set to use only selected CPUs (“hard affinity”)  No “master processor”  Dispatcher queues: o Before Windows Server 2003 : one global queue o Windows Server 2003: per CPU queues 24

Hard Affinity 25

Windows 7 changes  Core Parking (server) o Use fewer processor cores o Not used cores going to standby  Time coalescing o Timers with same periodicity are merged  Dynamic Fair Share Scheduling (DFSS) o for Remote Desktop o Every session gets a share o If share is exhausted, thread cannot run  Eliminating global locks in scheduler 26

Summary  Process ↔ Thread  Scheduling: o Priority levels o Round robin / quantum 27