Date: Thu, 20 Dec 2007 23:29:18 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 131338 for review Message-ID: <200712202329.lBKNTIGA000597@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=131338 Change 131338 by jhb@jhb_mutex on 2007/12/20 23:29:12 IFC @131334 Affected files ... .. //depot/projects/smpng/sys/vm/vm_page.c#94 integrate .. //depot/projects/smpng/sys/vm/vm_phys.c#2 integrate .. //depot/projects/smpng/sys/vm/vm_phys.h#2 integrate Differences ... ==== //depot/projects/smpng/sys/vm/vm_page.c#94 (text+ko) ==== @@ -97,7 +97,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/vm/vm_page.c,v 1.363 2007/12/19 05:47:50 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/vm/vm_page.c,v 1.364 2007/12/20 22:45:54 alc Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1026,8 +1026,11 @@ mtx_unlock(&vm_page_queue_free_mtx); return (NULL); } - vm_phys_unfree_page(m); - vm_phys_set_pool(VM_FREEPOOL_DEFAULT, m, 0); + if (vm_phys_unfree_page(m)) + vm_phys_set_pool(VM_FREEPOOL_DEFAULT, m, 0); + else + panic("vm_page_alloc: cache page %p is missing" + " from the free queue", m); } else if ((req & VM_ALLOC_IFCACHED) != 0) { mtx_unlock(&vm_page_queue_free_mtx); return (NULL); ==== //depot/projects/smpng/sys/vm/vm_phys.c#2 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/vm/vm_phys.c,v 1.5 2007/12/19 23:09:45 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/vm/vm_phys.c,v 1.6 2007/12/20 22:45:54 alc Exp $"); #include "opt_ddb.h" @@ -468,7 +468,7 @@ * * The free page queues must be locked. */ -void +boolean_t vm_phys_unfree_page(vm_page_t m) { struct vm_freelist *fl; @@ -489,13 +489,15 @@ order < VM_NFREEORDER - 1; ) { order++; pa = m->phys_addr & (~(vm_paddr_t)0 << (PAGE_SHIFT + order)); - KASSERT(pa >= seg->start && pa < seg->end, - ("vm_phys_unfree_page: paddr %#jx is not within segment %p", - (uintmax_t)pa, seg)); - m_set = &seg->first_page[atop(pa - seg->start)]; + if (pa >= seg->start && pa < seg->end) + m_set = &seg->first_page[atop(pa - seg->start)]; + else + return (FALSE); } - KASSERT(m_set->order >= order, ("vm_phys_unfree_page: page %p's order" - " (%d) is less than expected (%d)", m_set, m_set->order, order)); + if (m_set->order < order) + return (FALSE); + if (m_set->order == VM_NFREEORDER) + return (FALSE); KASSERT(m_set->order < VM_NFREEORDER, ("vm_phys_unfree_page: page %p has unexpected order %d", m_set, m_set->order)); @@ -525,6 +527,7 @@ fl[order].lcnt++; } KASSERT(m_set == m, ("vm_phys_unfree_page: fatal inconsistency")); + return (TRUE); } /* ==== //depot/projects/smpng/sys/vm/vm_phys.h#2 (text+ko) ==== @@ -28,7 +28,7 @@ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/vm/vm_phys.h,v 1.3 2007/09/25 06:25:06 alc Exp $ + * $FreeBSD: src/sys/vm/vm_phys.h,v 1.4 2007/12/20 22:45:54 alc Exp $ */ /* @@ -38,6 +38,8 @@ #ifndef _VM_PHYS_H_ #define _VM_PHYS_H_ +#ifdef _KERNEL + void vm_phys_add_page(vm_paddr_t pa); vm_page_t vm_phys_alloc_contig(unsigned long npages, vm_paddr_t low, vm_paddr_t high, @@ -47,7 +49,8 @@ void vm_phys_free_pages(vm_page_t m, int order); void vm_phys_init(void); void vm_phys_set_pool(int pool, vm_page_t m, int order); -void vm_phys_unfree_page(vm_page_t m); +boolean_t vm_phys_unfree_page(vm_page_t m); boolean_t vm_phys_zero_pages_idle(void); +#endif /* _KERNEL */ #endif /* !_VM_PHYS_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712202329.lBKNTIGA000597>