Eingebettete Systeme Übungsblatt 10: PCP in RTEMS. LS 12, TU Dortmund. Ingo Korb Ingo Korb (LS 12, TU Dortmund) 1 / 9

Similar documents
Lab: Response Time Analysis using FpsCalc Course: Real-Time Systems Period: Autumn 2015

CPU Scheduling. Jo, Heeseung

SELF OPTIMIZING KERNEL WITH HYBRID SCHEDULING ALGORITHM

Course Outline. Embedded Real Time Operating System Chin Fu Kuo National University of Kaohsiung 2009 Fall

CS510 Operating System Foundations. Jonathan Walpole

Project 2 solution code

Mode Change Protocols for Priority-Driven Preemptive Scheduling

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Real-Time Scheduling Theory and Ada

1

Real-time System Overheads: a Literature Overview

TUPE: Key Issues on Second Generation Outsourcings. We are just waiting on everyone joining and will be starting the session shortly at 1.

CPU SCHEDULING. Scheduling Objectives. Outline. Basic Concepts. Enforcement of fairness in allocating resources to processes

Implementing a Predictable Real-Time. Multiprocessor Kernel { The Spring Kernel.

Technical Report CMU/SEI-89-TR-14 ESD-TR-89-; 022. Carnegie-Mellon University. Software Engineering Institute. Real-Time Scheduling Theory

CS 143A - Principles of Operating Systems

OPTIMAL ALLOCATION OF WORK IN A TWO-STEP PRODUCTION PROCESS USING CIRCULATING PALLETS. Arne Thesen

CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms. Unix Scheduler

Economics 101 Fall 2014 International Trade. Problem Set 2. November 10, Heckscher-Ohlin Trade Theory and Wages

Lecture 11: CPU Scheduling

Optimal Design Methodology for an AGV Transportation System by Using the Queuing Network Theory

Rate Monotonic Analysis

Reference model of real-time systems

Comp 204: Computer Systems and Their Implementation. Lecture 10: Process Scheduling

CSC 553 Operating Systems

Dual Priority Scheduling: A Means of Providing Flexibility in Hard Real-time Systems.

Periodic task scheduling

Participant Guide Lesson 5 Monitoring Performance. Slide 1. 1 DPMAP Rev.2. July Lesson 5: Monitoring Performance. July 2016

Asia Pacific Journal of Engineering Science and Technology

CS 153 Design of Operating Systems Winter 2016

Economics 384 B1. Intermediate Microeconomics II. Assignment 2. S Landon Winter 2007

Introduction to Real-Time Systems. Note: Slides are adopted from Lui Sha and Marco Caccamo

Deliverable: D 4.1 Gap analysis against ISO 26262

Lecture 11: Scheduling

A Reference Model of Real-Time Systems

Homework 2: Comparing Scheduling Algorithms

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

CPU scheduling. CPU Scheduling

Principles of Operating Systems

10/1/2013 BOINC. Volunteer Computing - Scheduling in BOINC 5 BOINC. Challenges of Volunteer Computing. BOINC Challenge: Resource availability

Pricing in Dynamic Advance Reservation Games

The Math of Contact Center Staffing

Lecture 6: Scheduling. Michael O Boyle Embedded Software

SimSo: A Simulation Tool to Evaluate Real-Time Multiprocessor Scheduling Algorithms

Real-Time and Embedded Systems (M) Lecture 4

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

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

CPU Scheduling. Jo, Heeseung

LinTim. A Toolbox for the Experimental Evaluation of the Interaction of Different Planning Stages in Public Transportation

Dealing with chance Four strategies. Simple, direct Absolutes. Persuasion Top management support. Training. Corruption Alienation. 3 lines of defense

No THE MUSEUM PASS GAME AND ITS VALUE REVISITED. By Arantza Estévez-Fernández, Peter Borm, Herbert Hamers. January 2004 ISSN

Chapter 5. Market Equilibrium 5.1 EQUILIBRIUM, EXCESS DEMAND, EXCESS SUPPLY

Lecture 3. Questions? Friday, January 14 CS 470 Operating Systems - Lecture 3 1

Business Systems Operations Management

Collusion. Sotiris Georganas. February Sotiris Georganas () Collusion February / 31

Replenishment Training Manual

Scheduling. CSE Computer Systems November 19, 2001

Business Process Management - Quantitative

SOFTWARE HAZARD AND REQUIREMENTS ANALYSIS

Clock-Driven Scheduling

Advanced Operating Systems (CS 202) Scheduling (2)

Mwave/OS: A Predictable Real-time DSP Operating System

Chapter 9 Uniprocessor Scheduling

Chapter 4. Demand, Supply and Markets. These slides supplement the textbook, but should not replace reading the textbook

Simulation and Queing Theory

Motivating Examples of the Power of Analytical Modeling

The Staffing Problem of the N-Design Multi-Skill Call Center Based on Queuing Model

COAL - HAZOP SYSTEMS ANALYSIS GRINDING AND FIRING

Project Management. Term Project. Conveyor Belt Project

Management of Knowledge Intensive Systems As Supernetworks: Modeling, Analysis, Computations, and Applications. Anna Nagurney June Dong

Online Mediation Controller 1-1

SE350: Operating Systems. Lecture 6: Scheduling

Price Discrimination: Exercises Part 2

Using SAS Visual Investigator to Enforce Model Tuning Best Practices in a Regulatory Environment

ANS: Q2 and Q6: VORA, Chapter 9, Inventory Management:

Modeling and Execution of Multienterprise Business Processes

This webinar is Parish Emergency Operations Planning Session 1: Beginning the Basic Plan. October 22, Welcome Questions - Chat feature

Fractal Exercise. Fractals, task farm and load imbalance

Product Design and Development Dr. Inderdeep Singh Department of Mechanical and Industrial Engineering Indian Institute of Technology, Roorkee

Priority-Driven Scheduling of Periodic Tasks. Why Focus on Uniprocessor Scheduling?

1Introduction. Features. 2System. Automation College, Beijing Union University, Beijing, China

SCHEDULING IN MANUFACTURING SYSTEMS

Efficiency of Dynamic Pricing in Priority-based Contents Delivery Networks

CPU scheduling CPU 1. P k P 3 P 2 P 1 CPU 2. CPU n. The scheduling problem: Which jobs should we assign to which CPU(s)?

Life-Time Emissions Budget for New Coal-Fired Power Plants

Process Scheduling I. COMS W4118 Prof. Kaustubh R. Joshi hdp://

General Certificate of Education examination - June series

Example. You manage a web site, that suddenly becomes wildly popular. Performance starts to degrade. Do you?

18 Business Continuity Management

Model, analysis and application of employee assignment for quick service restaurant

Process Mapping. You cannot improve a process until everyone agrees on what the process is.

Exercise: Fractals, Task Farms and Load Imbalance

Labs : Real-Time Scheduling Tools. ETR 2015 F. Singhoff

OPTIMAL RENTING/SELLING STRATERGIES IN OLIGOPOLY DURABLE GOODS MARKETS. Golovko Sergiy

6 Competitive equilibrium: Introduction

Midterm Preparation EconS 330

TCSS 422: OPERATING SYSTEMS

A Queuing Approach for Energy Supply in Manufacturing Facilities

Chapter 6: CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. CPU Scheduler. Dispatcher. Alternating Sequence of CPU And I/O Bursts

CS162 Operating Systems and Systems Programming Lecture 10. Tips for Handling Group Projects Thread Scheduling

Transcription:

Eingebettete Systeme Übungsblatt 10: PCP in RTEMS Ingo Korb LS 12, TU Dortmund 18.01.2016 Ingo Korb (LS 12, TU Dortmund) 1 / 9

Outline ˆ Drawback of PIP ˆ Introduction of PCP ˆ PCP theory / implementation ˆ Exercises Ingo Korb (LS 12, TU Dortmund) 2 / 9

Drawback? Now we have PIP to mitigate the priority inversion and prevent the starvation of higher priority tasks. However, there is still a drawback: ˆ PIP might cause a deadlock if there are multiple resources However, if the resource accesses for a task are properly nested, then some analysis is still possible. ˆ all the required semaphores are locked at once, or ˆ only one semaphore is used to guard one critical section, or ˆ a critical section guarded by a semaphore is completely within another critical section guarded by another semaphore with a predened access order, or ˆ other ways to prevent deadlocks. Ingo Korb (LS 12, TU Dortmund) 3 / 9

Other ways? Priority Ceiling Protocol (PCP) ˆ Two key assumptions: ˆ The assigned priorities of all jobs are xed. ˆ The resources required by all jobs are known a priori before the execution of any job begins. ˆ Denition: The priority ceiling of a resource R is the highest priority of all the jobs that require R, and is denoted Π(R). ˆ Denition: The current priority of a job J at time t is denoted π(t, J), initialized to the jobs priority level when J is released. (smaller means higher priority) ˆ Denition: The current priority ceiling Π (t) of the system is equal to the highest priority ceiling of the resources currently in use at time t, or Ω if no resources are currently in use. Ω is a priority lower than any real priority. ˆ Use the priority ceiling to decide whether a higher priority can allocate a resource or not. Ingo Korb (LS 12, TU Dortmund) 4 / 9

Theoretical PCP 1 Scheduling Rule ˆ Every job J is scheduled based on the current priority π(t, J). 2 Allocation Rule: Whenever a job J requests a resource R at time t, one of the following two conditions occurs: ˆ R is held by another job and J becomes blocked. ˆ R is free: ˆ If J's priority π(t, J) is higher than the current priority ceiling Π (t), R is allocated to J. ˆ Otherwise, only if J is the job holding the resource(s) whose priority ceiling equals Π (t), R is allocated to J ˆ Otherwise, J becomes blocked. 3 Priority-inheritance Rule: When J becomes blocked, the job J l that blocks J inherits the current priority π(t, J) of J. J l executes at its inherited priority until it releases every resource whose priority ceiling is π(t, J) (or until it inherits an even higher priority); at that time, the priority of J l returns to its priority π(t, J l ) at the time t when it was granted the resources. Ingo Korb (LS 12, TU Dortmund) 5 / 9

PCP Implementation 1 Scheduling Rule ˆ Every job J is scheduled based on the current priority π(t, J). 2 Allocation Rule: Whenever a job J requests a resource R at time t, one of the following two conditions occurs: ˆ R is held by another job and J becomes blocked. ˆ R is free: ˆ If J's priority π(t, J) equals the semaphore ceiling Π(R), R is allocated to J directly. ˆ If priority π(t, J) is lower than Π(R), R is allocated to J. Moreover, priority π(t, J) needs to be raised to ceiling Π(R). ˆ If priority π(t, J) is larger than Π(R). (Won't normally happen.) 3 When releasing the semaphore, J returns to its priority π(t, J), then further check if another job J l was waiting for this semaphore. If so, transfer the semaphore to locked J l and raise it's priority to the semaphore priority ceiling Π(R). Ingo Korb (LS 12, TU Dortmund) 6 / 9

