c - How to know linux scheduler time slice? -


i'm looking value of time slice (or quantum) of linux kernel.

is there /proc file expose such information ?

(or) well-defined in linux header of distributions ?

(or) there c function of linux api (maybe sysinfo) expose value ?

thanks in advance.

the default linux timeslice realtime processes defined in linux kernel rr_timeslice in include/linux/sched/rt.h.

/*  * default timeslice 100 msecs (used sched_rr tasks).  * timeslices refilled after expire.  */ #define rr_timeslice            (100 * hz / 1000) 

note actual quantum allocated particular process may different value:

you can tune "slice" adjusting sched_latency_ns , sched_min_granularity_ns, note "slice" not fixed quantum. note cfs preemption decisions based upon instantaneous state. task may have received full (variable) "slice" of cpu time, preemption triggered if more deserving task available, "slice" not "max uninterrupted cpu time" may expect be.. similar.

however, can use sched_rr_get_interval() sched_rr interval given realtime process.


Comments