Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Oct 2017 16:54:42 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r324411 - head/sys/vm
Message-ID:  <201710081654.v98GsghJ077963@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sun Oct  8 16:54:42 2017
New Revision: 324411
URL: https://svnweb.freebsd.org/changeset/base/324411

Log:
  Replace an unnecessary call to vm_page_activate() by an assertion that
  the page is already wired or queued.  Prior to the elimination of PG_CACHED
  pages, vm_page_grab() might have returned a valid, previously PG_CACHED
  page, in which case enqueueing the page was necessary.  Now, that can't
  happen.  Moreover, activating the page is a dubious choice, since the page
  is not being accessed.
  
  Reviewed by:	kib
  MFC after:	1 week

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Sun Oct  8 08:02:26 2017	(r324410)
+++ head/sys/vm/swap_pager.c	Sun Oct  8 16:54:42 2017	(r324411)
@@ -1635,9 +1635,12 @@ swp_pager_force_pagein(vm_object_t object, vm_pindex_t
 	if (m->valid == VM_PAGE_BITS_ALL) {
 		vm_object_pip_wakeup(object);
 		vm_page_dirty(m);
+#ifdef INVARIANTS
 		vm_page_lock(m);
-		vm_page_activate(m);
+		if (m->wire_count == 0 && m->queue == PQ_NONE)
+			panic("page %p is neither wired nor queued", m);
 		vm_page_unlock(m);
+#endif
 		vm_page_xunbusy(m);
 		vm_pager_page_unswapped(m);
 		return;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710081654.v98GsghJ077963>