Escolar Documentos
Profissional Documentos
Cultura Documentos
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Operating Systems
Prof. Dr.-Ing. Ralf Steinmetz
Prof. Dr. Max Mhlhuser
MM: TU Darmstadt - Darmstadt University of Technology,
Dept. of of Computer Science
TK - Telecooperation, Tel.+49 6151 16-3709,
Alexanderstr. 6, D-64283 Darmstadt, Germany, max@informatik.tu-darmstadt.de Fax. +49 6151 16-3052
Scope
09B-os.fm 1 20.June.01
Scope
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Applications
Usage
Learning & Teaching Design User Interfaces
Services
Content Group
Docu- Synchro-
Process- Security ... Communi-
ments nization
ing cations
Databases Programming
Systems
Compression
Basics
Computer
Archi- Image &
Scope tectures Animation Video Audio
Graphics
Scope
09B-os.fm 2 20.June.01
Contents
1. Real-Time Characterization
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
09B-os.fm 3 20.June.01
1. Real-Time Characterization
Real-time process:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Scope
Scope
09B-os.fm 4 20.June.01
Deadlines
A deadline represents the latest acceptable time for the presenta-
tion of a processing result
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Soft deadlines:
in some cases the deadline is missed
not too many deadlines are missed
deadlines are not missed by much
presented result has still some value
Example: train/plain arrival-departure
Hard deadlines:
should never be violated
violation means system failure
too late presented result has no value
Critical:
violation means severe (potentially catastrophic) system failure
Scope
Scope
09B-os.fm 5 20.June.01
Real-Time Operating System Requirements
Real Time
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Multi-tasking capabilities
Short interrupt latency
Fast context switch
Control of memory management
Proper scheduling
Fine-granularity of timer services
Rich set of interprocess communication mechanisms
Scope
Scope
09B-os.fm 6 20.June.01
2. Resource Scheduling: Motivation
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
streams
scheduler resource
Resource:
active: like CPU, network protocol, ...
passive: like bandwidth, memory, ...
Scheduler:
One for each active resource: esp. CPU, network
Multiplexes resource between:
Processing requests from different multimedia streams
Other processing requests
Scope
Determines order by which requests are serviced
Scope
? scheduling algorithm
09B-os.fm 7 20.June.01
Scheduler Requirements
Support QoS scheme:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Scope
Scope
09B-os.fm 8 20.June.01
Overall - Approach
Adapt real-time scheduling to continuous media
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Scope
Scope
09B-os.fm 9 20.June.01
Priorities
Overall priorities account for importance of traffic, e.g.:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
09B-os.fm 10 20.June.01
Preemptions
Preemptive scheduling:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Scope
Scope
09B-os.fm 11 20.June.01
3. Properties of Multimedia Streams
Periodic stream model:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
p=1/r
t
s
Packets of stream i:
Begin at time si
Arrive with rate ri (i.e. ri packets per time unit)
Require processing time ei
Scope
Must be finished at deadlines dij
Scope ? Scheduling algorithm must account for these properties
09B-os.fm 12 20.June.01
4. Deadline-Based Scheduling EDF
Process priority determined by process deadline:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
EDF schedule:
priority/ d11 d12 d13 d14 d15
next deadline: d21 d22
Scope
Scope
09B-os.fm 13 20.June.01
Deadline-Based Scheduling
(Assumption for most research projects): deadline = end of period:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
deadline d1 d2 d3
t
arrival time s1 s2 s3 s4
QoS calculation:
Preemptive scheduling (Liu / Layland, 1973):
maximum allowable throughput (limit for accepting scheduling requests):
e
-----i 1
pi
all streams i
packet delay pi
Scope Non-preemptive scheduling (Nagarajan / Vogt, 1992):
same throughput as above
Scope
packet delay <= 1/pi + e, where e is the (unique) processing time for a
packet
09B-os.fm 14 20.June.01
5. Rate-Monotonic Scheduling
Process priority determined by packet rate:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
arrival time
required processing time
process 1:
high priority
process 2:
low priority
rate-monotonic schedules:
preemption
preemptive:
non-
Scope
preemptive:
Scope
? Relative stream priority is fixed
09B-os.fm 15 20.June.01
Rate-Monotonic Scheduling
Deadline = end of period (same as for deadline-based sched.):
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
deadline d1 d2 d3
t
arrival time s1 s2 s3 s4
QoS calculation:
Preemptive scheduling (Liu / Layland, 1973):
maximum allowable throughput:
e
-----i ln 2
pi
all streams i
packet delay pi
Scope Non-preemptive scheduling (Nagarajan / Vogt, 1992):
formulae significantly more complex
Scope
guaranteed throughput significantly lower
09B-os.fm 16 20.June.01
6. Deadline-Based vs. Rate-Monotonic Scheduling
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
process j:
rate-monotonic deadline
scheduling: violation
finished
deadline-based in time
scheduling:
Scope
Scope
09B-os.fm 17 20.June.01
7. Some Other Scheduling Algorithms
Fixed-priority scheduling:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
remaining
processing time Pi
laxity(ti) = Di - ti - Pi
Scope
Other examples:
"shortest-job-first" SJF: improvement for overload conditions
Scheduling for Imprecise Computations
Sporadic Servers
09B-os.fm 18 20.June.01
8. Execution Architecture System Structure
Problem:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Scope
Scope
09B-os.fm 19 20.June.01
System Structure Example
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Network SH Microphone
Receiver
Mixer Audio Adapter
SH
File
Network, e.g. SH
Scope Token Ring Speaker
Disk
Scope
09B-os.fm 20 20.June.01
9. CPU Requirement Estimation:
CPU Utilization of Software Modules
QoS calculation needs knowledge of required CPU capacity
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Definition:
The CPU utilization ti of a software module is the time during
which the processor executes code of this module or code for the
management of this execution.
Scope
09B-os.fm 21 20.June.01
Measurement Tool Architecture
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Specification
SH Under Test
Compiler
Measurement Tool
Parameter Adjustment MSH
Trace Point
Input
SH
Under
Test
Trace Point
Output
Scope
Analyzer MSH
Scope
CPU Utilization
09B-os.fm 22 20.June.01
10. Operating System Support
Operating system manages local resources:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
CPU
Memory space
File system
? To be distinguished from network resources used for data trans-
mission
Operating system support required for:
Real-time processing
Memory management
Scope
Scope
09B-os.fm 23 20.June.01
10.1 Issues in Operating System Support - Examples
Fixed-priority scheduling:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Scope
Scope
09B-os.fm 24 20.June.01
Operating System Example: AIX
Fixed CPU priorities:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
High-granularity timers:
Logical granularity: 1 ns
Current implementation: 256 ns
Preemptive kernel
Scope Pinning of pages in main memory
Scope
09B-os.fm 25 20.June.01
Operating System Example: Windows NT
Fixed CPU priorities:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Scope
Scope
09B-os.fm 26 20.June.01
10.2 CPU Management: Scheduling Scenario
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
preemption
streams CPU
scheduler / dispatcher
09B-os.fm 27 20.June.01
CPU Management: Scheduling Algorithms
Rate-Monotonic Scheduling:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Implementation:
relative priority of a stream remains fixed
map stream priorities to fixed operating system priorities (as in AIX)
QoS calculation based on Liu / Layland formulae
Deadline-Based Scheduling:
Implementation:
dynamic process priorities require frequent priority switches
considerable overhead in operating systems with static system priorities
QoS calculation based on Liu / Layland formulae
Scope
Scope
09B-os.fm 28 20.June.01
10.3 Memory Management
Main memory is needed for several purposes:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
09B-os.fm 29 20.June.01
Memory Management (2)
Data movement costs should be kept small
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
09B-os.fm 30 20.June.01
Memory Management (3) Streaming Modes
User
User
Data Data Modification Data Data Data
Kernel
Kernel
Device Independent Device Independent
Abstraction Layer(s) Abstraction Layer(s)
Application-Streaming Kernel-Streaming
Read Write Create
User
User
Stream Stream Stream
Kernel
Kernel
Device Independent Device Independent
Scope
Abstraction Layer(s) Abstraction Layer(s)
read write
Scope Data
Device Driver Device Driver Device Driver Kernel Device Driver
Thread
Device Device Device Device
09B-os.fm 31 20.June.01
10.4 Existing Operating Systems: Difficulties (1)
Extensions have been developed for
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Scope
09B-os.fm 32 20.June.01
Existing Operating Systems: Difficulties (2)
Reasons:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
09B-os.fm 33 20.June.01
10.5 New Architectures for
Multimedia Operating Systems
Entirely new operating system
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Scope
Scope
09B-os.fm 34 20.June.01
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Scope
Scope
R. Steinmetz, M. Mhlhuser
09B-os.fm 35 20.June.01
Microkernel
Monolithic
Comparison of OS Structures
Kernel
Nemesis
11. Conclusions
Scheduling mechanisms have to:
R. Steinmetz, M. Mhlhuser
http://www.kom.e-technik.tu-darmstadt.de
http://www.tk.informatik.tu-darmstadt.de
Scope
Scope
09B-os.fm 36 20.June.01