Skip to content

Commit

Permalink
domain_schedule: pick more useful defaults
Browse files Browse the repository at this point in the history
The previous schedule lead to 15/16th idle time and had extremely short
(1 tick) domain slices which means a lot of the test time was spent
idle or domain switching instead of running code.

This setup give domain 0 a long-ish slice to make some progress, adds
some variety to the schedule and sets 2 as the shortest period.

Signed-off-by: Gerwin Klein <[email protected]>
  • Loading branch information
lsf37 committed Jan 20, 2023
1 parent 1a21851 commit 944f3d0
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions domain_schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@

/* This is a domain schedule that is suitable for the domains tests in sel4test. All
* sel4test actually needs is for every domain to be executable for some period of time
* in order for the tests to make progress
* in order for the tests to make progress.
*
* Most tests run only in domain 0, so we give it the longest period to reduce
* overall idle time. We pick 2 ticks as the shortest period so that tests can
* make some progress if they exist, and we pick some variety in the first four
* domains so that not everything is equal.
*/

/* remember that this is compiled as part of the kernel, and so is referencing kernel headers */
Expand All @@ -17,51 +22,51 @@

/* Default schedule. */
const dschedule_t ksDomSchedule[] = {
{ .domain = 0, .length = 1 },
{ .domain = 0, .length = 60 },
#if CONFIG_NUM_DOMAINS > 1
{ .domain = 1, .length = 1 },
{ .domain = 1, .length = 4 },
#endif
#if CONFIG_NUM_DOMAINS > 2
{ .domain = 2, .length = 1 },
{ .domain = 2, .length = 3 },
#endif
#if CONFIG_NUM_DOMAINS > 3
{ .domain = 3, .length = 1 },
{ .domain = 3, .length = 2 },
#endif
#if CONFIG_NUM_DOMAINS > 4
{ .domain = 4, .length = 1 },
{ .domain = 4, .length = 2 },
#endif
#if CONFIG_NUM_DOMAINS > 5
{ .domain = 5, .length = 1 },
{ .domain = 5, .length = 2 },
#endif
#if CONFIG_NUM_DOMAINS > 6
{ .domain = 6, .length = 1 },
{ .domain = 6, .length = 2 },
#endif
#if CONFIG_NUM_DOMAINS > 7
{ .domain = 7, .length = 1 },
{ .domain = 7, .length = 2 },
#endif
#if CONFIG_NUM_DOMAINS > 8
{ .domain = 8, .length = 1 },
{ .domain = 8, .length = 2 },
#endif
#if CONFIG_NUM_DOMAINS > 9
{ .domain = 9, .length = 1 },
{ .domain = 9, .length = 2 },
#endif
#if CONFIG_NUM_DOMAINS > 10
{ .domain = 10, .length = 1 },
{ .domain = 10, .length = 2 },
#endif
#if CONFIG_NUM_DOMAINS > 11
{ .domain = 11, .length = 1 },
{ .domain = 11, .length = 2 },
#endif
#if CONFIG_NUM_DOMAINS > 12
{ .domain = 12, .length = 1 },
{ .domain = 12, .length = 2 },
#endif
#if CONFIG_NUM_DOMAINS > 13
{ .domain = 13, .length = 1 },
{ .domain = 13, .length = 2 },
#endif
#if CONFIG_NUM_DOMAINS > 14
{ .domain = 14, .length = 1 },
{ .domain = 14, .length = 2 },
#endif
#if CONFIG_NUM_DOMAINS > 15
{ .domain = 15, .length = 1 },
{ .domain = 15, .length = 2 },
#endif
#if CONFIG_NUM_DOMAINS > 16
#error Unsupportd number of domains set
Expand Down

0 comments on commit 944f3d0

Please sign in to comment.