FreeBSD/sys/kern/sched_ule.c
/*
 * Bound timeshare latency by decreasing slice size as load increases.  We
 * consider the maximum latency as the sum of the threads waiting to run
 * aside from curthread and target no more than sched_slice latency but
 * no less than sched_slice_min runtime.
 */
Bound timeshare latency by decreasing slice size as load increases.  We
consider the maximum latency as the sum of the threads waiting to run
aside from curthread and target no more than sched_slice latency but
no less than sched_slice_min runtime.
Bound timeshare latency by decreasing slice size as load increases . We consider the maximum latency as the sum of the threads waiting to run aside from curthread and target no more than sched_slice latency but no less than sched_slice_min runtime .
static inline int
tdq_slice(struct tdq *tdq)
{
	int load;
	load = tdq->tdq_sysload - 1;
	if (load >= SCHED_SLICE_MIN_DIVISOR)
		return (sched_slice_min);
	if (load <= 1)
		return (sched_slice);
	return (sched_slice / load);
}
static inline int tdq_slice ( struct tdq * tdq ) { int load ; load = tdq -> tdq_sysload - 1 ; if ( load >= SCHED_SLICE_MIN_DIVISOR ) return ( sched_slice_min ) ; if ( load <= 1 ) return ( sched_slice ) ; return ( sched_slice / load ) ; }
Bound timeshare latency by decreasing slice size as load increases.
Bound timeshare latency by decreasing slice size as load increases .
/*
	 * It is safe to use sys_load here because this is called from
	 * contexts where timeshare threads are running and so there
	 * cannot be higher priority load in the system.
	 */