SlideShare a Scribd company logo
1 of 27
Download to read offline
Supporting Time-Sensitive
Applications on a Commodity OS
Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow
and Jonathan Walpole
Presenter : Namhyuk Ahn
Real-Time and Time-Sensitive Applications
§ Real-Time system
• Must meet an exact (or very nearly) deadline
• Failure to meet deadline means system failures
• e.g. space shuttle, air craft..
§ Time-sensitive applications
• Applications with real-time requirements
• e.g. media player
Distributed Shared Memory: Concepts and Systems 2
Motivation
§ Needs of time-sensitive application on commodity OS increase
§ However,
§ Most commodity OS aim to maximize system throughput
• These don’t consider real-time nor time-sensitive applications
§ Most real-time OS focus on hard real-time scenario
• System throughput is decreased and limited
§ Solution: General-purpose OS should offer both properties
• Time Sensitive Linux (TS-Linux)
Distributed Shared Memory: Concepts and Systems 3
Problems of Time-Sensitive Application
§ Time-sensitive applications require timely resources allocation
§ Minimize kernel latency is important issue
• Timer latency due to inaccurate timer
• Preemption latency due to threads executing in kernel cannot be preempted
• Scheduling latency is time taken to schedule the event
Distributed Shared Memory: Concepts and Systems 4
Solutions
§ TSL improves three keys causing latency
• Timer latency → Accurate timer mechanism
► Firm timer
• Preemption latency → Responsive kernel
► Lock-breaking preemptible kernel
• Scheduling latency → Effective scheduling
► Proportion-period scheduler
► Priority-based scheduler
§ TSL is version of Linux that can:
• Effectively run time-sensitive applications
• Effectively run throughput applications
• Be implemented without modifying existing applications
Distributed Shared Memory: Concepts and Systems 5
Timer Mechanism
§ Periodic timers
• Timer interrupts periodically; Max timer latency equals to the period
• Reducing latency increase interrupt overhead
§ One-shot timers
• Interrupts only when needs
• Cost of reprogramming
• High accuracy but high interrupt overhead
§ Example: Two task with periods 5, 7ms and run 35ms
• Periodic timers with period of 1ms
► Maximum latency is 1ms; 35 interrupts
• One-shot timer
► Relatively small latency; 11 interrupts (5ms, 7ms, 10ms, 14ms ..)
Distributed Shared Memory: Concepts and Systems 6
Timer Mechanism
§ Soft timers
• One-shot timer have interrupt overhead
• Reduce cost of context switch caused by interrupts
• But, timer latency is increase
§ Procedure
1. At some points, system will arrive at “trigger states”
o End of system call, exception handler or interrupt handler
o CPU idle
2. This invoke event handler; there is no overhead since already context-
switched
3. Soft timer checks for any pending events without hardware timer cost
Distributed Shared Memory: Concepts and Systems 7
Accurate Timer Mechanism – Firm timer
§ Firm timers
• Combine all the advantages of three timers before
• Overshoot parameter: bridge between one-shot and soft timer
• This makes unnecessary interrupts avoided
• High overshoot = soft; low = one-shot
Distributed Shared Memory: Concepts and Systems 8
Time
One-shot
timer expired
Overshoot
syscall
Programmed
One-shot interrupt
Dispatch and reprogram
one-shot timer
Interrupt does not occured
In case no syscall in overshot period, it perform as one-shot timer
Responsive Kernel
§ Kernel is responsive when non-preemptible section is small
§ The case scheduler is not able to run
• Interrupts is disabled (has to ready in ready-queue)
• Another thread is executing critical section in kernel
§ So, length of non-preemptible section is important
• But traditional commodity kernel disable preemption for the entire kernel
Distributed Shared Memory: Concepts and Systems 9
Fine-grained Preemptible Kernel
§ Explicit preemption
• Explicit insertion of preemption points inside the kernel
• Kernel explicitly yields CPU to scheduler when meet preemption point
• Has to be manually placed preemption points
§ Anytime preemption
• Allow preemption anytime kernel not manipulating shared data structure
• Shared kernel data must be protected using mutex or spinlock
• High latency when spinlock are held long time
Distributed Shared Memory: Concepts and Systems 10
Fine-grained Preemptible Kernel
§ Lock-breaking preemption
• Combine the above ideas
• TSL use lock-breaking preemption
• Split long spinlock section to multiple acquire-release points
Distributed Shared Memory: Concepts and Systems 11
acq()
... // manipulate shared data
rel()
… // preemptive kernel, check for expired scheduler
reacq()
…
rel()
acq()
…
rel()
Scheduling
§ Highest priority goes first
• Very simple
• But misbehaving and high-priority process can starve all other tasks
• Temporal protection issue:
► don’t make misbehaved task consuming too much execution time
Distributed Shared Memory: Concepts and Systems 12
Scheduling
§ Proportion-period scheduling
• Each task is allocated a fixed proportion
of CPU
• Provide temporal protection
• Q and T are adjustable by feedback
controller mechanism
• After executing for time Q, it block until
next T (or schedule for non-TS task)
13
T1
T2
2/3
1/3
Proportion Q
Proportion Q
Time
Period T
Scheduling
§ TSL combines proportion-based and fixed priority scheduler
• Fixed priority schedule doesn’t guarantee temporal protection
• Make proportion Q with respect to fixed priority
• Sounds good, but few exceptions
Distributed Shared Memory: Concepts and Systems 14
Scheduling
§ Exception case:
C1
Server
High priority
Low priority
Time
C1 scheduled Server
run
C2 Mid priority
Blocking call
C1 Ready to runC2
run
C2 preempts server
: Priority inversion for C1
Scheduling
§ Exception case:
C1
Server
High priority
Low priority
Time
C1 scheduled Server
run
C2 Mid priority
Blocking call
C1 Ready to run
Highest locking priority (HLP):
When a task acquires a resource, it gets the
highest priority that can acquire this resource
e.g. server task is now priority of C1
Evaluation
§ Setup:
• Modified version of Linux 2.4.16
• + Firm timer, lock-breaking and proportion-period scheduler
• 1.5 GHz Intel Pentium 4
• 512 MB RAM
Distributed Shared Memory: Concepts and Systems 17
Evaluation
§ Micro benchmarks
• Evaluate timer latency and preemption latency
• Measure time that process actually sleep in time-sensitive process using
nanosleep()
§ Timer latency
• Standard Linux: 10ms
• + firm timer: < 1ms
§ Preemption latency
• Evaluate when number of system loads are run in background
• Linux + firm timer: > 5ms
• + lock-break: < 1ms
Distributed Shared Memory: Concepts and Systems 18
Evaluation
§ Evaluation on real-world application
• Measure audio/video sync skew in Mplayer (media player)
§ Evaluate under three scenarios
1. Non-kernel CPU load
o User-level stress test is run in the background
2. Kernel CPU load
o Large memory buffer is copied to a file (user to kernel space)
3. File-system load
o Large directory is copied
Distributed Shared Memory: Concepts and Systems 19
Evaluation
§ Non-kernel CPU load
Distributed Shared Memory: Concepts and Systems 20
Evaluation
§ Kernel CPU load
Distributed Shared Memory: Concepts and Systems 21
Evaluation
§ File-system load
Distributed Shared Memory: Concepts and Systems 22
Evaluation
§ Preemption overhead
• Memory access (access 128MB array thus produce page fault)
► TSL overhead: 0.42% std 0.18%
• Fork (create 512 processes)
► TSL overhead: 0.53% std 0.06%
• File system (copy data from 2MB user buffer to 8MB file)
► TSL overhead: no significant overhead
Distributed Shared Memory: Concepts and Systems 23
Evaluation
§ Firm timer overhead
Distributed Shared Memory: Concepts and Systems 24
Conclusion
§ TSL provides real-time support for commodity OS by,
• Firm timer
• Responsive kernel
• Proportion-based scheduler
§ TSL can be used in both time-sensitive and throughput oriented app
Distributed Shared Memory: Concepts and Systems 25
Discussion topics
§ Rethinking the Real-time
• Requirements for RT system
► What are needed to ensure exact (or near-exact) timing?
• Example of time-sensitive applications have to run in commodity OS
• How to bring RT concept to commodity OS efficiently?
Distributed Shared Memory: Concepts and Systems 26
Discussion topics
§ What features should we consider to build Distributed RTOS?
Distributed Shared Memory: Concepts and Systems 27

