Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/librump/rumpkern Now that Makefile.rump was changed...



details:   https://anonhg.NetBSD.org/src/rev/640f197f0766
branches:  trunk
changeset: 749353:640f197f0766
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Nov 27 13:45:15 2009 +0000

description:
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.

diffstat:

 sys/rump/librump/rumpkern/Makefile.rumpkern |  12 +++++++-----
 sys/rump/librump/rumpkern/memalloc.c        |  14 +++++++++++---
 sys/rump/librump/rumpkern/rump.c            |   6 ++----
 3 files changed, 20 insertions(+), 12 deletions(-)

diffs (94 lines):

diff -r 7d23485d274c -r 640f197f0766 sys/rump/librump/rumpkern/Makefile.rumpkern
--- a/sys/rump/librump/rumpkern/Makefile.rumpkern       Fri Nov 27 13:36:30 2009 +0000
+++ b/sys/rump/librump/rumpkern/Makefile.rumpkern       Fri Nov 27 13:45:15 2009 +0000
@@ -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
diff -r 7d23485d274c -r 640f197f0766 sys/rump/librump/rumpkern/memalloc.c
--- a/sys/rump/librump/rumpkern/memalloc.c      Fri Nov 27 13:36:30 2009 +0000
+++ b/sys/rump/librump/rumpkern/memalloc.c      Fri Nov 27 13:45:15 2009 +0000
@@ -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 */
diff -r 7d23485d274c -r 640f197f0766 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Fri Nov 27 13:36:30 2009 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Fri Nov 27 13:45:15 2009 +0000
@@ -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();
 



Home | Main Index | Thread Index | Old Index