rem: } else if (q->head != NULL) panic("dequeue_page: list %p is corrupt\n", q);  if ((q->head == NULL || q->tail == NULL) && q->head != q->tail) { dprintf("page = %p, page->prev = %p, page->next = %p\n", page, page->queue_prev, page->queue_next); dprintf("q = %p, q->head = %p, q->tail = %p, q->count = %d\n", q, q->head, q->tail, q->count); panic("dequeue_page2: list at %p is corrupt (count = %d)\n", q, q->count);
context: static vm_page *dequeue_page(page_queue *q){	vm_page *page;	check_page_queue("dq1", q);//	dprintf("dequeue_page: q = %p, q->head = %p, q->tail = %p\n", q, q->head, q->tail);	if ((q->head == NULL || q->tail == NULL) && q->head != q->tail)		panic("dequeue_page1: list at %p is corrupt (count = %d)\n", q, q->count);	page = q->tail;	if (page != NULL) {		if (page->queue_prev == NULL && q->head != page)			panic("dp: q = %p, page = %p, page->queue_prev == NULL, but q->head != page\n", q, page);		if (page->queue_next == NULL && q->tail != page)			panic("dp: q = %p, page = %p, page->queue_next == NULL, but q->tail != page\n", q, page);		if (q->head == page) {			dprintf("dequeue: q = %p, set head to NULL\n", q);			q->head = NULL;		}		if (page->queue_prev != NULL) {			page->queue_prev->queue_next = NULL;		}		q->tail = page->queue_prev;		q->count--;	} else if (q->head != NULL)		panic("dequeue_page: list %p is corrupt\n", q);	if ((q->head == NULL || q->tail == NULL) && q->head != q->tail) {		dprintf("page = %p, page->prev = %p, page->next = %p\n", page, page->queue_prev, page->queue_next);		dprintf("q = %p, q->head = %p, q->tail = %p, q->count = %d\n", q, q->head, q->tail, q->count);		panic("dequeue_page2: list at %p is corrupt (count = %d)\n", q, q->count);	}	check_page_queue("dq2", q);	return page;}