From owner-svn-src-all@freebsd.org Tue Oct 29 20:46:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1EAA164112; Tue, 29 Oct 2019 20:46:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472kC63W8Tz438Y; Tue, 29 Oct 2019 20:46:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5732727896; Tue, 29 Oct 2019 20:46:26 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9TKkQA5030973; Tue, 29 Oct 2019 20:46:26 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9TKkQZc030972; Tue, 29 Oct 2019 20:46:26 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201910292046.x9TKkQZc030972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 29 Oct 2019 20:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354156 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 354156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Oct 2019 20:46:26 -0000 Author: jeff Date: Tue Oct 29 20:46:25 2019 New Revision: 354156 URL: https://svnweb.freebsd.org/changeset/base/354156 Log: Drop the object lock earlier in fault and don't relock it after pmap_enter(). Recent changes in object and page locking have enabled more lock pushdown. Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22036 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Tue Oct 29 20:37:59 2019 (r354155) +++ head/sys/vm/vm_fault.c Tue Oct 29 20:46:25 2019 (r354156) @@ -184,11 +184,10 @@ unlock_vp(struct faultstate *fs) } static void -unlock_and_deallocate(struct faultstate *fs) +fault_deallocate(struct faultstate *fs) { vm_object_pip_wakeup(fs->object); - VM_OBJECT_WUNLOCK(fs->object); if (fs->object != fs->first_object) { VM_OBJECT_WLOCK(fs->first_object); vm_page_free(fs->first_m); @@ -202,6 +201,14 @@ unlock_and_deallocate(struct faultstate *fs) } static void +unlock_and_deallocate(struct faultstate *fs) +{ + + VM_OBJECT_WUNLOCK(fs->object); + fault_deallocate(fs); +} + +static void vm_fault_dirty(vm_map_entry_t entry, vm_page_t m, vm_prot_t prot, vm_prot_t fault_type, int fault_flags, bool set_wd) { @@ -1261,10 +1268,12 @@ readrest: fs.object, OFF_TO_IDX( fs.first_object->backing_object_offset)); #endif + VM_OBJECT_WUNLOCK(fs.object); fs.first_m = fs.m; fs.m = NULL; VM_CNT_INC(v_cow_optim); } else { + VM_OBJECT_WUNLOCK(fs.object); /* * Oh, well, lets copy it. */ @@ -1285,7 +1294,6 @@ readrest: * conditional */ vm_object_pip_wakeup(fs.object); - VM_OBJECT_WUNLOCK(fs.object); /* * We only try to prefault read-only mappings to the @@ -1405,7 +1413,6 @@ readrest: vm_fault_prefault(&fs, vaddr, faultcount > 0 ? behind : PFBAK, faultcount > 0 ? ahead : PFFOR, false); - VM_OBJECT_WLOCK(fs.object); /* * If the page is not wired down, then put it where the pageout daemon @@ -1427,7 +1434,7 @@ readrest: /* * Unlock everything, and return */ - unlock_and_deallocate(&fs); + fault_deallocate(&fs); if (hardfault) { VM_CNT_INC(v_io_faults); curthread->td_ru.ru_majflt++;