diff options
author | jeff <jeff@FreeBSD.org> | 2003-11-04 07:18:18 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2003-11-04 07:18:18 +0000 |
commit | 8cecbe74983913d60c797d1c6082e062de4b3b13 (patch) | |
tree | e91ed66092d9928d88098fc3edcb8dba984dde1c /sys/sys/sched.h | |
parent | 62316cd3c75adb18d0c06d927916dc6d2cc4c436 (diff) | |
download | FreeBSD-src-8cecbe74983913d60c797d1c6082e062de4b3b13.zip FreeBSD-src-8cecbe74983913d60c797d1c6082e062de4b3b13.tar.gz |
- Clean up comments to reflect the KSE pushout.
- Add the following functions to the api: sched_bind(), sched_unbind(),
sched_pin(), and sched_unpin(). Bind/unbind are used for traditional
cpu binding. Pin and unpin are meant to allow the kernel to hold a thread
on a particular cpu so that it may cache per-cpu data without fear of
being migrated.
Diffstat (limited to 'sys/sys/sched.h')
-rw-r--r-- | sys/sys/sched.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/sys/sys/sched.h b/sys/sys/sched.h index cd804cc..1f8f338 100644 --- a/sys/sys/sched.h +++ b/sys/sys/sched.h @@ -51,11 +51,12 @@ void sched_fork_ksegrp(struct ksegrp *kg, struct ksegrp *child); void sched_nice(struct ksegrp *kg, int nice); /* - * Threads are switched in and out, block on resources, and have temporary - * priorities inherited from their ksegs. + * Threads are switched in and out, block on resources, have temporary + * priorities inherited from their ksegs, and use up cpu time. */ void sched_exit_thread(struct thread *td, struct thread *child); void sched_fork_thread(struct thread *td, struct thread *child); +fixpt_t sched_pctcpu(struct thread *td); void sched_prio(struct thread *td, u_char prio); void sched_sleep(struct thread *td, u_char prio); void sched_switch(struct thread *td); @@ -63,19 +64,27 @@ void sched_userret(struct thread *td); void sched_wakeup(struct thread *td); /* - * KSEs are moved on and off of run queues. + * Threads are moved on and off of run queues */ void sched_add(struct thread *td); -struct kse *sched_choose(void); +struct kse *sched_choose(void); /* XXX Should be thread * */ void sched_clock(struct thread *td); -void sched_exit_kse(struct kse *ke, struct kse *child); -void sched_fork_kse(struct kse *ke, struct kse *child); void sched_rem(struct thread *td); /* - * and they use up cpu time. + * Binding makes cpu affinity permanent while pinning is used to temporarily + * hold a thread on a particular CPU. */ -fixpt_t sched_pctcpu(struct thread *td); +void sched_bind(struct thread *td, int cpu); +void sched_pin(struct thread *td); +void sched_unbind(struct thread *td); +void sched_unpin(struct thread *td); + +/* + * These interfaces will eventually be removed. + */ +void sched_exit_kse(struct kse *ke, struct kse *child); +void sched_fork_kse(struct kse *ke, struct kse *child); /* * These procedures tell the process data structure allocation code how |