Module Name:    src
Committed By:   riastradh
Date:           Sat Sep  2 17:43:28 UTC 2023

Modified Files:
        src/sys/kern: kern_cpu.c

Log Message:
cpu_setstate: Fix call to heartbeat_suspend.

Do this on successful offlining, not on failed offlining.

No functional change right now because heartbeat_suspend is
implemented as a noop -- heartbeat(9) will just check the
SPCF_OFFLINE flag.  But if we change it to not be a noop, well, then
we need to call it in the right place.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/kern/kern_cpu.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/kern/kern_cpu.c
diff -u src/sys/kern/kern_cpu.c:1.95 src/sys/kern/kern_cpu.c:1.96
--- src/sys/kern/kern_cpu.c:1.95	Fri Jul  7 12:34:50 2023
+++ src/sys/kern/kern_cpu.c	Sat Sep  2 17:43:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_cpu.c,v 1.95 2023/07/07 12:34:50 riastradh Exp $	*/
+/*	$NetBSD: kern_cpu.c,v 1.96 2023/09/02 17:43:28 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010, 2012, 2019 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.95 2023/07/07 12:34:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.96 2023/09/02 17:43:28 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_cpu_ucode.h"
@@ -370,6 +370,10 @@ cpu_xc_offline(struct cpu_info *ci, void
 	pcu_save_all_on_cpu();
 #endif
 
+#ifdef HEARTBEAT
+	heartbeat_suspend();
+#endif
+
 #ifdef __HAVE_MD_CPU_OFFLINE
 	cpu_offline_md();
 #endif
@@ -379,10 +383,6 @@ fail:
 	s = splsched();
 	spc->spc_flags &= ~SPCF_OFFLINE;
 	splx(s);
-
-#ifdef HEARTBEAT
-	heartbeat_suspend();
-#endif
 }
 
 static void

Reply via email to