Date: Wed, 23 Jan 2008 01:31:00 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 133903 for review Message-ID: <200801230131.m0N1V0kM090607@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=133903 Change 133903 by kmacy@pandemonium:kmacy:xen31 on 2008/01/23 01:30:14 disable pre-faulting until the problems are better understood Affected files ... .. //depot/projects/xen31/sys/i386/xen/pmap.c#30 edit Differences ... ==== //depot/projects/xen31/sys/i386/xen/pmap.c#30 (text+ko) ==== @@ -290,6 +290,8 @@ static void pmap_pte_release(pt_entry_t *pte); static int pmap_unuse_pt(pmap_t, vm_offset_t, vm_page_t *); static vm_offset_t pmap_kmem_choose(vm_offset_t addr); +static boolean_t pmap_is_prefaultable_locked(pmap_t pmap, vm_offset_t addr); + #ifdef PAE static void *pmap_pdpt_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait); #endif @@ -2788,6 +2790,9 @@ PMAP_LOCK(pmap); for (i = 0; i < count; i++, addrs++, pages++, prots++) { + if (!pmap_is_prefaultable_locked(pmap, *addrs)) + continue; + (void) pmap_enter_quick_locked(mclp, pmap, *addrs, *pages, *prots, NULL); index++; mclp++; @@ -3481,22 +3486,32 @@ * Return whether or not the specified virtual address is elgible * for prefault. */ -boolean_t -pmap_is_prefaultable(pmap_t pmap, vm_offset_t addr) +static boolean_t +pmap_is_prefaultable_locked(pmap_t pmap, vm_offset_t addr) { pt_entry_t *pte; boolean_t rv = FALSE; - PMAP_LOCK(pmap); + return (rv); + if (*pmap_pde(pmap, addr)) { pte = vtopte(addr); - rv = *pte == 0; + rv = ((*pte & PG_V) == 0); } + return (rv); +} + +boolean_t +pmap_is_prefaultable(pmap_t pmap, vm_offset_t addr) +{ + boolean_t rv; + + PMAP_LOCK(pmap); + rv = pmap_is_prefaultable_locked(pmap, addr); PMAP_UNLOCK(pmap); return (rv); } - void pmap_map_readonly(pmap_t pmap, vm_offset_t va, int len) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801230131.m0N1V0kM090607>