This experiment was born from the desire to verify the behavior of various
kernel schedulers as CPU resources become exhausted.
Time-sharing processes should be able to meet CPU% needs,
provided total CPU requirement is less than 100%.
Real-time processes should always supercede time-sharing processes
when enduring >100% loading.
Real-time priority handling should exhibit proper prioritization.
A scenario was created to test these three concerns. Each concern is
tested in sequence through periodic-based tasks. In this scenario,
each task (T,C) is run with the same period (T) and varying CPU (C)
requirements. Some tasks are run with a fixed C value, to test stability,
while others are run with steadily increasing C values, to test the
scheduler's behavior as it crosses various thresholds.
Contention for CPU among Time-Sharing processes:
One process constantly expects to run 30% of the time
One process constantly expects to run 40% of the time
One process increases load from 20% to 40%.
Note that 3 competing processes can only fairly expect 33.3% CPU usage.
Since the first only uses 30%, we expect to see it always receive this.
The second two can only then split the remaining (70%) CPU time.
Contention for CPU between TS and Real-Time process:
One process constantly expects to run 30% of the time
One process constantly expects to run 40% of the time
RT Process increases from 20% to 50%.
As RT Process exceeds 30%, total CPU load will be over 100%.
The two TS processes should split the remaining CPU time evenly,
up to their CPU usage requirement.
Prioritized RT processes:
Any TS tasks running when there is >100% loading from RT tasks
should be given 0% CPU usage.
CPU time should be given as needed to higher priority tasks before
lower priority tasks.