diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-09-08 21:28:37 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-09-08 21:28:37 +0000 |
commit | c4036ada496263bb264b768ce90a658ae6bf9afd (patch) | |
tree | 76c4f46247d0639da7787c1eb6ad3a208b4eaee5 /sys/kern | |
parent | 5eb963fb56771b0261b6e4f5b34955c3a62f9edc (diff) |
Give the pool page allocator backends more sensible names. We now have:
* pool_allocator_single: single page allocator, always interrupt safe
* pool_allocator_multi: multi-page allocator, interrupt safe
* pool_allocator_multi_ni: multi-page allocator, not interrupt-safe
ok deraadt@, dlg@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_pool.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c index df542953c20..b9325b40d01 100644 --- a/sys/kern/subr_pool.c +++ b/sys/kern/subr_pool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_pool.c,v 1.191 2015/09/08 13:37:21 kettenis Exp $ */ +/* $OpenBSD: subr_pool.c,v 1.192 2015/09/08 21:28:36 kettenis Exp $ */ /* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */ /*- @@ -127,28 +127,27 @@ void *pool_page_alloc(struct pool *, int, int *); void pool_page_free(struct pool *, void *); /* - * safe for interrupts, name preserved for compat this is the default - * allocator + * safe for interrupts; this is the default allocator */ -struct pool_allocator pool_allocator_nointr = { +struct pool_allocator pool_allocator_single = { pool_page_alloc, pool_page_free }; -void *pool_large_alloc(struct pool *, int, int *); -void pool_large_free(struct pool *, void *); +void *pool_multi_alloc(struct pool *, int, int *); +void pool_multi_free(struct pool *, void *); -struct pool_allocator pool_allocator_large = { - pool_large_alloc, - pool_large_free +struct pool_allocator pool_allocator_multi = { + pool_multi_alloc, + pool_multi_free }; -void *pool_large_alloc_ni(struct pool *, int, int *); -void pool_large_free_ni(struct pool *, void *); +void *pool_multi_alloc_ni(struct pool *, int, int *); +void pool_multi_free_ni(struct pool *, void *); -struct pool_allocator pool_allocator_large_ni = { - pool_large_alloc_ni, - pool_large_free_ni +struct pool_allocator pool_allocator_multi_ni = { + pool_multi_alloc_ni, + pool_multi_free_ni }; #ifdef DDB @@ -243,9 +242,9 @@ pool_init(struct pool *pp, size_t size, u_int align, u_int ioff, int flags, if (pgsize > PAGE_SIZE) { palloc = ISSET(flags, PR_WAITOK) ? - &pool_allocator_large_ni : &pool_allocator_large; + &pool_allocator_multi_ni : &pool_allocator_multi; } else - palloc = &pool_allocator_nointr; + palloc = &pool_allocator_single; } else pgsize = palloc->pa_pagesz ? palloc->pa_pagesz : PAGE_SIZE; @@ -1445,7 +1444,7 @@ pool_page_free(struct pool *pp, void *v) } void * -pool_large_alloc(struct pool *pp, int flags, int *slowdown) +pool_multi_alloc(struct pool *pp, int flags, int *slowdown) { struct kmem_va_mode kv = kv_intrsafe; struct kmem_dyn_mode kd = KMEM_DYN_INITIALIZER; @@ -1468,7 +1467,7 @@ pool_large_alloc(struct pool *pp, int flags, int *slowdown) } void -pool_large_free(struct pool *pp, void *v) +pool_multi_free(struct pool *pp, void *v) { struct kmem_va_mode kv = kv_intrsafe; int s; @@ -1484,7 +1483,7 @@ pool_large_free(struct pool *pp, void *v) } void * -pool_large_alloc_ni(struct pool *pp, int flags, int *slowdown) +pool_multi_alloc_ni(struct pool *pp, int flags, int *slowdown) { struct kmem_va_mode kv = kv_any; struct kmem_dyn_mode kd = KMEM_DYN_INITIALIZER; @@ -1504,7 +1503,7 @@ pool_large_alloc_ni(struct pool *pp, int flags, int *slowdown) } void -pool_large_free_ni(struct pool *pp, void *v) +pool_multi_free_ni(struct pool *pp, void *v) { struct kmem_va_mode kv = kv_any; |