freebsd-nq/sys
Robert Watson 41a17fe326 Clean up locking for the MAC Framework:
(1) Accept that we're now going to use mutexes, so don't attempt
    to avoid treating them as mutexes.  This cleans up locking
    accessor function names some.

(2) Rename variables to _mtx, _cv, _count, simplifying the naming.

(3) Add a new form of the _busy() primitive that conditionally
    makes the list busy: if there are entries on the list, bump
    the busy count.  If there are no entries, don't bump the busy
    count.  Return a boolean indicating whether or not the busy
    count was bumped.

(4) Break mac_policy_list into two lists: one with the same name
    holding dynamic policies, and a new list, mac_static_policy_list,
    which holds policies loaded before mac_late and without the
    unload flag set.  The static list may be accessed without
    holding the busy count, since it can't change at run-time.

(5) In general, prefer making the list busy conditionally, meaning
    we pay only one mutex lock per entry point if all modules are
    on the static list, rather than two (since we don't have to
    lower the busy count when we're done with the framework).  For
    systems running just Biba or MLS, this will halve the mutex
    accesses in the network stack, and may offer a substantial
    performance benefits.

(6) Lay the groundwork for a dynamic-free kernel option which
    eliminates all locking associated with dynamically loaded or
    unloaded policies, for pre-configured systems requiring
    maximum performance but less run-time flexibility.

These changes have been running for a few weeks on MAC development
branch systems.

Approved by:	re (jhb)
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-05-07 17:49:24 +00:00
..
alpha Style fixes. 2003-05-04 22:13:04 +00:00
amd64 Style nits. 2003-05-07 17:21:38 +00:00
arm Style fixes. 2003-05-04 22:13:04 +00:00
boot Since we insist on loading the POS ACPI by default, give the poor user 2003-05-05 07:33:12 +00:00
cam Fix three problems in large (>2TB) device handling: 2003-05-03 00:21:40 +00:00
coda - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with 2003-03-31 22:49:17 +00:00
compat Change the semantics of sysv shm emulation to take a additional 2003-05-05 09:22:58 +00:00
conf We are now in 5.1-BETA 2003-05-06 03:55:24 +00:00
contrib This commit was generated by cvs2svn to compensate for changes in r114584, 2003-05-03 17:16:40 +00:00
crypto Assembly files put thru the C preprocessor need to have C style comments. 2003-04-21 16:30:12 +00:00
ddb Move the _oncpu entry from the KSE to the thread. 2003-04-10 17:35:44 +00:00
dev Add PCI ID's for the Intel ICH5 (82801EB) chipset. 2003-05-06 19:31:56 +00:00
fs Clean up proc locking in procfs: make sure the proc lock is held before 2003-05-05 15:12:51 +00:00
geom Hide the "ENOMEM" notice messages behind bootverbose. They are still 2003-05-07 05:37:31 +00:00
gnu This commit was generated by cvs2svn to compensate for changes in r113778, 2003-04-21 02:27:52 +00:00
i4b - Add vm_paddr_t, a physical address type. This is required for systems 2003-03-25 00:07:06 +00:00
i386 Style nits. 2003-05-07 17:21:38 +00:00
ia64 Style fixes. 2003-05-04 22:13:04 +00:00
isa Only use the pc bios stuff on i386's. I think this might even be unused 2003-05-01 04:23:15 +00:00
isofs/cd9660
kern Clean up locking for the MAC Framework: 2003-05-07 17:49:24 +00:00
libkern Deprecate machine/limits.h in favor of new sys/limits.h. 2003-04-29 13:36:06 +00:00
modules Add RealTek RTL8150 USB to fast Ethernet controller driver. 2003-05-03 10:16:56 +00:00
net Define a link layer MIB for ATM. Most fields of this MIB are needed by 2003-05-05 16:35:52 +00:00
netatalk - Use if_broadcastaddr from struct ifnet rather than relying on 2003-03-21 17:53:16 +00:00
netatm Use __FBSDID rather than rcsid[]. 2003-04-03 21:36:33 +00:00
netgraph Deprecate machine/limits.h in favor of new sys/limits.h. 2003-04-29 13:36:06 +00:00
netinet Correct a bug introduced with reduced TCP state handling; make 2003-05-07 05:26:27 +00:00
netinet6 Add definitions for IN6ADDR_LINKLOCAL_ALLMDNS_INIT and INADDR_ALLMDNS_GROUP. 2003-04-29 22:03:46 +00:00
netipsec Introduce an M_ASSERTPKTHDR() macro which performs the very common task 2003-04-08 14:25:47 +00:00
netipx
netkey Introduce an M_ASSERTPKTHDR() macro which performs the very common task 2003-04-08 14:25:47 +00:00
netnatm Introduce an M_ASSERTPKTHDR() macro which performs the very common task 2003-04-08 14:25:47 +00:00
netncp - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with 2003-03-31 22:49:17 +00:00
netsmb - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with 2003-03-31 22:49:17 +00:00
nfs
nfsclient Instead of recording the Unix time in a process when it starts, record the 2003-05-01 16:59:23 +00:00
nfsserver - Acquire the vm_object's lock when performing vm_object_page_clean(). 2003-04-24 04:31:25 +00:00
opencrypto
pc98 Deprecate machine/limits.h in favor of new sys/limits.h. 2003-04-29 13:36:06 +00:00
pccard 1. Allow drivers to query CIS strings from OLDCARD. 2003-04-23 23:39:21 +00:00
pci Don't call timeout() in sis_tick(), this is done earlier by mii_tick(), and it 2003-05-06 02:00:01 +00:00
posix4
powerpc Things run thru the C preprocessor must use C-style comments. 2003-05-05 10:01:10 +00:00
rpc
security Clean up locking for the MAC Framework: 2003-05-07 17:49:24 +00:00
sparc64 Style fixes. 2003-05-04 22:13:04 +00:00
sys #include <sys/resource.h> to limit ports damage. 2003-05-07 15:26:43 +00:00
tools MFp4: 2003-03-28 06:43:50 +00:00
ufs Lock the vm_object on entry to vm_object_vndeallocate(). 2003-05-03 20:28:26 +00:00
vm Lock the vm_object when performing vm_pager_deallocate(). 2003-05-06 02:45:28 +00:00
Makefile