Date: Sun, 19 Feb 2017 18:00:57 +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: r313960 - head/sys/amd64/amd64 Message-ID: <201702191800.v1JI0vQx014369@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: alc Date: Sun Feb 19 18:00:57 2017 New Revision: 313960 URL: https://svnweb.freebsd.org/changeset/base/313960 Log: In pmap_enter(), set the PG_MANAGED flag on the new PTE in one place, rather two places, and do so before the pmap lock is acquired. Submitted by: Yufeng Zhou <yz70@rice.edu> Reviewed by: kib MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Feb 19 17:47:43 2017 (r313959) +++ head/sys/amd64/amd64/pmap.c Sun Feb 19 18:00:57 2017 (r313960) @@ -4350,7 +4350,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, if ((m->oflags & VPO_UNMANAGED) != 0) { if ((newpte & PG_RW) != 0) newpte |= PG_M; - } + } else + newpte |= PG_MANAGED; mpte = NULL; @@ -4423,11 +4424,9 @@ retry: /* * No, might be a protection or wiring change. */ - if ((origpte & PG_MANAGED) != 0) { - newpte |= PG_MANAGED; - if ((newpte & PG_RW) != 0) - vm_page_aflag_set(m, PGA_WRITEABLE); - } + if ((origpte & PG_MANAGED) != 0 && + (newpte & PG_RW) != 0) + vm_page_aflag_set(m, PGA_WRITEABLE); if (((origpte ^ newpte) & ~(PG_M | PG_A)) == 0) goto unchanged; goto validate; @@ -4444,8 +4443,7 @@ retry: /* * Enter on the PV list if part of our managed memory. */ - if ((m->oflags & VPO_UNMANAGED) == 0) { - newpte |= PG_MANAGED; + if ((newpte & PG_MANAGED) != 0) { pv = get_pv_entry(pmap, &lock); pv->pv_va = va; CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, pa);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702191800.v1JI0vQx014369>