if we're able to use large page allocators, try and place at least
authordlg <dlg@openbsd.org>
Mon, 22 Dec 2014 00:33:40 +0000 (00:33 +0000)
committerdlg <dlg@openbsd.org>
Mon, 22 Dec 2014 00:33:40 +0000 (00:33 +0000)
8 items on a page. this reduces the number of allocator operations
we have to do per item on large items.

ok tedu@

sys/kern/subr_pool.c

index d8866a5..c98db82 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: subr_pool.c,v 1.172 2014/12/19 02:49:07 dlg Exp $     */
+/*     $OpenBSD: subr_pool.c,v 1.173 2014/12/22 00:33:40 dlg Exp $     */
 /*     $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $       */
 
 /*-
@@ -232,7 +232,7 @@ pool_init(struct pool *pp, size_t size, u_int align, u_int ioff, int flags,
        size = roundup(size, align);
 
        if (palloc == NULL) {
-               while (size > pgsize)
+               while (size * 8 > pgsize)
                        pgsize <<= 1;
 
                if (pgsize > PAGE_SIZE) {