diff options
author | jhb <jhb@FreeBSD.org> | 2008-07-28 17:25:24 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-07-28 17:25:24 +0000 |
commit | 68f0af82de36b35bd925b8dd9fc18ecc57c20806 (patch) | |
tree | 1ddf02b638944800f00a1dc5576a8dd0dd5df90b /lib/libc/rpc | |
parent | ffa615778870d82037421f0b90fa371af7218892 (diff) | |
download | FreeBSD-src-68f0af82de36b35bd925b8dd9fc18ecc57c20806.zip FreeBSD-src-68f0af82de36b35bd925b8dd9fc18ecc57c20806.tar.gz |
Implement support for cpusets in the 4BSD scheduler.
- When a cpuset is applied to a thread, walk the cpuset to see if it is a
"full" cpuset (includes all available CPUs). If not, set a new
TDS_AFFINITY flag to indicate that this thread can't run on all CPUs.
When inheriting a cpuset from another thread during thread creation, the
new thread also inherits this flag. It is in a new ts_flags field in
td_sched rather than using one of the TDF_SCHEDx flags because fork()
clears td_flags after invoking sched_fork().
- When placing a thread on a runqueue via sched_add(), if the thread is not
pinned or bound but has the TDS_AFFINITY flag set, then invoke a new
routine (sched_pickcpu()) to pick a CPU for the thread to run on next.
sched_pickcpu() walks the cpuset and picks the CPU with the shortest
per-CPU runqueue length. Note that the reason for the TDS_AFFINITY flag
is to avoid having to walk the cpuset and examine runq lengths in the
common case.
- To avoid walking the per-CPU runqueues in sched_pickcpu(), add an array
of counters to hold the length of the per-CPU runqueues and update them
when adding and removing threads to per-CPU runqueues.
MFC after: 2 weeks
Diffstat (limited to 'lib/libc/rpc')
0 files changed, 0 insertions, 0 deletions