Title: Supporting TimeSensitive Applications on a Commodity OS
1Supporting Time-Sensitive Applications on a
Commodity OS
- Ashvin Goel, Luca Abeni, Charles Krasic,
Jim Snow, Jonathan Walpole
Presented by Seonah Lee (CPSC 508) University of
British Columbia
2Contents
- Introduction
- TSL Review
- Firm Timer
- Responsive Kernel
- CPU Scheduler
- Evaluation Discussion
2
3Introduction
- Goal
- Requirements
- Concept
4Goal
Total Throughput
Coarse- grained
Time-Sensitive Linux
Firm Timer Preempt Schedule
Fine- grained
Response Time
4
5Time-Sensitive Requirements
Kernel Latency
5
6Time Sensitive Linux (TSL)
Linux 2.4.16
User space
Kernel space
TSL Firm Timer
Robert Loves locking-breaking preemptible kernel
patch
TSL Proportion-period scheduler
6
CPSC 508 OS 2006
7Timer
- One-shot Soft Timers
- TSL (Firm) Timer
- Evaluation
- Questions
8One-shot Soft Timers
- One-shot Timer
- High accurate timing
- -- Reprogramming at each activation (with PIT)
- ? Inexpensive programming (with APIC)
-
- Soft Timer
- Reducing of hardware generated timer
interrupts - Reducing of user-kernel context switches
- -- Cost in polling and checking for timers
- -- Increasing timer latency
8
8
CPSC 508 OS 2006
9Firm Timer (1/2)
- To Combine One-Shot Timer Soft Timer
- One-shot timer is programmed to fire an overshot
amount of time instead of at the next timer
firing. - If the conditional events of soft timer happens,
the timer fires, and the timer is reprogrammed
Firm Timer
The amount of timer overshoot
--
0
--
Accuracy
One-shot Timer
Soft Timer
Overhead
--
9
9
CPSC 508 OS 2006
10Firm Timer (2/2)
nanosleep(), pause(), setitimer(), select(),
poll()
P1
P2
Processor
Timer Queue
Sorted whenever timer expires
Interrupt handler execute the callback function
N is decrement at each CPU clock cycle
Time Conversion
APIC Timer expires
N is decrement at each memory bus cycle If N is
0, APIC generates an interrupt
10
10
CPSC 508 OS 2006
11Firm Timer Overhead
Povray with 50 timer processes, 10 ms period
timers
12Questions
- I am a bit unclear on how a one-shot timer
works... But how are multiple process timers
implemented? Does each process have a one-shot
timer if it needs one? - The firm timers used in the paper relies on
periodic timers as a contingency measure of
sorts. Is there any way to go one step further
and do away with periodic timers, just using pure
one-shot/soft timers to handle any possible
event? (6 people)
13Responsive Kernel
- Responsive Kernel
- Fine-Grained Kernel Preemptibility
- Evaluation
- Questions
14Responsive Kernel
Time
Preemption Latency
Scheduling Latency
Timer Latency
Wall-clock time event
Timer Interrupt
Scheduler
Application Scheduled (Activation)
Responsive Kernel
Small non-preemptible sections
A thread executing in a critical section
Disable interrupts
Traditional commodity kernel disables
preemption when a thread is in the kernel
14
14
CPSC 508 OS 2006
15Fine-Grained Kernel Preemptibility
- 1st Approach
- To insert preemption points at strategic points
- Maximum latency time between 2 preemption points
- 2nd Approach
- To allow preemption whenever shared data is not
accessed - Maximum latency time that a spinlock is held or
interrupt service routine takes - 3rd Approach 1st 2nd Approaches
- To release spinlocks at strategic points
- Done by Robert Love 11
15
15
CPSC 508 OS 2006
16Questions
- To obtain the fine granularity on kernel
preemptibility, spinlocks are only allowed to be
released and reacquired on the strategic points
in the long code sections that access shared
data. Is there an automated way to assign these
strategic points? Otherwise you might have to
deal with the code you havent written, or have
little clue about, or am I making the situation
sound like more dramatic than as it is?
17CPU Scheduling
- CPU Scheduling
- TSL CPU Scheduling
- Evaluation
- Questions
18CPU Scheduling
Time
Preemption Latency
Scheduling Latency
Timer Latency
Wall-clock time event
Timer Interrupt
Scheduler
Application Scheduled (Activation)
- Priority-based scheduler
- Schedule with pre-assigned priorities
- Proportion-period scheduler
- Schedule with an upper-bound on delay
18
18
CPSC 508 OS 2006
19TSL CPU Scheduling
- TSL use a combination of two models
- Proportion-period Scheduling
- Implemented using Earliest Deadline First
- Execution Time Task Proportion X Period
- Using the end of each period as a deadline
- Priority-based Scheduling
- use highest locking priority protocol
- To solve priority inversion
19
19
CPSC 508 OS 2006
20Maximum Deviation
- To evaluate the accuracy of the scheduler
21Questions
- TSL uses a priority ceiling protocol called
"Highest Locking Priority Protocol" (HLP) to
solve priority inversion problems when multiple
interdependent tasks are running at different
priorities. Using HLP, a task that acquires a
resource gets the highest priority of any task
that can access that resource. How can the kernel
easily know that 2 different processes are
accessing the same resources ?
22Evaluation Mplayer
- Linux, X non-real time
- TSL, X non-real time
- TSL, X real time
23Linux, X server non-real time
24TSL, X server non-real time
25TSL, X server real time
26Discussion
- Strengths vs. Weaknesses
- Questions
27Strengths vs. Weakness
- Strengths
- TSL increases timer accuracy of overall
applications - TSL does not require the modification of
applications - Weakness
- APIC Timer has poor resolution and the clocks
silicon is sometimes very buggy - Guidelines For Providing Multimedia Timer
Support
27
28Questions
- 1- As far as I know there are some scheduling
techniques that measure the amount of I/O between
the user and the application to identify the
interactive multimedia applications and then give
them higher priorities to maintain their
real-time performance. How do you compare this
scheduling method and the one used in the paper?
28
CPSC 544 HCI 2006
29Questions
- Could you give some information on other projects
in relative fields ? - I found unclear the method by which TSL
calculates proportions for user applications. The
paper mentions that an application-specific
progress rate metric is used. If that is true,
doesn't that go against the goal of TSL to run on
a general commodity operating system ?
Shouldn't a more general heuristic be applied
instead to determine which real-time tasks should
be given higher priorities ?