diff options
author | alc <alc@FreeBSD.org> | 2012-11-14 17:33:00 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2012-11-14 17:33:00 +0000 |
commit | 1bce6c40648cef6575e0cb25eee13d7d429465a7 (patch) | |
tree | a87061ea9bceb123d07608701fbd43c7bf19f9d9 /sys | |
parent | d80ce03f42a9c9f75eca4006d016925f01df089d (diff) | |
download | FreeBSD-src-1bce6c40648cef6575e0cb25eee13d7d429465a7.zip FreeBSD-src-1bce6c40648cef6575e0cb25eee13d7d429465a7.tar.gz |
The function pmap_alloc_direct_page() unconditionally zeroes the returned
page. Therefore, it is really inappropriate for use by the function
uma_small_alloc(). The effect of using it was that every page was zeroed
at least once and possibly twice if M_ZERO was passed as a "wait" flag.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/mips/include/pmap.h | 1 | ||||
-rw-r--r-- | sys/mips/mips/pmap.c | 3 | ||||
-rw-r--r-- | sys/mips/mips/uma_machdep.c | 8 |
3 files changed, 7 insertions, 5 deletions
diff --git a/sys/mips/include/pmap.h b/sys/mips/include/pmap.h index 7b5468c..15b07d3 100644 --- a/sys/mips/include/pmap.h +++ b/sys/mips/include/pmap.h @@ -179,7 +179,6 @@ void pmap_kenter_temporary_free(vm_paddr_t pa); void pmap_flush_pvcache(vm_page_t m); int pmap_emulate_modified(pmap_t pmap, vm_offset_t va); void pmap_grow_direct_page_cache(void); -vm_page_t pmap_alloc_direct_page(unsigned int index, int req); #endif /* _KERNEL */ diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c index 608546e..7925b8c 100644 --- a/sys/mips/mips/pmap.c +++ b/sys/mips/mips/pmap.c @@ -163,6 +163,7 @@ static vm_page_t pmap_pv_reclaim(pmap_t locked_pmap); static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va); static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap, vm_offset_t va); +static vm_page_t pmap_alloc_direct_page(unsigned int index, int req); static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte); static int pmap_remove_pte(struct pmap *pmap, pt_entry_t *ptq, vm_offset_t va, @@ -1041,7 +1042,7 @@ pmap_grow_direct_page_cache() #endif } -vm_page_t +static vm_page_t pmap_alloc_direct_page(unsigned int index, int req) { vm_page_t m; diff --git a/sys/mips/mips/uma_machdep.c b/sys/mips/mips/uma_machdep.c index 798e632..f1483a9 100644 --- a/sys/mips/mips/uma_machdep.c +++ b/sys/mips/mips/uma_machdep.c @@ -50,12 +50,14 @@ uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) *flags = UMA_SLAB_PRIV; if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) - pflags = VM_ALLOC_INTERRUPT; + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED; else - pflags = VM_ALLOC_SYSTEM; + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED; + if (wait & M_ZERO) + pflags |= VM_ALLOC_ZERO; for (;;) { - m = pmap_alloc_direct_page(0, pflags); + m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, pflags); if (m == NULL) { if (wait & M_NOWAIT) return (NULL); |