More Related Content

What's hot

Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & DeadlockOperating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & DeadlockAjit Nayak
 
Linux Preempt-RT Internals
Linux Preempt-RT InternalsLinux Preempt-RT Internals
Linux Preempt-RT Internals哲豪 康哲豪
 
HKG15-305: Real Time processing comparing the RT patch vs Core isolation
HKG15-305: Real Time processing comparing the RT patch vs Core isolationHKG15-305: Real Time processing comparing the RT patch vs Core isolation
HKG15-305: Real Time processing comparing the RT patch vs Core isolationLinaro
 
Operating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - SchedulingOperating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - SchedulingPeter Tröger
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithmBinal Parekh
 
Operating System-Ch8 memory management
Operating System-Ch8 memory managementOperating System-Ch8 memory management
Operating System-Ch8 memory managementSyaiful Ahdan
 
Real-time soultion
Real-time soultionReal-time soultion
Real-time soultionNylon
 
Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...
Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...
Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...peknap
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Mukesh Chinta
 

What's hot (20)

Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & DeadlockOperating Systems Part II-Process Scheduling, Synchronisation & Deadlock
Operating Systems Part II-Process Scheduling, Synchronisation & Deadlock
 
Preempt_rt realtime patch
Preempt_rt realtime patchPreempt_rt realtime patch
Preempt_rt realtime patch
 
