Real-Time Operating Systems Issues. Realtime Scheduling in SunOS 5.0

Similar documents
Comparison of soft real-time CPU scheduling in Linux kernel 2.6 series with Solaris 10

Unix SVR4 (Open Solaris and illumos distributions) CPU Scheduling

SMD149 - Operating Systems

Multiprocessor and Real-Time Scheduling. Chapter 10

Multiprocessor and Real- Time Scheduling. Chapter 10

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

Scheduling II. Today. Next Time. ! Proportional-share scheduling! Multilevel-feedback queue! Multiprocessor scheduling. !

Chapter 5: CPU Scheduling

CSE 153 Design of Operating Systems

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

Scheduling II. q q q q. Proportional-share scheduling Multilevel-feedback queue Multiprocessor scheduling Next Time: Memory management

Chapter 6 Concurrency: Deadlock and Starvation

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

Scheduling in the Supermarket

Chapter 2 Processes and Threads

Tasks. Task Implementation and management

Course Syllabus. Operating Systems

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

CSCI-GA Operating Systems Lecture 3: Processes and Threads -Part 2 Scheduling Hubertus Franke

Lecture 9: Midterm Review

Processes The Process Model. Chapter 2. Processes and Threads. Process Termination. Process Creation

Deadlock. Concurrency: Deadlock and Starvation. Reusable Resources

by Maria Lima Term Paper for Professor Barrymore Warren Mercy College Division of Mathematics and Computer Information Science

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

Real Time Linux patches: history and usage

Operating Systems CS 323 Ms. Ines Abbes

CSE 120 Principles of Operating Systems Spring 2017

Subject Name:Operating system. Subject Code:10EC35. Prepared By:Remya Ramesan and Kala H.S. Department:ECE. Date:

LECTURE 3:CPU SCHEDULING

CSE 4/521 Introduction to Operating Systems

Threads. Threads The Thread Model (1) CSCE 351: Operating System Kernels Witawas Srisa-an Chapter 4-5

CSE 120. Fall Lecture 8: Scheduling and Deadlock. Keith Marzullo

CS307: Operating Systems

2. The shared resource(s) in the dining philosophers problem is(are) a. forks. b. food. c. seats at a circular table.

Chapter 5: Process Scheduling

CS 153 Design of Operating Systems Winter 2016

CSE 4/521 Introduction to Operating Systems. Lecture 29 Windows 7 (History, Design Principles, System Components, Programmer Interface) Summer 2018

Scheduling - Overview

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

Chapter 5: CPU Scheduling. Operating System Concepts 9 th Edit9on

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

8: Scheduling. Scheduling. Mark Handley

Processes. Overview. Processes. Process Creation. Process Creation fork() Processes. CPU scheduling. Pål Halvorsen 21/9-2005

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

Processes The Process Model. Chapter 2 Processes and Threads. Process Termination. Process States (1) Process Hierarchies

Operating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst

Computer Systems Assignment 4: Scheduling and I/O

Operating system concepts. Task scheduling

Scheduling Mar. 19, 2018

The Real-time Specification for Java

CSE 120 Principles of Operating Systems

Process & Thread Management II. Queues. Sleep() and Sleep Queues CIS 657

Process & Thread Management II CIS 657

Chapter 5: CPU Scheduling

PROCESS SCHEDULING II. CS124 Operating Systems Fall , Lecture 13

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

Mid Term from Feb-2005 to Nov 2012 CS604- Operating System

MARUTHI SCHOOL OF BANKING (MSB)

Implementation and Evaluation of the Synchronization Protocol Immediate Priority Ceiling in PREEMPT-RT Linux

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

CS370 Operating Systems

Operating Systems Unit 3

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

STUDENT NAME: STUDENT ID: Problem 1 Problem 2 Problem 3 Problem 4 Problem 5 Total

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)

Operating System Performance and Large Servers 1

Multimedia Systems 2011/2012

CSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.

