Date: Fri, 26 Jun 2009 05:41:02 +0000 (UTC) From: Kip Macy <kmacy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r195038 - user/kmacy/releng_7_2_fcs/sys/vm Message-ID: <200906260541.n5Q5f2ls076204@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kmacy Date: Fri Jun 26 05:41:02 2009 New Revision: 195038 URL: http://svn.freebsd.org/changeset/base/195038 Log: fix lock ordering and avoid duplicate acquisition of page queue lock Modified: user/kmacy/releng_7_2_fcs/sys/vm/vm_pageout.c Modified: user/kmacy/releng_7_2_fcs/sys/vm/vm_pageout.c ============================================================================== --- user/kmacy/releng_7_2_fcs/sys/vm/vm_pageout.c Fri Jun 26 05:29:40 2009 (r195037) +++ user/kmacy/releng_7_2_fcs/sys/vm/vm_pageout.c Fri Jun 26 05:41:02 2009 (r195038) @@ -743,19 +743,18 @@ vm_pageout_scan(int pass) maxlaunder = 1; if (pass) maxlaunder = 10000; + vm_page_lock_queues(); rescan0: addl_page_shortage = addl_page_shortage_init; maxscan = cnt.v_inactive_count; - vm_page_lock_queues(); for (m = TAILQ_FIRST(&vm_page_queues[PQ_INACTIVE].pl); m != NULL && maxscan-- > 0 && page_shortage > 0; m = next) { cnt.v_pdpages++; - if (VM_PAGE_GETQUEUE(m) != PQ_INACTIVE) { + if (VM_PAGE_GETQUEUE(m) != PQ_INACTIVE) goto rescan0; - } next = TAILQ_NEXT(m, pageq); object = m->object; @@ -987,8 +986,8 @@ rescan0: goto unlock_and_continue; } VM_OBJECT_LOCK(object); - vm_page_lock_queues(); vm_page_lock(m); + vm_page_lock_queues(); /* * The page might have been moved to another * queue during potential blocking in vget()
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906260541.n5Q5f2ls076204>