Module Name: src Committed By: pooka Date: Sun Mar 10 16:27:11 UTC 2013
Modified Files: src/sys/rump/librump/rumpkern: Makefile.rumpkern memalloc.c Log Message: Always include subr_vmem.c, even with RUMP_UNREAL_ALLOCATORS=yes (previously it was just missing in that case). Record wchan to unreal pool_init() to avoid memory leak warning. To generate a diff of this commit: cvs rdiff -u -r1.121 -r1.122 src/sys/rump/librump/rumpkern/Makefile.rumpkern cvs rdiff -u -r1.18 -r1.19 src/sys/rump/librump/rumpkern/memalloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.121 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.122 --- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.121 Sun Dec 30 23:52:12 2012 +++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Sun Mar 10 16:27:11 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rumpkern,v 1.121 2012/12/30 23:52:12 pooka Exp $ +# $NetBSD: Makefile.rumpkern,v 1.122 2013/03/10 16:27:11 pooka Exp $ # .include "${RUMPTOP}/Makefile.rump" @@ -97,10 +97,12 @@ SRCS+= init_sysctl_base.c \ subr_log.c \ subr_lwp_specificdata.c \ subr_once.c \ + subr_percpu.c \ subr_prf.c \ subr_pserialize.c \ subr_specificdata.c \ subr_time.c \ + subr_vmem.c \ subr_workqueue.c \ subr_xcall.c \ sys_descrip.c \ @@ -137,7 +139,7 @@ SRCS+= kern_select_50.c .if defined(RUMP_UNREAL_ALLOCATORS) && ${RUMP_UNREAL_ALLOCATORS} == "yes" CPPFLAGS+= -DRUMP_UNREAL_ALLOCATORS .else -SRCS+= subr_kmem.c subr_percpu.c subr_pool.c subr_vmem.c +SRCS+= subr_kmem.c subr_pool.c .endif .ifdef RUMP_LOCKDEBUG Index: src/sys/rump/librump/rumpkern/memalloc.c diff -u src/sys/rump/librump/rumpkern/memalloc.c:1.18 src/sys/rump/librump/rumpkern/memalloc.c:1.19 --- src/sys/rump/librump/rumpkern/memalloc.c:1.18 Fri Jul 20 09:20:05 2012 +++ src/sys/rump/librump/rumpkern/memalloc.c Sun Mar 10 16:27:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: memalloc.c,v 1.18 2012/07/20 09:20:05 pooka Exp $ */ +/* $NetBSD: memalloc.c,v 1.19 2013/03/10 16:27:11 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -26,14 +26,12 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: memalloc.c,v 1.18 2012/07/20 09:20:05 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: memalloc.c,v 1.19 2013/03/10 16:27:11 pooka Exp $"); #include <sys/param.h> #include <sys/kmem.h> #include <sys/malloc.h> -#include <sys/percpu.h> #include <sys/pool.h> -#include <sys/vmem.h> #include <rump/rumpuser.h> @@ -148,6 +146,7 @@ pool_init(struct pool *pp, size_t size, pp->pr_size = size; pp->pr_align = align; + pp->pr_wchan = wchan; } void @@ -327,68 +326,4 @@ struct pool_allocator pool_allocator_kme .pa_pagesz = 0 }; -void -vmem_rehash_start() -{ - - return; -} - -/* - * A simplified percpu is included in here since subr_percpu.c uses - * the vmem allocator and I don't want to reimplement vmem. So use - * this simplified percpu for non-vmem systems. - */ - -static kmutex_t pcmtx; - -void -percpu_init(void) -{ - - mutex_init(&pcmtx, MUTEX_DEFAULT, IPL_NONE); -} - -void -percpu_init_cpu(struct cpu_info *ci) -{ - - /* nada */ -} - -void * -percpu_getref(percpu_t *pc) -{ - - mutex_enter(&pcmtx); - return pc; -} - -void -percpu_putref(percpu_t *pc) -{ - - mutex_exit(&pcmtx); -} - -percpu_t * -percpu_alloc(size_t size) -{ - - return kmem_alloc(size, KM_SLEEP); -} - -void -percpu_free(percpu_t *pc, size_t size) -{ - - kmem_free(pc, size); -} - -void -percpu_foreach(percpu_t *pc, percpu_callback_t cb, void *arg) -{ - - cb(pc, arg, rump_cpu); -} #endif /* RUMP_UNREAL_ALLOCATORS */