Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Aug 2013 21:20:14 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r253941 - in user/attilio/vmcontention: cddl/contrib/opensolaris/cmd/zfs etc/devd sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/dev/iwn sys/fs/tmpfs sys/geom/part sys/kern sys/spar...
Message-ID:  <201308042120.r74LKEuh000104@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Sun Aug  4 21:20:14 2013
New Revision: 253941
URL: http://svnweb.freebsd.org/changeset/base/253941

Log:
  MFC

Modified:
  user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
  user/attilio/vmcontention/etc/devd/usb.conf
  user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  user/attilio/vmcontention/sys/dev/iwn/if_iwn.c
  user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_vnops.c
  user/attilio/vmcontention/sys/geom/part/g_part.c
  user/attilio/vmcontention/sys/geom/part/g_part_apm.c
  user/attilio/vmcontention/sys/kern/imgact_elf.c
  user/attilio/vmcontention/sys/kern/kern_exec.c
  user/attilio/vmcontention/sys/kern/sys_process.c
  user/attilio/vmcontention/sys/sparc64/include/pmap.h
  user/attilio/vmcontention/sys/sparc64/sparc64/pmap.c
  user/attilio/vmcontention/sys/vm/vm_extern.h
  user/attilio/vmcontention/sys/vm/vm_fault.c
  user/attilio/vmcontention/sys/vm/vm_glue.c
  user/attilio/vmcontention/sys/vm/vm_map.h
Directory Properties:
  user/attilio/vmcontention/   (props changed)
  user/attilio/vmcontention/cddl/   (props changed)
  user/attilio/vmcontention/cddl/contrib/opensolaris/   (props changed)
  user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zfs/   (props changed)
  user/attilio/vmcontention/sys/   (props changed)
  user/attilio/vmcontention/sys/cddl/contrib/opensolaris/   (props changed)

Modified: user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==============================================================================
--- user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c	Sun Aug  4 21:20:14 2013	(r253941)
@@ -57,6 +57,7 @@
 #include <sys/fs/zfs.h>
 #include <sys/types.h>
 #include <time.h>
+#include <err.h>
 
 #include <libzfs.h>
 #include <libzfs_core.h>

Modified: user/attilio/vmcontention/etc/devd/usb.conf
==============================================================================
--- user/attilio/vmcontention/etc/devd/usb.conf	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/etc/devd/usb.conf	Sun Aug  4 21:20:14 2013	(r253941)
@@ -777,7 +777,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x050d";
-	match "product" "(0x8053|0x805c|0x815c|0x825a|0x825b)";
+	match "product" "(0x8053|0x805c|0x815c)";
 	action "kldload -n if_run";
 };
 
@@ -785,6 +785,30 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x050d";
+	match "product" "0x815f";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x050d";
+	match "product" "(0x825a|0x825b)";
+	action "kldload -n if_run";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x050d";
+	match "product" "0x845a";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x050d";
 	match "product" "0x905b";
 	action "kldload -n if_rum";
 };
@@ -800,6 +824,14 @@ nomatch 32 {
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x050d";
+	match "product" "0x945a";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x0525";
 	match "product" "(0x1080|0xa4a0)";
 	action "kldload -n udbp";
@@ -1249,6 +1281,14 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x06f8";
+	match "product" "(0xe031|0xe032)";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x06f8";
 	match "product" "0xe033";
 	action "kldload -n if_urtwn";
 };
@@ -1457,6 +1497,14 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x07aa";
+	match "product" "0x0047";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x07aa";
 	match "product" "0x0056";
 	action "kldload -n if_urtwn";
 };
@@ -1561,6 +1609,14 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x07d1";
+	match "product" "(0x3300|0x3302|0x3303)";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x07d1";
 	match "product" "0x3a0c";
 	action "kldload -n if_uath";
 };
