svn commit: r357308 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Thu Jan 30 19:38:51 UTC 2020


Author: mjg
Date: Thu Jan 30 19:38:51 2020
New Revision: 357308
URL: https://svnweb.freebsd.org/changeset/base/357308

Log:
  Assert that smp_rendezvous_cpus is called with interrupts enabled.

Modified:
  head/sys/kern/subr_smp.c

Modified: head/sys/kern/subr_smp.c
==============================================================================
--- head/sys/kern/subr_smp.c	Thu Jan 30 19:38:12 2020	(r357307)
+++ head/sys/kern/subr_smp.c	Thu Jan 30 19:38:51 2020	(r357308)
@@ -563,6 +563,12 @@ smp_rendezvous_cpus(cpuset_t map,
 		return;
 	}
 
+	/*
+	 * Make sure we come here with interrupts enabled.  Otherwise we
+	 * livelock if smp_ipi_mtx is owned by a thread which sent as an IPI.
+	 */
+	MPASS(curthread->td_md.md_spinlock_count == 0);
+
 	CPU_FOREACH(i) {
 		if (CPU_ISSET(i, &map))
 			ncpus++;


More information about the svn-src-all mailing list