kernel - Fix lwbuf leak for i386
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 31 Mar 2010 06:45:52 +0000 (23:45 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 31 Mar 2010 06:45:52 +0000 (23:45 -0700)
commit8d79eb09eb976887c3548dee6e130560cf72c854
tree6122325ef3440b4d85e3cc0e105147c4d068bbca
parenta2c4794c977b4a177da2d50ec7d1cb87dde2caf8
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
  cpu.

  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.
sys/cpu/i386/include/lwbuf.h
sys/cpu/i386/misc/lwbuf.c
sys/platform/pc32/include/globaldata.h