From owner-svn-src-head@FreeBSD.ORG Mon Aug 18 20:28:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D9E0A61; Mon, 18 Aug 2014 20:28:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5987533C6; Mon, 18 Aug 2014 20:28:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7IKS9eM076922; Mon, 18 Aug 2014 20:28:09 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7IKS9vQ076920; Mon, 18 Aug 2014 20:28:09 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201408182028.s7IKS9vQ076920@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 18 Aug 2014 20:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270151 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Aug 2014 20:28:09 -0000 Author: alc Date: Mon Aug 18 20:28:08 2014 New Revision: 270151 URL: http://svnweb.freebsd.org/changeset/base/270151 Log: There exists a possible sequence of page table page allocation failures starting with a superpage demotion by pmap_enter() that could result in a PV list lock being held when pmap_enter() is just about to return KERN_RESOURCE_SHORTAGE. Consequently, the KASSERT that no PV list locks are held needs to be replaced with a conditional unlock. Discussed with: kib X-MFC with: r269728 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Aug 18 20:21:12 2014 (r270150) +++ head/sys/amd64/amd64/pmap.c Mon Aug 18 20:28:08 2014 (r270151) @@ -4201,9 +4201,10 @@ retry: mpte = _pmap_allocpte(pmap, pmap_pde_pindex(va), nosleep ? NULL : &lock); if (mpte == NULL && nosleep) { - KASSERT(lock == NULL, ("lock leaked for nosleep")); - PMAP_UNLOCK(pmap); + if (lock != NULL) + rw_wunlock(lock); rw_runlock(&pvh_global_lock); + PMAP_UNLOCK(pmap); return (KERN_RESOURCE_SHORTAGE); } goto retry;