@@ -1657,7 +1713,23 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x083a";
-	match "product" "(0x6618|0x7511|0x7512|0x7522|0x8522|0xa512|0xa618|0xa701|0xa702|0xb522|0xc522|0xd522)";
+	match "product" "(0x6618|0x7511|0x7512|0x7522|0x8522|0xa512|0xa618|0xa701|0xa702|0xb522)";
+	action "kldload -n if_run";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x083a";
+	match "product" "0xc512";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x083a";
+	match "product" "(0xc522|0xd522)";
 	action "kldload -n if_run";
 };
 
@@ -2137,7 +2209,39 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0b05";
-	match "product" "(0x1731|0x1732|0x1742|0x1760|0x1761|0x1784|0x1790|0x179d)";
+	match "product" "(0x1731|0x1732|0x1742|0x1760|0x1761|0x1784)";
+	action "kldload -n if_run";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0b05";
+	match "product" "0x1786";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0b05";
+	match "product" "0x1790";
+	action "kldload -n if_run";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0b05";
+	match "product" "0x1791";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0b05";
+	match "product" "0x179d";
 	action "kldload -n if_run";
 };
 
@@ -2273,7 +2377,23 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0bda";
-	match "product" "(0x8170|0x8176|0x8177|0x8178|0x817a|0x817b|0x817c|0x817d|0x817e)";
+	match "product" "0x8170";
+	action "kldload -n if_urtwn";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0bda";
+	match "product" "(0x8171|0x8172|0x8173|0x8174)";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0bda";
+	match "product" "(0x8176|0x8177|0x8178|0x817a|0x817b|0x817c|0x817d|0x817e)";
 	action "kldload -n if_urtwn";
 };
 
@@ -2305,6 +2425,14 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0bda";
+	match "product" "(0x8712|0x8712)";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0bda";
 	match "product" "0x8754";
 	action "kldload -n if_urtwn";
 };
@@ -2312,6 +2440,14 @@ nomatch 32 {
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x0bda";
+	match "product" "0xc512";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x0bed";
 	match "product" "(0x1100|0x1101)";
 	action "kldload -n uslcom";
@@ -2609,7 +2745,39 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0df6";
-	match "product" "(0x002b|0x002c|0x002d|0x0039|0x003b|0x003c|0x003d|0x003e|0x003f|0x0040|0x0041|0x0042|0x0047|0x0048|0x004a|0x004d)";
+	match "product" "(0x002b|0x002c|0x002d|0x0039|0x003b|0x003c|0x003d|0x003e|0x003f|0x0040|0x0041|0x0042)";
+	action "kldload -n if_run";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0df6";
+	match "product" "0x0045";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0df6";
+	match "product" "(0x0047|0x0048|0x004a)";
+	action "kldload -n if_run";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0df6";
+	match "product" "0x004b";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0df6";
+	match "product" "0x004d";
 	action "kldload -n if_run";
 };
 
@@ -2681,6 +2849,14 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0e66";
+	match "product" "(0x0015|0x0016)";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0e66";
 	match "product" "0x0019";
 	action "kldload -n if_urtwn";
 };
@@ -3401,6 +3577,14 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x13d3";
+	match "product" "(0x3306|0x3309|0x3310|0x3311|0x3325)";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x13d3";
 	match "product" "(0x3357|0x3358|0x3359)";
 	action "kldload -n if_urtwn";
 };
@@ -3553,6 +3737,14 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x14b2";
+	match "product" "(0x3300|0x3301|0x3302)";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x14b2";
 	match "product" "0x3c02";
 	action "kldload -n if_ural";
 };
@@ -3945,6 +4137,14 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x1740";
+	match "product" "(0x9603|0x9605)";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x1740";
 	match "product" "(0x9701|0x9702|0x9703|0x9705|0x9706|0x9707|0x9708|0x9709|0x9801)";
 	action "kldload -n if_run";
 };
@@ -3961,7 +4161,23 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x177f";
-	match "product" "(0x0153|0x0302|0x0313)";
+	match "product" "0x0153";
+	action "kldload -n if_run";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x177f";
+	match "product" "0x0154";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x177f";
+	match "product" "(0x0302|0x0313)";
 	action "kldload -n if_run";
 };
 
