From owner-svn-src-all@FreeBSD.ORG Wed Feb 10 05:43:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 591C11065672; Wed, 10 Feb 2010 05:43:32 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 484598FC16; Wed, 10 Feb 2010 05:43:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1A5hWu0097234; Wed, 10 Feb 2010 05:43:32 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1A5hWMp097233; Wed, 10 Feb 2010 05:43:32 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002100543.o1A5hWMp097233@svn.freebsd.org> From: Neel Natu Date: Wed, 10 Feb 2010 05:43:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203743 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 05:43:32 -0000 Author: neel Date: Wed Feb 10 05:43:31 2010 New Revision: 203743 URL: http://svn.freebsd.org/changeset/base/203743 Log: 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. Modified: head/sys/mips/mips/exception.S Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Wed Feb 10 04:12:55 2010 (r203742) +++ head/sys/mips/mips/exception.S Wed Feb 10 05:43:31 2010 (r203743) @@ -728,6 +728,18 @@ NNON_LEAF(MipsUserIntr, STAND_FRAME_SIZE 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 */ DO_AST