Date: Thu, 22 Nov 2007 13:27:17 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 129378 for review Message-ID: <200711221327.lAMDRHFI013184@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=129378 Change 129378 by gonzo@gonzo_jeeves on 2007/11/22 13:26:16 o Add pv_wired boolean field to pv_entry_t to mark wired entries. o Add pmap_page_wired_mappings to pmap module Affected files ... .. //depot/projects/mips2/src/sys/mips/include/pmap.h#9 edit .. //depot/projects/mips2/src/sys/mips/mips/pmap.c#29 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/include/pmap.h#9 (text+ko) ==== @@ -204,6 +204,7 @@ TAILQ_ENTRY(pv_entry) pv_list; TAILQ_ENTRY(pv_entry) pv_plist; vm_page_t pv_ptem; /* VM page for pte */ + boolean_t pv_wired; /* whether this entry is wired */ } *pv_entry_t; #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) ==== //depot/projects/mips2/src/sys/mips/mips/pmap.c#29 (text+ko) ==== @@ -197,7 +197,7 @@ static int pmap_remove_pte(pmap_t pmap, pt_entry_t* ptq, vm_offset_t sva); static int pmap_remove_entry(struct pmap *pmap, vm_page_t m, vm_offset_t va); static void pmap_insert_entry(pmap_t pmap, vm_offset_t va, - vm_page_t mpte, vm_page_t m); + vm_page_t mpte, vm_page_t m, boolean_t wired); /* * Given a map and a machine independent protection code, @@ -964,7 +964,8 @@ * (pmap, va). */ static void -pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t mpte, vm_page_t m) +pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t mpte, vm_page_t m, + boolean_t wired) { pv_entry_t pv; @@ -975,6 +976,7 @@ pv->pv_va = va; pv->pv_pmap = pmap; pv->pv_ptem = mpte; + pv->pv_wired = wired; TAILQ_INSERT_TAIL(&pmap->pm_pvlist, pv, pv_plist); TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); @@ -1303,7 +1305,7 @@ if (pmap_initialized && ((m->flags & (PG_FICTITIOUS|PG_UNMANAGED)) == 0) && (!has_mapping)) { - pmap_insert_entry(pmap, va, mpte, m); + pmap_insert_entry(pmap, va, mpte, m, wired); vm_page_lock_queues(); vm_page_flag_set(m, PG_REFERENCED); vm_page_unlock_queues(); @@ -1915,3 +1917,27 @@ return addr; } + +/* + * pmap_page_wired_mappings: + * + * Return the number of managed mappings to the given physical page + * that are wired. + */ +int +pmap_page_wired_mappings(vm_page_t m) +{ + pv_entry_t pv; + int count; + + count = 0; + if ((m->flags & PG_FICTITIOUS) != 0) + return (count); + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) + if (pv->pv_wired) + count++; + return (count); +} + +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711221327.lAMDRHFI013184>