git: kernel - Fix lwbuf leak for i386

Matthew Dillon dillon at
Tue Mar 30 23:51:50 PDT 2010

commit 8d79eb09eb976887c3548dee6e130560cf72c854
Author: Matthew Dillon <dillon at>
Date:   Tue Mar 30 23:45:52 2010 -0700

    kernel - Fix lwbuf leak for i386
    * lwbufs were not being freed back to the originating cpu, creating a
      situation where an infinite number of lwbufs could be allocated.
    * Refactor the lwbuf code for i386.  Track the cpu in the lwbuf, remove
      lwbuf_free_kvp, track the number of lwbufs on the free list for each
      Free a lwbuf back to the cpu it was originally created on.
      Destroy lwbufs and related kmem if the number of free lwbufs on a cpu
      exceeds 256.
    * This is a temporary fix until the i386 code can be adjusted to use the
      objcache again.

Summary of changes:
 sys/cpu/i386/include/lwbuf.h           |   13 ++--
 sys/cpu/i386/misc/lwbuf.c              |  110 ++++++++++++++------------------
 sys/platform/pc32/include/globaldata.h |    3 +-
 3 files changed, 56 insertions(+), 70 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list