Announcements/Reminders

INF1060: Introduction to Operating Systems and Data Communication. Pål Halvorsen. Wednesday, September 29, 2010

CS450/550 Operating Systems

Chapter 5: CPU Scheduling

Threads and Too Much Milk! CS439: Principles of Computer Systems February 6, 2019

CS450/550 Operating Systems

(MCQZ-CS604 Operating Systems)

Operating Systems Design Fall 2010 Exam 1 Review. Paul Krzyzanowski

CS370 Operating Systems

How Linux RT_PREEMPT Works

CPU Scheduling: Objectives

Practice Exercises 305

CPSC/ECE 3220 Fall 2017 Exam Give the definition (note: not the roles) for an operating system as stated in the textbook. (2 pts.

CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU and I/O Bursts

TDIU25: Operating Systems II. Processes, Threads and Scheduling

Operating Systems. Figure: Process States. 1 P a g e

March 6, 2000 Applications that process and/or transfer Continuous Media (audio and video) streams become

Windows 7 Overview. Windows 7. Objectives. The History of Windows. CS140M Fall Lake 1

CHAPTER 2: PROCESS MANAGEMENT

Introduction. CS3026 Operating Systems Lecture 01

Process- Concept &Process Scheduling OPERATING SYSTEMS

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

CSI3131 Final Exam Review

Scheduling. Scheduling 1/51

CS370 Operating Systems

Concurrency: Deadlock and Starvation

This slide show uses materials from the Windows Operating System Internals Curriculum Development Kit

Threads and Too Much Milk! CS439: Principles of Computer Systems January 31, 2018

Lecture 2 Process Management

Embedded Systems. 6. Real-Time Operating Systems

Processes and Threads. Processes: Review

CS370 Operating Systems Midterm Review

Transcription:

Real-Time Operating Systems Issues Example of a real-time capable OS: Solaris. S. Khanna, M. Sebree, J.Zolnowsky. Realtime Scheduling in SunOS 5.0. USENIX - Winter 92. Problems with the design of general-purpose real-time capable OS: Solaris J.Nieh, J.G.Hanko, J.D. Northcutt, G.A.Wall. SVR4 UNIX Scheduler Unacceptable for Multimedia Applications. NOSSDAV 93. URL: http://www.cs.columbia.edu/~nieh/#publications Realtime Scheduling in SunOS 5.0 Requirements for Solaris as a real-time OS: Scheduling of tasks in kernel should be deterministic. Kernel should be free from unbounded priority inversion. Allow for mixed-mode applications: real-time and non-real-time components. Appropriate for multiprocessor machines. Provide standard interface to user, such as System V. Historically: unbounded dispatch latency caused by non-preemptible kernel. Solution 1: Well-defined preemption points. (?) Solution 2: Fully synchronize access by kernel code to kernel data structures. Reduces set of non-preemptible portions in kernel. Kernel is multithreaded. 1

Scheduling Classes Time-Sharing class: round robin scheduling. Sys class: fixed priority scheduling, not accessible by the user. Real-Time class: fixed priority scheduling. priocntl(2) Change scheduling class or other scheduling parameters. interrupt RT 159 RT 59 sys 99 0 +20 59 TS TS -20 0 Scheduling State of thread: blocked, runnable, executing Scheduling operations (operations on dispatch queue) are protected by single spin lock schedlock. Variables per processor: cpu_thread: thread curr. executing cpu_dispthread: thread last sched. for disp cpu_idle: special idle thread cpu_runrun: user-level preemption cpu_kprunrun: kernel-level preemption cpu_chosenlevel: next trhead to preempt RT0 RT1 RT2 runnable threads dispatch queue S0 BT0 BT1 BT2 blocked threads DT executing thread P1 processor 2

Operations on Dispatch Queues setfrontdq() put thread in dispatch queue setbackdq() (when thread is preempted) cpu_choose() find CPU on which runnable thread might be dispatched cpu_surrender() give up CPU when priority is lowered disp() select a thread for execution from the dispatch queue (used by swtch) swtch() select highest-priority thread for execution if none is found, returns idle thread modifies many per-processor variables kpreempt() attempt to preempt kernel kpreempt_disable()disable preemption for critical interval kpreempt_enable() reenable preemption Priority Inversion Priority inversion happens due to non-preemptable portions access to synchronization objects hidden scheduling Synchronization Objects (mutex, r/w locks) Solution: basic priority-inheritance protocol Hidden Scheduling Work done asynchronously in kernel on behalf of threads without regard to their priority. process Example: streams processing Example: timeouts done at lowest interrupt level Solution: Move this code into kernel threads running at sys priority level. user kernel check pending streams requests 3

Priority Inheritance Primitives: pi_willto(thread) impose priority of argument thread onto all threads that block it, directly or indirectly pi_waive() release priority inheritance The function pi_willto() is called after the thread has been put to sleep in the queue associated with the synchronization object. The information about the synchronization object can therefore be recovered. Priority inheritance for readers/writers locks: when writer owns the lock: no problem when readers own the lock: potentially many owners ; not practical to keep pointer from resource to every thread that owns it Solution: define a single owner-of-record, which is only thread that inherits priority. Applicability of SunOS 5.0 for Multimedia Applications J.Nieh, J.G.Hanko, J.D. Northcutt, G.A.Wall. SVR4 UNIX Scheduler Unacceptable for Multimedia Applications. NOSSDAV 93. URL: http://www.cs.columbia.edu/~nieh/#publications Objectives of real-time OS for general-purpose workstations Provide real-time guarantees without reducing general capabilities of workstations Manage resources so that other applications can operate correctly. SunOS 5.0 (SVR4) provides real-time static-priority scheduler. Question: How well are resources managed? 4

Experimental Evaluation: Overview Platform Sun Sparc10 Solaris 2.2 Scheduling classes (RT class, TS class, SYS class) Experiment (measurement) criteria: Interactive: minimize average and variance between user input and response Typing, cursor motion, mouse selection <= 50-150 ms. Continuous media: Minimize difference between average display rate and desired display rate. Minimize variance of display rate. Batch: Minimize difference between actual time of completion and minimum time of completion when whole machine is dedicated. Experiment: Workload 3 classes of workload Interactive: (editors, GUIs) TYPING: Emulate a user typing, and display characters on the screen. Continuous media: (television, teleconference) VIDEO: Capture data from digitizer board and display through x- windows server. Batch: (compilations, scientific computation) make: Repeatedly fork and wait for small processes to complete. Instrumentation of application and system software components does not measurably change the performance. 5

Experiment: The Baseline Application Measurement Mean Std. Dev. Typing Latency between character arrival 38.5 ms 15.7 ms and rendering to frame buffer Video Time between display of successive 112 ms 9.75 ms frames Compute Time to execute one loop iteration 149 ms 6.79 ms Table: Application Baseline Values What is a well-behaved system? Concurrent applications should make some progress No case where system fails to respond to operator input User should exercise wide range of influence over system behavior. Experiment 1: Run all tasks in RT class Window system is no longer accepting input events from mouse or keyboard. Command interpreter not permitted to run. System blocked by batch-job Identified as I/O intensive interactive job. Gets priority boosts for sleeping. Window server develops backlog of service requests. As it works down its queue, it gets identified as compute bound. Table entries are relative to baseline (tall is better) T: TYPING character latency V: time between display of successive frames for VIDEO. C: time for one iteration in COMPUTE. 6

What can the System Administrator do? Increase priority of X- Server, decrease priority of batch task In addition, decrease priority of VIDEO a bit Decrease priority of VIDEO a little bit more. Play with RT Class 7

Result: New TS Class Removes anomalies of identifying batch jobs as interactive and vice versa. Ensures that each process makes steady progress. Reduces feedback interval Included in Solaris 2.3. 8