Overview of PIP/PCP User&Space& Task1& Task2& Cri0cal& Sec0on& Cri0cal& Kernel& RTEMS& SCORE& SemObtain()& Trylock()/blocking()& SemRelease()& MutexSurrender()& 1 In SemObtain() of RTEMS, it will call _CORE_mutex_Seize(). 2 In SemRelease() of RTEMS, it will call _CORE_mutex_Surrender(). 3 After calling the above interface functions in SCORE, the mutex-relevant features will be triggered. Ingo Korb (LS 12, TU Dortmund) 7 / 9

Exercises (10 points) 1 Please activate PIP for the DOUBLE_SEMAPHORE example and see whether it does work. Draw the scheduling diagram. (4 points) 2 Please complete the missing code of the PCP implementation to get rid of the deadlock due to the resource competition. The relevant les are: coremuteximpl.h, coremutexsurrender.c (6 points) Hints: Please refer slides 6 and 7 to full the code. 3 _Thread_Raise_priority(A, B), raises the priority of A to B. 4 _Thread_queue_Release( queue, lock ), releases the lock from the wait queue of a mutex. Ingo Korb (LS 12, TU Dortmund) 8 / 9

Task data Tasks Period Critical Section Arrive Time Semaphore τ 1 20 6 2 II τ 2 30 0 5 X τ 3 40 6 0 I Ingo Korb (LS 12, TU Dortmund) 9 / 9