@@ -4353,6 +4569,14 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x2019";
+	match "product" "0xab28";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x2019";
 	match "product" "(0xab2a|0xab2b|0xab2e)";
 	action "kldload -n if_urtwn";
 };
@@ -4681,6 +4905,14 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x7392";
+	match "product" "(0x7611|0x7612|0x7622)";
+	action "kldload -n if_rsu";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x7392";
 	match "product" "(0x7711|0x7717|0x7718)";
 	action "kldload -n if_run";
 };
@@ -4936,5 +5168,5 @@ nomatch 32 {
 	action "kldload -n umass";
 };
 
-# 2477 USB entries processed
+# 2515 USB entries processed
 

Modified: user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Sun Aug  4 21:20:14 2013	(r253941)
@@ -324,7 +324,8 @@ zfs_ioctl(vnode_t *vp, u_long com, intpt
 }
 
 static vm_page_t
-page_busy(vnode_t *vp, int64_t start, int64_t off, int64_t nbytes)
+page_busy(vnode_t *vp, int64_t start, int64_t off, int64_t nbytes,
+    boolean_t alloc)
 {
 	vm_object_t obj;
 	vm_page_t pp;
@@ -346,6 +347,8 @@ page_busy(vnode_t *vp, int64_t start, in
 				continue;
 			}
 		} else if (pp == NULL) {
+			if (!alloc)
+				break;
 			pp = vm_page_alloc(obj, OFF_TO_IDX(start),
 			    VM_ALLOC_SYSTEM | VM_ALLOC_IFCACHED |
 			    VM_ALLOC_NOBUSY);
@@ -356,8 +359,10 @@ page_busy(vnode_t *vp, int64_t start, in
 
 		if (pp != NULL) {
 			ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL);
-			vm_object_pip_add(obj, 1);
 			vm_page_io_start(pp);
+			if (!alloc)
+				break;
+			vm_object_pip_add(obj, 1);
 			pmap_remove_write(pp);
 			vm_page_clear_dirty(pp, off, nbytes);
 		}
@@ -367,55 +372,12 @@ page_busy(vnode_t *vp, int64_t start, in
 }
 
 static void
-page_unbusy(vm_page_t pp)
+page_unbusy(vm_page_t pp, boolean_t unalloc)
 {
 
 	vm_page_io_finish(pp);
-	vm_object_pip_subtract(pp->object, 1);
-}
-
-static vm_page_t
-page_hold(vnode_t *vp, int64_t start)
-{
-	vm_object_t obj;
-	vm_page_t pp;
-
-	obj = vp->v_object;
-	zfs_vmobject_assert_wlocked(obj);
-
-	for (;;) {
-		if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL &&
-		    pp->valid) {
-			if ((pp->oflags & VPO_BUSY) != 0) {
-				/*
-				 * Reference the page before unlocking and
-				 * sleeping so that the page daemon is less
-				 * likely to reclaim it.
-				 */
-				vm_page_reference(pp);
-				vm_page_sleep(pp, "zfsmwb");
-				continue;
-			}
-
-			ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL);
-			vm_page_lock(pp);
-			vm_page_hold(pp);
-			vm_page_unlock(pp);
-
-		} else
-			pp = NULL;
-		break;
-	}
-	return (pp);
-}
-
-static void
-page_unhold(vm_page_t pp)
-{
-
-	vm_page_lock(pp);
-	vm_page_unhold(pp);
-	vm_page_unlock(pp);
+	if (unalloc)
+		vm_object_pip_subtract(pp->object, 1);
 }
 
 static caddr_t
