From 9e0ad88b8280923d4a210efa2cee2e1f29a34354 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 22 Oct 2020 17:47:51 +0000 Subject: [PATCH] Micro-optimize uma_small_alloc(). Replace bzero(..., PAGE_SIZE) by pagezero(). Ultimately, they use the same method for bulk zeroing, but the generality of bzero() requires size and alignment checks that pagezero() does not. Eliminate an unnecessary #include. Reviewed by: emaste, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26876 --- sys/arm64/arm64/uma_machdep.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/uma_machdep.c b/sys/arm64/arm64/uma_machdep.c index e419a099d640..4897cebbacc2 100644 --- a/sys/arm64/arm64/uma_machdep.c +++ b/sys/arm64/arm64/uma_machdep.c @@ -36,11 +36,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include -#include +#include void * uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, @@ -60,7 +59,7 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, dump_add_page(pa); va = (void *)PHYS_TO_DMAP(pa); if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) - bzero(va, PAGE_SIZE); + pagezero(va); return (va); }