kernel - Correct bug in malloc_type ks_memuse/ks_inuse management
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 19 Sep 2010 16:43:09 +0000 (09:43 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 19 Sep 2010 16:43:09 +0000 (09:43 -0700)
commit28135cc28c6b3b52668ae0411eae94811f4e1437
tree01572dd1c47b68c031896ff5aaaadba316c92524
parentadcc77ef66e2dfae85c2980db6b22f4493c5489c
kernel - Correct bug in malloc_type ks_memuse/ks_inuse management

* The new kfree() was improperly adjust ks_memuse/ks_inuse for the wrong
  cpu, leading to MP races which could cause the memory statistics to go
  negative and trigger a panic.

* When calculating loosememuse it is possible to race another cpu and
  come up with an incorrect value.  The race itself is ok, loosememuse
  is not supposed to be 100% deterministic, but even so do not allow
  the value to underflow or we will wind up asserting.
sys/kern/kern_slaballoc.c