freebsd-nq/usr.bin/systat
Bosko Milekic 08442f8a82 Introduce numerous SMP friendly changes to the mbuf allocator. Namely,
introduce a modified allocation mechanism for mbufs and mbuf clusters; one
which can scale under SMP and which offers the possibility of resource
reclamation to be implemented in the future. Notable advantages:

 o Reduce contention for SMP by offering per-CPU pools and locks.
 o Better use of data cache due to per-CPU pools.
 o Much less code cache pollution due to excessively large allocation macros.
 o Framework for `grouping' objects from same page together so as to be able
   to possibly free wired-down pages back to the system if they are no longer
   needed by the network stacks.

 Additional things changed with this addition:

  - Moved some mbuf specific declarations and initializations from
    sys/conf/param.c into mbuf-specific code where they belong.
  - m_getclr() has been renamed to m_get_clrd() because the old name is really
    confusing. m_getclr() HAS been preserved though and is defined to the new
    name. No tree sweep has been done "to change the interface," as the old
    name will continue to be supported and is not depracated. The change was
    merely done because m_getclr() sounds too much like "m_get a cluster."
  - TEMPORARILY disabled mbtypes statistics displaying in netstat(1) and
    systat(1) (see TODO below).
  - Fixed systat(1) to display number of "free mbufs" based on new per-CPU
    stat structures.
  - Fixed netstat(1) to display new per-CPU stats based on sysctl-exported
    per-CPU stat structures. All infos are fetched via sysctl.

 TODO (in order of priority):

  - Re-enable mbtypes statistics in both netstat(1) and systat(1) after
    introducing an SMP friendly way to collect the mbtypes stats under the
    already introduced per-CPU locks (i.e. hopefully don't use atomic() - it
    seems too costly for a mere stat update, especially when other locks are
    already present).
  - Optionally have systat(1) display not only "total free mbufs" but also
    "total free mbufs per CPU pool."
  - Fix minor length-fetching issues in netstat(1) related to recently
    re-enabled option to read mbuf stats from a core file.
  - Move reference counters at least for mbuf clusters into an unused portion
    of the cluster itself, to save space and need to allocate a counter.
  - Look into introducing resource freeing possibly from a kproc.

Reviewed by (in parts): jlemon, jake, silby, terry
Tested by: jlemon (Intel & Alpha), mjacob (Intel & Alpha)
Preliminary performance measurements: jlemon (and me, obviously)
URL: http://people.freebsd.org/~bmilekic/mb_alloc/
2001-06-22 06:35:32 +00:00
..
cmds.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
cmdtab.c Display -tcp w/o load average so that all statistics fits on a 80x25 screen. 2001-05-31 07:14:52 +00:00
devs.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
devs.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
extern.h Mark error() as __printflike() and fix a non-exploitable format string 2001-05-25 23:15:05 +00:00
fetch.c Replace a use of the hw.nintr sysctl as it has just gone away, cast 2001-06-01 13:29:19 +00:00
icmp.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
iostat.c Get rid of setgid kmem for systat, and while being there, fix some bugs 2001-03-23 03:58:25 +00:00
ip.c Count and show incoming UDP datagrams with no checksum. 2001-03-13 13:26:06 +00:00
keyboard.c
main.c Fix the error buffer passed to kvm_openfiles to have a length of 2001-05-25 23:10:27 +00:00
Makefile Removed -I${.CURDIR}/.../sys from CFLAGS. 2001-05-18 13:41:42 +00:00
mbufs.c Introduce numerous SMP friendly changes to the mbuf allocator. Namely, 2001-06-22 06:35:32 +00:00
mode.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
mode.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
netcmds.c Get rid of setgid kmem for systat, and while being there, fix some bugs 2001-03-23 03:58:25 +00:00
netstat.c Get rid of setgid kmem for systat, and while being there, fix some bugs 2001-03-23 03:58:25 +00:00
pigs.c Compensate for header dethreading. 2001-05-01 08:46:02 +00:00
swap.c Mark error() as __printflike() and fix a non-exploitable format string 2001-05-25 23:15:05 +00:00
systat.1 mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
systat.h Replace a use of the hw.nintr sysctl as it has just gone away, cast 2001-06-01 13:29:19 +00:00
tcp.c Display -tcp w/o load average so that all statistics fits on a 80x25 screen. 2001-05-31 07:14:52 +00:00
vmstat.c Replace a use of the hw.nintr sysctl as it has just gone away, cast 2001-06-01 13:29:19 +00:00