summaryrefslogtreecommitdiffstats
path: root/sys/sys/sched.h
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-11-06 03:09:05 +0000
committerjeff <jeff@FreeBSD.org>2003-11-06 03:09:05 +0000
commitf5b5faded511289de95043e76b5a4794b2c5213e (patch)
tree960dff4f2f7d50babb38e3b3e2d10bd7a993e637 /sys/sys/sched.h
parentbe32bf80013e9d5a8db96d9daaa5c555cc972c15 (diff)
downloadFreeBSD-src-f5b5faded511289de95043e76b5a4794b2c5213e.zip
FreeBSD-src-f5b5faded511289de95043e76b5a4794b2c5213e.tar.gz
- Add a pinned count to the thread so that cpu pinning may nest. This is
not in scheduler specific data because eventually it will be required by all schedulers. - Implement sched_pin and unpin as an inline for now. If a scheduler needs to do something more complicated than adjusting the pinned count we can move this into a function later in an api compatible way.
Diffstat (limited to 'sys/sys/sched.h')
-rw-r--r--sys/sys/sched.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/sys/sched.h b/sys/sys/sched.h
index 1f8f338..1cefda7 100644
--- a/sys/sys/sched.h
+++ b/sys/sys/sched.h
@@ -76,9 +76,9 @@ void sched_rem(struct thread *td);
* hold a thread on a particular CPU.
*/
void sched_bind(struct thread *td, int cpu);
-void sched_pin(struct thread *td);
+static __inline void sched_pin(struct thread *td);
void sched_unbind(struct thread *td);
-void sched_unpin(struct thread *td);
+static __inline void sched_unpin(struct thread *td);
/*
* These interfaces will eventually be removed.
@@ -100,4 +100,16 @@ extern struct kg_sched *ksegrp0_sched;
extern struct p_sched *proc0_sched;
extern struct td_sched *thread0_sched;
+static __inline void
+sched_pin(struct thread *td)
+{
+ td->td_pinned++;
+}
+
+static __inline void
+sched_unpin(struct thread *td)
+{
+ td->td_pinned--;
+}
+
#endif /* !_SYS_SCHED_H_ */
OpenPOWER on IntegriCloud