Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Feb 2013 22:05:23 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r246332 - in user/attilio/vmc-playground/sys: fs/tmpfs kern vm
Message-ID:  <201302042205.r14M5NSk007073@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Mon Feb  4 22:05:22 2013
New Revision: 246332
URL: http://svnweb.freebsd.org/changeset/base/246332

Log:
  Reduce differences with HEAD.

Modified:
  user/attilio/vmc-playground/sys/fs/tmpfs/tmpfs_fifoops.c
  user/attilio/vmc-playground/sys/fs/tmpfs/tmpfs_vnops.c
  user/attilio/vmc-playground/sys/kern/uipc_shm.c
  user/attilio/vmc-playground/sys/vm/vm_object.c
  user/attilio/vmc-playground/sys/vm/vm_page.c
  user/attilio/vmc-playground/sys/vm/vnode_pager.c

Modified: user/attilio/vmc-playground/sys/fs/tmpfs/tmpfs_fifoops.c
==============================================================================
--- user/attilio/vmc-playground/sys/fs/tmpfs/tmpfs_fifoops.c	Mon Feb  4 21:58:57 2013	(r246331)
+++ user/attilio/vmc-playground/sys/fs/tmpfs/tmpfs_fifoops.c	Mon Feb  4 22:05:22 2013	(r246332)
@@ -39,7 +39,6 @@
 #include <sys/param.h>
 #include <sys/filedesc.h>
 #include <sys/proc.h>
-#include <sys/systm.h>
 #include <sys/vnode.h>
 
 #include <vm/vm.h>

Modified: user/attilio/vmc-playground/sys/fs/tmpfs/tmpfs_vnops.c
==============================================================================
--- user/attilio/vmc-playground/sys/fs/tmpfs/tmpfs_vnops.c	Mon Feb  4 21:58:57 2013	(r246331)
+++ user/attilio/vmc-playground/sys/fs/tmpfs/tmpfs_vnops.c	Mon Feb  4 22:05:22 2013	(r246332)
@@ -654,7 +654,7 @@ tmpfs_mappedwrite(vm_object_t vobj, vm_o
 		goto nocache;
 	}
 lookupvpg:
