diff options
author | 2015-09-08 21:28:35 +0000 | |
---|---|---|
committer | 2015-09-08 21:28:35 +0000 | |
commit | e03893a65cbcacf2b8a8baf4135fa413a85c6ddd (patch) | |
tree | 8c012e1c9a2047a55eed62fa88f7005f6b52f96c | |
parent | Typo; Eric Lalonde (diff) | |
download | wireguard-openbsd-e03893a65cbcacf2b8a8baf4135fa413a85c6ddd.tar.xz wireguard-openbsd-e03893a65cbcacf2b8a8baf4135fa413a85c6ddd.zip |
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@
-rw-r--r-- | sys/arch/alpha/alpha/pmap.c | 4 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/pmap.c | 4 | ||||
-rw-r--r-- | sys/arch/arm/arm/pmap.c | 6 | ||||
-rw-r--r-- | sys/arch/arm/arm/pmap7.c | 6 | ||||
-rw-r--r-- | sys/arch/m88k/m88k/pmap.c | 4 | ||||
-rw-r--r-- | sys/arch/powerpc/powerpc/pmap.c | 4 | ||||
-rw-r--r-- | sys/arch/sh/sh/pmap.c | 4 | ||||
-rw-r--r-- | sys/arch/solbourne/solbourne/pmap.c | 4 | ||||
-rw-r--r-- | sys/kern/subr_pool.c | 39 | ||||
-rw-r--r-- | sys/sys/pool.h | 4 |
10 files changed, 39 insertions, 40 deletions
diff --git a/sys/arch/alpha/alpha/pmap.c b/sys/arch/alpha/alpha/pmap.c index fe5422e7e1a..7752e29b006 100644 --- a/sys/arch/alpha/alpha/pmap.c +++ b/sys/arch/alpha/alpha/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.78 2015/07/20 00:16:16 kettenis Exp $ */ +/* $OpenBSD: pmap.c,v 1.79 2015/09/08 21:28:35 kettenis Exp $ */ /* $NetBSD: pmap.c,v 1.154 2000/12/07 22:18:55 thorpej Exp $ */ /*- @@ -850,7 +850,7 @@ pmap_bootstrap(paddr_t ptaddr, u_int maxasn, u_long ncpuids) */ pmap_ncpuids = ncpuids; pool_init(&pmap_pmap_pool, PMAP_SIZEOF(pmap_ncpuids), 0, 0, 0, "pmappl", - &pool_allocator_nointr); + &pool_allocator_single); pool_init(&pmap_l1pt_pool, PAGE_SIZE, 0, 0, 0, "l1ptpl", &pmap_l1pt_allocator); pool_init(&pmap_pv_pool, sizeof(struct pv_entry), 0, 0, 0, "pvpl", diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c index 73cd3545ad1..286adbbff14 100644 --- a/sys/arch/amd64/amd64/pmap.c +++ b/sys/arch/amd64/amd64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.95 2015/09/03 18:47:36 kettenis Exp $ */ +/* $OpenBSD: pmap.c,v 1.96 2015/09/08 21:28:35 kettenis Exp $ */ /* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */ /* @@ -682,7 +682,7 @@ pmap_bootstrap(paddr_t first_avail, paddr_t max_pa) pool_init(&pmap_pmap_pool, sizeof(struct pmap), 0, 0, PR_WAITOK, "pmappl", NULL); pool_init(&pmap_pv_pool, sizeof(struct pv_entry), 0, 0, 0, "pvpl", - &pool_allocator_nointr); + &pool_allocator_single); pool_sethiwat(&pmap_pv_pool, 32 * 1024); pool_setipl(&pmap_pv_pool, IPL_VM); diff --git a/sys/arch/arm/arm/pmap.c b/sys/arch/arm/arm/pmap.c index daa4e23d098..d9a794cbeec 100644 --- a/sys/arch/arm/arm/pmap.c +++ b/sys/arch/arm/arm/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.55 2015/08/18 20:25:28 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.56 2015/09/08 21:28:36 kettenis Exp $ */ /* $NetBSD: pmap.c,v 1.147 2004/01/18 13:03:50 scw Exp $ */ /* @@ -3730,7 +3730,7 @@ pmap_bootstrap(pd_entry_t *kernel_l1pt, vaddr_t vstart, vaddr_t vend) * Initialize the pmap pool and cache */ pool_init(&pmap_pmap_pool, sizeof(struct pmap), 0, 0, 0, "pmappl", - &pool_allocator_nointr); + &pool_allocator_single); /* * Initialize the pv pool. @@ -3748,7 +3748,7 @@ pmap_bootstrap(pd_entry_t *kernel_l1pt, vaddr_t vstart, vaddr_t vend) * Initialise the L2 descriptor table pool and cache */ pool_init(&pmap_l2ptp_pool, L2_TABLE_SIZE_REAL, L2_TABLE_SIZE_REAL, 0, - 0, "l2ptppl", &pool_allocator_nointr); + 0, "l2ptppl", &pool_allocator_single); cpu_dcache_wbinv_all(); } diff --git a/sys/arch/arm/arm/pmap7.c b/sys/arch/arm/arm/pmap7.c index 5dff66eca97..ee771e92609 100644 --- a/sys/arch/arm/arm/pmap7.c +++ b/sys/arch/arm/arm/pmap7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap7.c,v 1.20 2015/02/02 09:29:53 mlarkin Exp $ */ +/* $OpenBSD: pmap7.c,v 1.21 2015/09/08 21:28:36 kettenis Exp $ */ /* $NetBSD: pmap.c,v 1.147 2004/01/18 13:03:50 scw Exp $ */ /* @@ -2791,7 +2791,7 @@ pmap_bootstrap(pd_entry_t *kernel_l1pt, vaddr_t vstart, vaddr_t vend) * Initialize the pmap pool. */ pool_init(&pmap_pmap_pool, sizeof(struct pmap), 0, 0, 0, "pmappl", - &pool_allocator_nointr); + &pool_allocator_single); /* * Initialize the pv pool. @@ -2809,7 +2809,7 @@ pmap_bootstrap(pd_entry_t *kernel_l1pt, vaddr_t vstart, vaddr_t vend) * Initialise the L2 descriptor table pool. */ pool_init(&pmap_l2ptp_pool, L2_TABLE_SIZE_REAL, L2_TABLE_SIZE_REAL, 0, - 0, "l2ptppl", &pool_allocator_nointr); + 0, "l2ptppl", &pool_allocator_single); cpu_dcache_wbinv_all(); cpu_sdcache_wbinv_all(); diff --git a/sys/arch/m88k/m88k/pmap.c b/sys/arch/m88k/m88k/pmap.c index ef69b823fee..57146bbdc00 100644 --- a/sys/arch/m88k/m88k/pmap.c +++ b/sys/arch/m88k/m88k/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.81 2015/07/29 17:54:35 miod Exp $ */ +/* $OpenBSD: pmap.c,v 1.82 2015/09/08 21:28:36 kettenis Exp $ */ /* * Copyright (c) 2001-2004, 2010, Miodrag Vallat. @@ -866,7 +866,7 @@ pmap_init(void) { DPRINTF(CD_INIT, ("pmap_init()\n")); pool_init(&pmappool, sizeof(struct pmap), 0, 0, 0, "pmappl", - &pool_allocator_nointr); + &pool_allocator_single); pool_init(&pvpool, sizeof(pv_entry_t), 0, 0, 0, "pvpl", NULL); } diff --git a/sys/arch/powerpc/powerpc/pmap.c b/sys/arch/powerpc/powerpc/pmap.c index 2155da5dcc6..093f32b780e 100644 --- a/sys/arch/powerpc/powerpc/pmap.c +++ b/sys/arch/powerpc/powerpc/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.160 2015/07/20 00:16:16 kettenis Exp $ */ +/* $OpenBSD: pmap.c,v 1.161 2015/09/08 21:28:36 kettenis Exp $ */ /* * Copyright (c) 2015 Martin Pieuchot @@ -2094,7 +2094,7 @@ pmap_init() pool_init(&pmap_pmap_pool, sizeof(struct pmap), 0, 0, 0, "pmap", NULL); pool_setlowat(&pmap_pmap_pool, 2); pool_init(&pmap_vp_pool, sizeof(struct pmapvp), 0, 0, 0, "vp", - &pool_allocator_nointr); + &pool_allocator_single); pool_setlowat(&pmap_vp_pool, 10); pool_init(&pmap_pted_pool, sizeof(struct pte_desc), 0, 0, 0, "pted", NULL); diff --git a/sys/arch/sh/sh/pmap.c b/sys/arch/sh/sh/pmap.c index fd895d0fee1..b6a41d967ec 100644 --- a/sys/arch/sh/sh/pmap.c +++ b/sys/arch/sh/sh/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.22 2014/11/16 12:30:58 deraadt Exp $ */ +/* $OpenBSD: pmap.c,v 1.23 2015/09/08 21:28:36 kettenis Exp $ */ /* $NetBSD: pmap.c,v 1.55 2006/08/07 23:19:36 tsutsui Exp $ */ /*- @@ -204,7 +204,7 @@ pmap_init() { /* Initialize pmap module */ pool_init(&__pmap_pmap_pool, sizeof(struct pmap), 0, 0, 0, "pmappl", - &pool_allocator_nointr); + &pool_allocator_single); pool_init(&__pmap_pv_pool, sizeof(struct pv_entry), 0, 0, 0, "pvpl", &pmap_pv_page_allocator); pool_setlowat(&__pmap_pv_pool, 16); diff --git a/sys/arch/solbourne/solbourne/pmap.c b/sys/arch/solbourne/solbourne/pmap.c index 0100ad076d7..131c99cc016 100644 --- a/sys/arch/solbourne/solbourne/pmap.c +++ b/sys/arch/solbourne/solbourne/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.11 2015/09/01 05:16:55 jsg Exp $ */ +/* $OpenBSD: pmap.c,v 1.12 2015/09/08 21:28:36 kettenis Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat * @@ -482,7 +482,7 @@ void pmap_init() { pool_init(&pmappool, sizeof(struct pmap), 0, 0, 0, "pmappl", - &pool_allocator_nointr); + &pool_allocator_single); pool_init(&pvpool, sizeof(struct pvlist), 0, 0, 0, "pvpl", NULL); } 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; diff --git a/sys/sys/pool.h b/sys/sys/pool.h index c23b5bd121b..e08163489fd 100644 --- a/sys/sys/pool.h +++ b/sys/sys/pool.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pool.h,v 1.57 2015/02/10 06:16:13 dlg Exp $ */ +/* $OpenBSD: pool.h,v 1.58 2015/09/08 21:28:36 kettenis Exp $ */ /* $NetBSD: pool.h,v 1.27 2001/06/06 22:00:17 rafal Exp $ */ /*- @@ -165,7 +165,7 @@ struct pool { #ifdef _KERNEL -extern struct pool_allocator pool_allocator_nointr; +extern struct pool_allocator pool_allocator_single; struct pool_request { TAILQ_ENTRY(pool_request) pr_entry; |