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
This commit is contained in:
parent
7cda7375e6
commit
9e0ad88b82
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366944
@ -36,11 +36,10 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <vm/vm.h>
|
#include <vm/vm.h>
|
||||||
#include <vm/vm_param.h>
|
#include <vm/vm_param.h>
|
||||||
#include <vm/vm_page.h>
|
#include <vm/vm_page.h>
|
||||||
#include <vm/vm_pageout.h>
|
|
||||||
#include <vm/vm_dumpset.h>
|
#include <vm/vm_dumpset.h>
|
||||||
#include <vm/uma.h>
|
#include <vm/uma.h>
|
||||||
#include <vm/uma_int.h>
|
#include <vm/uma_int.h>
|
||||||
#include <machine/md_var.h>
|
#include <machine/machdep.h>
|
||||||
|
|
||||||
void *
|
void *
|
||||||
uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags,
|
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);
|
dump_add_page(pa);
|
||||||
va = (void *)PHYS_TO_DMAP(pa);
|
va = (void *)PHYS_TO_DMAP(pa);
|
||||||
if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0)
|
if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0)
|
||||||
bzero(va, PAGE_SIZE);
|
pagezero(va);
|
||||||
return (va);
|
return (va);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user