From owner-svn-src-head@freebsd.org Mon May 28 04:38:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5080EF7F83; Mon, 28 May 2018 04:38:10 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 921807B4D2; Mon, 28 May 2018 04:38:10 +0000 (UTC) (envelope-from alc@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 70C1A58C; Mon, 28 May 2018 04:38:10 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4S4cAqH036391; Mon, 28 May 2018 04:38:10 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4S4cAvc036390; Mon, 28 May 2018 04:38:10 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201805280438.w4S4cAvc036390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 28 May 2018 04:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334274 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 334274 X-SVN-Commit-Repository: base 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.26 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: Mon, 28 May 2018 04:38:11 -0000 Author: alc Date: Mon May 28 04:38:10 2018 New Revision: 334274 URL: https://svnweb.freebsd.org/changeset/base/334274 Log: Eliminate duplicate assertions. We assert at the start of vm_fault_hold() that the map entry is wired if the caller passes the flag VM_FAULT_WIRE. Eliminate the same assertion, but spelled differently, at the end of vm_fault_hold() and vm_fault_populate(). Repeat the assertion only if the map is unlocked and the map lookup must be repeated. Reviewed by: kib MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D15582 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon May 28 03:14:36 2018 (r334273) +++ head/sys/vm/vm_fault.c Mon May 28 04:38:10 2018 (r334274) @@ -482,10 +482,9 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro m_mtx = NULL; for (i = 0; i < npages; i++) { vm_page_change_lock(&m[i], &m_mtx); - if ((fault_flags & VM_FAULT_WIRE) != 0) { - KASSERT(wired, ("VM_FAULT_WIRE && !wired")); + if ((fault_flags & VM_FAULT_WIRE) != 0) vm_page_wire(&m[i]); - } else + else vm_page_activate(&m[i]); if (m_hold != NULL && m[i].pindex == fs->first_pindex) { *m_hold = &m[i]; @@ -1247,6 +1246,10 @@ readrest: unlock_and_deallocate(&fs); goto RetryFault; } + + /* Reassert because wired may have changed. */ + KASSERT(wired || (fault_flags & VM_FAULT_WIRE) == 0, + ("!wired && VM_FAULT_WIRE")); } } @@ -1290,10 +1293,9 @@ readrest: * If the page is not wired down, then put it where the pageout daemon * can find it. */ - if ((fault_flags & VM_FAULT_WIRE) != 0) { - KASSERT(wired, ("VM_FAULT_WIRE && !wired")); + if ((fault_flags & VM_FAULT_WIRE) != 0) vm_page_wire(fs.m); - } else + else vm_page_activate(fs.m); if (m_hold != NULL) { *m_hold = fs.m;