@@ -479,7 +441,8 @@ update_pages(vnode_t *vp, int64_t start,
 
 			zfs_vmobject_wlock(obj);
 			vm_page_undirty(pp);
-		} else if ((pp = page_busy(vp, start, off, nbytes)) != NULL) {
+		} else if ((pp = page_busy(vp, start, off, nbytes,
+		    TRUE)) != NULL) {
 			zfs_vmobject_wunlock(obj);
 
 			va = zfs_map_page(pp, &sf);
@@ -488,7 +451,7 @@ update_pages(vnode_t *vp, int64_t start,
 			zfs_unmap_page(sf);
 
 			zfs_vmobject_wlock(obj);
-			page_unbusy(pp);
+			page_unbusy(pp, TRUE);
 		}
 		len -= nbytes;
 		off = 0;
@@ -598,7 +561,7 @@ mappedread(vnode_t *vp, int nbytes, uio_
 		vm_page_t pp;
 		uint64_t bytes = MIN(PAGESIZE - off, len);
 
-		if (pp = page_hold(vp, start)) {
+		if (pp = page_busy(vp, start, 0, 0, FALSE)) {
 			struct sf_buf *sf;
 			caddr_t va;
 
@@ -607,7 +570,7 @@ mappedread(vnode_t *vp, int nbytes, uio_
 			error = uiomove(va + off, bytes, UIO_READ, uio);
 			zfs_unmap_page(sf);
 			zfs_vmobject_wlock(obj);
-			page_unhold(pp);
+			page_unbusy(pp, FALSE);
 		} else {
 			zfs_vmobject_wunlock(obj);
 			error = dmu_read_uio(os, zp->z_id, uio, bytes);

Modified: user/attilio/vmcontention/sys/dev/iwn/if_iwn.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/iwn/if_iwn.c	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/dev/iwn/if_iwn.c	Sun Aug  4 21:20:14 2013	(r253941)
@@ -7489,7 +7489,7 @@ iwn_hw_reset(void *arg0, int pending)
 #define	COUNTOF(array) (sizeof(array) / sizeof(array[0]))
 
 /*
- * Transate CSR code to string
+ * Translate CSR code to string
  */
 static char *iwn_get_csr_string(int csr)
 {

Modified: user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_vnops.c
==============================================================================
--- user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_vnops.c	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_vnops.c	Sun Aug  4 21:20:14 2013	(r253941)
@@ -485,13 +485,13 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p
 			vm_page_zero_invalid(m, TRUE);
 		vm_page_wakeup(m);
 	}
-	vm_page_lock(m);
-	vm_page_hold(m);
-	vm_page_unlock(m);
+	vm_page_io_start(m);
 	VM_OBJECT_WUNLOCK(tobj);
 	error = uiomove_fromphys(&m, offset, tlen, uio);
+	VM_OBJECT_WLOCK(tobj);
+	vm_page_io_finish(m);
+	VM_OBJECT_WUNLOCK(tobj);
 	vm_page_lock(m);
-	vm_page_unhold(m);
 	if (m->queue == PQ_NONE) {
 		vm_page_deactivate(m);
 	} else {
@@ -602,16 +602,14 @@ tmpfs_mappedwrite(vm_object_t tobj, size
 			vm_page_zero_invalid(tpg, TRUE);
 		vm_page_wakeup(tpg);
 	}
-	vm_page_lock(tpg);
-	vm_page_hold(tpg);
-	vm_page_unlock(tpg);
+	vm_page_io_start(tpg);
 	VM_OBJECT_WUNLOCK(tobj);
 	error = uiomove_fromphys(&tpg, offset, tlen, uio);
 	VM_OBJECT_WLOCK(tobj);
+	vm_page_io_finish(tpg);
 	if (error == 0)
 		vm_page_dirty(tpg);
 	vm_page_lock(tpg);
-	vm_page_unhold(tpg);
 	if (tpg->queue == PQ_NONE) {
 		vm_page_deactivate(tpg);
 	} else {

Modified: user/attilio/vmcontention/sys/geom/part/g_part.c
==============================================================================
--- user/attilio/vmcontention/sys/geom/part/g_part.c	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/geom/part/g_part.c	Sun Aug  4 21:20:14 2013	(r253941)
@@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
 #include <sys/bio.h>
-#include <sys/diskmbr.h>
 #include <sys/endian.h>
 #include <sys/kernel.h>
 #include <sys/kobj.h>

Modified: user/attilio/vmcontention/sys/geom/part/g_part_apm.c
==============================================================================
--- user/attilio/vmcontention/sys/geom/part/g_part_apm.c	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/geom/part/g_part_apm.c	Sun Aug  4 21:20:14 2013	(r253941)
@@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/param.h>
 #include <sys/apm.h>
 #include <sys/bio.h>
-#include <sys/diskmbr.h>
 #include <sys/endian.h>
 #include <sys/kernel.h>
 #include <sys/kobj.h>

Modified: user/attilio/vmcontention/sys/kern/imgact_elf.c
==============================================================================
--- user/attilio/vmcontention/sys/kern/imgact_elf.c	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/kern/imgact_elf.c	Sun Aug  4 21:20:14 2013	(r253941)
@@ -378,7 +378,7 @@ __elfN(map_partial)(vm_map_t map, vm_obj
 		off = offset - trunc_page(offset);
 		error = copyout((caddr_t)sf_buf_kva(sf) + off, (caddr_t)start,
 		    end - start);
-		vm_imgact_unmap_page(sf);
+		vm_imgact_unmap_page(object, sf);
 		if (error) {
 			return (KERN_FAILURE);
 		}
@@ -433,7 +433,7 @@ __elfN(map_insert)(vm_map_t map, vm_obje
 					sz = PAGE_SIZE - off;
 				error = copyout((caddr_t)sf_buf_kva(sf) + off,
 				    (caddr_t)start, sz);
-				vm_imgact_unmap_page(sf);
+				vm_imgact_unmap_page(object, sf);
 				if (error) {
 					return (KERN_FAILURE);
 				}
@@ -553,7 +553,7 @@ __elfN(load_section)(struct image_params
 		    trunc_page(offset + filsz);
 		error = copyout((caddr_t)sf_buf_kva(sf) + off,
 		    (caddr_t)map_addr, copy_len);
-		vm_imgact_unmap_page(sf);
+		vm_imgact_unmap_page(object, sf);
 		if (error) {
 			return (error);
 		}

Modified: user/attilio/vmcontention/sys/kern/kern_exec.c
==============================================================================
--- user/attilio/vmcontention/sys/kern/kern_exec.c	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/kern/kern_exec.c	Sun Aug  4 21:20:14 2013	(r253941)
@@ -973,7 +973,7 @@ exec_map_first_page(imgp)
 		vm_page_wakeup(ma[0]);
 	}
 	vm_page_lock(ma[0]);
-	vm_page_hold(ma[0]);
+	vm_page_wire(ma[0]);
 	vm_page_unlock(ma[0]);
 	VM_OBJECT_WUNLOCK(object);
 
@@ -994,7 +994,7 @@ exec_unmap_first_page(imgp)
 		sf_buf_free(imgp->firstpage);
 		imgp->firstpage = NULL;
 		vm_page_lock(m);
-		vm_page_unhold(m);
+		vm_page_unwire(m, 0);
 		vm_page_unlock(m);
 	}
 }

Modified: user/attilio/vmcontention/sys/kern/sys_process.c
==============================================================================
--- user/attilio/vmcontention/sys/kern/sys_process.c	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/kern/sys_process.c	Sun Aug  4 21:20:14 2013	(r253941)
@@ -263,6 +263,7 @@ proc_rwmem(struct proc *p, struct uio *u
 	writing = uio->uio_rw == UIO_WRITE;
 	reqprot = writing ? VM_PROT_COPY | VM_PROT_READ : VM_PROT_READ;
 	fault_flags = writing ? VM_FAULT_DIRTY : VM_FAULT_NORMAL;
+	fault_flags |= VM_FAULT_IOBUSY;
 
 	/*
 	 * Only map in one page at a time.  We don't have to, but it
@@ -287,9 +288,9 @@ proc_rwmem(struct proc *p, struct uio *u
 		len = min(PAGE_SIZE - page_offset, uio->uio_resid);
 
 		/*
-		 * Fault and hold the page on behalf of the process.
+		 * Fault and busy the page on behalf of the process.
 		 */
-		error = vm_fault_hold(map, pageno, reqprot, fault_flags, &m);
+		error = vm_fault_handle(map, pageno, reqprot, fault_flags, &m);
 		if (error != KERN_SUCCESS) {
 			if (error == KERN_RESOURCE_SHORTAGE)
 				error = ENOMEM;
@@ -315,9 +316,9 @@ proc_rwmem(struct proc *p, struct uio *u
 		/*
 		 * Release the page.
 		 */
-		vm_page_lock(m);
-		vm_page_unhold(m);
-		vm_page_unlock(m);
+		VM_OBJECT_WLOCK(m->object);
+		vm_page_io_finish(m);
+		VM_OBJECT_WUNLOCK(m->object);
 
 	} while (error == 0 && uio->uio_resid > 0);
 

Modified: user/attilio/vmcontention/sys/sparc64/include/pmap.h
==============================================================================
--- user/attilio/vmcontention/sys/sparc64/include/pmap.h	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/sparc64/include/pmap.h	Sun Aug  4 21:20:14 2013	(r253941)
@@ -56,7 +56,6 @@ struct md_page {
 	struct	pmap *pmap;
 	uint32_t colors[DCACHE_COLORS];
 	int32_t	color;
-	uint32_t flags;
 };
 
 struct pmap {

Modified: user/attilio/vmcontention/sys/sparc64/sparc64/pmap.c
==============================================================================
--- user/attilio/vmcontention/sys/sparc64/sparc64/pmap.c	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/sparc64/sparc64/pmap.c	Sun Aug  4 21:20:14 2013	(r253941)
@@ -765,7 +765,6 @@ pmap_page_init(vm_page_t m)
 
 	TAILQ_INIT(&m->md.tte_list);
 	m->md.color = DCACHE_COLOR(VM_PAGE_TO_PHYS(m));
-	m->md.flags = 0;
 	m->md.pmap = NULL;
 }
 

Modified: user/attilio/vmcontention/sys/vm/vm_extern.h
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_extern.h	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/vm/vm_extern.h	Sun Aug  4 21:20:14 2013	(r253941)
@@ -63,7 +63,7 @@ void vm_fault_copy_entry(vm_map_t, vm_ma
     vm_ooffset_t *);
 int vm_fault_disable_pagefaults(void);
 void vm_fault_enable_pagefaults(int save);
-int vm_fault_hold(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type,
+int vm_fault_handle(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type,
     int fault_flags, vm_page_t *m_hold);
 int vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t addr, vm_size_t len,
     vm_prot_t prot, vm_page_t *ma, int max_count);
@@ -87,7 +87,7 @@ void vnode_pager_setsize(struct vnode *,
 int vslock(void *, size_t);
 void vsunlock(void *, size_t);
 struct sf_buf *vm_imgact_map_page(vm_object_t object, vm_ooffset_t offset);
-void vm_imgact_unmap_page(struct sf_buf *sf);
+void vm_imgact_unmap_page(vm_object_t, struct sf_buf *sf);
 void vm_thread_dispose(struct thread *td);
 int vm_thread_new(struct thread *td, int pages);
 int vm_mlock(struct proc *, struct ucred *, const void *, size_t);

Modified: user/attilio/vmcontention/sys/vm/vm_fault.c
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_fault.c	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/vm/vm_fault.c	Sun Aug  4 21:20:14 2013	(r253941)
@@ -221,8 +221,8 @@ vm_fault(vm_map_t map, vm_offset_t vaddr
 	if (map != kernel_map && KTRPOINT(td, KTR_FAULT))
 		ktrfault(vaddr, fault_type);
 #endif
-	result = vm_fault_hold(map, trunc_page(vaddr), fault_type, fault_flags,
-	    NULL);
+	result = vm_fault_handle(map, trunc_page(vaddr), fault_type,
+	    fault_flags, NULL);
 #ifdef KTRACE
 	if (map != kernel_map && KTRPOINT(td, KTR_FAULTEND))
 		ktrfaultend(result);
@@ -231,7 +231,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr
 }
 
 int
-vm_fault_hold(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type,
+vm_fault_handle(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type,
     int fault_flags, vm_page_t *m_hold)
 {
 	vm_prot_t prot;
@@ -943,7 +943,10 @@ vnode_locked:
 		vm_page_activate(fs.m);
 	if (m_hold != NULL) {
 		*m_hold = fs.m;
-		vm_page_hold(fs.m);
+		if (fault_flags & VM_FAULT_IOBUSY)
+			vm_page_io_start(fs.m);
+		else
+			vm_page_hold(fs.m);
 	}
 	vm_page_unlock(fs.m);
 	vm_page_wakeup(fs.m);
@@ -1145,7 +1148,7 @@ vm_fault_quick_hold_pages(vm_map_t map, 
 		 * and hold these pages.
 		 */
 		for (mp = ma, va = addr; va < end; mp++, va += PAGE_SIZE)
-			if (*mp == NULL && vm_fault_hold(map, va, prot,
+			if (*mp == NULL && vm_fault_handle(map, va, prot,
 			    VM_FAULT_NORMAL, mp) != KERN_SUCCESS)
 				goto error;
 	}

Modified: user/attilio/vmcontention/sys/vm/vm_glue.c
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_glue.c	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/vm/vm_glue.c	Sun Aug  4 21:20:14 2013	(r253941)
@@ -223,7 +223,7 @@ vsunlock(void *addr, size_t len)
  * Return the pinned page if successful; otherwise, return NULL.
  */
 static vm_page_t
-vm_imgact_hold_page(vm_object_t object, vm_ooffset_t offset)
+vm_imgact_page_iostart(vm_object_t object, vm_ooffset_t offset)
 {
 	vm_page_t m, ma[1];
 	vm_pindex_t pindex;
@@ -249,9 +249,7 @@ vm_imgact_hold_page(vm_object_t object, 
 		}
 		vm_page_wakeup(m);
 	}
-	vm_page_lock(m);
-	vm_page_hold(m);
-	vm_page_unlock(m);
+	vm_page_io_start(m);
 out:
 	VM_OBJECT_WUNLOCK(object);
 	return (m);
@@ -266,7 +264,7 @@ vm_imgact_map_page(vm_object_t object, v
 {
 	vm_page_t m;
 
-	m = vm_imgact_hold_page(object, offset);
+	m = vm_imgact_page_iostart(object, offset);
 	if (m == NULL)
 		return (NULL);
 	sched_pin();
@@ -277,16 +275,16 @@ vm_imgact_map_page(vm_object_t object, v
  * Destroy the given CPU private mapping and unpin the page that it mapped.
  */
 void
-vm_imgact_unmap_page(struct sf_buf *sf)
+vm_imgact_unmap_page(vm_object_t object, struct sf_buf *sf)
 {
 	vm_page_t m;
 
 	m = sf_buf_page(sf);
 	sf_buf_free(sf);
 	sched_unpin();
-	vm_page_lock(m);
-	vm_page_unhold(m);
-	vm_page_unlock(m);
+	VM_OBJECT_WLOCK(object);
+	vm_page_io_finish(m);
+	VM_OBJECT_WUNLOCK(object);
 }
 
 void

Modified: user/attilio/vmcontention/sys/vm/vm_map.h
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_map.h	Sun Aug  4 21:17:05 2013	(r253940)
+++ user/attilio/vmcontention/sys/vm/vm_map.h	Sun Aug  4 21:20:14 2013	(r253941)
@@ -329,6 +329,7 @@ long vmspace_resident_count(struct vmspa
 #define VM_FAULT_NORMAL 0		/* Nothing special */
 #define VM_FAULT_CHANGE_WIRING 1	/* Change the wiring as appropriate */
 #define	VM_FAULT_DIRTY 2		/* Dirty the page; use w/VM_PROT_COPY */
+#define	VM_FAULT_IOBUSY 4		/* Busy the faulted page */
 
 /*
  * Initially, mappings are slightly sequential.  The maximum window size must



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