5db078a9be
if we hold a spin mutex, since we can trivially get into deadlocks if we start switching out of processes that hold spinlocks. Checking to see if interrupts were disabled was a sort of cheap way of doing this since most of the time interrupts were only disabled when holding a spin lock. At least on the i386. To fix this properly, use a per-process counter p_spinlocks that counts the number of spin locks currently held, and instead of checking to see if interrupts are disabled in the witness code, check to see if we hold any spin locks. Since child processes always start up with the sched lock magically held in fork_exit(), we initialize p_spinlocks to 1 for child processes. Note that proc0 doesn't go through fork_exit(), so it starts with no spin locks held. Consulting from: cp |
||
---|---|---|
.. | ||
pc | ||
_limits.h | ||
alpha_cpu.h | ||
ansi.h | ||
asm.h | ||
atomic.h | ||
bootinfo.h | ||
bus_memio.h | ||
bus_pio.h | ||
bus.h | ||
bwx.h | ||
chipset.h | ||
clock.h | ||
clockvar.h | ||
cpu.h | ||
cpuconf.h | ||
cpufunc.h | ||
db_machdep.h | ||
elf.h | ||
endian.h | ||
exec.h | ||
float.h | ||
floatingpoint.h | ||
fpu.h | ||
frame.h | ||
globaldata.h | ||
globals.h | ||
ieee.h | ||
ieeefp.h | ||
in_cksum.h | ||
inst.h | ||
intr.h | ||
intrcnt.h | ||
ioctl_bt848.h | ||
ioctl_fd.h | ||
ioctl_meteor.h | ||
ipl.h | ||
limits.h | ||
md_var.h | ||
mutex.h | ||
pal.h | ||
param.h | ||
pcb.h | ||
pcpu.h | ||
pmap.h | ||
proc.h | ||
profile.h | ||
prom.h | ||
psl.h | ||
pte.h | ||
ptrace.h | ||
reg.h | ||
reloc.h | ||
resource.h | ||
rpb.h | ||
setjmp.h | ||
sgmap.h | ||
sigframe.h | ||
signal.h | ||
smp.h | ||
stdarg.h | ||
swiz.h | ||
sysarch.h | ||
types.h | ||
ucontext.h | ||
varargs.h | ||
vmparam.h |