Implementing AUTOSAR Scheduling and Resource Management on an Embedded SMT Processor



Similar documents
Implementing AUTOSAR Scheduling and Resource Management on an Embedded SMT Processor

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run

Processor Scheduling. Queues Recall OS maintains various queues

System Software and TinyAUTOSAR

Chapter 5 Process Scheduling

Operatin g Systems: Internals and Design Principle s. Chapter 10 Multiprocessor and Real-Time Scheduling Seventh Edition By William Stallings

Comparison of Service Call Implementations in an AUTOSAR Multi-core OS

2. is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput

CPU Scheduling. Core Definitions

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

OSEK/VDX. Operating System. Version February 17 th, 2005

2.1 What are distributed systems? What are systems? Different kind of systems How to distribute systems? 2.2 Communication concepts

Predictable response times in event-driven real-time systems

Multi-core Programming System Overview

Facing the Challenges for Real-Time Software Development on Multi-Cores

CPU Scheduling. CPU Scheduling

Priority Inversion Problem and Deadlock Situations

Chapter 6 Concurrent Programming

Real- Time Scheduling

Operating Systems Lecture #6: Process Management

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

Course Development of Programming for General-Purpose Multicore Processors

What is best for embedded development? Do most embedded projects still need an RTOS?

Module 8. Industrial Embedded and Communication Systems. Version 2 EE IIT, Kharagpur 1

How To Write A Multi Threaded Software On A Single Core (Or Multi Threaded) System

Operating System Aspects. Real-Time Systems. Resource Management Tasks

Real-Time Operating Systems for MPSoCs

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

CPU Scheduling Outline

Chapter 2: OS Overview

Programming real-time systems with C/C++ and POSIX

Chapter 19: Real-Time Systems. Overview of Real-Time Systems. Objectives. System Characteristics. Features of Real-Time Systems

Real Time Programming: Concepts

Resource Utilization of Middleware Components in Embedded Systems

Tasks Schedule Analysis in RTAI/Linux-GPL

EECS 750: Advanced Operating Systems. 01/28 /2015 Heechul Yun

Control 2004, University of Bath, UK, September 2004

CHAPTER 1 INTRODUCTION

Load-Balancing for a Real-Time System Based on Asymmetric Multi-Processing

Scheduling. Scheduling. Scheduling levels. Decision to switch the running process can take place under the following circumstances:

4. Fixed-Priority Scheduling

Embedded Systems. 6. Real-Time Operating Systems

Multi-core Curriculum Development at Georgia Tech: Experience and Future Steps

Asymmetric Scheduling and Load Balancing for Real-Time on Linux SMP

First-class User Level Threads

Resource Reservation & Resource Servers. Problems to solve

OPERATING SYSTEMS Internais and Design Principles

Operating System Tutorial

SYSTEM ecos Embedded Configurable Operating System

This Unit: Multithreading (MT) CIS 501 Computer Architecture. Performance And Utilization. Readings

Code Sharing using C++ between Desktop Applications and Real-time Embedded Platforms

E) Modeling Insights: Patterns and Anti-patterns

Multithreading Lin Gao cs9244 report, 2006

W4118 Operating Systems. Instructor: Junfeng Yang

An Implementation Of Multiprocessor Linux

Lecture 3 Theoretical Foundations of RTOS

Thread level parallelism

Chapter 11 I/O Management and Disk Scheduling

Making Multicore Work and Measuring its Benefits. Markus Levy, president EEMBC and Multicore Association

This tutorial will take you through step by step approach while learning Operating System concepts.

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

Linux Scheduler. Linux Scheduler

Weighted Total Mark. Weighted Exam Mark

Networking Operating Systems (CO32010)

A Survey of Fitting Device-Driver Implementations into Real-Time Theoretical Schedulability Analysis

Survey of software architectures: function-queue-scheduling architecture and real time OS

Comp 204: Computer Systems and Their Implementation. Lecture 12: Scheduling Algorithms cont d

A Comparison Of Shared Memory Parallel Programming Models. Jace A Mogill David Haglin

GEDAE TM - A Graphical Programming and Autocode Generation Tool for Signal Processor Applications

Operating Systems 4 th Class

Parallel Firewalls on General-Purpose Graphics Processing Units

CPU Scheduling. CSC 256/456 - Operating Systems Fall TA: Mohammad Hedayati

EECE 276 Embedded Systems

REAL TIME OPERATING SYSTEMS. Lesson-10:

Atomicity for Concurrent Programs Outsourcing Report. By Khilan Gudka Supervisor: Susan Eisenbach

Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification

A Survey of Parallel Processing in Linux

Module 6. Embedded System Software. Version 2 EE IIT, Kharagpur 1

Lecture Outline Overview of real-time scheduling algorithms Outline relative strengths, weaknesses

