genode/repos/base-hw/run/cpu_scheduler.run
Martin Stein 1b1fd1e1f9 hw: add and test totally sophisticated scheduler
The new scheduler serves the orthogonal requirements of both
high-throughput-oriented scheduling contexts (shortly called fill in the
scheduler) and low-latency-oriented scheduling contexts (shortly called
claim in the scheduler). Thus it knows two scheduling modes. Every claim
owns a CPU-time-quota expressed as percentage of a super period
(currently 1 second) and a priority that is absolute as long as the
claim has quota left for the current super period. At the end of a super
period the quota of all claims gets refreshed. During a super period,
the claim mode is dominant as long as any active claim has quota left.
Every time this isn't the case, the scheduler switches to scheduling of
fills. Fills are scheduled in a simple round robin with identical time
slices. Order and time-slices of the fill scheduling are not affected by
the super period. Now on thread creation, two arguments, priority and
quota are needed. If quota is 0, the new thread participates in CPU
scheduling with a fill only.  Otherwise he participates with both a
claim and a fill. This concept dovetails nicely with Genodes quota based
resource management as any process can grant subsets of its own
CPU-time and priorities to its child without knowing the global means of
CPU-time and priority.

The commit also adds a run script that enables an automated unit test of the
scheduler implementation.

fix #1225
2014-11-28 12:02:35 +01:00

25 lines
598 B
Plaintext

#
# \brief Test CPU-scheduler implementation of core
# \author Martin Stein
# \date 2014-09-30
#
# build program images
build "test/cpu_scheduler"
# create directory where the boot files are written to
create_boot_directory
# create single boot image from the compiled program images
build_boot_image "test-cpu_scheduler" test
# configure qemu to use 64 MB RAM and avoid GUI mode
append qemu_args " -m 64 -nographic"
# execute the test in qemu if the targeted platform is supported
run_genode_until "done.*\n" 10
# check the output
grep_output {\[test\]}
compare_output_to { [test] done }