Date: Tue, 31 Jan 2006 23:41:29 GMT From: Alan Cox <alc@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 90849 for review Message-ID: <200601312341.k0VNfTUp090146@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=90849 Change 90849 by alc@alc_home on 2006/01/31 23:41:03 Introduce vm_buddyq_find() and use it to reclaim pages from the cache queues in vm_page_select_cache(). Affected files ... .. //depot/projects/superpages/src/sys/vm/vm_buddy.h#8 edit .. //depot/projects/superpages/src/sys/vm/vm_page.c#17 edit Differences ... ==== //depot/projects/superpages/src/sys/vm/vm_buddy.h#8 (text+ko) ==== @@ -5,3 +5,16 @@ void buddy_free(vm_page_t m, int magn); void buddy_free_locked(int baseq, vm_page_t m, int magn); void buddy_unfree(vm_page_t m); + +static __inline vm_page_t +vm_buddyq_find(int baseq) +{ + vm_page_t m; + int q; + + q = 0; + while ((m = TAILQ_FIRST(&vm_page_queues[baseq + q].pl)) == NULL && + q < BUDDY_QUEUES) + q++; + return (m); +} ==== //depot/projects/superpages/src/sys/vm/vm_page.c#17 (text+ko) ==== @@ -737,7 +737,7 @@ boolean_t was_trylocked; mtx_assert(&vm_page_queue_mtx, MA_OWNED); - while ((m = TAILQ_FIRST(&vm_page_queues[PQ_CACHE].pl)) != NULL) { + while ((m = vm_buddyq_find(PQ_CACHE)) != NULL) { KASSERT(m->dirty == 0, ("Found dirty cache page %p", m)); KASSERT(!pmap_page_is_mapped(m), ("Found mapped cache page %p", m));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601312341.k0VNfTUp090146>