Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jun 2010 10:11:46 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r208772 - head/sys/vm
Message-ID:  <201006031011.o53ABk0x041466@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Jun  3 10:11:45 2010
New Revision: 208772
URL: http://svn.freebsd.org/changeset/base/208772

Log:
  Add assertion and comment in vm_page_flag_set() describing the expectations
  when the PG_WRITEABLE flag is set.
  
  Reviewed by:	alc

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Thu Jun  3 09:54:53 2010	(r208771)
+++ head/sys/vm/vm_page.c	Thu Jun  3 10:11:45 2010	(r208772)
@@ -486,6 +486,14 @@ vm_page_flag_set(vm_page_t m, unsigned s
 {
 
 	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+	/*
+	 * For a managed page, the PG_WRITEABLE flag can be set only if
+	 * the page is VPO_BUSY.  Currently this flag is only set by
+	 * pmap_enter().
+	 */
+	KASSERT((bits & PG_WRITEABLE) == 0 ||
+	    (m->flags & (PG_UNMANAGED | PG_FICTITIOUS)) != 0 ||
+	    (m->oflags & VPO_BUSY) != 0, ("PG_WRITEABLE and !VPO_BUSY"));
 	m->flags |= bits;
 } 
 



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