-	if (((vpg = vm_radix_lookup(&vobj->rtree, idx)) != NULL) &&
+	if (((vpg = vm_page_lookup(vobj, idx)) != NULL) &&
 	    vm_page_is_valid(vpg, offset, tlen)) {
 		if ((vpg->oflags & VPO_BUSY) != 0) {
 			/*

Modified: user/attilio/vmc-playground/sys/kern/uipc_shm.c
==============================================================================
--- user/attilio/vmc-playground/sys/kern/uipc_shm.c	Mon Feb  4 21:58:57 2013	(r246331)
+++ user/attilio/vmc-playground/sys/kern/uipc_shm.c	Mon Feb  4 22:05:22 2013	(r246332)
@@ -278,7 +278,7 @@ shm_dotruncate(struct shmfd *shmfd, off_
 		if (base != 0) {
 			idx = OFF_TO_IDX(length);
 retry:
-			m = vm_radix_lookup(&object->rtree, idx);
+			m = vm_page_lookup(object, idx);
 			if (m != NULL) {
 				if ((m->oflags & VPO_BUSY) != 0 ||
 				    m->busy != 0) {

Modified: user/attilio/vmc-playground/sys/vm/vm_object.c
==============================================================================
--- user/attilio/vmc-playground/sys/vm/vm_object.c	Mon Feb  4 21:58:57 2013	(r246331)
+++ user/attilio/vmc-playground/sys/vm/vm_object.c	Mon Feb  4 22:05:22 2013	(r246332)
@@ -326,7 +326,7 @@ vm_object_set_memattr(vm_object_t object
 	case OBJT_SG:
 	case OBJT_SWAP:
 	case OBJT_VNODE:
-		if (object->resident_page_count == 0)
+		if (!TAILQ_EMPTY(&object->memq))
 			return (KERN_FAILURE);
 		break;
 	case OBJT_DEAD:
@@ -730,7 +730,7 @@ vm_object_terminate(vm_object_t object)
 		 * wired, then the effect of this assignment is that
 		 * vm_page_free()'s call to vm_page_remove() will return
 		 * immediately without modifying the page or the object.
-		 */
+		 */ 
 		p->object = NULL;
 		if (p->wire_count == 0) {
 			vm_page_free(p);
@@ -1796,7 +1796,6 @@ vm_object_collapse(vm_object_t object)
 					mtx_unlock(&vm_page_queue_free_mtx);
 				}
 			}
-
 			/*
 			 * Object now shadows whatever backing_object did.
 			 * Note that the reference to 
@@ -1935,7 +1934,7 @@ again:
 
 	/*
 	 * Here, the variable "p" is either (1) the page with the least pindex
-	 * greater than or equal to the parameter "start" or (2) NULL.
+	 * greater than or equal to the parameter "start" or (2) NULL. 
 	 */
 	for (; p != NULL && (p->pindex < end || end == 0); p = next) {
 		next = TAILQ_NEXT(p, listq);
@@ -2400,9 +2399,8 @@ DB_SHOW_COMMAND(object, vm_object_print_
 			db_printf(",");
 		count++;
 
-		db_printf("(off=0x%jx,page=0x%jx,obj=%p,flags=0x%X)",
-		    (uintmax_t)p->pindex, (uintmax_t)VM_PAGE_TO_PHYS(p),
-		    p->object, p->flags);
+		db_printf("(off=0x%jx,page=0x%jx)",
+		    (uintmax_t)p->pindex, (uintmax_t)VM_PAGE_TO_PHYS(p));
 	}
 	if (count != 0)
 		db_printf("\n");

Modified: user/attilio/vmc-playground/sys/vm/vm_page.c
==============================================================================
--- user/attilio/vmc-playground/sys/vm/vm_page.c	Mon Feb  4 21:58:57 2013	(r246331)
+++ user/attilio/vmc-playground/sys/vm/vm_page.c	Mon Feb  4 22:05:22 2013	(r246332)
@@ -312,14 +312,13 @@ vm_page_startup(vm_offset_t vaddr)
 	/*
 	 * Initialize the page and queue locks.
 	 */
-	mtx_init(&vm_page_queue_free_mtx, "vm page queue free mutex", NULL,
-	    MTX_DEF | MTX_RECURSE);
-
-	/* Setup page locks. */
+	mtx_init(&vm_page_queue_free_mtx, "vm page free queue", NULL, MTX_DEF |
+	    MTX_RECURSE);
 	for (i = 0; i < PA_LOCK_COUNT; i++)
 		mtx_init(&pa_lock[i], "vm page", NULL, MTX_DEF);
 	for (i = 0; i < PQ_COUNT; i++)
 		vm_pagequeue_init_lock(&vm_pagequeues[i]);
+
 	/*
 	 * Allocate memory for use when boot strapping the kernel memory
 	 * allocator.
@@ -811,6 +810,7 @@ void
 vm_page_insert(vm_page_t m, vm_object_t object, vm_pindex_t pindex)
 {
 	vm_page_t neighbor;
+
 	VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
 	if (m->object != NULL)
 		panic("vm_page_insert: page already inserted");

Modified: user/attilio/vmc-playground/sys/vm/vnode_pager.c
==============================================================================
--- user/attilio/vmc-playground/sys/vm/vnode_pager.c	Mon Feb  4 21:58:57 2013	(r246331)
+++ user/attilio/vmc-playground/sys/vm/vnode_pager.c	Mon Feb  4 22:05:22 2013	(r246332)
@@ -404,13 +404,12 @@ vnode_pager_setsize(vp, nsize)
 		 * completely invalid page and mark it partially valid
 		 * it can screw up NFS reads, so we don't allow the case.
 		 */
-		if ((nsize & PAGE_MASK) && (m = vm_radix_lookup(&object->rtree,
-		    OFF_TO_IDX(nsize))) != NULL && m->valid != 0) {
+		if ((nsize & PAGE_MASK) &&
+		    (m = vm_page_lookup(object, OFF_TO_IDX(nsize))) != NULL &&
+		    m->valid != 0) {
 			int base = (int)nsize & PAGE_MASK;
 			int size = PAGE_SIZE - base;
 
-			MPASS(m->object == object);
-
 			/*
 			 * Clear out partial-page garbage in case
 			 * the page has been mapped.



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