Linux Preempt-RT Internals
Linux Preempt-RT InternalsLinux Preempt-RT Internals
Linux Preempt-RT Internals
 
HKG15-305: Real Time processing comparing the RT patch vs Core isolation
HKG15-305: Real Time processing comparing the RT patch vs Core isolationHKG15-305: Real Time processing comparing the RT patch vs Core isolation
HKG15-305: Real Time processing comparing the RT patch vs Core isolation
 
Operating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - SchedulingOperating Systems 1 (10/12) - Scheduling
Operating Systems 1 (10/12) - Scheduling
 
Window scheduling algorithm
Window scheduling algorithmWindow scheduling algorithm
Window scheduling algorithm
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Process Synchronization
Process SynchronizationProcess Synchronization
Process Synchronization
 
Operating System-Ch8 memory management
Operating System-Ch8 memory managementOperating System-Ch8 memory management
Operating System-Ch8 memory management
 
The Windows Scheduler
The Windows SchedulerThe Windows Scheduler
The Windows Scheduler
 
cpu scheduling in os
cpu scheduling in oscpu scheduling in os
cpu scheduling in os
 
Real-time soultion
Real-time soultionReal-time soultion
Real-time soultion
 
Real time system tsp
Real time system tspReal time system tsp
Real time system tsp
 
cpu scheduling OS
 cpu scheduling OS cpu scheduling OS
cpu scheduling OS
 
Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...
Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...
Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...
 
Process Management
Process ManagementProcess Management
Process Management
 
Lecture 2 process
Lecture 2   processLecture 2   process
Lecture 2 process
 
OS_Ch4
OS_Ch4OS_Ch4
OS_Ch4
 
Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)Process scheduling (CPU Scheduling)
Process scheduling (CPU Scheduling)
 
Rtos part2
Rtos part2Rtos part2
Rtos part2
 

Similar to Supporting Time-Sensitive Applications on a Commodity OS

Process scheduling &amp; time
Process scheduling &amp; timeProcess scheduling &amp; time
Process scheduling &amp; timeYojana Nanaware
 
