2c Desktop slowdown – reason Stop Polling! The Case Against OS Ticks Dan Tsafrir*, Yoav Etsion and Dror G. Feitelson The Hebrew University of Jerusalem.

Slides:



Advertisements
Similar presentations
Introduction to Embedded Systems Resource Management - III Lecture 19.
Advertisements

Lecture 11: Operating System Services. What is an Operating System? An operating system is an event driven program which acts as an interface between.
1/19 Secretly Monopolizing the CPU Without Superuser Privileges IBM Watson, NY-Dan Tsafrir Hebrew University, Jerusalem-Yoav Etsion Hebrew University,
Virtual Memory Background Demand Paging Performance of Demand Paging
BFS: Brain F*ck Scheduler Jacob Chan. Objectives  Brain F*ck Scheduling  What it is  How it works  Features  Scalability  Limitations  Definition.
Concurrency: Threads, Address Spaces, and Processes Sarah Diesburg Operating Systems COP 4610.
Why Concurrency? Allows multiple applications to run at the same time  Analogy: juggling.
Effects of Clock Resolution on the Scheduling of Interactive and Soft Real- Time Processes by Yoav Etsion, Dan Tsafrir, Dror G. Feitelson Presented by.
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
OS Spring ’ 04 Scheduling Operating Systems Spring 2004.
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Jonathan.
Operating System Structure. Announcements Make sure you are registered for CS 415 First CS 415 project is up –Initial design documents due next Friday,
Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented by Reinette Grobler.
Supporting Time-sensitive Application on a Commodity OS By Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow, Jonathan Walpole Presenter: Shuping Tien.
5: CPU-Scheduling1 Jerry Breecher OPERATING SYSTEMS SCHEDULING.
Measuring zSeries System Performance Dr. Chu J. Jong School of Information Technology Illinois State University 06/11/2012 Sponsored in part by Deer &
Computer System Architectures Computer System Software
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 5 Operating Systems.
OPERATING SYSTEMS CPU SCHEDULING.  Introduction to CPU scheduling Introduction to CPU scheduling  Dispatcher Dispatcher  Terms used in CPU scheduling.
Concurrency: Threads, Address Spaces, and Processes Andy Wang Operating Systems COP 4610 / CGS 5765.
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.
Scheduling Basic scheduling policies, for OS schedulers (threads, tasks, processes) or thread library schedulers Review of Context Switching overheads.
Operating Systems Lecture 2 Processes and Threads Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
Operating Systems Lecture Notes CPU Scheduling Matthew Dailey Some material © Silberschatz, Galvin, and Gagne, 2002.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
4.1 Advanced Operating Systems Desktop Scheduling You are running some long simulations. In the mean time, why not watch an illegally downloaded Simpsons.
Reference: Ian Sommerville, Chap 15  Systems which monitor and control their environment.  Sometimes associated with hardware devices ◦ Sensors: Collect.
Operating Systems CSE 411 Multi-processor Operating Systems Multi-processor Operating Systems Dec Lecture 30 Instructor: Bhuvan Urgaonkar.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
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.
Cpr E 308 Spring 2005 Process Scheduling Basic Question: Which process goes next? Personal Computers –Few processes, interactive, low response time Batch.
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Oindrila.
SECURING SELF-VIRTUALIZING ETHERNET DEVICES IGOR SMOLYAR, MULI BEN-YEHUDA, AND DAN TSAFRIR PRESENTED BY LUREN WANG.
O PERATING S YSTEM. What is an Operating System? An operating system is an event driven program which acts as an interface between a user of a computer,
Lecture 2a: Performance Measurement. Goals of Performance Analysis The goal of performance analysis is to provide quantitative information about the performance.
Lecture 26 Virtual Machine Monitors. Virtual Machines Goal: run an guest OS over an host OS Who has done this? Why might it be useful? Examples: Vmware,
HPC HPC-5 Systems Integration High Performance Computing 1 Application Resilience: Making Progress in Spite of Failure Nathan A. DeBardeleben and John.
Practice Chapter Five.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Time Sources and Timing David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Operating System Concepts
Background Computer System Architectures Computer System Software.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
1 System Noise & OS Clock Ticks Dan Tsafrir Yoav Etsion Dror G. Feitelson Scott Kirkpatrick
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Real-Time Operating Systems RTOS For Embedded systems.
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
Power Management. Outline Why manage power? Power management in CPU cores Power management system wide Ways for embedded programmers to be power conscious.
Mohit Aron Peter Druschel Presenter: Christopher Head
Yoav Etsion, Dan Tsafrir, Dror G. Feitelson
CS 6560: Operating Systems Design
Time Sources and Timing
Presented by Kristen Carlson Accardi
Time Sources and Timing
Real Time Operating System
Concurrency: Threads, Address Spaces, and Processes
Concurrency: Threads, Address Spaces, and Processes
Operating systems Process scheduling.
CPU SCHEDULING.
CPU scheduling decisions may take place when a process:
CSE451 - Section 10.
Time Sources and Timing
Chapter-1 Computer is an advanced electronic device that takes raw data as an input from the user and processes it under the control of a set of instructions.
Chapter 1: Introduction
Concurrency: Threads, Address Spaces, and Processes
Presentation transcript:

2c Desktop slowdown – reason Stop Polling! The Case Against OS Ticks Dan Tsafrir*, Yoav Etsion and Dror G. Feitelson The Hebrew University of Jerusalem (*current affiliation: IBM Watson Research Center) i Ticks are… The general purpose operating system (OS) wakes up HZ times a second “Tick” = Every time the OS wakes up 1ms4ms1ms10msevery HZ FreeBSDLinux2.6Linux2.4WindowsOS The role of ticks: 1)Do alarm signals (movie-player wants to display 50 frames-per-second? Windows will wake it up every 2 ticks; FreeBSD every 20) 2) Do CPU billing (bill current process as if it ran since the last tick, even if it didn’t) 3) Do Context switch (if the quantum of the current process is exhausted) 2a Desktop slowdown Let’s run an empty-loop that is supposed to take 1 millisecond Let’s do it a million times, and measure the actual duration each loop takes: for( i = 1 … 10 6 ) : start = cycle_counter for(…) /* one ms work */ ; end = cycle_counter time[i] = end – start Let’s do it on these machines: processorID clock [MHz]cache [K μops] main mem busL2 L1 datacode Pentium-IV-2.4M Pentium-IV-2.8M Pentium-IV-3.0M cumulative distribution duration [ms] M1 M2 M3 user kernel L1 cache misses [10 6 ] The only activity other than our program is OS interrupts (mostly ticks, some network) There are lots of cache misses, and they are due to kernel interrupts. (As in panel 5, weaker machines suffer more) Indeed, reducing the Hz has a stabilizing effect Finally, disabling the cache and subtracting interrupts’ direct overhead (from the duration of the loops in which they occurred) reveals all variability is accounted for duration [ms] with ticks without histogram 2b Desktop slowdown – evidence … considering our program is the only process allowed to run while measuring (realtime priority) Example: M2’s average duration is 1.08 ms –8% slowdown relative to 1ms, and… –60% relative to the minimal duration! Conjecture by Avi Mendelson [Intel Haifa]: “durations that are shorter than 1ms might occur because the processor possibly works faster from time to time”… Results are bad (histogram of the ‘time’ array)… duration [milliseconds] histogram [%] M1 M2M3 1 Unwarranted power consumption Measuring power consumption of an idle laptop (with disabled screen and hard disk) Higher Hz => more tick handling => more power consumption 100Hz is worse than 500Hz, because 100Hz has enough time to complete HALT tick frequency [Hz] power [watt] overhead [%] power added overhead (relative to 500 Hz) 3 Cluster slowdown The slowdown penalty is amplified for clusters: Parallel programs’ structure often dictates that each task repeatedly computes for a short while and then (barrier) synchronizes with it peers Thus, the duration of each compute-phase is determined by the task that is late the most: “Noise” = unrelated OS activity More processors => greater noise “The noise law”: we empirically observe and analytically prove that this chance is linearly proportional to the number of processors Panels 2* show ticks are a major source of noise time processors computation noise wait barrier n+1 barrier n+2 barrier n 4 Security breach CPU billing is based on sampling (see panel 1): If a process runs while a tick takes place => the process is billed for the entire tick We discovered that a “cheater” process can easily escape this sampling (see next panel) => it looks as if it consumes 0% CPU ! Thus, a “cheater” won’t show up on CPU-usage monitoring tools (like the UNIX ‘top’ utility) It’s therefore possible your computer is secretly running nuclear simulations for… 5 CPU denial of service As all general purpose OSs prioritize processes based on their (lack of) CPU consumption, … The fact a cheater looks as if it uses 0% CPU can be exploited by it to get as much CPU as it wants! This is true regardless of the number of running processes in the system: one process sum of all the others one “cheater” (wants and gets 80%) sum of others CPU [%] total number of (CPU-intensive) processes in the system all are honestone is cheating The above “works” for many OSs: Linux Windows Solaris FreeBSD 7 Hard realtime: problematic predictability Hard-realtime computing requires the execution- time of tasks to be predictable & deterministic Panels 2a-c show it’s far from it, for very short tasks, due to ticks ii Abstract All general purpose OSs use ticks as means of maintaining control (see previous panel). The decision to use ticks was made ~40 years ago, in the late 1960s [Dijkstra’s “THE” system, 1968] Ticks always happen, even if the system is otherwise idle (thus using ticks polling) Our case: drawbacks of ticks accumulate into a critical mass suggesting it’s time for a change Our solution: switch to one-shot timers (set only for specific needs) while avoiding the potentially huge overheads they entail to allow general use This poster presents our case against ticks: many, often surprising, drawbacks; last panel outlines the solution 9 Microkernel complexity Microkernels are at the heart of the effort to make computer systems more reliable: much smaller kernel => much less fatal bugs Ticks are traditionally part of the microkernel due to overhead considerations (happen too frequently) Eliminating ticks would means further reduction of the kernel size (e.g. in MINIX-3) 8 Virtual machines overhead Virtual machines (VMs) are used to multiplex hardware resources between multiple OS instances Overhead of “virtualized” ticks is obviously bigger Further, a VM server can be overwhelmed by ticks: –Example: an IBM S/390 mainframe for which servicing the ticks of multiple idle OSs led to 100% utilization of the physical processor fin The solution The OS can request the hardware to wake it up only when there’s something to do using one-shot timers such as Pentium’s APIC or HPET But OSs cannot just allow user-processes to use one-shot timers for alarms… Otherwise, any process would be able to easily bring down the system by generating numerous events with nanosecond differences We suggest the “smart timers” mechanism that 1) eliminates useless periodic ticking, and 2) provides accurate timing with a settable bound on alarm latency (equivalent to “HZ”), and 3) reduces overhead by aggregating near-by events (by HZ alignment or overshoot param.) This solves all above problems and makes the “general-purpose” OS more general… Soft realtime & multimedia: insufficient resolution Xine movie player discards 1/3 of its frames due to low res. This time, 1000Hz was enough But other apps. require more, and OSs & CPUs can deliver desired frames/sec. achieved frames/sec Hz 100 Hz 6