kernel - Implement type-stable EXIS semantics for kfree_obj() - step 2
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 22 Mar 2021 05:17:43 +0000 (22:17 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 22 Mar 2021 05:17:43 +0000 (22:17 -0700)
commit56c9ecc85b5c36e00f04a27a5f282a5bc4f5f006
tree7e08f1e6ffca48c46cc67b021f91ab71623a360c
parent45270dd1e4c4f5fc2f0035f791edef2327aefec7
kernel - Implement type-stable EXIS semantics for kfree_obj() - step 2

* Put an exislock_t in the kmalloc_slab structure and issue
  exis_terminate() upon entering the slab on the full list.

* Do not return a full slab to the gcache until it becomes
  exis_freeable().

  This implements type-stable operation for objects allocated via the
  kmalloc_obj() mechanism.  Kernel code operating inside an
  exis_hold() / exis_drop() sequence is guaranteed type-stability.

* Note that destroying a kmalloc_obj zone shreds any related slabs
  regardless of their EXIS state.  However, this is not a problem
  for the zones we care about because they are global zones that
  will never be destroyed.
sys/kern/kern_kmalloc.c
sys/kern/kern_slaballoc.c
sys/sys/_malloc.h