Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Oct 2012 20:19:43 +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: r241517 - head/sys/vm
Message-ID:  <201210132019.q9DKJh3e000747@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sat Oct 13 20:19:43 2012
New Revision: 241517
URL: http://svn.freebsd.org/changeset/base/241517

Log:
  Move vm_page_requeue() to the only file that uses it.
  
  MFC after:	3 weeks

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Sat Oct 13 19:53:11 2012	(r241516)
+++ head/sys/vm/vm_page.c	Sat Oct 13 20:19:43 2012	(r241517)
@@ -1868,28 +1868,6 @@ vm_waitpfault(void)
 }
 
 /*
- *	vm_page_requeue:
- *
- *	Move the given page to the tail of its present page queue.
- *
- *	The page queues must be locked.
- */
-void
-vm_page_requeue(vm_page_t m)
-{
-	struct vpgqueues *vpq;
-	int queue;
-
-	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
-	queue = m->queue;
-	KASSERT(queue != PQ_NONE,
-	    ("vm_page_requeue: page %p is not queued", m));
-	vpq = &vm_page_queues[queue];
-	TAILQ_REMOVE(&vpq->pl, m, pageq);
-	TAILQ_INSERT_TAIL(&vpq->pl, m, pageq);
-}
-
-/*
  *	vm_page_queue_remove:
  *
  *	Remove the given page from the specified queue.

Modified: head/sys/vm/vm_page.h
==============================================================================
--- head/sys/vm/vm_page.h	Sat Oct 13 19:53:11 2012	(r241516)
+++ head/sys/vm/vm_page.h	Sat Oct 13 20:19:43 2012	(r241517)
@@ -392,7 +392,6 @@ void vm_page_readahead_finish(vm_page_t 
 void vm_page_reference(vm_page_t m);
 void vm_page_remove (vm_page_t);
 void vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t);
-void vm_page_requeue(vm_page_t m);
 void vm_page_set_valid_range(vm_page_t m, int base, int size);
 void vm_page_sleep(vm_page_t m, const char *msg);
 vm_page_t vm_page_splay(vm_pindex_t, vm_page_t);

Modified: head/sys/vm/vm_pageout.c
==============================================================================
--- head/sys/vm/vm_pageout.c	Sat Oct 13 19:53:11 2012	(r241516)
+++ head/sys/vm/vm_pageout.c	Sat Oct 13 20:19:43 2012	(r241517)
@@ -218,6 +218,7 @@ static void vm_req_vmdaemon(int req);
 #endif
 static boolean_t vm_pageout_page_lock(vm_page_t, vm_page_t *);
 static void vm_pageout_page_stats(void);
+static void vm_pageout_requeue(vm_page_t m);
 
 /*
  * Initialize a dummy page for marking the caller's place in the specified
@@ -749,7 +750,7 @@ vm_pageout_object_deactivate_pages(pmap_
 						vm_page_deactivate(p);
 					} else {
 						vm_page_lock_queues();
-						vm_page_requeue(p);
+						vm_pageout_requeue(p);
 						vm_page_unlock_queues();
 					}
 				} else {
@@ -758,7 +759,7 @@ vm_pageout_object_deactivate_pages(pmap_
 					    ACT_ADVANCE)
 						p->act_count += ACT_ADVANCE;
 					vm_page_lock_queues();
-					vm_page_requeue(p);
+					vm_pageout_requeue(p);
 					vm_page_unlock_queues();
 				}
 			} else if (p->queue == PQ_INACTIVE)
@@ -855,6 +856,26 @@ vm_pageout_map_deactivate_pages(map, des
 #endif		/* !defined(NO_SWAPPING) */
 
 /*
+ *	vm_pageout_requeue:
+ *
+ *	Move the specified page to the tail of its present page queue.
+ *
+ *	The page queues must be locked.
+ */
+static void
+vm_pageout_requeue(vm_page_t m)
+{
+	struct vpgqueues *vpq;
+
+	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+	KASSERT(m->queue != PQ_NONE,
+	    ("vm_pageout_requeue: page %p is not queued", m));
+	vpq = &vm_page_queues[m->queue];
+	TAILQ_REMOVE(&vpq->pl, m, pageq);
+	TAILQ_INSERT_TAIL(&vpq->pl, m, pageq);
+}
+
+/*
  *	vm_pageout_scan does the dirty work for the pageout daemon.
  */
 static void
@@ -1097,7 +1118,7 @@ vm_pageout_scan(int pass)
 			m->flags |= PG_WINATCFLS;
 			vm_page_lock_queues();
 			queues_locked = TRUE;
-			vm_page_requeue(m);
+			vm_pageout_requeue(m);
 		} else if (maxlaunder > 0) {
 			/*
 			 * We always want to try to flush some dirty pages if
@@ -1128,7 +1149,7 @@ vm_pageout_scan(int pass)
 				vm_page_unlock(m);
 				VM_OBJECT_UNLOCK(object);
 				queues_locked = TRUE;
-				vm_page_requeue(m);
+				vm_pageout_requeue(m);
 				goto relock_queues;
 			}
 
@@ -1216,7 +1237,7 @@ vm_pageout_scan(int pass)
 				 */
 				if (m->hold_count) {
 					vm_page_unlock(m);
-					vm_page_requeue(m);
+					vm_pageout_requeue(m);
 					if (object->flags & OBJ_MIGHTBEDIRTY)
 						vnodes_skipped++;
 					goto unlock_and_continue;
@@ -1321,7 +1342,7 @@ relock_queues:
 		    (m->hold_count != 0)) {
 			vm_page_unlock(m);
 			VM_OBJECT_UNLOCK(object);
-			vm_page_requeue(m);
+			vm_pageout_requeue(m);
 			m = next;
 			continue;
 		}
@@ -1358,7 +1379,7 @@ relock_queues:
 		 * page activation count stats.
 		 */
 		if (actcount && (object->ref_count != 0)) {
-			vm_page_requeue(m);
+			vm_pageout_requeue(m);
 		} else {
 			m->act_count -= min(m->act_count, ACT_DECLINE);
 			if (vm_pageout_algorithm ||
@@ -1376,7 +1397,7 @@ relock_queues:
 					vm_page_deactivate(m);
 				}
 			} else {
-				vm_page_requeue(m);
+				vm_pageout_requeue(m);
 			}
 		}
 		vm_page_unlock(m);
@@ -1588,7 +1609,7 @@ vm_pageout_page_stats()
 		    (m->hold_count != 0)) {
 			vm_page_unlock(m);
 			VM_OBJECT_UNLOCK(object);
-			vm_page_requeue(m);
+			vm_pageout_requeue(m);
 			m = next;
 			continue;
 		}
@@ -1604,7 +1625,7 @@ vm_pageout_page_stats()
 			m->act_count += ACT_ADVANCE + actcount;
 			if (m->act_count > ACT_MAX)
 				m->act_count = ACT_MAX;
-			vm_page_requeue(m);
+			vm_pageout_requeue(m);
 		} else {
 			if (m->act_count == 0) {
 				/*
@@ -1620,7 +1641,7 @@ vm_pageout_page_stats()
 				vm_page_deactivate(m);
 			} else {
 				m->act_count -= min(m->act_count, ACT_DECLINE);
-				vm_page_requeue(m);
+				vm_pageout_requeue(m);
 			}
 		}
 		vm_page_unlock(m);



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