diff options
author | alc <alc@FreeBSD.org> | 2003-06-18 02:57:38 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2003-06-18 02:57:38 +0000 |
commit | 9dcd110789373369f96f2400292de3c7b2d50d6e (patch) | |
tree | d86cf16353f3d8e0361533d5f22b7ae288925f52 | |
parent | d54ed51ea92e745fb49138453ff3331e9304b943 (diff) | |
download | FreeBSD-src-9dcd110789373369f96f2400292de3c7b2d50d6e.zip FreeBSD-src-9dcd110789373369f96f2400292de3c7b2d50d6e.tar.gz |
Fix a performance bug in all of the various implementations of
uma_small_alloc(): They always zeroed the page regardless of what the
caller requested.
-rw-r--r-- | sys/alpha/alpha/pmap.c | 2 | ||||
-rw-r--r-- | sys/amd64/amd64/pmap.c | 2 | ||||
-rw-r--r-- | sys/ia64/ia64/pmap.c | 2 | ||||
-rw-r--r-- | sys/sparc64/sparc64/vm_machdep.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index 55d46fb..c14e42d 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 8a3226b..93bd3ac 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 77effaa..43405bd 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 7f54e12..5b4b9ab 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); } |