Insider operating system
Insider   operating systemInsider   operating system
Insider operating systemAditi Saxena
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works. Fahad Farooq
 
Lec 9-os-review
Lec 9-os-reviewLec 9-os-review
Lec 9-os-reviewMothi R
 
Memory Management in Operating Systems for all
Memory Management in Operating Systems for allMemory Management in Operating Systems for all
Memory Management in Operating Systems for allVSKAMCSPSGCT
 
Real time operating system
Real time operating systemReal time operating system
Real time operating systemKhuram Shahzad
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systemsleo3004
 
참여기관_발표자료-국민대학교 201301 정기회의
참여기관_발표자료-국민대학교 201301 정기회의참여기관_발표자료-국민대학교 201301 정기회의
참여기관_발표자료-국민대학교 201301 정기회의DzH QWuynh
 
MK Sistem Operasi.pdf
MK Sistem Operasi.pdfMK Sistem Operasi.pdf
MK Sistem Operasi.pdfwisard1
 
Memory Management Strategies - II.pdf
Memory Management Strategies - II.pdfMemory Management Strategies - II.pdf
Memory Management Strategies - II.pdfHarika Pudugosula
 
Evolution, Strutcture and Operations.pptx
Evolution, Strutcture and Operations.pptxEvolution, Strutcture and Operations.pptx
Evolution, Strutcture and Operations.pptxssuser000e54
 
ch5_CPU Scheduling_part1.pdf
ch5_CPU Scheduling_part1.pdfch5_CPU Scheduling_part1.pdf
ch5_CPU Scheduling_part1.pdfSonaliAjankar
 
May14ProcessScheduling.ppt
May14ProcessScheduling.pptMay14ProcessScheduling.ppt
May14ProcessScheduling.pptansariparveen06
 
Chip Multithreading Systems Need a New Operating System Scheduler
Chip Multithreading Systems Need a New Operating System Scheduler Chip Multithreading Systems Need a New Operating System Scheduler
Chip Multithreading Systems Need a New Operating System Scheduler Sarwan ali
 

Similar to Supporting Time-Sensitive Applications on a Commodity OS (20)

Process scheduling &amp; time
Process scheduling &amp; timeProcess scheduling &amp; time
Process scheduling &amp; time
 
Insider operating system
Insider   operating systemInsider   operating system
Insider operating system
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works.
 
Section05 scheduling
Section05 schedulingSection05 scheduling
Section05 scheduling
 
OS.pptx
OS.pptxOS.pptx
OS.pptx
 
Lec 9-os-review
Lec 9-os-reviewLec 9-os-review
Lec 9-os-review
 
Real-Time Operating Systems
Real-Time Operating SystemsReal-Time Operating Systems
Real-Time Operating Systems
 
Memory Management in Operating Systems for all
Memory Management in Operating Systems for allMemory Management in Operating Systems for all
Memory Management in Operating Systems for all
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
참여기관_발표자료-국민대학교 201301 정기회의
참여기관_발표자료-국민대학교 201301 정기회의참여기관_발표자료-국민대학교 201301 정기회의
참여기관_발표자료-국민대학교 201301 정기회의
 
MK Sistem Operasi.pdf
MK Sistem Operasi.pdfMK Sistem Operasi.pdf
MK Sistem Operasi.pdf
 
Nbvtalkatjntuvizianagaram
NbvtalkatjntuvizianagaramNbvtalkatjntuvizianagaram
Nbvtalkatjntuvizianagaram
 
Memory Management Strategies - II.pdf
Memory Management Strategies - II.pdfMemory Management Strategies - II.pdf
Memory Management Strategies - II.pdf
 
Evolution, Strutcture and Operations.pptx
Evolution, Strutcture and Operations.pptxEvolution, Strutcture and Operations.pptx
Evolution, Strutcture and Operations.pptx
 
ch5_CPU Scheduling_part1.pdf
ch5_CPU Scheduling_part1.pdfch5_CPU Scheduling_part1.pdf
ch5_CPU Scheduling_part1.pdf
 
