1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-26 11:47:31 +00:00

Call VM_WAIT in pmap_ptpgzone_allocf() if M_WAITOK is set.

Removed unused variable.

Approved by:	rrs (mentor)
This commit is contained in:
Jayachandran C. 2010-05-27 10:05:40 +00:00
parent 4479115eaf
commit fde7da314a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208589

View File

@ -969,10 +969,15 @@ pmap_ptpgzone_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait)
("pmap_ptpgzone_allocf: invalid allocation size %d", bytes));
*flags = UMA_SLAB_PRIV;
m = vm_phys_alloc_contig(1, 0, MIPS_KSEG0_LARGEST_PHYS,
PAGE_SIZE, PAGE_SIZE);
if (m == NULL)
return (NULL);
for (;;) {
m = vm_phys_alloc_contig(1, 0, MIPS_KSEG0_LARGEST_PHYS,
PAGE_SIZE, PAGE_SIZE);
if (m != NULL)
break;
if ((wait & M_WAITOK) == 0)
return (NULL);
VM_WAIT;
}
paddr = VM_PAGE_TO_PHYS(m);
return ((void *)MIPS_PHYS_TO_KSEG0(paddr));
@ -1039,8 +1044,10 @@ pmap_pinit(pmap_t pmap)
* allocate the page directory page
*/
ptdpg = pmap_alloc_pte_page(pmap, NUSERPGTBLS, M_WAITOK, &ptdva);
pmap->pm_segtab = (pd_entry_t *)ptdva;
if (ptdpg == NULL)
return (0);
pmap->pm_segtab = (pd_entry_t *)ptdva;
pmap->pm_active = 0;
pmap->pm_ptphint = NULL;
for (i = 0; i < MAXCPU; i++) {
@ -1062,13 +1069,11 @@ _pmap_allocpte(pmap_t pmap, unsigned ptepindex, int flags)
{
vm_offset_t pteva;
vm_page_t m;
int req;
KASSERT((flags & (M_NOWAIT | M_WAITOK)) == M_NOWAIT ||
(flags & (M_NOWAIT | M_WAITOK)) == M_WAITOK,
("_pmap_allocpte: flags is neither M_NOWAIT nor M_WAITOK"));
req = VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_NOOBJ;
/*
* Find or fabricate a new pagetable page
*/