]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix wakeup latency when sleeping with 'wait'
authorJayachandran C. <jchandra@FreeBSD.org>
Tue, 18 Oct 2011 16:37:28 +0000 (16:37 +0000)
committerJayachandran C. <jchandra@FreeBSD.org>
Tue, 18 Oct 2011 16:37:28 +0000 (16:37 +0000)
commit29550c285c4a7ef59279f543a2316ce1cdae5b6b
tree70ca18ceb01dcca91bd650fa1a50cdaf0ed55e21
parentdceed24a7c730b6c50166d699e2110379c196a79
Fix wakeup latency when sleeping with 'wait'

If we handle an interrupt just before the 'wait' and the interrupt
schedules some work, we need to skip the 'wait' call. The simple solution
of calling sched_runnable() with interrupts disabled immediately before
wait still leaves a window after the call and before 'wait' in which
the same issue can occur.

The solution implemented is to check the EPC in the interrupt handler, and
if it is in a region before the 'wait' call, to fix up the EPC to skip the
wait call.

Reported/analysed by: adrian
Fix suggested by: kib

Reviewed by: jmallett, imp
sys/mips/include/md_var.h
sys/mips/mips/exception.S
sys/mips/mips/machdep.c