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 Use kern_malloc.c instead of the r...



details:   https://anonhg.NetBSD.org/src/rev/5b5e6831fd56
branches:  trunk
changeset: 785353:5b5e6831fd56
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sun Mar 10 17:05:12 2013 +0000

description:
Use kern_malloc.c instead of the relegated allocators in memalloc.c.
Previously this didn't make sense due to the use of kmem_map, but the
new malloc is more dynamic and puts sense into using it.

diffstat:

 sys/rump/librump/rumpkern/Makefile.rumpkern |   8 ++++----
 sys/rump/librump/rumpkern/memalloc.c        |  16 +++++++++++-----
 sys/rump/librump/rumpkern/rump.c            |   5 +++--
 sys/rump/librump/rumpkern/vm.c              |   6 ++----
 4 files changed, 20 insertions(+), 15 deletions(-)

diffs (144 lines):

diff -r 3160c329d49b -r 5b5e6831fd56 sys/rump/librump/rumpkern/Makefile.rumpkern
--- a/sys/rump/librump/rumpkern/Makefile.rumpkern       Sun Mar 10 16:51:31 2013 +0000
+++ b/sys/rump/librump/rumpkern/Makefile.rumpkern       Sun Mar 10 17:05:12 2013 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.rumpkern,v 1.122 2013/03/10 16:27:11 pooka Exp $
+#      $NetBSD: Makefile.rumpkern,v 1.123 2013/03/10 17:05:12 pooka Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -20,7 +20,7 @@
 # Source modules, first the ones specifically implemented for librump.
 # 
 SRCS=  rump.c rumpcopy.c emul.c intr.c lwproc.c klock.c        \
-       kobj_rename.c ltsleep.c memalloc.c scheduler.c          \
+       kobj_rename.c ltsleep.c scheduler.c                     \
        signals.c sleepq.c threads.c vm.c cprng_stub.c
 
 # Multiprocessor or uniprocessor locking.  TODO: select right
@@ -137,9 +137,9 @@
 # all kernel corner cases as well (not to mention if you want to debug the
 # allocators themselves).
 .if defined(RUMP_UNREAL_ALLOCATORS) && ${RUMP_UNREAL_ALLOCATORS} == "yes"
-CPPFLAGS+=     -DRUMP_UNREAL_ALLOCATORS
+SRCS+=         memalloc.c
 .else
-SRCS+=         subr_kmem.c subr_pool.c
+SRCS+=         kern_malloc.c subr_kmem.c subr_pool.c
 .endif
 
 .ifdef RUMP_LOCKDEBUG
diff -r 3160c329d49b -r 5b5e6831fd56 sys/rump/librump/rumpkern/memalloc.c
--- a/sys/rump/librump/rumpkern/memalloc.c      Sun Mar 10 16:51:31 2013 +0000
+++ b/sys/rump/librump/rumpkern/memalloc.c      Sun Mar 10 17:05:12 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memalloc.c,v 1.19 2013/03/10 16:27:11 pooka Exp $      */
+/*     $NetBSD: memalloc.c,v 1.20 2013/03/10 17:05:12 pooka Exp $      */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,13 +26,15 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: memalloc.c,v 1.19 2013/03/10 16:27:11 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: memalloc.c,v 1.20 2013/03/10 17:05:12 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
 #include <sys/malloc.h>
 #include <sys/pool.h>
 
+#include <uvm/uvm_extern.h>
+
 #include <rump/rumpuser.h>
 
 #include "rump_private.h"
@@ -52,6 +54,13 @@
  * malloc
  */
 
+void
+kmeminit(void)
+{
+
+       return;
+}
+
 void *
 kern_malloc(unsigned long size, int flags)
 {
@@ -86,7 +95,6 @@
  * Kmem
  */
 
-#ifdef RUMP_UNREAL_ALLOCATORS
 void
 kmem_init()
 {
@@ -325,5 +333,3 @@
         .pa_free = pool_page_free,
         .pa_pagesz = 0
 };
-
-#endif /* RUMP_UNREAL_ALLOCATORS */
diff -r 3160c329d49b -r 5b5e6831fd56 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Sun Mar 10 16:51:31 2013 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Sun Mar 10 17:05:12 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump.c,v 1.256 2013/03/10 16:51:31 pooka Exp $ */
+/*     $NetBSD: rump.c,v 1.257 2013/03/10 17:05:12 pooka Exp $ */
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.256 2013/03/10 16:51:31 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.257 2013/03/10 17:05:12 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -309,6 +309,7 @@
        prop_kern_init();
 
        kmem_init();
+       kmeminit();
 
        uvm_ra_init();
        uao_init();
diff -r 3160c329d49b -r 5b5e6831fd56 sys/rump/librump/rumpkern/vm.c
--- a/sys/rump/librump/rumpkern/vm.c    Sun Mar 10 16:51:31 2013 +0000
+++ b/sys/rump/librump/rumpkern/vm.c    Sun Mar 10 17:05:12 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm.c,v 1.136 2013/03/06 11:42:18 yamt Exp $    */
+/*     $NetBSD: vm.c,v 1.137 2013/03/10 17:05:12 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.136 2013/03/06 11:42:18 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.137 2013/03/10 17:05:12 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -349,7 +349,6 @@
 
        pool_subsystem_init();
 
-#ifndef RUMP_UNREAL_ALLOCATORS
        kmem_arena = vmem_create("kmem", 0, 1024*1024, PAGE_SIZE,
            NULL, NULL, NULL,
            0, VM_NOSLEEP | VM_BOOTSTRAP, IPL_VM);
@@ -359,7 +358,6 @@
        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_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