From owner-svn-src-all@freebsd.org Tue Oct 24 17:14:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A8FEE533BC; Tue, 24 Oct 2017 17:14:55 +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 mx1.freebsd.org (Postfix) with ESMTPS id DC23567AE5; Tue, 24 Oct 2017 17:14:54 +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 v9OHEsQl061326; Tue, 24 Oct 2017 17:14:54 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9OHErqo061325; Tue, 24 Oct 2017 17:14:54 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710241714.v9OHErqo061325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 24 Oct 2017 17:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324960 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324960 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.23 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, 24 Oct 2017 17:14:55 -0000 Author: alc Date: Tue Oct 24 17:14:53 2017 New Revision: 324960 URL: https://svnweb.freebsd.org/changeset/base/324960 Log: Micro-optimize the handling of fictitious pages in vm_page_free_prep(). A fictitious page is always wired, so there is no point in trying to remove one from the page queues. Completely remove one inaccurate comment from vm_page_free_prep() and correct another. Reviewed by: kib, markj MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Oct 24 16:28:00 2017 (r324959) +++ head/sys/vm/vm_page.c Tue Oct 24 17:14:53 2017 (r324960) @@ -2802,27 +2802,26 @@ vm_page_free_prep(vm_page_t m, bool pagequeue_locked) if (vm_page_sbusied(m)) panic("vm_page_free: freeing busy page %p", m); + vm_page_remove(m); + /* - * Unqueue, then remove page. Note that we cannot destroy - * the page here because we do not want to call the pager's - * callback routine until after we've put the page on the - * appropriate free queue. + * If fictitious remove object association and + * return. */ + if ((m->flags & PG_FICTITIOUS) != 0) { + KASSERT(m->wire_count == 1, + ("fictitious page %p is not wired", m)); + KASSERT(m->queue == PQ_NONE, + ("fictitious page %p is queued", m)); + return (false); + } + if (m->queue != PQ_NONE) { if (pagequeue_locked) vm_page_dequeue_locked(m); else vm_page_dequeue(m); } - vm_page_remove(m); - - /* - * If fictitious remove object association and - * return, otherwise delay object association removal. - */ - if ((m->flags & PG_FICTITIOUS) != 0) - return (false); - m->valid = 0; vm_page_undirty(m);