MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tdq_slice

Function tdq_slice

freebsd/kern/sched_ule.c:577–593  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

575 * no less than sched_slice_min runtime.
576 */
577static inline int
578tdq_slice(struct tdq *tdq)
579{
580 int load;
581
582 /*
583 * It is safe to use sys_load here because this is called from
584 * contexts where timeshare threads are running and so there
585 * cannot be higher priority load in the system.
586 */
587 load = tdq->tdq_sysload - 1;
588 if (load >= SCHED_SLICE_MIN_DIVISOR)
589 return (sched_slice_min);
590 if (load <= 1)
591 return (sched_slice);
592 return (sched_slice / load);
593}
594
595/*
596 * Set lowpri to its exact value by searching the run-queue and

Callers 2

sched_fork_threadFunction · 0.85
sched_clockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected