summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_proc.c')
-rw-r--r--sys/kern/kern_proc.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index a4f8576..e980176 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -2983,6 +2983,12 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC_SIGTRAMP, sigtramp, CTLFLAG_RD |
int allproc_gen;
+/*
+ * stop_all_proc() purpose is to stop all process which have usermode,
+ * except current process for obvious reasons. This makes it somewhat
+ * unreliable when invoked from multithreaded process. The service
+ * must not be user-callable anyway.
+ */
void
stop_all_proc(void)
{
@@ -2991,17 +2997,6 @@ stop_all_proc(void)
bool restart, seen_stopped, seen_exiting, stopped_some;
cp = curproc;
- /*
- * stop_all_proc() assumes that all process which have
- * usermode must be stopped, except current process, for
- * obvious reasons. Since other threads in the process
- * establishing global stop could unstop something, disable
- * calls from multithreaded processes as precaution. The
- * service must not be user-callable anyway.
- */
- KASSERT((cp->p_flag & P_HADTHREADS) == 0 ||
- (cp->p_flag & P_KTHREAD) != 0, ("mt stop_all_proc"));
-
allproc_loop:
sx_xlock(&allproc_lock);
gen = allproc_gen;
@@ -3015,8 +3010,7 @@ allproc_loop:
LIST_REMOVE(cp, p_list);
LIST_INSERT_AFTER(p, cp, p_list);
PROC_LOCK(p);
- if ((p->p_flag & (P_KTHREAD | P_SYSTEM |
- P_TOTAL_STOP)) != 0) {
+ if ((p->p_flag & (P_KPROC | P_SYSTEM | P_TOTAL_STOP)) != 0) {
PROC_UNLOCK(p);
continue;
}
@@ -3088,7 +3082,7 @@ resume_all_proc(void)
sx_xunlock(&allproc_lock);
}
-#define TOTAL_STOP_DEBUG 1
+/* #define TOTAL_STOP_DEBUG 1 */
#ifdef TOTAL_STOP_DEBUG
volatile static int ap_resume;
#include <sys/mount.h>
OpenPOWER on IntegriCloud