diff options
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_pool.c | 14 | ||||
-rw-r--r-- | sys/kern/uipc_mbuf.c | 26 |
2 files changed, 9 insertions, 31 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c index ead67200271..67ec10797d4 100644 --- a/sys/kern/subr_pool.c +++ b/sys/kern/subr_pool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_pool.c,v 1.39 2003/11/18 06:08:18 tedu Exp $ */ +/* $OpenBSD: subr_pool.c,v 1.40 2004/05/27 04:55:27 tedu Exp $ */ /* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */ /*- @@ -434,7 +434,7 @@ pool_init(struct pool *pp, size_t size, u_int align, u_int ioff, int flags, pp->pr_npages = 0; pp->pr_minitems = 0; pp->pr_minpages = 0; - pp->pr_maxpages = UINT_MAX; + pp->pr_maxpages = 8; pp->pr_roflags = flags; pp->pr_flags = 0; pp->pr_size = size; @@ -2081,15 +2081,14 @@ pool_page_alloc(struct pool *pp, int flags) { boolean_t waitok = (flags & PR_WAITOK) ? TRUE : FALSE; - return ((void *)uvm_km_alloc_poolpage1(kmem_map, uvmexp.kmem_object, - waitok)); + return (uvm_km_getpage(waitok)); } void pool_page_free(struct pool *pp, void *v) { - uvm_km_free_poolpage1(kmem_map, (vaddr_t)v); + uvm_km_putpage(v); } void * @@ -2099,8 +2098,7 @@ pool_page_alloc_nointr(struct pool *pp, int flags) splassert(IPL_NONE); - return ((void *)uvm_km_alloc_poolpage1(kernel_map, uvm.kernel_object, - waitok)); + return (uvm_km_getpage(waitok)); } void @@ -2108,5 +2106,5 @@ pool_page_free_nointr(struct pool *pp, void *v) { splassert(IPL_NONE); - uvm_km_free_poolpage1(kernel_map, (vaddr_t)v); + uvm_km_putpage(v); } diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 732676c49ec..425587781b9 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.69 2004/05/23 19:41:23 tedu Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.70 2004/05/27 04:55:28 tedu Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -99,8 +99,6 @@ int max_protohdr; /* largest protocol header */ int max_hdr; /* largest link+protocol header */ int max_datalen; /* MHLEN - max_hdr */ -void *mclpool_alloc(struct pool *, int); -void mclpool_release(struct pool *, void *); struct mbuf *m_copym0(struct mbuf *, int, int, int, int); void nmbclust_update(void); @@ -108,18 +106,14 @@ void nmbclust_update(void); const char *mclpool_warnmsg = "WARNING: mclpool limit reached; increase kern.maxclusters"; -struct pool_allocator mclpool_allocator = { - mclpool_alloc, mclpool_release, 0, -}; - /* * Initialize the mbuf allcator. */ void mbinit() { - pool_init(&mbpool, MSIZE, 0, 0, 0, "mbpl", &mclpool_allocator); - pool_init(&mclpool, MCLBYTES, 0, 0, 0, "mclpl", &mclpool_allocator); + pool_init(&mbpool, MSIZE, 0, 0, 0, "mbpl", NULL); + pool_init(&mclpool, MCLBYTES, 0, 0, 0, "mclpl", NULL); pool_set_drain_hook(&mbpool, m_reclaim, NULL); pool_set_drain_hook(&mclpool, m_reclaim, NULL); @@ -147,20 +141,6 @@ nmbclust_update(void) (void)pool_sethardlimit(&mclpool, nmbclust, mclpool_warnmsg, 60); } - - -void * -mclpool_alloc(struct pool *pp, int flags) -{ - return uvm_km_getpage(); -} - -void -mclpool_release(struct pool *pp, void *v) -{ - uvm_km_putpage(v); -} - void m_reclaim(void *arg, int flags) { |