From owner-svn-src-user@FreeBSD.ORG Sat Jun 27 20:26:16 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA1A2106567A; Sat, 27 Jun 2009 20:26:16 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE1BF8FC24; Sat, 27 Jun 2009 20:26:16 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5RKQG5n087325; Sat, 27 Jun 2009 20:26:16 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5RKQGbs087323; Sat, 27 Jun 2009 20:26:16 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200906272026.n5RKQGbs087323@svn.freebsd.org> From: Kip Macy Date: Sat, 27 Jun 2009 20:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195115 - user/kmacy/releng_7_2_fcs/sys/vm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Jun 2009 20:26:17 -0000 Author: kmacy Date: Sat Jun 27 20:26:16 2009 New Revision: 195115 URL: http://svn.freebsd.org/changeset/base/195115 Log: The page object association is now protected by the page lock and not the global page queue lock, thus we need to acquire the page lock before validating the object and acquiring the object 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 Sat Jun 27 20:06:56 2009 (r195114) +++ user/kmacy/releng_7_2_fcs/sys/vm/vm_pageout.c Sat Jun 27 20:26:16 2009 (r195115) @@ -254,6 +254,8 @@ vm_pageout_fallback_object_lock(vm_page_ TAILQ_INSERT_AFTER(&vm_page_queues[queue].pl, m, &marker, pageq); vm_page_unlock_queues(); + vm_page_unlock(m); + vm_page_lock(m); VM_OBJECT_LOCK(object); vm_page_lock_queues(); @@ -757,7 +759,6 @@ rescan0: goto rescan0; next = TAILQ_NEXT(m, pageq); - object = m->object; /* * skip marker pages @@ -774,6 +775,10 @@ rescan0: continue; } + if (vm_page_trylock(m) == 0 || (object = m->object) == NULL) { + addl_page_shortage++; + continue; + } /* * Don't mess with busy pages, keep in the front of the * queue, most likely are being paged out. @@ -781,12 +786,7 @@ rescan0: if (!VM_OBJECT_TRYLOCK(object) && !vm_pageout_fallback_object_lock(m, &next)) { VM_OBJECT_UNLOCK(object); - addl_page_shortage++; - continue; - } - vm_page_lock_assert(m, MA_NOTOWNED); - if (vm_page_trylock(m) == 0) { - VM_OBJECT_UNLOCK(object); + vm_page_unlock(m); addl_page_shortage++; continue; } @@ -1088,7 +1088,6 @@ unlock_and_continue: ("vm_pageout_scan: page %p isn't active", m)); next = TAILQ_NEXT(m, pageq); - object = m->object; /* * XXX note that the object == NULL check is a band-aid @@ -1098,19 +1097,19 @@ unlock_and_continue: * trylocking the object which in turn complicates error * handling slightly */ - if ((object == NULL) || (m->flags & PG_MARKER) != 0) { + if ((m->flags & PG_MARKER) != 0) { m = next; continue; } - if (!VM_OBJECT_TRYLOCK(object) && - !vm_pageout_fallback_object_lock(m, &next)) { - VM_OBJECT_UNLOCK(object); + + if (vm_page_trylock(m) == 0 || (object = m->object) == NULL) { m = next; continue; } - - if (vm_page_trylock(m) == 0) { + if (!VM_OBJECT_TRYLOCK(object) && + !vm_pageout_fallback_object_lock(m, &next)) { VM_OBJECT_UNLOCK(object); + vm_page_unlock(m); m = next; continue; }