Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/b9a6d06b638a
branches:  netbsd-7
changeset: 799624:b9a6d06b638a
user:      riz <riz%NetBSD.org@localhost>
date:      Wed Nov 04 18:00:34 2015 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #965):
        sys/kern/kern_cpu.c: revision 1.71
Don't decrement the number of offline cpus if we fail to shut down one.
ok christos@, via tech-kern@

diffstat:

 sys/kern/kern_cpu.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (50 lines):

diff -r f971e771c634 -r b9a6d06b638a sys/kern/kern_cpu.c
--- a/sys/kern/kern_cpu.c       Wed Nov 04 17:58:38 2015 +0000
+++ b/sys/kern/kern_cpu.c       Wed Nov 04 18:00:34 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_cpu.c,v 1.66 2014/07/25 08:10:40 dholland Exp $   */
+/*     $NetBSD: kern_cpu.c,v 1.66.2.1 2015/11/04 18:00:34 riz Exp $    */
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010, 2012 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.66 2014/07/25 08:10:40 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.66.2.1 2015/11/04 18:00:34 riz Exp $");
 
 #include "opt_cpu_ucode.h"
 #include "opt_compat_netbsd.h"
@@ -444,7 +444,6 @@
                if ((spc->spc_flags & SPCF_OFFLINE) == 0)
                        return 0;
                func = (xcfunc_t)cpu_xc_online;
-               ncpuonline++;
        } else {
                if ((spc->spc_flags & SPCF_OFFLINE) != 0)
                        return 0;
@@ -463,16 +462,19 @@
                if (nonline == 1)
                        return EBUSY;
                func = (xcfunc_t)cpu_xc_offline;
-               ncpuonline--;
        }
 
        where = xc_unicast(0, func, ci, NULL, ci);
        xc_wait(where);
        if (online) {
                KASSERT((spc->spc_flags & SPCF_OFFLINE) == 0);
-       } else if ((spc->spc_flags & SPCF_OFFLINE) == 0) {
-               /* If was not set offline, then it is busy */
-               return EBUSY;
+               ncpuonline++;
+       } else {
+               if ((spc->spc_flags & SPCF_OFFLINE) == 0) {
+                       /* If was not set offline, then it is busy */
+                       return EBUSY;
+               }
+               ncpuonline--;
        }
 
        spc->spc_lastmod = time_second;



Home | Main Index | Thread Index | Old Index