Date: Thu, 2 Feb 2006 06:35:43 GMT From: Alan Cox <alc@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 90913 for review Message-ID: <200602020635.k126Zhe4047840@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=90913 Change 90913 by alc@alc_home on 2006/02/02 06:35:21 Rename vm_buddyq_find() to vm_buddyq_first(). Add vm_buddyq_next(). Use these functions to transfer pages from the cache queues to the free queues in vm_pageout_scan(). Affected files ... .. //depot/projects/superpages/src/sys/vm/vm_buddy.h#9 edit .. //depot/projects/superpages/src/sys/vm/vm_page.c#18 edit .. //depot/projects/superpages/src/sys/vm/vm_pageout.c#9 edit Differences ... ==== //depot/projects/superpages/src/sys/vm/vm_buddy.h#9 (text+ko) ==== @@ -7,7 +7,7 @@ void buddy_unfree(vm_page_t m); static __inline vm_page_t -vm_buddyq_find(int baseq) +vm_buddyq_first(int baseq) { vm_page_t m; int q; @@ -18,3 +18,16 @@ q++; return (m); } + +static __inline vm_page_t +vm_buddyq_next(vm_page_t m) +{ + int baseq, q; + + baseq = m->queue - m->buddyq; + q = m->buddyq; + m = TAILQ_NEXT(m, pageq); + while (m == NULL && ++q < BUDDY_QUEUES) + m = TAILQ_FIRST(&vm_page_queues[baseq + q].pl); + return (m); +} ==== //depot/projects/superpages/src/sys/vm/vm_page.c#18 (text+ko) ==== @@ -737,7 +737,7 @@ boolean_t was_trylocked; mtx_assert(&vm_page_queue_mtx, MA_OWNED); - while ((m = vm_buddyq_find(PQ_CACHE)) != NULL) { + while ((m = vm_buddyq_first(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)); ==== //depot/projects/superpages/src/sys/vm/vm_pageout.c#9 (text+ko) ==== @@ -100,6 +100,7 @@ #include <vm/vm_map.h> #include <vm/vm_pageout.h> #include <vm/vm_pager.h> +#include <vm/vm_buddy.h> #include <vm/swap_pager.h> #include <vm/vm_extern.h> #include <vm/uma.h> @@ -1129,7 +1130,8 @@ * does not effect other calculations. */ while (cnt.v_free_count < cnt.v_free_reserved) { - TAILQ_FOREACH(m, &vm_page_queues[PQ_CACHE].pl, pageq) { + for (m = vm_buddyq_first(PQ_CACHE); m != NULL; + m = vm_buddyq_next(m)) { KASSERT(m->dirty == 0, ("Found dirty cache page %p", m)); KASSERT(!pmap_page_is_mapped(m),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602020635.k126Zhe4047840>