Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Aug 2014 20:28:09 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r270151 - head/sys/amd64/amd64
Message-ID:  <201408182028.s7IKS9vQ076920@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408182028.s7IKS9vQ076920>