summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mbuf.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2008-04-04 18:41:12 +0000
committeralc <alc@FreeBSD.org>2008-04-04 18:41:12 +0000
commit067dba5f97f5aec73b22ae390047bd858ca388e1 (patch)
treeda7f6a5b63eaf179d69327307f8b69f29e18aaf3 /sys/kern/kern_mbuf.c
parent8353654e9666e7668d486e7e2a72051f06fcc9d3 (diff)
downloadFreeBSD-src-067dba5f97f5aec73b22ae390047bd858ca388e1.zip
FreeBSD-src-067dba5f97f5aec73b22ae390047bd858ca388e1.tar.gz
Reintroduce UMA_SLAB_KMAP; however, change its spelling to
UMA_SLAB_KERNEL for consistency with its sibling UMA_SLAB_KMEM. (UMA_SLAB_KMAP met its original demise in revision 1.30 of vm/uma_core.c.) UMA_SLAB_KERNEL is now required by the jumbo frame allocators. Without it, UMA cannot correctly return pages from the jumbo frame zones to the VM system because it resets the pages' object field to NULL instead of the kernel object. In more detail, the jumbo frame zones are created with the option UMA_ZONE_REFCNT. This causes UMA to overwrite the pages' object field with the address of the slab. However, when UMA wants to release these pages, it doesn't know how to restore the object field, so it sets it to NULL. This change teaches UMA how to reset the object field to the kernel object. Crashes reported by: kris Fix tested by: kris Fix discussed with: jeff MFC after: 6 weeks
Diffstat (limited to 'sys/kern/kern_mbuf.c')
-rw-r--r--sys/kern/kern_mbuf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c
index 4cdb12e..7846be8 100644
--- a/sys/kern/kern_mbuf.c
+++ b/sys/kern/kern_mbuf.c
@@ -352,7 +352,8 @@ static void *
mbuf_jumbo_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait)
{
- *flags = UMA_SLAB_PRIV;
+ /* Inform UMA that this allocator uses kernel_map/object. */
+ *flags = UMA_SLAB_KERNEL;
return (contigmalloc(bytes, M_JUMBOFRAME, wait, (vm_paddr_t)0,
~(vm_paddr_t)0, 1, 0));
}
OpenPOWER on IntegriCloud