Index: kern/subr_pool.c =================================================================== RCS file: /cvsroot/src/sys/kern/subr_pool.c,v retrieving revision 1.275 diff -p -u -r1.275 subr_pool.c --- kern/subr_pool.c 19 Dec 2020 23:38:21 -0000 1.275 +++ kern/subr_pool.c 23 Feb 2021 05:30:54 -0000 @@ -3096,9 +3096,14 @@ pool_redzone_init(struct pool *pp, size_ /* * No space in the natural padding; check if we can extend a * bit the size of the pool. + * + * Avoid using redzone for allocations half of a page or larger. + * For pagesize items, we'd waste a whole new page (could be + * unmapped?), and for half pagesize items, approximately half + * the space is lost (eg, 4K pages, you get one 2K allocation.) */ nsz = roundup(pp->pr_size + redzsz, pp->pr_align); - if (nsz <= pp->pr_alloc->pa_pagesz) { + if (nsz <= (pp->pr_alloc->pa_pagesz / 2)) { /* Ok, we can */ pp->pr_size = nsz; pp->pr_reqsize_with_redzone = requested_size + redzsz;