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 Make it possible to select between...



details:   https://anonhg.NetBSD.org/src/rev/66cb7d9d9a03
branches:  trunk
changeset: 780324:66cb7d9d9a03
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Jul 20 09:20:05 2012 +0000

description:
Make it possible to select between real and unreal allocators from
make.  Plus some gratuitous renaming.

diffstat:

 sys/rump/librump/rumpkern/Makefile.rumpkern |  15 +++++++++------
 sys/rump/librump/rumpkern/memalloc.c        |   8 ++++----
 sys/rump/librump/rumpkern/vm.c              |   8 ++++----
 3 files changed, 17 insertions(+), 14 deletions(-)

diffs (100 lines):

diff -r 0ae61ec3875f -r 66cb7d9d9a03 sys/rump/librump/rumpkern/Makefile.rumpkern
--- a/sys/rump/librump/rumpkern/Makefile.rumpkern       Fri Jul 20 09:11:33 2012 +0000
+++ b/sys/rump/librump/rumpkern/Makefile.rumpkern       Fri Jul 20 09:20:05 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.rumpkern,v 1.118 2012/06/22 12:45:43 rmind Exp $
+#      $NetBSD: Makefile.rumpkern,v 1.119 2012/07/20 09:20:05 pooka Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -128,13 +128,16 @@
 # compat
 SRCS+= kern_select_50.c
 
-# 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
+# Set RUMP_UNREAL_ALLOCATORS to "yes" to use memory allocation hypercalls
+# directly instead of the kmem/pool allocators backed by hypercalls.
+# Direct hypercalls may be a few percent faster, but don't emulate
+# all kernel corner cases as well (not to mention if you want to debug the
 # allocators themselves).
-#CPPFLAGS+=    -DRUMP_USE_UNREAL_ALLOCATORS
+.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
+.endif
 
 .ifdef RUMP_LOCKDEBUG
 SRCS+=         subr_lockdebug.c
diff -r 0ae61ec3875f -r 66cb7d9d9a03 sys/rump/librump/rumpkern/memalloc.c
--- a/sys/rump/librump/rumpkern/memalloc.c      Fri Jul 20 09:11:33 2012 +0000
+++ b/sys/rump/librump/rumpkern/memalloc.c      Fri Jul 20 09:20:05 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memalloc.c,v 1.17 2012/07/20 09:11:33 pooka Exp $      */
+/*     $NetBSD: memalloc.c,v 1.18 2012/07/20 09:20:05 pooka Exp $      */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: memalloc.c,v 1.17 2012/07/20 09:11:33 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: memalloc.c,v 1.18 2012/07/20 09:20:05 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -88,7 +88,7 @@
  * Kmem
  */
 
-#ifdef RUMP_USE_UNREAL_ALLOCATORS
+#ifdef RUMP_UNREAL_ALLOCATORS
 void
 kmem_init()
 {
@@ -391,4 +391,4 @@
 
        cb(pc, arg, rump_cpu);
 }
-#endif /* RUMP_USE_UNREAL_ALLOCATORS */
+#endif /* RUMP_UNREAL_ALLOCATORS */
diff -r 0ae61ec3875f -r 66cb7d9d9a03 sys/rump/librump/rumpkern/vm.c
--- a/sys/rump/librump/rumpkern/vm.c    Fri Jul 20 09:11:33 2012 +0000
+++ b/sys/rump/librump/rumpkern/vm.c    Fri Jul 20 09:20:05 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm.c,v 1.128 2012/07/20 09:11:33 pooka Exp $   */
+/*     $NetBSD: vm.c,v 1.129 2012/07/20 09:20:05 pooka Exp $   */
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.128 2012/07/20 09:11:33 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.129 2012/07/20 09:20:05 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -332,7 +332,7 @@
 
        pool_subsystem_init();
 
-#ifndef RUMP_USE_UNREAL_ALLOCATORS
+#ifndef RUMP_UNREAL_ALLOCATORS
        vmem_bootstrap();
        kmem_arena = vmem_create("kmem", 0, 1024*1024, PAGE_SIZE,
            NULL, NULL, NULL,
@@ -343,7 +343,7 @@
        kmem_va_arena = vmem_create("kva", 0, 0, PAGE_SIZE,
            vmem_alloc, vmem_free, kmem_arena,
            8 * PAGE_SIZE, VM_NOSLEEP | VM_BOOTSTRAP, IPL_VM);
-#endif /* !RUMP_USE_UNREAL_ALLOCATORS */
+#endif /* !RUMP_UNREAL_ALLOCATORS */
 
        pool_cache_bootstrap(&pagecache, sizeof(struct vm_page), 0, 0, 0,
            "page$", NULL, IPL_NONE, pgctor, pgdtor, NULL);



Home | Main Index | Thread Index | Old Index