May14ProcessScheduling.ppt
May14ProcessScheduling.pptMay14ProcessScheduling.ppt
May14ProcessScheduling.ppt
 
pscheduling.ppt
pscheduling.pptpscheduling.ppt
pscheduling.ppt
 
Chip Multithreading Systems Need a New Operating System Scheduler
Chip Multithreading Systems Need a New Operating System Scheduler Chip Multithreading Systems Need a New Operating System Scheduler
Chip Multithreading Systems Need a New Operating System Scheduler
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 

More from NamHyuk Ahn

TensorFlow Tutorial
TensorFlow TutorialTensorFlow Tutorial
TensorFlow TutorialNamHyuk Ahn
 
Generative Adversarial Network (+Laplacian Pyramid GAN)
Generative Adversarial Network (+Laplacian Pyramid GAN)Generative Adversarial Network (+Laplacian Pyramid GAN)
Generative Adversarial Network (+Laplacian Pyramid GAN)NamHyuk Ahn
 
Single Shot Multibox Detector
Single Shot Multibox DetectorSingle Shot Multibox Detector
Single Shot Multibox DetectorNamHyuk Ahn
 
Multimodal Residual Learning for Visual QA
Multimodal Residual Learning for Visual QAMultimodal Residual Learning for Visual QA
Multimodal Residual Learning for Visual QANamHyuk Ahn
 
Google's Multilingual Neural Machine Translation System
Google's Multilingual Neural Machine Translation SystemGoogle's Multilingual Neural Machine Translation System
Google's Multilingual Neural Machine Translation SystemNamHyuk Ahn
 
DeconvNet, DecoupledNet, TransferNet in Image Segmentation
DeconvNet, DecoupledNet, TransferNet in Image SegmentationDeconvNet, DecoupledNet, TransferNet in Image Segmentation
DeconvNet, DecoupledNet, TransferNet in Image SegmentationNamHyuk Ahn
 
Case Study of Convolutional Neural Network
Case Study of Convolutional Neural NetworkCase Study of Convolutional Neural Network
Case Study of Convolutional Neural NetworkNamHyuk Ahn
 

More from NamHyuk Ahn (7)

TensorFlow Tutorial
TensorFlow TutorialTensorFlow Tutorial
TensorFlow Tutorial
 
Generative Adversarial Network (+Laplacian Pyramid GAN)
Generative Adversarial Network (+Laplacian Pyramid GAN)Generative Adversarial Network (+Laplacian Pyramid GAN)
Generative Adversarial Network (+Laplacian Pyramid GAN)
 
Single Shot Multibox Detector
Single Shot Multibox DetectorSingle Shot Multibox Detector
Single Shot Multibox Detector
 
Multimodal Residual Learning for Visual QA
Multimodal Residual Learning for Visual QAMultimodal Residual Learning for Visual QA
Multimodal Residual Learning for Visual QA
 
Google's Multilingual Neural Machine Translation System
Google's Multilingual Neural Machine Translation SystemGoogle's Multilingual Neural Machine Translation System
Google's Multilingual Neural Machine Translation System
 
DeconvNet, DecoupledNet, TransferNet in Image Segmentation
DeconvNet, DecoupledNet, TransferNet in Image SegmentationDeconvNet, DecoupledNet, TransferNet in Image Segmentation
DeconvNet, DecoupledNet, TransferNet in Image Segmentation
 
Case Study of Convolutional Neural Network
Case Study of Convolutional Neural NetworkCase Study of Convolutional Neural Network
Case Study of Convolutional Neural Network
 

Recently uploaded

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Recently uploaded (20)

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

