Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Jul 2016 02:55:02 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r302925 - stable/10/sys/kern
Message-ID:  <201607160255.u6G2t22D055760@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Sat Jul 16 02:55:02 2016
New Revision: 302925
URL: https://svnweb.freebsd.org/changeset/base/302925

Log:
  MFC r302346:
  Ensure that spinlock sections are balanced even after a panic.

Modified:
  stable/10/sys/kern/kern_mutex.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_mutex.c
==============================================================================
--- stable/10/sys/kern/kern_mutex.c	Sat Jul 16 02:53:52 2016	(r302924)
+++ stable/10/sys/kern/kern_mutex.c	Sat Jul 16 02:55:02 2016	(r302925)
@@ -658,8 +658,15 @@ thread_lock_flags_(struct thread *td, in
 	i = 0;
 	tid = (uintptr_t)curthread;
 
-	if (SCHEDULER_STOPPED())
+	if (SCHEDULER_STOPPED()) {
+		/*
+		 * Ensure that spinlock sections are balanced even when the
+		 * scheduler is stopped, since we may otherwise inadvertently
+		 * re-enable interrupts while dumping core.
+		 */
+		spinlock_enter();
 		return;
+	}
 
 #ifdef KDTRACE_HOOKS
 	spin_time -= lockstat_nsecs(&td->td_lock->lock_object);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607160255.u6G2t22D055760>