From 885d51a38a7d27227219d37738b67fd39064ec6a Mon Sep 17 00:00:00 2001 From: Jeff Roberson Date: Sun, 2 Mar 2008 07:19:35 +0000 Subject: [PATCH] - Add a new sched_affinity() api to be used in the upcoming cpuset implementation. - Add empty implementations of sched_affinity() to 4BSD and ULE. Sponsored by: Nokia --- sys/kern/sched_4bsd.c | 5 +++++ sys/kern/sched_ule.c | 5 +++++ sys/sys/sched.h | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index e1e5c916fb42..0357ea7bdcf7 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -1402,5 +1402,10 @@ sched_fork_exit(struct thread *td) THREAD_LOCK_ASSERT(td, MA_OWNED | MA_NOTRECURSED); } +void +sched_affinity(struct thread *td) +{ +} + #define KERN_SWITCH_INCLUDE 1 #include "kern/kern_switch.c" diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 706adf94eb98..4445b0573348 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -2492,6 +2492,11 @@ sched_pctcpu(struct thread *td) return (pctcpu); } +void +sched_affinity(struct thread *td) +{ +} + /* * Bind a thread to a target cpu. */ diff --git a/sys/sys/sched.h b/sys/sys/sched.h index 5f225e1dcf04..91be1df2ab88 100644 --- a/sys/sys/sched.h +++ b/sys/sys/sched.h @@ -32,7 +32,7 @@ */ /*- - * Copyright (c) 2002, Jeffrey Roberson + * Copyright (c) 2002-2008, Jeffrey Roberson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -129,6 +129,7 @@ static __inline void sched_pin(void); void sched_unbind(struct thread *td); static __inline void sched_unpin(void); int sched_is_bound(struct thread *td); +void sched_affinity(struct thread *td); /* * These procedures tell the process data structure allocation code how