Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/kern Pull up following revision(s) (requested by bouy...



details:   https://anonhg.NetBSD.org/src/rev/f26adca0f616
branches:  netbsd-8
changeset: 852005:f26adca0f616
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Sep 23 17:46:16 2018 +0000

description:
Pull up following revision(s) (requested by bouyer in ticket #1031):

        sys/kern/kern_synch.c: revision 1.317

In mi_switch(), also call pserialize_switchpoint() if we're not switching
to another lwp, as proposed on
http://mail-index.netbsd.org/tech-kern/2018/07/20/msg023709.html

Without it, on a SMP machine with few processes running (e.g while
running sysinst), pserialize could hang for a long time until all
CPUs got a LWP to run (or, eventually, forever).

Tested on Xen domUs with 4 CPUs, and on a 64-threads AMD machine.

diffstat:

 sys/kern/kern_synch.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 39ed4c9650f6 -r f26adca0f616 sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c     Sun Sep 23 17:43:36 2018 +0000
+++ b/sys/kern/kern_synch.c     Sun Sep 23 17:46:16 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_synch.c,v 1.311.10.1 2018/02/26 00:43:23 snj Exp $        */
+/*     $NetBSD: kern_synch.c,v 1.311.10.2 2018/09/23 17:46:16 martin Exp $     */
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.311.10.1 2018/02/26 00:43:23 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.311.10.2 2018/09/23 17:46:16 martin Exp $");
 
 #include "opt_kstack.h"
 #include "opt_perfctrs.h"
@@ -759,6 +759,7 @@
                retval = 1;
        } else {
                /* Nothing to do - just unlock and return. */
+               pserialize_switchpoint();
                mutex_spin_exit(spc->spc_mutex);
                lwp_unlock(l);
                retval = 0;



Home | Main Index | Thread Index | Old Index