summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/amd64/mp_machdep.c11
-rw-r--r--sys/amd64/amd64/mptable.c11
-rw-r--r--sys/amd64/include/mptable.h11
-rw-r--r--sys/i386/i386/mp_machdep.c11
-rw-r--r--sys/i386/i386/mptable.c11
-rw-r--r--sys/i386/include/mptable.h11
-rw-r--r--sys/kern/subr_smp.c11
7 files changed, 63 insertions, 14 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 945a588..907a2e2 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -2777,10 +2777,14 @@ forward_signal(struct proc *p)
return;
if (!forward_signal_enabled)
return;
+ mtx_enter(&sched_lock, MTX_SPIN);
while (1) {
- if (p->p_stat != SRUN)
+ if (p->p_stat != SRUN) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
id = p->p_oncpu;
+ mtx_exit(&sched_lock, MTX_SPIN);
if (id == 0xff)
return;
map = (1<<id);
@@ -2798,8 +2802,11 @@ forward_signal(struct proc *p)
break;
}
}
- if (id == p->p_oncpu)
+ mtx_enter(&sched_lock, MTX_SPIN);
+ if (id == p->p_oncpu) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
}
}
diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c
index 945a588..907a2e2 100644
--- a/sys/amd64/amd64/mptable.c
+++ b/sys/amd64/amd64/mptable.c
@@ -2777,10 +2777,14 @@ forward_signal(struct proc *p)
return;
if (!forward_signal_enabled)
return;
+ mtx_enter(&sched_lock, MTX_SPIN);
while (1) {
- if (p->p_stat != SRUN)
+ if (p->p_stat != SRUN) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
id = p->p_oncpu;
+ mtx_exit(&sched_lock, MTX_SPIN);
if (id == 0xff)
return;
map = (1<<id);
@@ -2798,8 +2802,11 @@ forward_signal(struct proc *p)
break;
}
}
- if (id == p->p_oncpu)
+ mtx_enter(&sched_lock, MTX_SPIN);
+ if (id == p->p_oncpu) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
}
}
diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h
index 945a588..907a2e2 100644
--- a/sys/amd64/include/mptable.h
+++ b/sys/amd64/include/mptable.h
@@ -2777,10 +2777,14 @@ forward_signal(struct proc *p)
return;
if (!forward_signal_enabled)
return;
+ mtx_enter(&sched_lock, MTX_SPIN);
while (1) {
- if (p->p_stat != SRUN)
+ if (p->p_stat != SRUN) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
id = p->p_oncpu;
+ mtx_exit(&sched_lock, MTX_SPIN);
if (id == 0xff)
return;
map = (1<<id);
@@ -2798,8 +2802,11 @@ forward_signal(struct proc *p)
break;
}
}
- if (id == p->p_oncpu)
+ mtx_enter(&sched_lock, MTX_SPIN);
+ if (id == p->p_oncpu) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
}
}
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c
index 945a588..907a2e2 100644
--- a/sys/i386/i386/mp_machdep.c
+++ b/sys/i386/i386/mp_machdep.c
@@ -2777,10 +2777,14 @@ forward_signal(struct proc *p)
return;
if (!forward_signal_enabled)
return;
+ mtx_enter(&sched_lock, MTX_SPIN);
while (1) {
- if (p->p_stat != SRUN)
+ if (p->p_stat != SRUN) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
id = p->p_oncpu;
+ mtx_exit(&sched_lock, MTX_SPIN);
if (id == 0xff)
return;
map = (1<<id);
@@ -2798,8 +2802,11 @@ forward_signal(struct proc *p)
break;
}
}
- if (id == p->p_oncpu)
+ mtx_enter(&sched_lock, MTX_SPIN);
+ if (id == p->p_oncpu) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
}
}
diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c
index 945a588..907a2e2 100644
--- a/sys/i386/i386/mptable.c
+++ b/sys/i386/i386/mptable.c
@@ -2777,10 +2777,14 @@ forward_signal(struct proc *p)
return;
if (!forward_signal_enabled)
return;
+ mtx_enter(&sched_lock, MTX_SPIN);
while (1) {
- if (p->p_stat != SRUN)
+ if (p->p_stat != SRUN) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
id = p->p_oncpu;
+ mtx_exit(&sched_lock, MTX_SPIN);
if (id == 0xff)
return;
map = (1<<id);
@@ -2798,8 +2802,11 @@ forward_signal(struct proc *p)
break;
}
}
- if (id == p->p_oncpu)
+ mtx_enter(&sched_lock, MTX_SPIN);
+ if (id == p->p_oncpu) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
}
}
diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h
index 945a588..907a2e2 100644
--- a/sys/i386/include/mptable.h
+++ b/sys/i386/include/mptable.h
@@ -2777,10 +2777,14 @@ forward_signal(struct proc *p)
return;
if (!forward_signal_enabled)
return;
+ mtx_enter(&sched_lock, MTX_SPIN);
while (1) {
- if (p->p_stat != SRUN)
+ if (p->p_stat != SRUN) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
id = p->p_oncpu;
+ mtx_exit(&sched_lock, MTX_SPIN);
if (id == 0xff)
return;
map = (1<<id);
@@ -2798,8 +2802,11 @@ forward_signal(struct proc *p)
break;
}
}
- if (id == p->p_oncpu)
+ mtx_enter(&sched_lock, MTX_SPIN);
+ if (id == p->p_oncpu) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
}
}
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
index 945a588..907a2e2 100644
--- a/sys/kern/subr_smp.c
+++ b/sys/kern/subr_smp.c
@@ -2777,10 +2777,14 @@ forward_signal(struct proc *p)
return;
if (!forward_signal_enabled)
return;
+ mtx_enter(&sched_lock, MTX_SPIN);
while (1) {
- if (p->p_stat != SRUN)
+ if (p->p_stat != SRUN) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
id = p->p_oncpu;
+ mtx_exit(&sched_lock, MTX_SPIN);
if (id == 0xff)
return;
map = (1<<id);
@@ -2798,8 +2802,11 @@ forward_signal(struct proc *p)
break;
}
}
- if (id == p->p_oncpu)
+ mtx_enter(&sched_lock, MTX_SPIN);
+ if (id == p->p_oncpu) {
+ mtx_exit(&sched_lock, MTX_SPIN);
return;
+ }
}
}
OpenPOWER on IntegriCloud