Sample Header Ad - 728x90

How to set the SCHED_RR time slice or time quantum per process / thread?

1 vote
1 answer
3809 views
The time slice (also called time quantum) for threads with SCHED_RR policy can, according to the sched_rr_get_interval man page be obtained using int sched_rr_get_interval(pid_t pid, struct timespec *tp); This indicates that there could be different values set for different processes / threads. According to the same man page , however, the value can (since kernel 3.9) be adjusted using /proc/sys/kernel/sched_rr_timeslice_ms, which, however, does not seem to allow to change the configuration per thread in a sensible way. Other places dealing with real-time scheduling also do not provide information how the time slice for SCHED_RR threads can be set per thread (man chrt , man sched_setattr , SO: How to know linux scheduler time slice? ). It it possible to set the time slice individually per SCHED_RR thread? If so, what is the preferred approach to do so?
Asked by Dirk Herrmann (686 rep)
Feb 20, 2019, 05:16 PM
Last activity: Apr 18, 2020, 04:19 PM