Date: Tue, 18 Feb 2020 00:02:21 +0000 (UTC) From: Chuck Silvers <chs@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358058 - head/sys/amd64/amd64 Message-ID: <202002180002.01I02LH7009838@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002180002.01I02LH7009838>