freebsd-skq/sys/powerpc/aim
Julian Elischer ed062c8d66 Refactor a bunch of scheduler code to give basically the same behaviour
but with slightly cleaned up interfaces.

The KSE structure has become the same as the "per thread scheduler
private data" structure. In order to not make the diffs too great
one is #defined as the other at this time.

The KSE (or td_sched) structure is  now allocated per thread and has no
allocation code of its own.

Concurrency for a KSEGRP is now kept track of via a simple pair of counters
rather than using KSE structures as tokens.

Since the KSE structure is different in each scheduler, kern_switch.c
is now included at the end of each scheduler. Nothing outside the
scheduler knows the contents of the KSE (aka td_sched) structure.

The fields in the ksegrp structure that are to do with the scheduler's
queueing mechanisms are now moved to the kg_sched structure.
(per ksegrp scheduler private data structure). In other words how the
scheduler queues and keeps track of threads is no-one's business except
the scheduler's. This should allow people to write experimental
schedulers with completely different internal structuring.

A scheduler call sched_set_concurrency(kg, N) has been added that
notifies teh scheduler that no more than N threads from that ksegrp
should be allowed to be on concurrently scheduled. This is also
used to enforce 'fainess' at this time so that a ksegrp with
10000 threads can not swamp a the run queue and force out a process
with 1 thread, since the current code will not set the concurrency above
NCPU, and both schedulers will not allow more than that many
onto the system run queue at a time. Each scheduler should eventualy develop
their own methods to do this now that they are effectively separated.

Rejig libthr's kernel interface to follow the same code paths as
linkse for scope system threads. This has slightly hurt libthr's performance
but I will work to recover as much of it as I can.

Thread exit code has been cleaned up greatly.
exit and exec code now transitions a process back to
'standard non-threaded mode' before taking the next step.
Reviewed by:	scottl, peter
MFC after:	1 week
2004-09-05 02:09:54 +00:00
..
clock.c - fix compile warnings 2004-02-11 08:07:19 +00:00
copyinout.c Kernel changes for libthr (and probably libpthread). 2004-03-02 06:13:09 +00:00
interrupt.c Be more conservative about re-enabling interrupts during trap processing 2003-01-08 12:20:46 +00:00
locore.S Instead of "OpenFirmware", "openfirmware", etc. use the official spelling 2004-08-16 15:45:27 +00:00
machdep.c Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
mmu_oea.c - Introduce a lock for synchronizing access to the pvo and pteg tables. 2004-08-30 21:39:22 +00:00
nexus.c Instead of "OpenFirmware", "openfirmware", etc. use the official spelling 2004-08-16 15:45:27 +00:00
ofw_machdep.c Instead of "OpenFirmware", "openfirmware", etc. use the official spelling 2004-08-16 15:45:27 +00:00
ofwmagic.S Instead of "OpenFirmware", "openfirmware", etc. use the official spelling 2004-08-16 15:45:27 +00:00
swtch.S Update the callframe structure to leave space for the frame pointer 2004-07-22 01:28:51 +00:00
trap_subr.S Save DAR/DSISR in DDB regsave area when stack overflow detected. It's 2004-07-27 03:46:34 +00:00
trap.c Remove an unneeded argument.. 2004-08-31 07:34:54 +00:00
uio_machdep.c Remove checks for curthread == NULL - it can't happen. 2004-06-03 10:22:47 +00:00
uma_machdep.c Add sysctl hw.uma_mdpages to track how many pages have been allocated 2004-02-11 04:42:48 +00:00
vm_machdep.c Update the callframe structure to leave space for the frame pointer 2004-07-22 01:28:51 +00:00