diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index 55d46fba01a..c14e42d1661 100644 --- a/sys/alpha/alpha/pmap.c +++ b/sys/alpha/alpha/pmap.c @@ -594,7 +594,7 @@ uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) } va = (void *)ALPHA_PHYS_TO_K0SEG(m->phys_addr); - if ((m->flags & PG_ZERO) == 0) + if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) bzero(va, PAGE_SIZE); return (va); } diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 8a3226b9212..93bd3acbead 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -557,7 +557,7 @@ uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) } va = (void *)PHYS_TO_DMAP(m->phys_addr); - if ((m->flags & PG_ZERO) == 0) + if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) pagezero(va); return (va); } diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c index 77effaa698e..43405bdcfce 100644 --- a/sys/ia64/ia64/pmap.c +++ b/sys/ia64/ia64/pmap.c @@ -539,7 +539,7 @@ uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) } va = (void *)IA64_PHYS_TO_RR7(VM_PAGE_TO_PHYS(m)); - if ((m->flags & PG_ZERO) == 0) + if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) bzero(va, PAGE_SIZE); return (va); } diff --git a/sys/sparc64/sparc64/vm_machdep.c b/sys/sparc64/sparc64/vm_machdep.c index 7f54e122e48..5b4b9ab299e 100644 --- a/sys/sparc64/sparc64/vm_machdep.c +++ b/sys/sparc64/sparc64/vm_machdep.c @@ -370,7 +370,7 @@ uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) dcache_page_inval(pa); } va = (void *)TLB_PHYS_TO_DIRECT(pa); - if ((m->flags & PG_ZERO) == 0) + if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) bzero(va, PAGE_SIZE); return (va); }