diff options
author | julian <julian@FreeBSD.org> | 2004-09-10 22:28:33 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2004-09-10 22:28:33 +0000 |
commit | 7cae3c9d5b0db780f92af04b645f2716499bc051 (patch) | |
tree | 45ec30d8b6838f53409c69d14291f0f11b5f7b7c /sys/kern/sched_4bsd.c | |
parent | b9945320c2a286dda4ad4c6529fec0f3f85f68a3 (diff) | |
download | FreeBSD-src-7cae3c9d5b0db780f92af04b645f2716499bc051.zip FreeBSD-src-7cae3c9d5b0db780f92af04b645f2716499bc051.tar.gz |
Make up my mind if cpu pinning is stored in the thread structure or the
scheduler specific extension to it. Put it in the extension as
the implimentation details of how the pinning is done needn't be visible
outside the scheduler.
Submitted by: tegge (of course!) (with changes)
MFC after: 3 days
Diffstat (limited to 'sys/kern/sched_4bsd.c')
-rw-r--r-- | sys/kern/sched_4bsd.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 9a96344..6686339 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -87,7 +87,7 @@ struct kse { } ke_state; /* (j) KSE status. */ int ke_cpticks; /* (j) Ticks of cpu time. */ struct runq *ke_runq; /* runq the kse is currently on */ - int ke_pinned; /* nested count of pinned to a cpu */ + int ke_pinned; /* (k) nested count, pinned to a cpu */ }; #define ke_proc ke_thread->td_proc @@ -764,7 +764,6 @@ sched_switch(struct thread *td, struct thread *newtd, int flags) if ((p->p_flag & P_NOLOAD) == 0) sched_tdcnt--; - /* * We are volunteering to switch out so we get to nominate * a successor for the rest of our quantum @@ -1173,5 +1172,26 @@ sched_pctcpu(struct thread *td) return (0); } + +void +sched_pin(void) +{ + curthread->td_sched->ke_pinned++; +} + + void +sched_unpin(void) +{ + curthread->td_sched->ke_pinned--; +} + +#ifdef INVARIANTS +int +sched_ispinned(void) +{ + return (curthread->td_sched->ke_pinned); +} +#endif + #define KERN_SWITCH_INCLUDE 1 #include "kern/kern_switch.c" |