Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jan 2011 17:33:34 +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: r217477 - head/sys/vm
Message-ID:  <201101161733.p0GHXY3X071360@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sun Jan 16 17:33:34 2011
New Revision: 217477
URL: http://svn.freebsd.org/changeset/base/217477

Log:
  Clean up the start of vm_page_alloc().  In particular, eliminate an
  assertion that is no longer required.  Long ago, calls to vm_page_alloc()
  from an interrupt handler had to specify VM_ALLOC_INTERRUPT so that
  vm_page_alloc() would not attempt to reclaim a PQ_CACHE page from another vm
  object.  Today, with the synchronization on a vm object's collection of
  PQ_CACHE pages, this is no longer an issue.  In fact, VM_ALLOC_INTERRUPT now
  reclaims PQ_CACHE pages just like VM_ALLOC_{NORMAL,SYSTEM}.
  
  MFC after:	3 weeks

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Sun Jan 16 14:37:48 2011	(r217476)
+++ head/sys/vm/vm_page.c	Sun Jan 16 17:33:34 2011	(r217477)
@@ -1214,23 +1214,19 @@ vm_page_alloc(vm_object_t object, vm_pin
 	vm_page_t m;
 	int flags, page_req;
 
-	page_req = req & VM_ALLOC_CLASS_MASK;
-	KASSERT(curthread->td_intr_nesting_level == 0 ||
-	    page_req == VM_ALLOC_INTERRUPT,
-	    ("vm_page_alloc(NORMAL|SYSTEM) in interrupt context"));
-
 	if ((req & VM_ALLOC_NOOBJ) == 0) {
 		KASSERT(object != NULL,
 		    ("vm_page_alloc: NULL object."));
 		VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
 	}
 
+	page_req = req & VM_ALLOC_CLASS_MASK;
+
 	/*
 	 * The pager is allowed to eat deeper into the free page list.
 	 */
-	if ((curproc == pageproc) && (page_req != VM_ALLOC_INTERRUPT)) {
+	if ((curproc == pageproc) && (page_req != VM_ALLOC_INTERRUPT))
 		page_req = VM_ALLOC_SYSTEM;
-	};
 
 	mtx_lock(&vm_page_queue_free_mtx);
 	if (cnt.v_free_count + cnt.v_cache_count > cnt.v_free_reserved ||



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