From 3112ae76449ae0931d207603f14b083627bd731d Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Fri, 15 Mar 2013 10:15:07 +0000 Subject: [PATCH] Make m_get2() never use clusters that are bigger than PAGE_SIZE. Requested by: andre, jhb Sponsored by: Nginx, Inc. --- sys/kern/uipc_mbuf.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index e962670c08aa..e2b008a83209 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -92,7 +92,6 @@ m_get2(int size, int how, short type, int flags) { struct mb_args args; struct mbuf *m, *n; - uma_zone_t zone; args.flags = flags; args.type = type; @@ -101,24 +100,15 @@ m_get2(int size, int how, short type, int flags) return (uma_zalloc_arg(zone_mbuf, &args, how)); if (size <= MCLBYTES) return (uma_zalloc_arg(zone_pack, &args, how)); - if (size > MJUM16BYTES) + + if (size > MJUMPAGESIZE) return (NULL); m = uma_zalloc_arg(zone_mbuf, &args, how); if (m == NULL) return (NULL); -#if MJUMPAGESIZE != MCLBYTES - if (size <= MJUMPAGESIZE) - zone = zone_jumbop; - else -#endif - if (size <= MJUM9BYTES) - zone = zone_jumbo9; - else - zone = zone_jumbo16; - - n = uma_zalloc_arg(zone, m, how); + n = uma_zalloc_arg(zone_jumbop, m, how); if (n == NULL) { uma_zfree(zone_mbuf, m); return (NULL);