Date: Wed, 11 Mar 2009 14:55:04 +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: r189698 - head/sys/amd64/amd64 Message-ID: <200903111455.n2BEt4g7098696@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: alc Date: Wed Mar 11 14:55:04 2009 New Revision: 189698 URL: http://svn.freebsd.org/changeset/base/189698 Log: Optimize the inner loop of pmap_copy(). MFC after: 6 weeks Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Mar 11 14:39:55 2009 (r189697) +++ head/sys/amd64/amd64/pmap.c Wed Mar 11 14:55:04 2009 (r189698) @@ -3538,6 +3538,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm src_pte = (pt_entry_t *)PHYS_TO_DMAP(srcptepaddr); src_pte = &src_pte[pmap_pte_index(addr)]; + dstmpte = NULL; while (addr < va_next) { pt_entry_t ptetemp; ptetemp = *src_pte; @@ -3545,9 +3546,11 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm * we only virtual copy managed pages */ if ((ptetemp & PG_MANAGED) != 0) { - dstmpte = pmap_allocpte(dst_pmap, addr, - M_NOWAIT); - if (dstmpte == NULL) + if (dstmpte != NULL && + dstmpte->pindex == pmap_pde_pindex(addr)) + dstmpte->wire_count++; + else if ((dstmpte = pmap_allocpte(dst_pmap, + addr, M_NOWAIT)) == NULL) break; dst_pte = (pt_entry_t *) PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dstmpte));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903111455.n2BEt4g7098696>