From owner-svn-src-head@FreeBSD.ORG Sun Apr 5 20:07:34 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F56FEAF; Sun, 5 Apr 2015 20:07:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B48883D; Sun, 5 Apr 2015 20:07:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t35K7YeV029896; Sun, 5 Apr 2015 20:07:34 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t35K7YTx029895; Sun, 5 Apr 2015 20:07:34 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201504052007.t35K7YTx029895@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 5 Apr 2015 20:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281118 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 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: Sun, 05 Apr 2015 20:07:34 -0000 Author: alc Date: Sun Apr 5 20:07:33 2015 New Revision: 281118 URL: https://svnweb.freebsd.org/changeset/base/281118 Log: Until the lock assertions in vm_page_advise() are properly reevaluated, vm_fault_dontneed() should acquire a write lock on the first object in the shadow chain. Reported by: gleb, David Wolfskill Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Apr 5 18:57:58 2015 (r281117) +++ head/sys/vm/vm_fault.c Sun Apr 5 20:07:33 2015 (r281118) @@ -1060,9 +1060,9 @@ vm_fault_dontneed(const struct faultstat VM_OBJECT_ASSERT_WLOCKED(object); first_object = fs->first_object; if (first_object != object) { - if (!VM_OBJECT_TRYRLOCK(first_object)) { + if (!VM_OBJECT_TRYWLOCK(first_object)) { VM_OBJECT_WUNLOCK(object); - VM_OBJECT_RLOCK(first_object); + VM_OBJECT_WLOCK(first_object); VM_OBJECT_WLOCK(object); } } @@ -1097,7 +1097,7 @@ vm_fault_dontneed(const struct faultstat } } if (first_object != object) - VM_OBJECT_RUNLOCK(first_object); + VM_OBJECT_WUNLOCK(first_object); } /*