while ((pg = uvm_pagealloc(NULL, 0, NULL, 0)) == NULL) {
while ((pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_ZERO)) == NULL) {
uvm_loanzero(ufi, output, flags)	struct uvm_faultinfo *ufi;	void ***output;	int flags;{	struct vm_anon *anon;	struct vm_page *pg;	if ((flags & UVM_LOAN_TOANON) == 0) {	/* loaning to kernel-page */		while ((pg = uvm_pagealloc(NULL, 0, NULL, 0)) == NULL) {			uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, 			    ufi->entry->object.uvm_obj, NULL);			uvm_wait("loanzero1");			if (!uvmfault_relock(ufi))				return(0);			if (ufi->entry->aref.ar_amap)				amap_lock(ufi->entry->aref.ar_amap);			if (ufi->entry->object.uvm_obj)				simple_lock(				    &ufi->entry->object.uvm_obj->vmobjlock);			/* ... and try again */		}				/* got a page, zero it and return */		uvm_pagezero(pg);		/* clears PG_CLEAN */		pg->flags &= ~(PG_BUSY|PG_FAKE);		UVM_PAGE_OWN(pg, NULL);		**output = pg;		*output = (*output) + 1;		uvm_lock_pageq();		/* wire it as we are loaning to kernel-page */		uvm_pagewire(pg);		pg->loan_count = 1;		uvm_unlock_pageq();		return(1);	}	/* loaning to an anon */	while ((anon = uvm_analloc()) == NULL || 	    (pg = uvm_pagealloc(NULL, 0, anon, 0)) == NULL) {				/* unlock everything */		uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap,		       ufi->entry->object.uvm_obj, NULL);				/* out of swap causes us to fail */		if (anon == NULL)			return(-1);		uvm_anfree(anon);		uvm_wait("loanzero2");		/* wait for pagedaemon */		if (!uvmfault_relock(ufi))			/* map changed while unlocked, need relookup */			return (0);		/* relock everything else */		if (ufi->entry->aref.ar_amap)			amap_lock(ufi->entry->aref.ar_amap);		if (ufi->entry->object.uvm_obj)			simple_lock(&ufi->entry->object.uvm_obj->vmobjlock);		/* ... and try again */	}	/* got a page, zero it and return */	uvm_pagezero(pg);		/* clears PG_CLEAN */	pg->flags &= ~(PG_BUSY|PG_FAKE);	UVM_PAGE_OWN(pg, NULL);	uvm_lock_pageq();	uvm_pageactivate(pg);	uvm_unlock_pageq();	**output = anon;	*output = (*output) + 1;	return(1);}