towards partitioned hierarchical real-time scheduling on ...€¦ · rt_task5 (t able i). t asks...
TRANSCRIPT
Towards Partitioned Hierarchical Real-Time
Scheduling on Multi-core Processors
Mikael Åsberg, Thomas Nolte and Shinpei Kato
Outline
●Introduction
● Motivation
● Related work
● Contribution
●ExSched
● Core module
●Partitioned-hsf-fp
● Hierarchical scheduling framework (HSF)
●Evaluation
● Overhead
● Closure
● Conclusion
● Future work
2
3
INTRODUCTION
●Linux is free, open-source and packed with a gigantic software base
●Embedded systems: good arch support, small footprint, fast bootup, potential scheduling-policy adaptation
●Adapting the Linux scheduler has advantages
●For example, improve user experience in Android devices (remove lag, smooth video/audio playback)
●Problem (scheduler development in Linux):
●Kernel modifications are common in most solutions
●New Linux kernel releases every ~2-3 months
●Disadvantage since your customized Linux can’t keep pace, either features-wise or drivers-wise, with mainstream Linux
●Solution: Do not modify the Linux kernel
4
Motivation
Solution Type No OS modification OS independent
ExSched Scheduler
Hijack Scheduler
VSched Scheduler
Alloc. Disp. Scheduler
SCHED_DEADLINE Scheduler
AQuoSA Scheduler
LitmusRT Scheduler
RT-Linux Hypervisor
RTAI Hypervisor
RK Scheduler
Linux-SRT Scheduler
KURT Scheduler
5
Related work
●Virtualizing the CPU (Hierarchical scheduling)…
●…on multi-core processors (Partitioned scheduling)
6
Contribution
7
EXSCHED
●Schedules fixed priority (pre-emptive) tasks with periods
●Module, Library and Plugins
●Supports Linux and VxWorks
●Plug-in schedulers (kernel modules)
●Tested on X86 and ARM
8
Core module
Linux VxWorks
ExSched
Plugin Plugin Plugin
9
PARTITIONED HSF-FP
●Partitioned scheduling of HSFs requires duplication of server release and complete handlers, as well as modifications to job release and complete handlers (and HSF recorder)
10
Hierarchical scheduling framework (HSF)
Z ^ ,
Z ^ ,
Z ^ , , ^&
>
Z ^ ,
, ^&
Fig. 6. HSF recorder control flow
products (without wasting too much resources), and thereby
eliminating the probe effect.
B. Multimedia example
The purpose of this example is to show how a multime-
dia task (processing a movie) can benefit from hierarchical
scheduling in such a way that the movie playback runs more
smoothly. The HSF scheduler has never been evaluated (and
debugged) as properly as the example we are about to show,
so this is a good case study for the HSF recorder. We run
the multimedia task in different setups (with and without
hierarchical scheduling), and measure its performance. The
hierarchical scheduling gives the multimedia task an even
amount of CPU power, and thereby improves the movie
playback. Note that all of this is done, including the recording,
without modifying the kernel. The HSF recorder plays a key
role since knowledge of the scheduling behavior is important
in order for the result of this evaluation to be correct. For
example, the recorder shows that the tasks and servers get the
amount of CPU that we specify (i.e., that tasks run within
their servers) and that the tasks/servers run according to the
specified frequency and WCET / Q. During our experiments,
the recording showed that the HSF cannot keep tasks within
their server if they do a lot of blocking (e.g. multimedia tasks).
Therefore, we set lowest priority to the multimedia task and
add idle tasks with higher priority than the multimedia task.
This will keep the multimedia task within its server, thereby
guaranteeing the upper limit on its resource supply. This was
confirmed by the recording of our HSF recorder. A second
recorder (Ftrace) was also used in order to show that the
HSF recorder recorded correctly. We used the Grasp tool [13]
to visualize our recordings (for both the HSF recorder and
Ftrace), since it can display both tasks and servers.
In this example, we have 5 tasks, i.e., rt_task1 to
rt_task5 (Table I). Tasks rt_task1 to rt_task4 are
dummy tasks, i.e., they just loop (rt_task1 in Figure 7).
rt_task5 does a movie playback, its task body is shown in
Figure 7.
// r t t ask 1int main(int argc, char *argv[ ])
{..
for (i = 0; i < NR OF JOBS; i++) {for (j = 0; j < USEC UNIT; j++) {}if (!rt wait for period()) {
printf(”deadline is missed!\ n”);}
}.
.
}// r t t ask 5int main (int argc, char *argv[ ])
{..
libvlc media player play(player);
.
.
}
Fig. 7. Task bodies
rt_task5 used the libVLC1 for movie playback and the
library itself has the nice property that the movie processing
can be executed by a task running in r eal -t ime mode. We
executed rt_task5 in 4 different setups:
1libVLC http://wiki.videolan.org/Libvlc
384
11
EVALUATION
●Comparing unicore-HSF with multi-core-HSF, little overhead difference can be observed
●The difference in overhead is affected by the scheduling parameters and the allocation strategy
12
Overhead
13
CLOSURE
●We have extended the HSF scheduler in ExSched to support the multi-core processor platform
●We have also developed a multi-core scheduling simulator compatible with ExSched
●The HSF scheduler in ExSched fits perfectly in Android based systems (since HSF can virtualize the CPU)
●The added multi-core support makes HSF more practical since most Android devices have multi-core processors nowadays
14
Conclusion
●Integrate ExSched (and HSF) in Android
●ExSched is downloadable (open-source and free of course)
15
Future work
16
END