commit | 1bf5908de421a24d29b5df0e741869fa729a6da3 | [log] [tgz] |
---|---|---|
author | Daniel Bristot de Oliveira <bristot@redhat.com> | Fri Jun 25 15:01:24 2021 +0200 |
committer | Daniel Bristot de Oliveira <bristot@redhat.com> | Fri Jun 25 15:01:24 2021 +0200 |
tree | 7436946268be3f21137b59eb62ef48766b2ad0a3 | |
parent | f3f19669ec2569bae97d185eca4f7cd89c7aaf7e [diff] |
stalld v1.12 Most of the changes are cleanups. The most visible change is that the stalld's systemd service now starts the daemon with FIFO:10 priority. This change is necessary to avoid having stalld starving or being indirectly blocked on a real-time mutex owned by a starving thread. The latter behavior indeed happened in the multi-threaded mode. Changes: stalld.8: fix diff cruft left in manpage source stalld.c: clean up handling of nr_running stalld.c: remove duplicate parameter to fill_waiting_task() stalld: Add error handling in get_cpu_idle_time() stalld.service: Run stalld as sched_fifo via systemd packaging: clean up Makefiles and rpm specfile stalld: Always print current function for info messages stalld: Always print current function for warn messages stalld: Always print current function for die messages utils: change PATHMAX to 4096 Signed-off-by: Daniel Bristot de Oliveira <bristot@redhat.com>
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]
The repository at https://gitlab.com/rt-linux-tools/stalld is the main repository, where the development takes place.
The repository at https://git.kernel.org/pub/scm/utils/stalld/stalld.git is the distribution repository, where distros can pick the latest released version.