freebsd-nq/sys
Bosko Milekic 099a0e588c Bring in mbuma to replace mballoc.
mbuma is an Mbuf & Cluster allocator built on top of a number of
extensions to the UMA framework, all included herein.

Extensions to UMA worth noting:
  - Better layering between slab <-> zone caches; introduce
    Keg structure which splits off slab cache away from the
    zone structure and allows multiple zones to be stacked
    on top of a single Keg (single type of slab cache);
    perhaps we should look into defining a subset API on
    top of the Keg for special use by malloc(9),
    for example.
  - UMA_ZONE_REFCNT zones can now be added, and reference
    counters automagically allocated for them within the end
    of the associated slab structures.  uma_find_refcnt()
    does a kextract to fetch the slab struct reference from
    the underlying page, and lookup the corresponding refcnt.

mbuma things worth noting:
  - integrates mbuf & cluster allocations with extended UMA
    and provides caches for commonly-allocated items; defines
    several zones (two primary, one secondary) and two kegs.
  - change up certain code paths that always used to do:
    m_get() + m_clget() to instead just use m_getcl() and
    try to take advantage of the newly defined secondary
    Packet zone.
  - netstat(1) and systat(1) quickly hacked up to do basic
    stat reporting but additional stats work needs to be
    done once some other details within UMA have been taken
    care of and it becomes clearer to how stats will work
    within the modified framework.

From the user perspective, one implication is that the
NMBCLUSTERS compile-time option is no longer used.  The
maximum number of clusters is still capped off according
to maxusers, but it can be made unlimited by setting
the kern.ipc.nmbclusters boot-time tunable to zero.
Work should be done to write an appropriate sysctl
handler allowing dynamic tuning of kern.ipc.nmbclusters
at runtime.

Additional things worth noting/known issues (READ):
   - One report of 'ips' (ServeRAID) driver acting really
     slow in conjunction with mbuma.  Need more data.
     Latest report is that ips is equally sucking with
     and without mbuma.
   - Giant leak in NFS code sometimes occurs, can't
     reproduce but currently analyzing; brueffer is
     able to reproduce but THIS IS NOT an mbuma-specific
     problem and currently occurs even WITHOUT mbuma.
   - Issues in network locking: there is at least one
     code path in the rip code where one or more locks
     are acquired and we end up in m_prepend() with
     M_WAITOK, which causes WITNESS to whine from within
     UMA.  Current temporary solution: force all UMA
     allocations to be M_NOWAIT from within UMA for now
     to avoid deadlocks unless WITNESS is defined and we
     can determine with certainty that we're not holding
     any locks when we're M_WAITOK.
   - I've seen at least one weird socketbuffer empty-but-
     mbuf-still-attached panic.  I don't believe this
     to be related to mbuma but please keep your eyes
     open, turn on debugging, and capture crash dumps.

This change removes more code than it adds.

A paper is available detailing the change and considering
various performance issues, it was presented at BSDCan2004:
http://www.unixdaemons.com/~bmilekic/netbuf_bmilekic.pdf
Please read the paper for Future Work and implementation
details, as well as credits.

Testing and Debugging:
    rwatson,
    brueffer,
    Ketrien I. Saihr-Kesenchedra,
    ...
Reviewed by: Lots of people (for different parts)
2004-05-31 21:46:06 +00:00
..
alpha Retire cpu_sched_exit(); it is not used any more. 2004-05-26 12:09:39 +00:00
amd64 Add some missing <sys/module.h> includes which are masked by the 2004-05-30 17:57:46 +00:00
arm Retire cpu_sched_exit(); it is not used any more. 2004-05-26 12:09:39 +00:00
boot Use the correct location of the EBDA for searching for the RSDP. 2004-05-25 05:52:48 +00:00
cam Quirk for Neuros USB audio device. 2004-05-02 19:24:23 +00:00
coda add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
compat Fix build with ndisulator: Add prototype for my_strcasecmp(). 2004-05-29 22:34:08 +00:00
conf Bring in mbuma to replace mballoc. 2004-05-31 21:46:06 +00:00
contrib Add missing #include <sys/module.h> 2004-05-30 20:34:58 +00:00
crypto
ddb Fixed DDB_NOKLDSYM on amd64's: 2004-05-18 05:30:06 +00:00
dev Necessary modifications do get pcf working again for ISA. Tested with 2004-05-31 14:24:21 +00:00
fs add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
geom Zap a redundant NULL 2004-05-30 18:04:06 +00:00
gnu Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
i4b add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
i386 Bring in mbuma to replace mballoc. 2004-05-31 21:46:06 +00:00
ia64 Retire cpu_sched_exit(); it is not used any more. 2004-05-26 12:09:39 +00:00
isa add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
isofs/cd9660 Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
kern Bring in mbuma to replace mballoc. 2004-05-31 21:46:06 +00:00
libkern Import libkern arm specific bits. 2004-05-14 12:28:31 +00:00
modules add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
net add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
net80211 Add some missing <sys/module.h> includes which are masked by the 2004-05-30 17:57:46 +00:00
netatalk Remove redundant call to soisdisconnected() from ddp_abort(), as it 2004-05-05 03:34:37 +00:00
netatm These are changes to allow to use the Intel C/C++ compiler (lang/icc) 2004-03-12 21:45:33 +00:00
netgraph add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
netinet add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
netinet6 add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
netipsec use correct address for SADB_EXT_ADDRESS_DST in key_do_allocsa_policy 2004-05-03 05:15:53 +00:00
netipx Rename dup_sockaddr() to sodupsockaddr() for consistency with other 2004-03-01 03:14:23 +00:00
netkey
netnatm Rename dup_sockaddr() to sodupsockaddr() for consistency with other 2004-03-01 03:14:23 +00:00
netncp add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
netsmb add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
nfs Remove advertising clause from University of California Regent's 2004-04-07 05:00:01 +00:00
nfs4client Remove advertising clause from University of California Regent's 2004-04-07 20:46:16 +00:00
nfsclient Make vm_page's PG_ZERO flag immutable between the time of the page's 2004-05-06 05:03:23 +00:00
nfsserver Giant wasn't dropped here if we have to return EBUSY. This is bad. 2004-05-31 20:21:06 +00:00
opencrypto add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
pc98 Merged from sys/dev/fdc/fdc.c revision 1.272. 2004-05-30 13:56:06 +00:00
pccard Convert callers to the new bus_alloc_resource_any(9) API. 2004-03-17 17:50:55 +00:00
pci Add missing <sys/module.h> includes 2004-05-30 20:00:41 +00:00
posix4
powerpc Retire cpu_sched_exit(); it is not used any more. 2004-05-26 12:09:39 +00:00
rpc Remove advertising clause from University of California Regent's 2004-04-07 05:00:01 +00:00
security add missing #include <sys/module.h> 2004-05-30 20:27:19 +00:00
sparc64 Bring in mbuma to replace mballoc. 2004-05-31 21:46:06 +00:00
sys Bring in mbuma to replace mballoc. 2004-05-31 21:46:06 +00:00
tools devlist2h.awk is too generic a name for what it does. It really 2004-05-26 00:19:39 +00:00
ufs - Fix typo 2004-05-31 16:55:12 +00:00
vm Bring in mbuma to replace mballoc. 2004-05-31 21:46:06 +00:00
Makefile Try harder not to compile anything in sys/boot for arm. 2004-05-16 00:19:12 +00:00