From owner-p4-projects@FreeBSD.ORG Tue Jan 31 23:41:30 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 82C6416A423; Tue, 31 Jan 2006 23:41:30 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C47216A420 for ; Tue, 31 Jan 2006 23:41:30 +0000 (GMT) (envelope-from alc@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2790B43D45 for ; Tue, 31 Jan 2006 23:41:30 +0000 (GMT) (envelope-from alc@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0VNfUGH090150 for ; Tue, 31 Jan 2006 23:41:30 GMT (envelope-from alc@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0VNfTUp090146 for perforce@freebsd.org; Tue, 31 Jan 2006 23:41:29 GMT (envelope-from alc@freebsd.org) Date: Tue, 31 Jan 2006 23:41:29 GMT Message-Id: <200601312341.k0VNfTUp090146@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to alc@freebsd.org using -f From: Alan Cox To: Perforce Change Reviews Cc: Subject: PERFORCE change 90849 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2006 23:41:31 -0000 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));