svn commit: r358058 - head/sys/amd64/amd64

Chuck Silvers chs at FreeBSD.org
Tue Feb 18 00:02:22 UTC 2020


Author: chs
Date: Tue Feb 18 00:02:20 2020
New Revision: 358058
URL: https://svnweb.freebsd.org/changeset/base/358058

Log:
  amd64: keep PTE bitmasks in sync with target pmap during pv reclaim
  
  in reclaim_pv_chunk_domain(), when we switch to a new target pmap from which
  we are trying to reclaim a pv chunk, always update the current PTE bitmasks
  to match.
  
  Reviewed by:	kib, markj
  Approved by:	imp (mentor)
  Sponsored by:	Netflix

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Tue Feb 18 00:01:18 2020	(r358057)
+++ head/sys/amd64/amd64/pmap.c	Tue Feb 18 00:02:20 2020	(r358058)
@@ -4298,7 +4298,7 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwl
 	struct spglist free;
 	uint64_t inuse;
 	int bit, field, freed;
-	bool start_di;
+	bool start_di, restart;
 
 	PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED);
 	KASSERT(lockp != NULL, ("reclaim_pv_chunk: lockp is NULL"));
@@ -4343,6 +4343,7 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwl
 		 * corresponding pmap is locked.
 		 */
 		if (pmap != next_pmap) {
+			restart = false;
 			reclaim_pv_chunk_leave_pmap(pmap, locked_pmap,
 			    start_di);
 			pmap = next_pmap;
@@ -4353,13 +4354,13 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwl
 				if (start_di)
 					pmap_delayed_invl_start();
 				mtx_lock(&pvc->pvc_lock);
-				continue;
+				restart = true;
 			} else if (pmap != locked_pmap) {
 				if (PMAP_TRYLOCK(pmap)) {
 					if (start_di)
 						pmap_delayed_invl_start();
 					mtx_lock(&pvc->pvc_lock);
-					continue;
+					restart = true;
 				} else {
 					pmap = NULL; /* pmap is not locked */
 					mtx_lock(&pvc->pvc_lock);
@@ -4375,6 +4376,8 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwl
 			PG_A = pmap_accessed_bit(pmap);
 			PG_M = pmap_modified_bit(pmap);
 			PG_RW = pmap_rw_bit(pmap);
+			if (restart)
+				continue;
 		}
 
 		/*


More information about the svn-src-all mailing list