Applying FPPT to AEH in the RTSJ ▶

Download Report

Transcript Applying FPPT to AEH in the RTSJ ▶

Applying FPPT to AEH in the RTSJ
▶ AEH in the RTSJ
▶ AEH Implementations
▶ Critical Sequences in the Dynamic 1:N mapping
▶ Schedulability Analysis for FPPT
▶ Preemption Threshold Assignment
▶ Finding rmax
▶ Applying FPPT to AEH in the RTSJ
▶ Conclusions
1
AEH in the RTSJ

The driving design goal of AEH is to have a
lightweight concurrency mechanism

Handlers should not incur the same overhead as realtime threads do

The lightweightness requirement can only be achieved
by minimising the number of server threads
2
AEH Implementations

1:1 Mapping Model
- Static: bound asynchronous event handlers and OVM
- Dynamic: jRate

1:N Mapping Model
- Static: Jamaics
- Dynamic: Java RTS 2.0
3
Critical Sequences in the
Dynamic 1:N Mapping

In a fixed priority system where every handler may selfsuspend (Blocking Handlers), a critical sequence of
handler releases for a set of handlers occurs when



a handler is released after or at the release time of a previous
handler, and
before or during the self-suspension of the previous handler, that is,
ri is in the range [rj , rj + ssj ] exclusively, for every handler in the set.
Where ri denote the release and the execution time of a handler i
and the greater the value i, the higher the priority. ssi denotes the
finishing time of the self-suspension of handler i.
4
Critical Sequences in the
Dynamic 1:N Mapping

In a fixed priority system where handlers do not selfsuspend (Non-Blocking Handlers), a critical
sequence of the handler releases occurs when


handlers are released in a priority-ascending manner in
turn and
one is released in the middle of a previously released
handler being executed, that is, ri is in the range [ri-1, ri-1
+ ssi-1] exclusively, for every handler in a set.
5
Critical Sequences in the
Dynamic 1:N mapping
Based on the critical sequences

For Blocking Handlers
- Used by the Blocking AEH model:
- The required number of server threads is dependent on the
number of released handlers

For Non-Blocking Handlers
- Used by the non-blocking AEH model:
- The required number of server threads is dependent on the
number of priority levels
6
Fixed-Priority Preemptive Scheduling with
Preemption Threshold





Is primarily introduced to feasibly schedule a task set unschedulable
either by FPP or FPNP (3-6% improvement)
Assigns two priority levels to each task, a regular priority and a
preemption threshold
The regular priority of a task is used when the task is queued, but when
the task gets the CPU its active priority is raised to its preemption
threshold
Effectively reduces the number of active priority levels, by allowing a
task not to be preempted by a higher regular priority task up to its
preemption threshold
Note that, FPPT’s schedulability improvement comes at the expense of
the increased worst-case response time of higher priority tasks
7
Schedulability Analysis for FPPT
8
Preemption Threshold Assignment
rmax
rmin
1
2
3
FPP
FPPT
FPNP
4
5
6
9
Finding rmax
1 rmin
2 rmax
10
A Simple Example

An unschedulable task set with 8 tasks such that t8 =
(1, 10), t7 = (1, 15), t6 = (4, 40), t5 = (10, 60), t4 = (20, 80),
t3 = (15, 100), t2 = (10, 200), t1 = (16, 240) as w1 = 293
However, it is schedulable with rmin and rmax.
▪ rmin = {8,7,6,5,4,4,4,2} schedulable with 6 servers
▪ rmax = {8,8,8,7,6,6,7,6} schedulable with 3 servers
11
Applying FPPT to AEH




The non-blocking AEH model has been extended to
support FPPT
The ImportanceParameters class is used to denote the
preemption threshold of a handler
A server thread in the model now raises its priority to the
preemption threshold of the current handler when it gets
the CPU
This hides the use of importance value from the base
priority-scheduler in order for existing mechanisms to
work correctly with the scheduler
12
Conclusions






In order to achieve the lightweight requirement of AEH in the RTSJ, the
critical sequences of the dynamic 1:N mapping are derived
Based on the critical sequences for non-blocking handlers, it is shown that
the number of server threads required is dependent on the number of
active priority levels in the system
FPPT is discussed to reduce the number of effective priority levels for
non-blocking handlers
FPPT is applied to the non-blocking AEH implementation to further
reduce the number of server threads
This allows AEH to further reduce the number of server threads required
to be smaller than that of the priority levels even in the worst case
This enables the lightweight requirement can be better achieved for AEH
in the RTSJ
13
Thank you
Q&A
14