From 09c01e4542a6e65fd5d0321542aa9b7ed98f3b78 Mon Sep 17 00:00:00 2001 From: Jeff Roberson Date: Tue, 4 Nov 2003 07:18:18 +0000 Subject: [PATCH] - 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. --- sys/sys/sched.h | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/sys/sys/sched.h b/sys/sys/sched.h index cd804cc559a5..1f8f3382d4cf 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