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
This commit is contained in:
Chuck Silvers 2020-02-18 00:02:20 +00:00
parent 80986ae0c1
commit 2272f66379

View File

@ -4298,7 +4298,7 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwlock **lockp, int domain)
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 rwlock **lockp, int domain)
* 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 rwlock **lockp, int domain)
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 rwlock **lockp, int domain)
PG_A = pmap_accessed_bit(pmap);
PG_M = pmap_modified_bit(pmap);
PG_RW = pmap_rw_bit(pmap);
if (restart)
continue;
}
/*