Linux scheduler history. We will be talking about the O(1) scheduler

STORM. Simulation TOol for Real-time Multiprocessor scheduling. Designer Guide V3.3.1 September 2009

Multicore Programming with LabVIEW Technical Resource Guide

OPERATING SYSTEMS SCHEDULING

Driving force. What future software needs. Potential research topics

Putting Checkpoints to Work in Thread Level Speculative Execution

SHARED HASH TABLES IN PARALLEL MODEL CHECKING

PikeOS: Multi-Core RTOS for IMA. Dr. Sergey Tverdyshev SYSGO AG , Moscow

Java Environment for Parallel Realtime Development Platform Independent Software Development for Multicore Systems

Operating Systems for Parallel Processing Assistent Lecturer Alecu Felician Economic Informatics Department Academy of Economic Studies Bucharest

Real-Time Software. Basic Scheduling and Response-Time Analysis. René Rydhof Hansen. 21. september 2010

Syllabus MCA-404 Operating System - II

Parallel Computing: Strategies and Implications. Dori Exterman CTO IncrediBuild.

Embedded Parallel Computing

Transcription:

Implementing AUTOSAR Scheduling and Resource Management on an Embedded SMT Processor Florian Kluge, Chenglong Yu, Jörg Mische, Sascha Uhrig, Theo Ungerer University of Augsburg 12th International Workshop on Software and Compilers for Embedded Systems April 23-24, 2009 Acropolis, Nice, France AUTOSAR on SMT Kluge et al. 1 / 28

Outline 1 Motivation 2 Problems 3 Solution 4 Conclusion AUTOSAR on SMT Kluge et al. 2 / 28

Outline 1 Motivation 2 Problems 3 Solution 4 Conclusion AUTOSAR on SMT Kluge et al. 3 / 28

Motivation (I) Automotive Software Standards AUTOSAR: AUTOmotive Open System ARchitecture Provides common platform for automotive applications Increases interoperability and interchangeability AUTOSAR on SMT Kluge et al. 4 / 28

Motivation (I) Automotive Software Standards AUTOSAR: AUTOmotive Open System ARchitecture Provides common platform for automotive applications Increases interoperability and interchangeability Upcoming Processor Architectures Simultaneous MultiThreading (SMT) Cores Multi-Core Processors real parallelism! AUTOSAR on SMT Kluge et al. 4 / 28

Motivation (II) Is AUTOSAR fit for SMT? AUTOSAR on SMT Kluge et al. 5 / 28

Motivation (II) Is AUTOSAR fit for SMT? NO! AUTOSAR on SMT Kluge et al. 5 / 28

Motivation (II) Is AUTOSAR fit for SMT? NO! What can we do? AUTOSAR on SMT Kluge et al. 5 / 28

Motivation (II) Is AUTOSAR fit for SMT? NO! What can we do? How can AUTOSAR benefit from SMT? AUTOSAR on SMT Kluge et al. 5 / 28

AUTOSAR Scheduling Basic and Extended tasks Task states: suspended, ready, running, waiting (only extended tasks) AUTOSAR on SMT Kluge et al. 6 / 28

AUTOSAR Scheduling Basic and Extended tasks Task states: suspended, ready, running, waiting (only extended tasks) Priority based scheduling: highest priority task is executed Designed for singlethreaded processors AUTOSAR on SMT Kluge et al. 6 / 28

AUTOSAR Resource Management Mutual exclusion on resource access Prevent priority inversion and deadlocks Resource access never results in waiting state Priority Ceiling Protocol (PCP) AUTOSAR on SMT Kluge et al. 7 / 28

SMT Processor Simultaneous MultiThreading issue instructions of different threads in one cycle Use latencies of one thread to execute another Prioritised slots Real parallelism AUTOSAR on SMT Kluge et al. 8 / 28

Challenges Goal: Earlier execution of low-priority tasks Challenges Preserve WCET analysability Preserve externally observable behaviour of highest-priority task Lower-priority tasks can be interrupted by higher-priority tasks! As few changes as possible to standard definition AUTOSAR on SMT Kluge et al. 9 / 28

Outline 1 Motivation 2 Problems 3 Solution 4 Conclusion AUTOSAR on SMT Kluge et al. 10 / 28

Forward Implementation SMT processor with n thread slots Issue n highest priority tasks Keep execution order Map AUTOSAR task priorities to thread priorities AUTOSAR on SMT Kluge et al. 11 / 28

Resource Management and Parallel Execution PCP relies on singlethreaded program execution No prevention from priority inversion and deadlocks in multithreaded program execution AUTOSAR on SMT Kluge et al. 12 / 28

Related Work: Resource Management Resource Management for Multiprocessor Systems Multiprocessor Priority Ceiling Protocol Multiprocessor Stack Resource Policy LP-Time Inheritance and Returning AUTOSAR on SMT Kluge et al. 13 / 28

