opnsense-src/sys
Alfred Perlstein 5ea487f34d 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
2001-04-03 03:15:11 +00:00
..
alpha Recognize a few newer cpus (pca57, ev67 & ev68) and update systypes to 2001-03-30 22:04:08 +00:00
amd64 Convert the allproc and proctree locks from lockmgr locks to sx locks. 2001-03-28 11:52:56 +00:00
arm/include Correct disordering which is corresponding to bde's fix to 2001-02-17 14:51:11 +00:00
boot MAN[1-9] -> MAN. 2001-03-27 11:59:22 +00:00
cam comment typo: subsytem -> subsystem 2001-03-31 04:34:15 +00:00
coda Send the remains (such as I have located) of "block major numbers" to 2001-03-26 12:41:29 +00:00
compat Add linux_sched_get_priority_max() and linux_sched_get_priority_min(): The 2001-04-01 06:37:40 +00:00
compile
conf Add support for MODULES_OVERRIDE. This is a list of modules to build 2001-04-02 08:52:05 +00:00
contrib/dev Send the remains (such as I have located) of "block major numbers" to 2001-03-26 12:41:29 +00:00
crypto Kernel crypto need binary key material, not symbolic ascii. 2001-03-10 13:02:58 +00:00
ddb Catch up to header include changes: 2001-03-28 09:17:56 +00:00
dev Fix probing on the alpha. It still causes the alpha to panic during 2001-04-03 00:26:34 +00:00
fs - Various style fixes. 2001-03-29 18:10:46 +00:00
geom fix a number of printf format string warnings inside DEBUG ifdefs 2001-03-29 15:05:08 +00:00
gnu Fixes to track snapshot copy-on-write checking in the specinfo 2001-03-07 07:09:55 +00:00
i4b Send the remains (such as I have located) of "block major numbers" to 2001-03-26 12:41:29 +00:00
i386 Regen after adding linux_sched_get_priority_max() and 2001-04-01 06:43:09 +00:00
ia64 Reduce the emasculation of bounds_check_with_label() by one line, so we 2001-03-29 20:26:12 +00:00
isa Catch up to header include changes: 2001-03-28 09:17:56 +00:00
isofs/cd9660 Add missed MODULE_VERSION() call, so loading of unicode conversion routine 2001-03-11 15:28:42 +00:00
kern Use only one mutex for the entire mbuf subsystem. 2001-04-03 03:15:11 +00:00
libkern Rewrite of the CAM error recovery code. 2001-03-27 05:45:52 +00:00
miscfs - Various style fixes. 2001-03-29 18:10:46 +00:00
modules Add support for MODULES_OVERRIDE. This is a list of modules to build 2001-04-02 08:52:05 +00:00
msdosfs Grab the process lock while calling psignal and before calling psignal. 2001-03-07 03:37:06 +00:00
net Allow MOD_UNLOADs of if_tun, and handle event handler registration 2001-04-03 01:22:15 +00:00
netatalk Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
netatm Silence some warnings 2001-03-20 10:42:49 +00:00
netgraph Catch up to header include changes: 2001-03-28 09:17:56 +00:00
netinet MFC candidate. 2001-03-28 14:13:19 +00:00
netinet6 Make per-address input packet counts for lo0 work. 2001-03-28 19:47:52 +00:00
netipx Another round of the <sys/queue.h> FOREACH transmogriffer. 2001-02-04 16:08:18 +00:00
netkey fixed possibility of panic at key_acquire(). 2001-01-14 17:25:08 +00:00
netnatm Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
netncp Move bindery authentication ncps to ncp_ncp.c file. ncp_login.c will stay 2001-03-22 10:38:16 +00:00
netns * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT. 2000-12-21 21:44:31 +00:00
nfs Use the same API as the example code. 2001-03-20 02:10:18 +00:00
nfsclient Use the same API as the example code. 2001-03-20 02:10:18 +00:00
nfsserver Use a generic implementation of the Fowler/Noll/Vo hash (FNV hash). 2001-03-17 09:31:06 +00:00
ntfs Reviewed by: jlemon 2001-03-01 21:00:17 +00:00
nwfs Add dependancy on libmchain module. 2001-03-22 06:51:53 +00:00
pc98 Correct typo. 2001-04-01 07:15:16 +00:00
pccard Send the remains (such as I have located) of "block major numbers" to 2001-03-26 12:41:29 +00:00
pci Send the remains (such as I have located) of "block major numbers" to 2001-03-26 12:41:29 +00:00
posix4 Lock need_resched with sched_lock. 2001-02-22 13:46:09 +00:00
powerpc Rework the witness code to work with sx locks as well as mutexes. 2001-03-28 09:03:24 +00:00
rpc Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and 2001-03-19 12:50:13 +00:00
svr4 This patchset fixes a large number of file descriptor race conditions. 2000-11-18 21:01:04 +00:00
sys Use only one mutex for the entire mbuf subsystem. 2001-04-03 03:15:11 +00:00
tools replace calls to non-existant bail() subroutine with calls to 2001-03-23 11:48:50 +00:00
ufs o Correct an ACL implementation bug that could result in a system panic 2001-04-02 01:02:32 +00:00
vm Convert the allproc and proctree locks from lockmgr locks to sx locks. 2001-03-28 11:52:56 +00:00
Makefile I should know better than to touch this without testing a 'make release' 2000-08-24 18:53:09 +00:00