svn commit: r208187 - stable/7/sys/fs/procfs

Konstantin Belousov kib at FreeBSD.org
Mon May 17 08:35:14 UTC 2010


Author: kib
Date: Mon May 17 08:35:14 2010
New Revision: 208187
URL: http://svn.freebsd.org/changeset/base/208187

Log:
  MFC r207848:
  The thread_unsuspend() requires both process mutex and process spinlock
  locked. Postpone the process unlock till the thread_unsuspend() is called.

Modified:
  stable/7/sys/fs/procfs/procfs_ctl.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/fs/procfs/procfs_ctl.c
==============================================================================
--- stable/7/sys/fs/procfs/procfs_ctl.c	Mon May 17 08:15:04 2010	(r208186)
+++ stable/7/sys/fs/procfs/procfs_ctl.c	Mon May 17 08:35:14 2010	(r208187)
@@ -233,7 +233,6 @@ out:
 			PROC_LOCK(p);
 		p->p_oppid = 0;
 		p->p_flag &= ~P_WAITED;	/* XXX ? */
-		PROC_UNLOCK(p);
 		sx_xunlock(&proctree_lock);
 
 		wakeup(td->td_proc);	/* XXX for CTL_WAIT below ? */
@@ -246,9 +245,10 @@ out:
 	 */
 	case PROCFS_CTL_STEP:
 		error = proc_sstep(FIRST_THREAD_IN_PROC(p)); /* XXXKSE */
-		PROC_UNLOCK(p);
-		if (error)
+		if (error) {
+			PROC_UNLOCK(p);
 			return (error);
+		}
 		break;
 
 	/*
@@ -257,7 +257,6 @@ out:
 	 */
 	case PROCFS_CTL_RUN:
 		p->p_flag &= ~P_STOPPED_SIG;	/* this uses SIGSTOP */
-		PROC_UNLOCK(p);
 		break;
 
 	/*
@@ -289,6 +288,7 @@ out:
 	PROC_SLOCK(p);
 	thread_unsuspend(p); /* If it can run, let it do so. */
 	PROC_SUNLOCK(p);
+	PROC_UNLOCK(p);
 	return (0);
 }
 


More information about the svn-src-all mailing list