Supporting Time-Sensitive Applications on a Commodity OS

  • 1. Supporting Time-Sensitive Applications on a Commodity OS Ashvin Goel, Luca Abeni, Charles Krasic, Jim Snow and Jonathan Walpole Presenter : Namhyuk Ahn
  • 2. Real-Time and Time-Sensitive Applications § Real-Time system • Must meet an exact (or very nearly) deadline • Failure to meet deadline means system failures • e.g. space shuttle, air craft.. § Time-sensitive applications • Applications with real-time requirements • e.g. media player Distributed Shared Memory: Concepts and Systems 2
  • 3. Motivation § Needs of time-sensitive application on commodity OS increase § However, § Most commodity OS aim to maximize system throughput • These don’t consider real-time nor time-sensitive applications § Most real-time OS focus on hard real-time scenario • System throughput is decreased and limited § Solution: General-purpose OS should offer both properties • Time Sensitive Linux (TS-Linux) Distributed Shared Memory: Concepts and Systems 3
  • 4. Problems of Time-Sensitive Application § Time-sensitive applications require timely resources allocation § Minimize kernel latency is important issue • Timer latency due to inaccurate timer • Preemption latency due to threads executing in kernel cannot be preempted • Scheduling latency is time taken to schedule the event Distributed Shared Memory: Concepts and Systems 4
  • 5. Solutions § TSL improves three keys causing latency • Timer latency → Accurate timer mechanism ► Firm timer • Preemption latency → Responsive kernel ► Lock-breaking preemptible kernel • Scheduling latency → Effective scheduling ► Proportion-period scheduler ► Priority-based scheduler § TSL is version of Linux that can: • Effectively run time-sensitive applications • Effectively run throughput applications • Be implemented without modifying existing applications Distributed Shared Memory: Concepts and Systems 5
  • 6. Timer Mechanism § Periodic timers • Timer interrupts periodically; Max timer latency equals to the period • Reducing latency increase interrupt overhead § One-shot timers • Interrupts only when needs • Cost of reprogramming • High accuracy but high interrupt overhead § Example: Two task with periods 5, 7ms and run 35ms • Periodic timers with period of 1ms ► Maximum latency is 1ms; 35 interrupts • One-shot timer ► Relatively small latency; 11 interrupts (5ms, 7ms, 10ms, 14ms ..) Distributed Shared Memory: Concepts and Systems 6
  • 7. Timer Mechanism § Soft timers • One-shot timer have interrupt overhead • Reduce cost of context switch caused by interrupts • But, timer latency is increase § Procedure 1. At some points, system will arrive at “trigger states” o End of system call, exception handler or interrupt handler o CPU idle 2. This invoke event handler; there is no overhead since already context- switched 3. Soft timer checks for any pending events without hardware timer cost Distributed Shared Memory: Concepts and Systems 7
  • 8. Accurate Timer Mechanism – Firm timer § Firm timers • Combine all the advantages of three timers before • Overshoot parameter: bridge between one-shot and soft timer • This makes unnecessary interrupts avoided • High overshoot = soft; low = one-shot Distributed Shared Memory: Concepts and Systems 8 Time One-shot timer expired Overshoot syscall Programmed One-shot interrupt Dispatch and reprogram one-shot timer Interrupt does not occured In case no syscall in overshot period, it perform as one-shot timer
  • 9. Responsive Kernel § Kernel is responsive when non-preemptible section is small § The case scheduler is not able to run • Interrupts is disabled (has to ready in ready-queue) • Another thread is executing critical section in kernel § So, length of non-preemptible section is important • But traditional commodity kernel disable preemption for the entire kernel Distributed Shared Memory: Concepts and Systems 9
  • 10. Fine-grained Preemptible Kernel § Explicit preemption • Explicit insertion of preemption points inside the kernel • Kernel explicitly yields CPU to scheduler when meet preemption point • Has to be manually placed preemption points § Anytime preemption • Allow preemption anytime kernel not manipulating shared data structure • Shared kernel data must be protected using mutex or spinlock • High latency when spinlock are held long time Distributed Shared Memory: Concepts and Systems 10
  • 11. Fine-grained Preemptible Kernel § Lock-breaking preemption • Combine the above ideas • TSL use lock-breaking preemption • Split long spinlock section to multiple acquire-release points Distributed Shared Memory: Concepts and Systems 11 acq() ... // manipulate shared data rel() … // preemptive kernel, check for expired scheduler reacq() … rel() acq() … rel()
  • 12. Scheduling § Highest priority goes first • Very simple • But misbehaving and high-priority process can starve all other tasks • Temporal protection issue: ► don’t make misbehaved task consuming too much execution time Distributed Shared Memory: Concepts and Systems 12
  • 13. Scheduling § Proportion-period scheduling • Each task is allocated a fixed proportion of CPU • Provide temporal protection • Q and T are adjustable by feedback controller mechanism • After executing for time Q, it block until next T (or schedule for non-TS task) 13 T1 T2 2/3 1/3 Proportion Q Proportion Q Time Period T
  • 14. Scheduling § TSL combines proportion-based and fixed priority scheduler • Fixed priority schedule doesn’t guarantee temporal protection • Make proportion Q with respect to fixed priority • Sounds good, but few exceptions Distributed Shared Memory: Concepts and Systems 14
  • 15. Scheduling § Exception case: C1 Server High priority Low priority Time C1 scheduled Server run C2 Mid priority Blocking call C1 Ready to runC2 run C2 preempts server : Priority inversion for C1
  • 16. Scheduling § Exception case: C1 Server High priority Low priority Time C1 scheduled Server run C2 Mid priority Blocking call C1 Ready to run Highest locking priority (HLP): When a task acquires a resource, it gets the highest priority that can acquire this resource e.g. server task is now priority of C1
  • 17. Evaluation § Setup: • Modified version of Linux 2.4.16 • + Firm timer, lock-breaking and proportion-period scheduler • 1.5 GHz Intel Pentium 4 • 512 MB RAM Distributed Shared Memory: Concepts and Systems 17
  • 18. Evaluation § Micro benchmarks • Evaluate timer latency and preemption latency • Measure time that process actually sleep in time-sensitive process using nanosleep() § Timer latency • Standard Linux: 10ms • + firm timer: < 1ms § Preemption latency • Evaluate when number of system loads are run in background • Linux + firm timer: > 5ms • + lock-break: < 1ms Distributed Shared Memory: Concepts and Systems 18
  • 19. Evaluation § Evaluation on real-world application • Measure audio/video sync skew in Mplayer (media player) § Evaluate under three scenarios 1. Non-kernel CPU load o User-level stress test is run in the background 2. Kernel CPU load o Large memory buffer is copied to a file (user to kernel space) 3. File-system load o Large directory is copied Distributed Shared Memory: Concepts and Systems 19
  • 20. Evaluation § Non-kernel CPU load Distributed Shared Memory: Concepts and Systems 20
  • 21. Evaluation § Kernel CPU load Distributed Shared Memory: Concepts and Systems 21
  • 22. Evaluation § File-system load Distributed Shared Memory: Concepts and Systems 22
  • 23. Evaluation § Preemption overhead • Memory access (access 128MB array thus produce page fault) ► TSL overhead: 0.42% std 0.18% • Fork (create 512 processes) ► TSL overhead: 0.53% std 0.06% • File system (copy data from 2MB user buffer to 8MB file) ► TSL overhead: no significant overhead Distributed Shared Memory: Concepts and Systems 23
  • 24. Evaluation § Firm timer overhead Distributed Shared Memory: Concepts and Systems 24
  • 25. Conclusion § TSL provides real-time support for commodity OS by, • Firm timer • Responsive kernel • Proportion-based scheduler § TSL can be used in both time-sensitive and throughput oriented app Distributed Shared Memory: Concepts and Systems 25
  • 26. Discussion topics § Rethinking the Real-time • Requirements for RT system ► What are needed to ensure exact (or near-exact) timing? • Example of time-sensitive applications have to run in commodity OS • How to bring RT concept to commodity OS efficiently? Distributed Shared Memory: Concepts and Systems 26
  • 27. Discussion topics § What features should we consider to build Distributed RTOS? Distributed Shared Memory: Concepts and Systems 27