freebsd-dev/sys
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
..
alpha Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
amd64 Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
arm Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
boot Add the loader side of support for preloading ELF relocatable object 2004-08-29 00:48:42 +00:00
cam Correct a typo in a comment: alloation->allocation 2004-08-30 20:14:21 +00:00
coda General modernization of coda: 2004-09-01 01:19:52 +00:00
compat Regenerate after fcntl() wrappers were marked MP safe. 2004-08-24 20:24:34 +00:00
conf Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
contrib From __FreeBSD_version 600001 on PFIL_HOOKS is permanently in the kernel and 2004-08-27 20:01:08 +00:00
crypto Use __FBSDID(). 2004-06-14 00:38:54 +00:00
ddb Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
dev Fixed build with DEVICE_POLLING defined. 2004-09-04 07:54:05 +00:00
doc Experimental support for using doxygen to generate kernel documentation. 2004-07-11 16:13:57 +00:00
fs Back out pseudo_vnops.c:1.45, which was a workaround for pfind() 2004-09-02 16:04:09 +00:00
gdb Comment-out the debugging printf I left in in case there were some 2004-08-10 19:32:33 +00:00
geom Allow to configure debug level from /boot/loader.conf. 2004-08-30 18:50:06 +00:00
gnu Add locking to the kqueue subsystem. This also makes the kqueue subsystem 2004-08-15 06:24:42 +00:00
i4b Kill count device support from config. I've changed the last few 2004-08-30 23:03:58 +00:00
i386 Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
ia64 Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
isa Improve sync recovery algorithm: 2004-08-27 21:25:16 +00:00
isofs/cd9660 Put a version element in the VFS filesystem configuration structure 2004-07-30 22:08:52 +00:00
kern Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
libkern Move the kernel-specific logic to adjust frompc from MI to MD. For 2004-08-27 19:42:35 +00:00
modules Let kmod.mk touch opt_*.h files as needed. 2004-09-04 06:37:58 +00:00
net Correct a comment typo: s/Note/Not/. 2004-09-03 01:37:02 +00:00
net80211 Add a new network interface flag, IFF_NEEDSGIANT, which will allow 2004-07-27 23:20:45 +00:00
netatalk Inline umich license from COPYRIGHT to make it clear what license the 2004-08-10 03:23:05 +00:00
netatm Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
netgraph In FreeBSD 5.x, curthread is always defined, so we don't need to to test 2004-09-02 19:53:13 +00:00
netinet Apply error and success logic consistently to the function netisr_queue() and 2004-08-27 18:33:08 +00:00
netinet6 Unlock rather than lock the ripcbinfo lock at the end of rip6_input(). 2004-09-02 20:18:02 +00:00
netipsec Apply error and success logic consistently to the function netisr_queue() and 2004-08-27 18:33:08 +00:00
netipx Mark Netgraph TTY, KAME IPSEC, and IPX/SPX as requiring Giant for correct 2004-08-28 15:24:53 +00:00
netkey The KAME IPSEC implementation at one point used its own pseudo-random 2004-09-02 20:14:03 +00:00
netnatm Constify send and receive space constants in natm. 2004-06-24 03:11:29 +00:00
netncp Do the dreaded s/dev_t/struct cdev */ 2004-06-16 09:47:26 +00:00
netsmb Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
nfs
nfs4client Put a version element in the VFS filesystem configuration structure 2004-07-30 22:08:52 +00:00
nfsclient In nfs_timer(), pass curthread rather than &thread0 into the protocol 2004-08-25 01:23:38 +00:00
nfsserver Convert a mtx_lock(&Giant) to a mtx_unlock(&Giant) in nfsrv_link() to 2004-08-25 16:52:59 +00:00
opencrypto Don't acquire Giant in cryptof_close(), as the code is intended to be 2004-08-10 03:26:17 +00:00
pc98 Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
pccard Move PNP IDs back into oldcard files 2004-08-13 06:57:31 +00:00
pci Tag a last set of PCI network interfaces as IFF_NEEDSGIANT until they 2004-08-28 15:10:35 +00:00
posix4
powerpc Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
rpc fix array index out of bounds in rpc->rc_srtt[], rpc->rc_sdrtt[] 2004-07-15 22:21:25 +00:00
security Allow mac_bsdextended(4) to log failed attempts to syslog's AUTHPRIV 2004-08-21 20:19:19 +00:00
sparc64 Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
sys Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
tools Pass doxygen doc comments through to the output. 2004-07-11 16:14:24 +00:00
ufs Currently, if the secure level is low enough, system flags can 2004-08-22 02:03:41 +00:00
vm Enable debug.mpsafevm by default on amd64 and i386. This enables copy-on- 2004-09-04 05:51:54 +00:00
Makefile Add a NO_BOOT knob to prevent building the boot blocks and loader. 2004-08-19 09:54:28 +00:00