Module Name:    src
Committed By:   pooka
Date:           Tue Sep  7 07:59:49 UTC 2010

Modified Files:
        src/sys/rump/librump/rumpkern: rump.c rump_private.h scheduler.c

Log Message:
Attach only one CPU for the bootstrap phase.


To generate a diff of this commit:
cvs rdiff -u -r1.185 -r1.186 src/sys/rump/librump/rumpkern/rump.c
cvs rdiff -u -r1.55 -r1.56 src/sys/rump/librump/rumpkern/rump_private.h
cvs rdiff -u -r1.19 -r1.20 src/sys/rump/librump/rumpkern/scheduler.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/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.185 src/sys/rump/librump/rumpkern/rump.c:1.186
--- src/sys/rump/librump/rumpkern/rump.c:1.185	Mon Sep  6 20:10:20 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Tue Sep  7 07:59:48 2010
@@ -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);

Index: src/sys/rump/librump/rumpkern/rump_private.h
diff -u src/sys/rump/librump/rumpkern/rump_private.h:1.55 src/sys/rump/librump/rumpkern/rump_private.h:1.56
--- src/sys/rump/librump/rumpkern/rump_private.h:1.55	Wed Sep  1 19:37:58 2010
+++ src/sys/rump/librump/rumpkern/rump_private.h	Tue Sep  7 07:59:48 2010
@@ -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 *);

Index: src/sys/rump/librump/rumpkern/scheduler.c
diff -u src/sys/rump/librump/rumpkern/scheduler.c:1.19 src/sys/rump/librump/rumpkern/scheduler.c:1.20
--- src/sys/rump/librump/rumpkern/scheduler.c:1.19	Wed Sep  1 19:37:59 2010
+++ src/sys/rump/librump/rumpkern/scheduler.c	Tue Sep  7 07:59:48 2010
@@ -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;

Reply via email to