Module Name: src Committed By: riz Date: Fri Feb 8 19:31:19 UTC 2013
Modified Files: src/sys/kern [netbsd-6-0]: kern_softint.c subr_pserialize.c src/sys/rump/include/machine [netbsd-6-0]: intr.h Log Message: Pull up following revision(s) (requested by rmind in ticket #782): sys/rump/include/machine/intr.h: revision 1.19 sys/kern/subr_pserialize.c: revision 1.6 sys/kern/kern_softint.c: revision 1.39 - softint_dispatch: perform pserialize(9) switchpoint when softintr processing finishes (without blocking). Problem reported by hannken@, thanks! - pserialize_read_enter: use splsoftserial(), not splsoftclock(). - pserialize_perform: add xcall(9) barrier as interrupts may be coalesced. Provide splsoftserial. GRRR RUMP To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.38.14.1 src/sys/kern/kern_softint.c cvs rdiff -u -r1.5 -r1.5.8.1 src/sys/kern/subr_pserialize.c cvs rdiff -u -r1.18 -r1.18.16.1 src/sys/rump/include/machine/intr.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/kern_softint.c diff -u src/sys/kern/kern_softint.c:1.38 src/sys/kern/kern_softint.c:1.38.14.1 --- src/sys/kern/kern_softint.c:1.38 Tue Sep 27 01:02:38 2011 +++ src/sys/kern/kern_softint.c Fri Feb 8 19:31:19 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_softint.c,v 1.38 2011/09/27 01:02:38 jym Exp $ */ +/* $NetBSD: kern_softint.c,v 1.38.14.1 2013/02/08 19:31:19 riz Exp $ */ /*- * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc. @@ -176,7 +176,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.38 2011/09/27 01:02:38 jym Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.38.14.1 2013/02/08 19:31:19 riz Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -186,6 +186,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_softint #include <sys/evcnt.h> #include <sys/cpu.h> #include <sys/xcall.h> +#include <sys/pserialize.h> #include <net/netisr.h> @@ -828,6 +829,9 @@ softint_dispatch(lwp_t *pinned, int s) l->l_pflag &= ~LP_TIMEINTR; } + /* Indicate a soft-interrupt switch. */ + pserialize_switchpoint(); + /* * If we blocked while handling the interrupt, the pinned LWP is * gone so switch to the idle LWP. It will select a new LWP to Index: src/sys/kern/subr_pserialize.c diff -u src/sys/kern/subr_pserialize.c:1.5 src/sys/kern/subr_pserialize.c:1.5.8.1 --- src/sys/kern/subr_pserialize.c:1.5 Sun Jan 29 22:55:40 2012 +++ src/sys/kern/subr_pserialize.c Fri Feb 8 19:31:19 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_pserialize.c,v 1.5 2012/01/29 22:55:40 rmind Exp $ */ +/* $NetBSD: subr_pserialize.c,v 1.5.8.1 2013/02/08 19:31:19 riz Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: subr_pserialize.c,v 1.5 2012/01/29 22:55:40 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_pserialize.c,v 1.5.8.1 2013/02/08 19:31:19 riz Exp $"); #include <sys/param.h> @@ -139,6 +139,7 @@ pserialize_destroy(pserialize_t psz) void pserialize_perform(pserialize_t psz) { + uint64_t xc; KASSERT(!cpu_intr_p()); KASSERT(!cpu_softintr_p()); @@ -168,7 +169,10 @@ pserialize_perform(pserialize_t psz) * Force some context switch activity on every CPU, as the system * may not be busy. Note: should pass the point twice. */ - xc_broadcast(XC_HIGHPRI, (xcfunc_t)nullop, NULL, NULL); + xc = xc_broadcast(XC_HIGHPRI, (xcfunc_t)nullop, NULL, NULL); + xc_wait(xc); + + /* No need to xc_wait() as we implement our own condvar. */ xc_broadcast(XC_HIGHPRI, (xcfunc_t)nullop, NULL, NULL); /* @@ -191,7 +195,7 @@ pserialize_read_enter(void) { KASSERT(!cpu_intr_p()); - return splsoftclock(); + return splsoftserial(); } void Index: src/sys/rump/include/machine/intr.h diff -u src/sys/rump/include/machine/intr.h:1.18 src/sys/rump/include/machine/intr.h:1.18.16.1 --- src/sys/rump/include/machine/intr.h:1.18 Mon Mar 21 16:41:08 2011 +++ src/sys/rump/include/machine/intr.h Fri Feb 8 19:31:18 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.h,v 1.18 2011/03/21 16:41:08 pooka Exp $ */ +/* $NetBSD: intr.h,v 1.18.16.1 2013/02/08 19:31:18 riz Exp $ */ /* * Copyright (c) 2009, 2010 Antti Kantee. All Rights Reserved. @@ -47,6 +47,7 @@ makeiplcookie(ipl_t ipl) #define spllower(x) ((void)x) #define splraise(x) 0 +#define splsoftserial() 0 #define splsoftnet() 0 #define splsoftclock() 0 #define splhigh() 0