Enable interrupts before doing AST processing to avoid a deadlock.

Specifically on an SMP kernel it was observed that if both the
processors are doing an exit1() via ast()->postsig()->sigexit()
then we will deadlock.

This happens because exit1() calls vmspace_exit() that in turn
calls pmap_invalidate_all(). This function tries to do a
smp_rendezvous() which blocks because the other processor is not
responding to IPIs - because it too is doing AST processing with
interrupts disabled.
This commit is contained in:
Neel Natu 2010-02-10 05:43:31 +00:00
parent a0b96fd411
commit ed6933b252
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=203743

View File

@ -727,6 +727,18 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE, ra)
jalr k0
sw a3, STAND_RA_OFFSET(sp) # for debugging
/*
* Enable interrupts before doing ast().
*
* On SMP kernels the AST processing might trigger IPI to other processors.
* If that processor is also doing AST processing with interrupts disabled
* then we may deadlock.
*/
mfc0 a0, COP_0_STATUS_REG
or a0, a0, SR_INT_ENAB
mtc0 a0, COP_0_STATUS_REG
ITLBNOPFIX
/*
* DO_AST enabled interrupts
*/