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 Allocate softint vectors for the f...



details:   https://anonhg.NetBSD.org/src/rev/a5d6ccf7ad6b
branches:  trunk
changeset: 757615:a5d6ccf7ad6b
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Sep 07 18:25:38 2010 +0000

description:
Allocate softint vectors for the final number of CPUs, not the
number currently attached.  Deals with a SNAFU in my commit earlier
today which would cause softints established early to lack a
softint context on non-bootstrap CPUs.

diffstat:

 sys/rump/librump/rumpkern/intr.c         |  14 ++++++++------
 sys/rump/librump/rumpkern/rump.c         |   6 +++---
 sys/rump/librump/rumpkern/rump_private.h |   4 ++--
 3 files changed, 13 insertions(+), 11 deletions(-)

diffs (105 lines):

diff -r 1d5acf5df154 -r a5d6ccf7ad6b sys/rump/librump/rumpkern/intr.c
--- a/sys/rump/librump/rumpkern/intr.c  Tue Sep 07 18:19:16 2010 +0000
+++ b/sys/rump/librump/rumpkern/intr.c  Tue Sep 07 18:25:38 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.33 2010/09/07 17:49:23 pooka Exp $  */
+/*     $NetBSD: intr.c,v 1.34 2010/09/07 18:25:38 pooka Exp $  */
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.33 2010/09/07 17:49:23 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.34 2010/09/07 18:25:38 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -74,6 +74,7 @@
 kcondvar_t lbolt; /* Oh Kath Ra */
 
 static u_int ticks;
+static int ncpu_final;
 
 static u_int
 rumptc_get(struct timecounter *tc)
@@ -198,10 +199,11 @@
 }
 
 void
-rump_intr_init()
+rump_intr_init(int numcpu)
 {
 
        cv_init(&lbolt, "oh kath ra");
+       ncpu_final = numcpu;
 }
 
 void
@@ -256,9 +258,9 @@
        si->si_flags = flags & SOFTINT_MPSAFE ? SI_MPSAFE : 0;
        si->si_level = flags & SOFTINT_LVLMASK;
        KASSERT(si->si_level < SOFTINT_COUNT);
-       si->si_entry = malloc(sizeof(*si->si_entry) * ncpu,
+       si->si_entry = malloc(sizeof(*si->si_entry) * ncpu_final,
            M_TEMP, M_WAITOK | M_ZERO);
-       for (i = 0; i < ncpu; i++) {
+       for (i = 0; i < ncpu_final; i++) {
                sip = &si->si_entry[i];
                sip->sip_parent = si;
        }
@@ -299,7 +301,7 @@
        struct softint *si = cook;
        int i;
 
-       for (i = 0; i < ncpu; i++) {
+       for (i = 0; i < ncpu_final; i++) {
                struct softint_percpu *sip;
 
                sip = &si->si_entry[i];
diff -r 1d5acf5df154 -r a5d6ccf7ad6b sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Tue Sep 07 18:19:16 2010 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Tue Sep 07 18:25:38 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump.c,v 1.186 2010/09/07 07:59:48 pooka Exp $ */
+/*     $NetBSD: rump.c,v 1.187 2010/09/07 18:25:38 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.186 2010/09/07 07:59:48 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.187 2010/09/07 18:25:38 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -269,7 +269,7 @@
        }
        rumpuser_thrinit(rump_user_schedule, rump_user_unschedule,
            rump_threads);
-       rump_intr_init();
+       rump_intr_init(numcpu);
        rump_tsleep_init();
 
        /* init minimal lwp/cpu context */
diff -r 1d5acf5df154 -r a5d6ccf7ad6b sys/rump/librump/rumpkern/rump_private.h
--- a/sys/rump/librump/rumpkern/rump_private.h  Tue Sep 07 18:19:16 2010 +0000
+++ b/sys/rump/librump/rumpkern/rump_private.h  Tue Sep 07 18:25:38 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump_private.h,v 1.56 2010/09/07 07:59:48 pooka Exp $  */
+/*     $NetBSD: rump_private.h,v 1.57 2010/09/07 18:25:38 pooka Exp $  */
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -135,7 +135,7 @@
 
 void   rump_tsleep_init(void);
 
-void   rump_intr_init(void);
+void   rump_intr_init(int);
 void   rump_softint_run(struct cpu_info *);
 
 void   *rump_hypermalloc(size_t, int, bool, const char *);



Home | Main Index | Thread Index | Old Index