freebsd-dev/sys/i386
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
..
acpica Be sure to always unlock the sx lock when exiting the sysctl function. 2004-08-24 17:53:25 +00:00
bios Clarify SDT feature word bits. 2004-08-31 21:51:51 +00:00
compile
conf Kill count device support from config. I've changed the last few 2004-08-30 23:03:58 +00:00
cpufreq o Fix whitespace bug introduced in the previous commit. 2004-08-23 10:09:29 +00:00
i386 Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
ibcs2 Regenerate after fcntl() wrappers were marked MP safe. 2004-08-24 20:24:34 +00:00
include Turn PREEMPTION into a kernel option. Make sure that it's defined if 2004-09-02 18:59:15 +00:00
isa Optimize intr_execute_handlers() by combining the pic_disable_source() and 2004-08-02 15:31:10 +00:00
linux Give setrunqueue() and sched_add() more of a clue as to 2004-09-01 02:11:28 +00:00
pci Consistently use __inline instead of __inline__ as the former is an empty macro 2004-07-04 16:11:03 +00:00
svr4 Attempt to make the proper changes here for the proc.h commit: 2004-01-05 00:29:00 +00:00
Makefile This commit adds basic support for the UFS2 filesystem. The UFS2 2002-06-21 06:18:05 +00:00