From owner-svn-src-head@freebsd.org Mon Oct 2 07:14:33 2017 Return-Path: Delivered-To: svn-src-head@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 43AA2E3869F; Mon, 2 Oct 2017 07:14:33 +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 105DC8248E; Mon, 2 Oct 2017 07:14:32 +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 v927EW3Q097271; Mon, 2 Oct 2017 07:14:32 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v927EWxk097270; Mon, 2 Oct 2017 07:14:32 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710020714.v927EWxk097270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 2 Oct 2017 07:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324189 - head/sys/dev/md X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/dev/md X-SVN-Commit-Revision: 324189 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.23 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, 02 Oct 2017 07:14:33 -0000 Author: alc Date: Mon Oct 2 07:14:32 2017 New Revision: 324189 URL: https://svnweb.freebsd.org/changeset/base/324189 Log: When mdstart_swap() accesses a page that is already in the active queue, mark the page as referenced rather than calling vm_page_activate(). This allows the page's act_count to grow beyond ACT_INIT and better reflect its usage. (See also r324146, which modified a function used by tmpfs, uiomove_object_page(), to behave in the same way.) Reviewed by: kib, markj MFC after: 2 weeks Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Mon Oct 2 06:48:56 2017 (r324188) +++ head/sys/dev/md/md.c Mon Oct 2 07:14:32 2017 (r324189) @@ -1111,7 +1111,10 @@ mdstart_swap(struct md_s *sc, struct bio *bp) if (m != NULL) { vm_page_xunbusy(m); vm_page_lock(m); - vm_page_activate(m); + if (vm_page_active(m)) + vm_page_reference(m); + else + vm_page_activate(m); vm_page_unlock(m); }