Remove the 'last' argument from the pmap_pti_free_page().

It is in fact unused.

Noted and reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	13 days
This commit is contained in:
Konstantin Belousov 2018-01-18 11:01:41 +00:00
parent 7680515c07
commit 0d6c61ec30

View File

@ -7550,17 +7550,16 @@ pmap_pti_alloc_page(void)
}
static bool
pmap_pti_free_page(vm_page_t m, bool last)
pmap_pti_free_page(vm_page_t m)
{
KASSERT(m->wire_count > 0, ("page %p not wired", m));
m->wire_count--;
if (m->wire_count == 0 || last) {
KASSERT(m->wire_count == 0, ("page %p wired", m));
atomic_subtract_int(&vm_cnt.v_wire_count, 1);
vm_page_free_zero(m);
return (true);
}
return (false);
if (m->wire_count != 0)
return (false);
atomic_subtract_int(&vm_cnt.v_wire_count, 1);
vm_page_free_zero(m);
return (true);
}
extern char kernphys[], etext[];
@ -7626,7 +7625,7 @@ pmap_pti_pdpe(vm_offset_t va)
panic("pml4 alloc after finalization\n");
m = pmap_pti_alloc_page();
if (*pml4e != 0) {
pmap_pti_free_page(m, true);
pmap_pti_free_page(m);
mphys = *pml4e & ~PAGE_MASK;
} else {
mphys = VM_PAGE_TO_PHYS(m);
@ -7658,7 +7657,7 @@ pmap_pti_unwire_pde(void *pde, bool only_ref)
m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pde));
MPASS(m->wire_count > 0);
MPASS(only_ref || m->wire_count > 1);
pmap_pti_free_page(m, false);
pmap_pti_free_page(m);
}
static void
@ -7670,7 +7669,7 @@ pmap_pti_unwire_pte(void *pte, vm_offset_t va)
VM_OBJECT_ASSERT_WLOCKED(pti_obj);
m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pte));
MPASS(m->wire_count > 0);
if (pmap_pti_free_page(m, false)) {
if (pmap_pti_free_page(m)) {
pde = pmap_pti_pde(va);
MPASS((*pde & (X86_PG_PS | X86_PG_V)) == X86_PG_V);
*pde = 0;
@ -7693,7 +7692,7 @@ pmap_pti_pde(vm_offset_t va)
if (*pdpe == 0) {
m = pmap_pti_alloc_page();
if (*pdpe != 0) {
pmap_pti_free_page(m, true);
pmap_pti_free_page(m);
MPASS((*pdpe & X86_PG_PS) == 0);
mphys = *pdpe & ~PAGE_MASK;
} else {
@ -7729,7 +7728,7 @@ pmap_pti_pte(vm_offset_t va, bool *unwire_pde)
if (*pde == 0) {
m = pmap_pti_alloc_page();
if (*pde != 0) {
pmap_pti_free_page(m, true);
pmap_pti_free_page(m);
MPASS((*pde & X86_PG_PS) == 0);
mphys = *pde & ~(PAGE_MASK | pg_nx);
} else {