1

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?

1 Answer 1

2

According to the man page you linked, sched_rr_get_interval conforms to the POSIX.1-2001 and POSIX.1-2008 standards. The POSIX standards thus allow different processes to have different time slice values, but as that same man page states: "POSIX does not specify any mechanism for controlling the size of the round-robin time quantum."

This might be the reason why there is no known way to set the round-robin time slice value per process or thread in Linux. As you noted, as far as I know and can find, it is only possible to change the time slice globally using /proc/sys/kernel/sched_rr_timeslice_ms.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .