Convert consumers to vm_page_alloc_noobj_contig()

Remove now-unneeded page zeroing.  No functional change intended.

Reviewed by:	alc, hselasky, kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32006
This commit is contained in:
Mark Johnston
2021-10-19 20:25:04 -04:00
parent 92db9f3bb7
commit 84c3922243
12 changed files with 53 additions and 97 deletions
+4 -8
View File
@@ -97,21 +97,19 @@ tegra_bo_alloc_contig(size_t npages, u_long alignment, vm_memattr_t memattr,
vm_page_t **ret_page)
{
vm_page_t m;
int pflags, tries, i;
int tries, i;
vm_paddr_t low, high, boundary;
low = 0;
high = -1UL;
boundary = 0;
pflags = VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_NOBUSY |
VM_ALLOC_WIRED | VM_ALLOC_ZERO;
tries = 0;
retry:
m = vm_page_alloc_contig(NULL, 0, pflags, npages, low, high, alignment,
boundary, memattr);
m = vm_page_alloc_noobj_contig(VM_ALLOC_WIRE | VM_ALLOC_ZERO, npages,
low, high, alignment, boundary, memattr);
if (m == NULL) {
if (tries < 3) {
if (!vm_page_reclaim_contig(pflags, npages, low, high,
if (!vm_page_reclaim_contig(0, npages, low, high,
alignment, boundary))
vm_wait(NULL);
tries++;
@@ -121,8 +119,6 @@ tegra_bo_alloc_contig(size_t npages, u_long alignment, vm_memattr_t memattr,
}
for (i = 0; i < npages; i++, m++) {
if ((m->flags & PG_ZERO) == 0)
pmap_zero_page(m);
m->valid = VM_PAGE_BITS_ALL;
(*ret_page)[i] = m;
}