|author||Clark Williams <firstname.lastname@example.org>||Wed Sep 16 21:15:26 2020 -0500|
|committer||Clark Williams <email@example.com>||Wed Sep 16 21:15:26 2020 -0500|
use FIFO for boosting (v2) This is a set of changes that allow stalld to operation without the Deadline scheduler policy. The idea is to emulate how deadline works boosting a starving thread. When a boost operation is called for, the fifo boosting logic figures out how many 'periods' would be in the specified boost duration (default 3 seconds) and iterates for that number of periods, boosting the starving thread to fifo:98, sleeping for the 'runtime', deboosting to the original policy, sleeping for the remainder (period - runtime) and repeating until the boost duration is done. The FIFO boost logic is turned on when the running kernel does not support DEADLINE or when the command line option -F/--force_fifo is specified. Signed-off-by: Clark Williams <firstname.lastname@example.org>
The stalld program (which stands for ‘stall daemon’) is a mechanism to prevent the starvation of operating system threads in a Linux system. The premise is to start up on a housekeeping cpu (one that is not used for real-application purposes) and to periodically monitor the state of each thread in the system, looking for a thread that has been on a run queue (i.e. ready to run) for a specifed length of time without being run. This condition is usually hit when the thread is on the same cpu as a high-priority cpu-intensive task and therefore is being given no opportunity to run.
When a thread is judged to be starving, stalld changes that thread to use the SCHED_DEADLINE policy and gives the thread a small slice of time for that cpu (specified on the command line). The thread then runs and when that timeslice is used, the thread is then returned to its original scheduling policy and stalld then continues to monitor thread states.
There is now an experimental option to boost using SCHED_FIFO. This logic is used if the running kernel does not support the SCHED_DEADLINE policy and may be forced by using the -F/--force_fifo option.
Usage: stalld [-l] [-v] [-k] [-s] [-f] [-h] [-F] [-c cpu-list] [-p time in ns] [-r time in ns] [-d time in seconds] [-t time in seconds]