Related Work: Resource Management Resource Management for Multiprocessor Systems Multiprocessor Priority Ceiling Protocol Multiprocessor Stack Resource Policy LP-Time Inheritance and Returning No transfer of processing time possible on SMT No nested resource accesses possible AUTOSAR on SMT Kluge et al. 13 / 28

Data Synchronisation Scheduler Shared data structures (FIFO queues) NO lock variables available! Further synchronisation necessary AUTOSAR on SMT Kluge et al. 14 / 28

Data Synchronisation Scheduler Shared data structures (FIFO queues) NO lock variables available! Further synchronisation necessary Related Work Lamport (Bakery Algorithm), Peterson s Algorithm: Spinning or sleeping/suspending Spinning wastes processing time Suspending can violate task state model AUTOSAR on SMT Kluge et al. 14 / 28

Data Synchronisation Scheduler Shared data structures (FIFO queues) NO lock variables available! Further synchronisation necessary Related Work Lamport (Bakery Algorithm), Peterson s Algorithm: Spinning or sleeping/suspending Spinning wastes processing time Suspending can violate task state model Lock-free algorithms Special instructions necessary Compare&Swap or Load Link/Store Conditional AUTOSAR on SMT Kluge et al. 14 / 28

Outline 1 Motivation 2 Problems 3 Solution 4 Conclusion AUTOSAR on SMT Kluge et al. 15 / 28

Task Filtering Execute only tasks that do not use the same resources Deferred tasks are buffered in task filter Internal task state resource ready Task has highest priority of all tasks accessing the same resources AUTOSAR on SMT Kluge et al. 16 / 28

Task Filtering: Example T 1 T 2 T 3 T 4 T 5 T 6 T 7 T 8 R 1 X R 2 X X R 3 X R 4 X R 5 X X R 6 X X R 7 X X X R 8 X SC o o o o o o AUTOSAR on SMT Kluge et al. 17 / 28

Discussion Tasks T 1, T 2, T 3 Priorities P 1 > P 2 > P 3 2 thread slots T 1, T 3 running T 1 and T 2 have resource conflict AUTOSAR on SMT Kluge et al. 18 / 28

Discussion (I) No resource conflict between T 2 and T 3 AUTOSAR on SMT Kluge et al. 19 / 28

Discussion (II) Resource conflict between T 2 and T 3 on R T 3 non-preemptable AUTOSAR on SMT Kluge et al. 20 / 28

Discussion (III) Resource conflict between T 2 and T 3 on R T 3 preemptable T 3 not holding R or other with CP > P 2 AUTOSAR on SMT Kluge et al. 21 / 28

Discussion (IV) Resource conflict between T 2 and T 3 on R T 3 preemptable T 3 holding R AUTOSAR on SMT Kluge et al. 22 / 28

Consequences Start of high priority tasks may be delayed, but time-predictable Once running, behaviour is same as in single-threaded processor for highest priority task Lower prioritiy tasks: may start earlier, but with lower performance Time for scheduling increases about 100 cycles - total time about 1.600 cycles (on prototype) Hardware requirement: slot-to-slot interrupt AUTOSAR on SMT Kluge et al. 23 / 28

Synchronisation of Scheduler Data Scheduler s FIFO-Queues accessed from every slot Must ensure consistency Use lock-free linked lists HW Requirement: Compare&Swap or Load Link/Store Conditional instructions Work in progress AUTOSAR on SMT Kluge et al. 24 / 28

Outline 1 Motivation 2 Problems 3 Solution 4 Conclusion AUTOSAR on SMT Kluge et al. 25 / 28

Summary & Conclusion Extensions to AUTOSAR Task Filtering method prevents resource conflicts New state resource-ready introduced Necessary hardware extensions CAS Slot-to-slot interrupts Timing behaviour of highest-priority task is preserved AUTOSAR on SMT Kluge et al. 26 / 28

Summary & Conclusion Extensions to AUTOSAR Task Filtering method prevents resource conflicts New state resource-ready introduced Necessary hardware extensions CAS Slot-to-slot interrupts Timing behaviour of highest-priority task is preserved Conclusions Current AUTOSAR not ready for multiprocessing More changes on specification necessary This work is just one step on the road... AUTOSAR on SMT Kluge et al. 26 / 28

Future Work Lock-free Algorithms Implementation and evaluation Benchmarking Current benchmarks just look at performance Design benchmark to test resource accesses Integration with Multi-Core Research MERASA project (Multi-Core Execution of Hard Real-Time Applications Supporting Analysability) AUTOSAR on SMT Kluge et al. 27 / 28

Thank you! Any Questions? AUTOSAR on SMT Kluge et al. 28 / 28