summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2001-04-03 03:15:11 +0000
committeralfred <alfred@FreeBSD.org>2001-04-03 03:15:11 +0000
commitfbfd25aee922032513e4e04dfb16464be003a1b6 (patch)
tree638eb098770deb945d19267471aaaf93a8c79467 /sys/ufs
parentdbc07c9dc314db452920a2cab9803a4b8ae07f08 (diff)
downloadFreeBSD-src-fbfd25aee922032513e4e04dfb16464be003a1b6.zip
FreeBSD-src-fbfd25aee922032513e4e04dfb16464be003a1b6.tar.gz
Use only one mutex for the entire mbuf subsystem.
Don't use atomic operations for the stats updating, instead protect the counts with the mbuf mutex. Most twiddling of the stats was done right before or after releasing a mutex. By doing this we reduce the number of locked ops needed as well as allow a sysctl to gain a consitant view of the entire stats structure. In the future... This will allow us to chain common mbuf operations that would normally need to aquire/release 2 or 3 of the locks to build an mbuf with a cluster or external data attached into a single op requiring only one lock. Simplify the per-cpu locks that are planned. There's also some if (1) code that should check if the "how" operation specifies blocking/non-blocking behavior, we _could_ make it so that we hold onto the mutex through calls into kmem_alloc when non-blocking requests are made, but for safety reasons we currently drop and reaquire the mutex around the calls. Also, note that calling kmem_alloc is rare and only happens during a shortage so drop/re-getting the mutex will not be a common occurance. Remove some #define's that seemed to obfuscate the code to me. Remove an extranious comment. Remove an XXX, including mutex.h isn't a crime. Reviewed by: bmilekic
Diffstat (limited to 'sys/ufs')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud