Module Name: src Committed By: pooka Date: Fri Nov 27 13:45:15 UTC 2009
Modified Files: src/sys/rump/librump/rumpkern: Makefile.rumpkern memalloc.c rump.c Log Message: Now that Makefile.rump was changed and everything gets built in update builds too, flip the allocator define to prefer the kernel pool/kmem instead of malloc(3). Use malloc(3) only if RUMP_USE_UNREAL_ALLOCATORS is defined. To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/rump/librump/rumpkern/Makefile.rumpkern cvs rdiff -u -r1.1 -r1.2 src/sys/rump/librump/rumpkern/memalloc.c cvs rdiff -u -r1.140 -r1.141 src/sys/rump/librump/rumpkern/rump.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.64 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.65 --- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.64 Thu Nov 26 17:24:52 2009 +++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Fri Nov 27 13:45:15 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rumpkern,v 1.64 2009/11/26 17:24:52 pooka Exp $ +# $NetBSD: Makefile.rumpkern,v 1.65 2009/11/27 13:45:15 pooka Exp $ # .include "${RUMPTOP}/Makefile.rump" @@ -57,10 +57,12 @@ # sys/dev SRCS+= clock_subr.c -# Comment these if you want to use malloc(3) directly instead of -# the kernel allocators. It's a few percent faster, but doesn't -# emulate all kernel corner cases as well. -CPPFLAGS+= -DRUMP_USE_REAL_ALLOCATORS +# Flip the comment to the other line if you want to use malloc(3) +# directly instead of the kernel allocators backed by malloc(3)/mmap(2). +# Libc malloc is a few percent faster, but doesn't emulate all kernel +# corner cases as well (not to mention if you want to debug the +# allocators themselves). +#CPPFLAGS+= -DRUMP_USE_UNREAL_ALLOCATORS SRCS+= subr_kmem.c subr_pool.c subr_vmem.c # no shlib_version because this is automatically in sync with lib/librump Index: src/sys/rump/librump/rumpkern/memalloc.c diff -u src/sys/rump/librump/rumpkern/memalloc.c:1.1 src/sys/rump/librump/rumpkern/memalloc.c:1.2 --- src/sys/rump/librump/rumpkern/memalloc.c:1.1 Wed Nov 4 20:38:58 2009 +++ src/sys/rump/librump/rumpkern/memalloc.c Fri Nov 27 13:45:15 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: memalloc.c,v 1.1 2009/11/04 20:38:58 pooka Exp $ */ +/* $NetBSD: memalloc.c,v 1.2 2009/11/27 13:45:15 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -32,6 +32,7 @@ #include <sys/kmem.h> #include <sys/malloc.h> #include <sys/pool.h> +#include <sys/vmem.h> #include <rump/rumpuser.h> @@ -94,7 +95,7 @@ * Kmem */ -#ifndef RUMP_USE_REAL_ALLOCATORS +#ifdef RUMP_USE_UNREAL_ALLOCATORS void kmem_init() { @@ -310,4 +311,11 @@ return pool_put(pp, item); } -#endif /* RUMP_USE_REAL_ALLOCATORS */ + +void +vmem_rehash_start() +{ + + return; +} +#endif /* RUMP_USE_UNREAL_ALLOCATORS */ Index: src/sys/rump/librump/rumpkern/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.140 src/sys/rump/librump/rumpkern/rump.c:1.141 --- src/sys/rump/librump/rumpkern/rump.c:1.140 Thu Nov 26 20:58:51 2009 +++ src/sys/rump/librump/rumpkern/rump.c Fri Nov 27 13:45:15 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.140 2009/11/26 20:58:51 pooka Exp $ */ +/* $NetBSD: rump.c,v 1.141 2009/11/27 13:45:15 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.140 2009/11/26 20:58:51 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.141 2009/11/27 13:45:15 pooka Exp $"); #include <sys/param.h> #include <sys/atomic.h> @@ -313,10 +313,8 @@ lwp0.l_fd = proc0.p_fd = fd_init(&rump_filedesc0); -#ifdef RUMP_USE_REAL_ALLOCATORS if (rump_threads) vmem_rehash_start(); -#endif rump_unschedule();