4BSD implementation

The functions below are extracted from sys/kern/sched_4bsd.c in the kern project. The scheduler.bsd4 scope identifies this implementation inside the manual; it is not the linked kernel symbol prefix. These are implementation interfaces, including private helpers.

Functions

static inline void sched_update_hogticks(void)
static void setup_runqs(void)
static void schedcpu(void)
static void schedcpu_thread(void)
static void sched_priority(struct thread *td, u_char prio)
static void maybe_resched(struct thread *td)
static void updatepri(struct thread *td)
static void resetpriority(struct thread *td)
static void resetpriority_thread(struct thread *td)
static void sched_sysinit(void)
static int sysctl_kern_4bsd_quantum(SYSCTL_HANDLER_ARGS)
static int sysctl_kern_slice(SYSCTL_HANDLER_ARGS)
__inline static void sched_load_add(void)
__inline static void sched_load_rem(void)
static void maybe_resched_ast(struct thread *td, int tda)
static int maybe_preempt(struct thread *td)
static void sched_setup(void)
static void sched_initticks(void)
static void sched_init(void)
static void sched_init_ap(void)
static bool sched_runnable(void)
static int sched_rr_interval(void)
static void sched_clock_tick(struct thread *td)
static void sched_clock(struct thread *td, int cnt)
static void sched_exit(struct proc *p, struct thread *td)
static void sched_exit_thread(struct thread *td, struct thread *child)
static void sched_fork(struct thread *td, struct thread *childtd)
static void sched_fork_thread(struct thread *td, struct thread *childtd)
static void sched_nice(struct proc *p, int nice)
static void sched_class(struct thread *td, int class)
static void sched_lend_prio(struct thread *td, u_char prio)
static void sched_unlend_prio(struct thread *td, u_char prio)
static void sched_prio(struct thread *td, u_char prio)
static void sched_ithread_prio(struct thread *td, u_char prio)
static void sched_user_prio(struct thread *td, u_char prio)
static void sched_lend_user_prio(struct thread *td, u_char prio)
static void sched_lend_user_prio_cond(struct thread *td, u_char prio)
static void sched_sleep(struct thread *td, int pri)
static void sched_switch(struct thread *td, int flags)
static void sched_wakeup(struct thread *td, int srqflags)
static void sched_add(struct thread *td, int flags)
static void sched_rem(struct thread *td)
static struct thread *sched_choose(void)
static void sched_preempt(struct thread *td)
static void sched_userret_slowpath(struct thread *td)
static void sched_bind(struct thread *td, int cpu)
static void sched_unbind(struct thread *td)
static int sched_is_bound(struct thread *td)
static void sched_relinquish(struct thread *td)
static int sched_load(void)
static int sched_sizeof_proc(void)
static int sched_sizeof_thread(void)
static fixpt_t sched_pctcpu(struct thread *td)
static u_int sched_estcpu(struct thread *td)
static void sched_idletd(void *dummy)
static void sched_throw_tail(struct thread *td)
static void sched_ap_entry(void)
static void sched_throw(struct thread *td)
static void sched_fork_exit(struct thread *td)
static char *sched_tdname(struct thread *td)
static void sched_clear_tdname(struct thread *td)
static void sched_affinity(struct thread *td)
static int sched_find_l2_neighbor(int cpu)