freebsd-skq/usr.bin/systat
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
..
cmds.c When we close a display, mark it as not-initialized so that we will 2003-01-04 21:58:25 +00:00
cmdtab.c Add ip6 and icmp6 displays to systat. 2003-08-01 20:28:20 +00:00
convtbl.c Fix the easy warnings: 2004-03-09 11:57:28 +00:00
convtbl.h Fix the easy warnings: 2004-03-09 11:57:28 +00:00
devs.c When a numeric field overflows its width, try formatting the number in 2003-10-20 20:13:50 +00:00
devs.h
extern.h Fix the easy warnings: 2004-03-09 11:57:28 +00:00
fetch.c
icmp6.c Add ip6 and icmp6 displays to systat. 2003-08-01 20:28:20 +00:00
icmp.c
ifcmds.c Fix the easy warnings: 2004-03-09 11:57:28 +00:00
ifstat.c Fix the easy warnings: 2004-03-09 11:57:28 +00:00
iostat.c Copy cur's snap_time to last when refreshing statistics. Fixes problem 2003-11-01 02:06:02 +00:00
ip6.c Add ip6 and icmp6 displays to systat. 2003-08-01 20:28:20 +00:00
ip.c
keyboard.c
main.c Fix the easy warnings: 2004-03-09 11:57:28 +00:00
Makefile Put libdevstat before libkvm, because the former depends on the latter. 2004-02-04 10:20:43 +00:00
mbufs.c Bring in mbuma to replace mballoc. 2004-05-31 21:46:06 +00:00
mode.c
mode.h
netcmds.c
netstat.c Make systat -net aware of compressed time_wait sockets. 2003-12-24 08:54:53 +00:00
pigs.c Include <sys/proc.h> for the definition of PS_INMEM instead of 2004-04-14 09:01:56 +00:00
swap.c
systat.1 Add ip6 and icmp6 displays to systat. 2003-08-01 20:28:20 +00:00
systat.h
tcp.c Demangled vendor ids. Fixed misplaced FreeBSD id. 2004-02-25 13:26:53 +00:00
vmstat.c Use 'k' as suffix for Kilo 2003-10-24 21:23:47 +00:00