cvs commit: src/sys/conf files src/sys/i386/i386 vm_machdep.c src/sys/kern kern_malloc.c kern_mbuf.c subr_mbuf.c uipc_mbuf.c uipc_mbuf2.c uipc_socket.c uipc_socket2.c uipc_syscalls.c...

Bosko Milekic bmilekic at FreeBSD.org
Mon May 31 14:46:10 PDT 2004


bmilekic    2004/05/31 14:46:06 PDT

  FreeBSD src repository

  Modified files:
    sys/conf             files 
    sys/i386/i386        vm_machdep.c 
    sys/kern             kern_malloc.c uipc_mbuf.c uipc_mbuf2.c 
                         uipc_socket.c uipc_socket2.c 
                         uipc_syscalls.c 
    sys/sparc64/sparc64  vm_machdep.c 
    sys/sys              mbuf.h 
    sys/vm               uma.h uma_core.c uma_dbg.c uma_int.h 
                         vm_kern.c 
    usr.bin/netstat      main.c mbuf.c netstat.1 netstat.h 
    usr.bin/systat       mbufs.c 
  Added files:
    sys/kern             kern_mbuf.c 
  Removed files:
    sys/kern             subr_mbuf.c 
  Log:
  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)
  
  Revision  Changes    Path
  1.899     +1 -1      src/sys/conf/files
  1.239     +7 -0      src/sys/i386/i386/vm_machdep.c
  1.133     +10 -17    src/sys/kern/kern_malloc.c
  1.1       +385 -0    src/sys/kern/kern_mbuf.c (new)
  1.60      +0 -1548   src/sys/kern/subr_mbuf.c (dead)
  1.130     +197 -38   src/sys/kern/uipc_mbuf.c
  1.25      +17 -23    src/sys/kern/uipc_mbuf2.c
  1.171     +55 -38    src/sys/kern/uipc_socket.c
  1.125     +5 -8      src/sys/kern/uipc_socket2.c
  1.184     +16 -0     src/sys/kern/uipc_syscalls.c
  1.66      +7 -0      src/sys/sparc64/sparc64/vm_machdep.c
  1.148     +144 -61   src/sys/sys/mbuf.h
  1.17      +75 -3     src/sys/vm/uma.h
  1.94      +619 -273  src/sys/vm/uma_core.c
  1.14      +20 -14    src/sys/vm/uma_dbg.c
  1.24      +119 -56   src/sys/vm/uma_int.h
  1.117     +0 -10     src/sys/vm/vm_kern.c
  1.68      +0 -8      src/usr.bin/netstat/main.c
  1.41      +9 -187    src/usr.bin/netstat/mbuf.c
  1.50      +0 -4      src/usr.bin/netstat/netstat.1
  1.40      +0 -1      src/usr.bin/netstat/netstat.h
  1.17      +12 -41    src/usr.bin/systat/mbufs.c


More information about the cvs-src mailing list