From owner-svn-src-head@FreeBSD.ORG Thu May 20 08:51:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A1EF106566B; Thu, 20 May 2010 08:51:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AA1B8FC15; Thu, 20 May 2010 08:51:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4K8p1Za044741; Thu, 20 May 2010 08:51:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4K8p1rj044739; Thu, 20 May 2010 08:51:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201005200851.o4K8p1rj044739@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 20 May 2010 08:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208340 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2010 08:51:01 -0000 Author: kib Date: Thu May 20 08:51:01 2010 New Revision: 208340 URL: http://svn.freebsd.org/changeset/base/208340 Log: When waiting for the busy page, do not unlock the object unless unlock cannot be avoided. Reviewed by: alc MFC after: 1 week Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu May 20 08:43:31 2010 (r208339) +++ head/sys/vm/vm_fault.c Thu May 20 08:51:01 2010 (r208340) @@ -340,9 +340,13 @@ RetryFault:; vm_page_flag_set(fs.m, PG_REFERENCED); vm_page_unlock_queues(); vm_page_unlock(fs.m); - VM_OBJECT_UNLOCK(fs.object); if (fs.object != fs.first_object) { - VM_OBJECT_LOCK(fs.first_object); + if (!VM_OBJECT_TRYLOCK( + fs.first_object)) { + VM_OBJECT_UNLOCK(fs.object); + VM_OBJECT_LOCK(fs.first_object); + VM_OBJECT_LOCK(fs.object); + } vm_page_lock(fs.first_m); vm_page_free(fs.first_m); vm_page_unlock(fs.first_m); @@ -351,7 +355,6 @@ RetryFault:; fs.first_m = NULL; } unlock_map(&fs); - VM_OBJECT_LOCK(fs.object); if (fs.m == vm_page_lookup(fs.object, fs.pindex)) { vm_page_sleep_if_busy(fs.m, TRUE,