uvm_page_lookup_freelist(pg)].pgfl_buckets[ VM_PGCOLOR_BUCKET(pg)].pgfl_queues[PGFL_UNKNOWN], pg, pageq);
uvm_page_lookup_freelist(pg)].pgfl_queues[PGFL_UNKNOWN], pg, pageq);
uvm_pagefree(pg)	struct vm_page *pg;{	int s;	int saved_loan_count = pg->loan_count;#ifdef DEBUG	if (pg->uobject == (void *)0xdeadbeef &&	    pg->uanon == (void *)0xdeadbeef) {		panic("uvm_pagefree: freeing free page %p\n", pg);	}#endif	/*	 * if the page was an object page (and thus "TABLED"), remove it	 * from the object.	 */	if (pg->flags & PG_TABLED) {		/*		 * if the object page is on loan we are going to drop ownership.		 * it is possible that an anon will take over as owner for this		 * page later on.   the anon will want a !PG_CLEAN page so that		 * it knows it needs to allocate swap if it wants to page the		 * page out.		 */		if (saved_loan_count)			pg->flags &= ~PG_CLEAN;	/* in case an anon takes over */		uvm_pageremove(pg);		/*		 * if our page was on loan, then we just lost control over it		 * (in fact, if it was loaned to an anon, the anon may have		 * already taken over ownership of the page by now and thus		 * changed the loan_count [e.g. in uvmfault_anonget()]) we just		 * return (when the last loan is dropped, then the page can be		 * freed by whatever was holding the last loan).		 */		if (saved_loan_count)			return;	} else if (saved_loan_count && (pg->pqflags & PQ_ANON)) {		/*		 * if our page is owned by an anon and is loaned out to the		 * kernel then we just want to drop ownership and return.		 * the kernel must free the page when all its loans clear ...		 * note that the kernel can't change the loan status of our		 * page as long as we are holding PQ lock.		 */		pg->pqflags &= ~PQ_ANON;		pg->uanon = NULL;		return;	}	KASSERT(saved_loan_count == 0);	/*	 * now remove the page from the queues	 */	if (pg->pqflags & PQ_ACTIVE) {		TAILQ_REMOVE(&uvm.page_active, pg, pageq);		pg->pqflags &= ~PQ_ACTIVE;		uvmexp.active--;	} else if (pg->pqflags & PQ_INACTIVE) {		TAILQ_REMOVE(&uvm.page_inactive, pg, pageq);		pg->pqflags &= ~PQ_INACTIVE;		uvmexp.inactive--;	}	/*	 * if the page was wired, unwire it now.	 */	if (pg->wire_count) {		pg->wire_count = 0;		uvmexp.wired--;	}	if (pg->uanon) {		uvmexp.anonpages--;	}	/*	 * and put on free queue	 */	pg->flags &= ~PG_ZERO;	s = uvm_lock_fpageq();	TAILQ_INSERT_TAIL(&uvm.page_free[	    uvm_page_lookup_freelist(pg)].pgfl_buckets[	    VM_PGCOLOR_BUCKET(pg)].pgfl_queues[PGFL_UNKNOWN], pg, pageq);	pg->pqflags = PQ_FREE;#ifdef DEBUG	pg->uobject = (void *)0xdeadbeef;	pg->offset = 0xdeadbeef;	pg->uanon = (void *)0xdeadbeef;#endif	uvmexp.free++;	if (uvmexp.zeropages < UVM_PAGEZERO_TARGET)		uvm.page_idle_zero = vm_page_zero_enable;	uvm_unlock_fpageq(s);}