- Change comments and asserts to reflect the removal of the global
scheduler lock. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)
This commit is contained in:
parent
74aaec43e8
commit
1b1618fb12
@ -170,7 +170,7 @@ cpu_fork(td1, p2, td2, flags)
|
||||
* pcb2->pcb_[fg]sbase: cloned above
|
||||
*/
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release spin count in fork_exit(). */
|
||||
td2->td_md.md_spinlock_count = 1;
|
||||
td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I;
|
||||
|
||||
@ -304,7 +304,7 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
|
||||
* pcb2->pcb_[fg]sbase: cloned above
|
||||
*/
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release spin count in fork_exit(). */
|
||||
td->td_md.md_spinlock_count = 1;
|
||||
td->td_md.md_saved_flags = PSL_KERNEL | PSL_I;
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ cpu_fork(register struct thread *td1, register struct proc *p2,
|
||||
tf->tf_r1 = 0;
|
||||
pcb2->un_32.pcb32_sp = (u_int)sf;
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release spin count in fork_exit(). */
|
||||
td2->td_md.md_spinlock_count = 1;
|
||||
td2->td_md.md_saved_cspr = 0;
|
||||
td2->td_md.md_tp = *(uint32_t **)ARM_TP_ADDRESS;
|
||||
@ -288,7 +288,7 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
|
||||
td->td_pcb->un_32.pcb32_sp = (u_int)sf;
|
||||
td->td_pcb->un_32.pcb32_und_sp = td->td_kstack + USPACE_UNDEF_STACK_TOP;
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release spin count in fork_exit(). */
|
||||
td->td_md.md_spinlock_count = 1;
|
||||
td->td_md.md_saved_cspr = 0;
|
||||
}
|
||||
|
@ -2326,8 +2326,8 @@ sc_switch_scr(sc_softc_t *sc, u_int next_scr)
|
||||
if (sc->new_scp == sc->old_scp) {
|
||||
sc->switch_in_progress = 0;
|
||||
/*
|
||||
* XXX wakeup() calls mtx_lock(&sched_lock) which will hang if
|
||||
* sched_lock is in an in-between state, e.g., when we stop at
|
||||
* XXX wakeup() locks the scheduler lock which will hang if
|
||||
* the lock is in an in-between state, e.g., when we stop at
|
||||
* a breakpoint at fork_exit. It has always been wrong to call
|
||||
* wakeup() when the debugger is active. In RELENG_4, wakeup()
|
||||
* is supposed to be locked by splhigh(), but the debugger may
|
||||
|
@ -264,7 +264,7 @@ cpu_fork(td1, p2, td2, flags)
|
||||
}
|
||||
mtx_unlock_spin(&dt_lock);
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release spin count in fork_exit(). */
|
||||
td2->td_md.md_spinlock_count = 1;
|
||||
td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I;
|
||||
|
||||
@ -438,7 +438,7 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
|
||||
*/
|
||||
pcb2->pcb_ext = NULL;
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release spin count in fork_exit(). */
|
||||
td->td_md.md_spinlock_count = 1;
|
||||
td->td_md.md_saved_flags = PSL_KERNEL | PSL_I;
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
|
||||
pcb->pcb_special.rp = FDESC_FUNC(fork_trampoline);
|
||||
cpu_set_fork_handler(td, (void (*)(void*))fork_return, td);
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release the spin count in fork_exit(). */
|
||||
td->td_md.md_spinlock_count = 1;
|
||||
td->td_md.md_saved_intr = 1;
|
||||
}
|
||||
@ -284,7 +284,7 @@ cpu_fork(struct thread *td1, struct proc *p2 __unused, struct thread *td2,
|
||||
td2->td_pcb->pcb_special.rp = FDESC_FUNC(fork_trampoline);
|
||||
cpu_set_fork_handler(td2, (void (*)(void*))fork_return, td2);
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release the spin count in fork_exit(). */
|
||||
td2->td_md.md_spinlock_count = 1;
|
||||
td2->td_md.md_saved_intr = 1;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
|
||||
pcb->pcb_lr = (register_t)fork_trampoline;
|
||||
pcb->pcb_usr = kernel_pmap->pm_sr[USER_SR];
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release spin count in fork_exit(). */
|
||||
td2->td_md.md_spinlock_count = 1;
|
||||
td2->td_md.md_saved_msr = PSL_KERNSET;
|
||||
|
||||
@ -327,7 +327,7 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
|
||||
pcb2->pcb_lr = (register_t)fork_trampoline;
|
||||
pcb2->pcb_usr = kernel_pmap->pm_sr[USER_SR];
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release spin count in fork_exit(). */
|
||||
td->td_md.md_spinlock_count = 1;
|
||||
td->td_md.md_saved_msr = PSL_KERNSET;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
|
||||
pcb->pcb_lr = (register_t)fork_trampoline;
|
||||
pcb->pcb_usr = kernel_pmap->pm_sr[USER_SR];
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release spin count in fork_exit(). */
|
||||
td2->td_md.md_spinlock_count = 1;
|
||||
td2->td_md.md_saved_msr = PSL_KERNSET;
|
||||
|
||||
@ -327,7 +327,7 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
|
||||
pcb2->pcb_lr = (register_t)fork_trampoline;
|
||||
pcb2->pcb_usr = kernel_pmap->pm_sr[USER_SR];
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release spin count in fork_exit(). */
|
||||
td->td_md.md_spinlock_count = 1;
|
||||
td->td_md.md_saved_msr = PSL_KERNSET;
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
|
||||
pcb->pcb_pc = (u_long)fork_trampoline - 8;
|
||||
pcb->pcb_sp = (u_long)fr - SPOFF;
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release the spin count in fork_exit(). */
|
||||
td->td_md.md_spinlock_count = 1;
|
||||
td->td_md.md_saved_pil = 0;
|
||||
}
|
||||
@ -298,7 +298,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
|
||||
pcb2->pcb_sp = (u_long)fp - SPOFF;
|
||||
pcb2->pcb_pc = (u_long)fork_trampoline - 8;
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release the spin count in fork_exit(). */
|
||||
td2->td_md.md_spinlock_count = 1;
|
||||
td2->td_md.md_saved_pil = 0;
|
||||
|
||||
|
@ -712,6 +712,5 @@ syscall(struct trapframe *tf)
|
||||
|
||||
WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning",
|
||||
(code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???");
|
||||
mtx_assert(&sched_lock, MA_NOTOWNED);
|
||||
mtx_assert(&Giant, MA_NOTOWNED);
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ cpu_set_upcall(struct thread *td, struct thread *td0)
|
||||
pcb->pcb_pc = (u_long)fork_trampoline - 8;
|
||||
pcb->pcb_sp = (u_long)fr - SPOFF;
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release spin count in fork_exit(). */
|
||||
td->td_md.md_spinlock_count = 1;
|
||||
td->td_md.md_saved_pil = 0;
|
||||
}
|
||||
@ -288,7 +288,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags)
|
||||
pcb2->pcb_pc = (u_long)fork_trampoline - 8;
|
||||
pcb2->pcb_kstack = (uint64_t)(((char *)pcb2orig) - (CCFSZ + SPOFF));
|
||||
|
||||
/* Setup to release sched_lock in fork_exit(). */
|
||||
/* Setup to release spin count in fork_exit(). */
|
||||
td2->td_md.md_spinlock_count = 1;
|
||||
td2->td_md.md_saved_pil = 0;
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
||||
* Locking key:
|
||||
* b - created at fork, never changes
|
||||
* c - locked by proc mtx
|
||||
* j - locked by sched_lock mtx
|
||||
* j - locked by proc slock
|
||||
* k - only accessed by curthread
|
||||
*/
|
||||
struct pstats {
|
||||
|
Loading…
Reference in New Issue
Block a user