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 Attach only one CPU for the bootst...



details:   https://anonhg.NetBSD.org/src/rev/0627e3454628
branches:  trunk
changeset: 757604:0627e3454628
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Sep 07 07:59:48 2010 +0000

description:
Attach only one CPU for the bootstrap phase.

diffstat:

 sys/rump/librump/rumpkern/rump.c         |  14 ++++++++++----
 sys/rump/librump/rumpkern/rump_private.h |   4 ++--
 sys/rump/librump/rumpkern/scheduler.c    |  14 ++++++++------
 3 files changed, 20 insertions(+), 12 deletions(-)

diffs (108 lines):

diff -r 1f2bae88480e -r 0627e3454628 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Tue Sep 07 07:47:36 2010 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Tue Sep 07 07:59:48 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump.c,v 1.185 2010/09/06 20:10:20 pooka Exp $ */
+/*     $NetBSD: rump.c,v 1.186 2010/09/07 07:59:48 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.185 2010/09/06 20:10:20 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.186 2010/09/07 07:59:48 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -313,7 +313,7 @@
        lwpinit_specificdata();
        lwp_initspecific(&lwp0);
 
-       rump_scheduler_init();
+       rump_scheduler_init(numcpu);
        /* revert temporary context and schedule a real context */
        l->l_cpu = NULL;
        rumpuser_set_curlwp(NULL);
@@ -329,9 +329,15 @@
        tc_setclock(&ts);
 
        /* we are mostly go.  do per-cpu subsystem init */
-       for (i = 0; i < ncpu; i++) {
+       for (i = 0; i < numcpu; i++) {
                struct cpu_info *ci = cpu_lookup(i);
 
+               /* attach non-bootstrap CPUs */
+               if (i > 0) {
+                       rump_cpu_attach(ci);
+                       ncpu++;
+               }
+
                callout_init_cpu(ci);
                softint_init(ci);
                xc_init_cpu(ci);
diff -r 1f2bae88480e -r 0627e3454628 sys/rump/librump/rumpkern/rump_private.h
--- a/sys/rump/librump/rumpkern/rump_private.h  Tue Sep 07 07:47:36 2010 +0000
+++ b/sys/rump/librump/rumpkern/rump_private.h  Tue Sep 07 07:59:48 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump_private.h,v 1.55 2010/09/01 19:37:58 pooka Exp $  */
+/*     $NetBSD: rump_private.h,v 1.56 2010/09/07 07:59:48 pooka Exp $  */
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -111,7 +111,7 @@
 struct lwp *   rump__lwproc_allockernlwp(void);
 
 void   rump_cpus_bootstrap(int);
-void   rump_scheduler_init(void);
+void   rump_scheduler_init(int);
 void   rump_schedule(void);
 void   rump_unschedule(void);
 void   rump_schedule_cpu(struct lwp *);
diff -r 1f2bae88480e -r 0627e3454628 sys/rump/librump/rumpkern/scheduler.c
--- a/sys/rump/librump/rumpkern/scheduler.c     Tue Sep 07 07:47:36 2010 +0000
+++ b/sys/rump/librump/rumpkern/scheduler.c     Tue Sep 07 07:59:48 2010 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: scheduler.c,v 1.19 2010/09/01 19:37:59 pooka Exp $    */
+/*      $NetBSD: scheduler.c,v 1.20 2010/09/07 07:59:48 pooka Exp $    */
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.19 2010/09/01 19:37:59 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.20 2010/09/07 07:59:48 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -136,13 +136,15 @@
                rcpu = &rcpu_storage[i];
                ci = &rump_cpus[i];
                ci->ci_index = i;
-               rump_cpu_attach(ci);
-               ncpu++;
        }
+
+       /* attach first cpu for bootstrap */
+       rump_cpu_attach(&rump_cpus[0]);
+       ncpu = 1;
 }
 
 void
-rump_scheduler_init()
+rump_scheduler_init(int numcpu)
 {
        struct rumpcpu *rcpu;
        struct cpu_info *ci;
@@ -150,7 +152,7 @@
 
        rumpuser_mutex_init(&lwp0mtx);
        rumpuser_cv_init(&lwp0cv);
-       for (i = 0; i < ncpu; i++) {
+       for (i = 0; i < numcpu; i++) {
                rcpu = &rcpu_storage[i];
                ci = &rump_cpus[i];
                rcpu->rcpu_ci = ci;



Home | Main Index | Thread Index | Old Index