summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2000-10-03 08:03:03 +0000
committerdfr <dfr@FreeBSD.org>2000-10-03 08:03:03 +0000
commit0e1317469eba45505dec0986c9cf526f995d5dec (patch)
tree9a302ca5933c55c31a3fa6601725ac7d8b8148f2 /sys
parent722bd184818a952dd451b20b8915ae459c8457d9 (diff)
downloadFreeBSD-src-0e1317469eba45505dec0986c9cf526f995d5dec.zip
FreeBSD-src-0e1317469eba45505dec0986c9cf526f995d5dec.tar.gz
Clear pcb_schednest in cpu_fork() for the child process. This is
is necessary since the child's call stack only includes one recursive hold of sched_lock.
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/alpha/vm_machdep.c7
-rw-r--r--sys/powerpc/aim/vm_machdep.c7
-rw-r--r--sys/powerpc/powerpc/vm_machdep.c7
3 files changed, 21 insertions, 0 deletions
diff --git a/sys/alpha/alpha/vm_machdep.c b/sys/alpha/alpha/vm_machdep.c
index 3831d67..f706590 100644
--- a/sys/alpha/alpha/vm_machdep.c
+++ b/sys/alpha/alpha/vm_machdep.c
@@ -210,6 +210,13 @@ cpu_fork(p1, p2, flags)
up->u_pcb.pcb_context[2] = (u_long) p2; /* s2: a0 */
up->u_pcb.pcb_context[7] =
(u_int64_t)switch_trampoline; /* ra: assembly magic */
+
+ /*
+ * Clear the saved recursion count for sched_lock
+ * since the child needs only one count which is
+ * released in switch_trampoline.
+ */
+ up->u_pcb.pcb_schednest = 0;
}
}
diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c
index 3831d67..f706590 100644
--- a/sys/powerpc/aim/vm_machdep.c
+++ b/sys/powerpc/aim/vm_machdep.c
@@ -210,6 +210,13 @@ cpu_fork(p1, p2, flags)
up->u_pcb.pcb_context[2] = (u_long) p2; /* s2: a0 */
up->u_pcb.pcb_context[7] =
(u_int64_t)switch_trampoline; /* ra: assembly magic */
+
+ /*
+ * Clear the saved recursion count for sched_lock
+ * since the child needs only one count which is
+ * released in switch_trampoline.
+ */
+ up->u_pcb.pcb_schednest = 0;
}
}
diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c
index 3831d67..f706590 100644
--- a/sys/powerpc/powerpc/vm_machdep.c
+++ b/sys/powerpc/powerpc/vm_machdep.c
@@ -210,6 +210,13 @@ cpu_fork(p1, p2, flags)
up->u_pcb.pcb_context[2] = (u_long) p2; /* s2: a0 */
up->u_pcb.pcb_context[7] =
(u_int64_t)switch_trampoline; /* ra: assembly magic */
+
+ /*
+ * Clear the saved recursion count for sched_lock
+ * since the child needs only one count which is
+ * released in switch_trampoline.
+ */
+ up->u_pcb.pcb_schednest = 0;
}
}
OpenPOWER on IntegriCloud