|author||Clark Williams <firstname.lastname@example.org>||Wed Sep 16 09:43:04 2020 -0500|
|committer||Clark Williams <email@example.com>||Wed Sep 16 09:43:04 2020 -0500|
stalld: first attempt at emulating DEADLINE using FIFO This is a first cut at the logic to do stalled thread boosting using SCHED_FIFO, when running on a kernel without SCHED_DEADLINE support. The idea is that in the boost logic, we change the starving thread's policy to SCHED_FIFO:98, then sleep up to the 'period' boundary (same period used for DEADLINE), then change the thread back to it's original policy and parameters. 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.
Usage: stalld [-l] [-v] [-k] [-s] [-f] [-h] [-c cpu-list] [-p time in ns] [-r time in ns] [-d time in seconds] [-t time in seconds]