summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-05-07 17:49:24 +0000
committerrwatson <rwatson@FreeBSD.org>2003-05-07 17:49:24 +0000
commitcdd2c23d207148dab7b37c63cb67b8aa152f83fe (patch)
tree7989b3e074594250f71a07750d37984cd261497c /lib
parent166330230a2277d4ff5ff2f7f1d0977d1af26ecb (diff)
downloadFreeBSD-src-cdd2c23d207148dab7b37c63cb67b8aa152f83fe.zip
FreeBSD-src-cdd2c23d207148dab7b37c63cb67b8aa152f83fe.tar.gz
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
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud