The sel4bench Suite
sel4bench is an application and support library for benchmarking the performance of the seL4 kernel.
A selection of benchmarking results are continually updated on the main seL4 website. The page also shows the build options used to obtain those results.
Sources:
Getting the code
First make sure you have set up your machine. Then run the following.
mkdir sel4bench
cd sel4bench
repo init -u https://github.com/seL4/sel4bench-manifest.git
repo sync
This clones the seL4 kernel, the benchmarking suite including libraries, and tools used in the build process. By default, the current master branch of the kernel is cloned. To clone a specific version of the kernel and compatible libraries and tools, replace the line
repo init https://github.com/seL4/sel4bench-manifest.git
above with e.g.:
repo init -u https://github.com/seL4/sel4bench-manifest.git -b refs/tags/13.0.0
This example clones version 13.0.0 of the kernel. For more information on version numbers, see the release page and the list of seL4 releases.
Building and running sel4bench
Configuration
The CMake build environment supports a number of platforms. For information on which ones these are and their corresponding CMake configuration arguments, see the Supported Platforms page.
For the available meta configuration options, see below.
For example, to enable the optional Fault benchmark set and build for the
sabre
platform, we would use the following invocation.
# create build directory
mkdir build
cd build
# configure build directory
../init-build.sh -DPLATFORM=sabre -DFAULT=ON
Building
After you have configured the system, you can build it by running:
ninja
Running it
The build step above will produce a bootable image file in the images/
directory. Please refer to the documentation of the respective build platform
for how to boot the specific board with such an image.
Available Benchmarks
The following table lists the available benchmark sets. Measured from user space means that the benchmark is not instrumenting the kernel. This means it measures unmodified kernel code, but may consequently have lower precision than some of the other benchmarks.
Components | Description |
---|---|
Fault |
Fault delivery, measured from user space |
Hardware |
Hardware-related seL4 operations |
IPC |
A benchmark of the kernel IPC path |
IRQ |
The IRQ path, measured from inside the kernel. |
IRQ user |
The IRQ path, measured from user space. |
Page mapping |
Performance of mapping a series of pages |
Scheduler |
Benchmark for scheduling decisions, using a producer/consumer pattern between two notification objects. Also measures |
Signal |
The seL4 signal operation, measured from user space |
SMP |
Intra-core IPC round-trip benchmark to measure overhead of kernel synchronization on IPC throughput. |
Synchronisation library |
Measuring the user-level seL4 sync library |
Aarch64 VCPU |
seL4 VCPU performance, including privilege escalation from EL1 to EL2 with |
Fault delivery, measured from user space
Hardware-related seL4 operations
A benchmark of the kernel IPC path
The IRQ path, measured from inside the kernel.
The IRQ path, measured from user space.
Performance of mapping a series of pages
Benchmark for scheduling decisions, using a producer/consumer pattern between two notification objects. Also measures seL4_Yield()
.
The seL4 signal operation, measured from user space
Intra-core IPC round-trip benchmark to measure overhead of kernel synchronization on IPC throughput.
Measuring the user-level seL4 sync library
seL4 VCPU performance, including privilege escalation from EL1 to EL2 with HVC
, privilege de-escalation from EL2 to EL1 with ERET
, null invocation of the EL2 kernel using HVC
, cost of seL4_Call()
from an EL1 guest thread to a native seL4 thread, and cost of an seL4_Reply()
from an seL4 native thread to an EL1 guest thread. See the sel4bench repository README for instructions.
Configuration Options
Kernel configuration settings can have a large effect on the end results reported by the benchmarks. Some benchmarks will only work in certain configurations. To make it easier to configure a build of seL4bench that has the right configuration values set, use the meta-configuration options listed below.
Configurations | Description | Value |
---|---|---|
|
Performance optimized build |
(Default: ON) |
|
Configuration for sel4bench hardware app |
(Default: OFF) |
|
Configuration sel4bench fault app |
(Default: OFF) |
|
Whether or not to run the VCPU benchmarks |
(Default: OFF) |
|
Configuration sel4bench smp app |
(Default: OFF) |
|
Platform to test |
(Default: x86_64) |
|
Turn fastpath on or off |
(Default: ON) |
|
ARM EL2 hypervisor features on or off |
(Default: OFF) |
RELEASE
Performance optimized build
HARDWARE
Configuration for sel4bench hardware app
FAULT
Configuration sel4bench fault app
VCPU
Whether or not to run the VCPU benchmarks
SMP
Configuration sel4bench smp app
PLATFORM
Platform to test
FASTPATH
Turn fastpath on or off
ARM_HYP
ARM EL2 hypervisor features on or off
Implementation
Benchmark runner
seL4bench must be started directly by seL4 as the root-task in the system. This
is the sel4bench
binary, which also serves as the main benchmark runner. It
runs the configured benchmarks and sets up a new environment for each benchmark
to run in. When a benchmark completes, it reports the results back to the runner
and the runner prints the results out as JSON once all the benchmarks have
completed.
Benchmarking environment
Each benchmark runs in a separate process environment. Currently there is only a
single kind of environment that all benchmarking apps are expected to execute
in. This environment defines the set of system resources that each benchmark is
given to run with. It also provides the configuration options for each
benchmark. Each benchmark can provide an init
function and a parse_results
function that will get called in the main sel4bench
app. Otherwise all
benchmark functionality runs in the environment.
The libsel4benchsupport
library provides environment functions that the
benchmarks can call.
Adding a new benchmark
For adding new benchmarks see the sel4bench repository README.