There is another defense that I did not know about.
If you have only one processor and you need a SCHED_FIFO process like this (one that never blocks and does not give the processor voluntarily) in order to monopolize it, in addition to having a high priority (in most cases this is not necessary, t it hurts), you should:
- Set
sched_rt_runtime_us to -1 or the value of sched_rt_period_us - If group scheduling is configured, set
/cgroup/cpu.rt_runtime_us to -1 (in case you mount the cgroup file system to /cgroup )
Apparently, I set up group scheduling and did not bypass the last defense.
If you have N processors and want your N processes to monopolize the processor, you just do the same, but start all of them from your shell (the shell should not get stuck until you run the latter, since the processors will work on it ) If you want to be sure that each process will switch to a different processor, set its compatibility with the processor accordingly.
Thanks everyone for the answers.
source share