diff options
author | jhb <jhb@FreeBSD.org> | 2001-12-14 23:37:35 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-12-14 23:37:35 +0000 |
commit | 0c1bfda97435eb852eb0df002eb7a86cc1fd4c88 (patch) | |
tree | 074c04b0152797b2bd2dc4e5bd3ac24c10606ade /sys/kern/kern_fork.c | |
parent | 12cc1b9a91930f83ea606b9bf81d05fd843edec9 (diff) | |
download | FreeBSD-src-0c1bfda97435eb852eb0df002eb7a86cc1fd4c88.zip FreeBSD-src-0c1bfda97435eb852eb0df002eb7a86cc1fd4c88.tar.gz |
Fix some nits in fork_exit() so it more properly duplicates the backend
of mi_switch:
- Set the oncpu value for the current thread.
- Always set switchticks, not just in the SMP case.
- Add a KTR entry for fork_exit that is the same as the "new proc"
entry in mi_switch().
- Release sched_lock a bit later like we do with mi_switch().
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r-- | sys/kern/kern_fork.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 28f0970..bb52a34 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -760,6 +760,7 @@ fork_exit(callout, arg, frame) struct thread *td = curthread; struct proc *p = td->td_proc; + td->td_kse->ke_oncpu = PCPU_GET(cpuid); /* * Setup the sched_lock state so that we can release it. */ @@ -769,13 +770,12 @@ fork_exit(callout, arg, frame) * XXX: We really shouldn't have to do this. */ mtx_intr_enable(&sched_lock); - mtx_unlock_spin(&sched_lock); - -#ifdef SMP + CTR3(KTR_PROC, "fork_exit: new proc %p (pid %d, %s)", p, p->p_pid, + p->p_comm); if (PCPU_GET(switchtime.tv_sec) == 0) microuptime(PCPU_PTR(switchtime)); PCPU_SET(switchticks, ticks); -#endif + mtx_unlock_spin(&sched_lock); /* * cpu_set_fork_handler intercepts this function call to |