Date: Fri, 9 Aug 2013 11:52:23 +0000 (UTC) From: Attilio Rao <attilio@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r254142 - in user/attilio/vmcontention: bin/pkill cddl/contrib/opensolaris/cmd/ztest contrib/ofed/libsdp/src/linux contrib/ofed/management/infiniband-diags/src contrib/ofed/management/o... Message-ID: <201308091152.r79BqNlE010725@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: attilio Date: Fri Aug 9 11:52:22 2013 New Revision: 254142 URL: http://svnweb.freebsd.org/changeset/base/254142 Log: MFC Added: user/attilio/vmcontention/share/man/man9/vm_page_busy.9 - copied unchanged from r254141, head/share/man/man9/vm_page_busy.9 Deleted: user/attilio/vmcontention/share/man/man9/vm_page_io.9 user/attilio/vmcontention/share/man/man9/vm_page_sleep_if_busy.9 user/attilio/vmcontention/share/man/man9/vm_page_wakeup.9 Modified: user/attilio/vmcontention/bin/pkill/pkill.1 user/attilio/vmcontention/bin/pkill/pkill.c user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/ztest/ztest.c user/attilio/vmcontention/contrib/ofed/libsdp/src/linux/sdp_inet.h user/attilio/vmcontention/contrib/ofed/management/infiniband-diags/src/sminfo.c user/attilio/vmcontention/contrib/ofed/management/opensm/opensm/osm_console.c user/attilio/vmcontention/contrib/ofed/management/opensm/opensm/osm_subnet.c user/attilio/vmcontention/etc/namedb/named.conf user/attilio/vmcontention/share/man/man9/Makefile user/attilio/vmcontention/share/man/man9/VOP_GETPAGES.9 user/attilio/vmcontention/share/man/man9/mutex.9 user/attilio/vmcontention/share/man/man9/vm_page_alloc.9 user/attilio/vmcontention/sys/amd64/amd64/pmap.c user/attilio/vmcontention/sys/amd64/conf/GENERIC user/attilio/vmcontention/sys/arm/arm/pmap-v6.c user/attilio/vmcontention/sys/arm/arm/pmap.c user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h user/attilio/vmcontention/sys/dev/agp/agp.c user/attilio/vmcontention/sys/dev/bge/if_bge.c user/attilio/vmcontention/sys/dev/bge/if_bgereg.h user/attilio/vmcontention/sys/dev/drm2/i915/i915_gem.c user/attilio/vmcontention/sys/dev/drm2/ttm/ttm_bo_vm.c user/attilio/vmcontention/sys/dev/drm2/ttm/ttm_tt.c user/attilio/vmcontention/sys/dev/md/md.c user/attilio/vmcontention/sys/dev/mps/mps.c user/attilio/vmcontention/sys/dev/mps/mps_sas.c user/attilio/vmcontention/sys/dev/mps/mps_sas.h user/attilio/vmcontention/sys/dev/mps/mps_sas_lsi.c user/attilio/vmcontention/sys/dev/mps/mpsvar.h user/attilio/vmcontention/sys/fs/fuse/fuse_vnops.c user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_subr.c user/attilio/vmcontention/sys/fs/tmpfs/tmpfs_vnops.c user/attilio/vmcontention/sys/i386/conf/GENERIC user/attilio/vmcontention/sys/i386/i386/pmap.c user/attilio/vmcontention/sys/i386/xen/pmap.c user/attilio/vmcontention/sys/ia64/conf/GENERIC user/attilio/vmcontention/sys/ia64/ia64/pmap.c user/attilio/vmcontention/sys/kern/kern_exec.c user/attilio/vmcontention/sys/kern/kern_mutex.c user/attilio/vmcontention/sys/kern/kern_sysctl.c user/attilio/vmcontention/sys/kern/subr_uio.c user/attilio/vmcontention/sys/kern/uipc_shm.c user/attilio/vmcontention/sys/kern/uipc_syscalls.c user/attilio/vmcontention/sys/kern/vfs_acl.c user/attilio/vmcontention/sys/kern/vfs_bio.c user/attilio/vmcontention/sys/kern/vfs_cluster.c user/attilio/vmcontention/sys/mips/mips/pmap.c user/attilio/vmcontention/sys/ofed/include/linux/bitops.h user/attilio/vmcontention/sys/ofed/include/linux/sysfs.h user/attilio/vmcontention/sys/ofed/include/rdma/sdp_socket.h user/attilio/vmcontention/sys/powerpc/aim/mmu_oea.c user/attilio/vmcontention/sys/powerpc/aim/mmu_oea64.c user/attilio/vmcontention/sys/powerpc/booke/pmap.c user/attilio/vmcontention/sys/powerpc/conf/GENERIC user/attilio/vmcontention/sys/powerpc/conf/GENERIC64 user/attilio/vmcontention/sys/sparc64/conf/GENERIC user/attilio/vmcontention/sys/sparc64/sparc64/pmap.c user/attilio/vmcontention/sys/sys/param.h user/attilio/vmcontention/sys/sys/socket.h user/attilio/vmcontention/sys/vm/_vm_radix.h user/attilio/vmcontention/sys/vm/device_pager.c user/attilio/vmcontention/sys/vm/phys_pager.c user/attilio/vmcontention/sys/vm/sg_pager.c user/attilio/vmcontention/sys/vm/swap_pager.c user/attilio/vmcontention/sys/vm/vm_fault.c user/attilio/vmcontention/sys/vm/vm_glue.c user/attilio/vmcontention/sys/vm/vm_object.c user/attilio/vmcontention/sys/vm/vm_object.h user/attilio/vmcontention/sys/vm/vm_page.c user/attilio/vmcontention/sys/vm/vm_page.h user/attilio/vmcontention/sys/vm/vm_pageout.c user/attilio/vmcontention/sys/vm/vm_phys.c user/attilio/vmcontention/sys/vm/vm_radix.c user/attilio/vmcontention/sys/vm/vm_radix.h user/attilio/vmcontention/sys/vm/vnode_pager.c Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/cddl/ (props changed) user/attilio/vmcontention/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/sys/ (props changed) user/attilio/vmcontention/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/attilio/vmcontention/bin/pkill/pkill.1 ============================================================================== --- user/attilio/vmcontention/bin/pkill/pkill.1 Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/bin/pkill/pkill.1 Fri Aug 9 11:52:22 2013 (r254142) @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 11, 2010 +.Dd August 9, 2013 .Dt PKILL 1 .Os .Sh NAME @@ -44,6 +44,7 @@ .Op Fl N Ar system .Op Fl P Ar ppid .Op Fl U Ar uid +.Op Fl c Ar class .Op Fl d Ar delim .Op Fl g Ar pgrp .Op Fl j Ar jid @@ -60,6 +61,7 @@ .Op Fl N Ar system .Op Fl P Ar ppid .Op Fl U Ar uid +.Op Fl c Ar class .Op Fl g Ar pgrp .Op Fl j Ar jid .Op Fl s Ar sid @@ -130,6 +132,9 @@ or process and all of its ancestors are excluded (unless .Fl v is used). +.It Fl c Ar class +Restrict matches to processes running with specified login class +.Ar class . .It Fl f Match against full argument lists. The default is to match against process names. Modified: user/attilio/vmcontention/bin/pkill/pkill.c ============================================================================== --- user/attilio/vmcontention/bin/pkill/pkill.c Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/bin/pkill/pkill.c Fri Aug 9 11:52:22 2013 (r254142) @@ -79,12 +79,14 @@ enum listtype { LT_TTY, LT_PGRP, LT_JID, - LT_SID + LT_SID, + LT_CLASS }; struct list { SLIST_ENTRY(list) li_chain; long li_number; + char *li_name; }; SLIST_HEAD(listhead, list); @@ -116,6 +118,7 @@ static struct listhead ppidlist = SLIST_ static struct listhead tdevlist = SLIST_HEAD_INITIALIZER(tdevlist); static struct listhead sidlist = SLIST_HEAD_INITIALIZER(sidlist); static struct listhead jidlist = SLIST_HEAD_INITIALIZER(jidlist); +static struct listhead classlist = SLIST_HEAD_INITIALIZER(classlist); static void usage(void) __attribute__((__noreturn__)); static int killact(const struct kinfo_proc *); @@ -179,7 +182,7 @@ main(int argc, char **argv) execf = NULL; coref = _PATH_DEVNULL; - while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnoqs:t:u:vx")) != -1) + while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ac:d:fg:ij:lnoqs:t:u:vx")) != -1) switch (ch) { case 'D': debug_opt++; @@ -222,6 +225,10 @@ main(int argc, char **argv) case 'a': ancestors++; break; + case 'c': + makelist(&classlist, LT_CLASS, optarg); + criteria = 1; + break; case 'd': if (!pgrep) usage(); @@ -469,6 +476,20 @@ main(int argc, char **argv) continue; } + SLIST_FOREACH(li, &classlist, li_chain) { + /* + * We skip P_SYSTEM processes to match ps(1) output. + */ + if ((kp->ki_flag & P_SYSTEM) == 0 && + kp->ki_loginclass != NULL && + strcmp(kp->ki_loginclass, li->li_name) == 0) + break; + } + if (SLIST_FIRST(&classlist) != NULL && li == NULL) { + selected[i] = 0; + continue; + } + if (argc == 0) selected[i] = 1; } @@ -562,9 +583,9 @@ usage(void) fprintf(stderr, "usage: %s %s [-F pidfile] [-G gid] [-M core] [-N system]\n" - " [-P ppid] [-U uid] [-g pgrp] [-j jid] [-s sid]\n" - " [-t tty] [-u euid] pattern ...\n", getprogname(), - ustr); + " [-P ppid] [-U uid] [-c class] [-g pgrp] [-j jid]\n" + " [-s sid] [-t tty] [-u euid] pattern ...\n", + getprogname(), ustr); exit(STATUS_BADUSAGE); } @@ -664,8 +685,10 @@ makelist(struct listhead *head, enum lis SLIST_INSERT_HEAD(head, li, li_chain); empty = 0; - li->li_number = (uid_t)strtol(sp, &ep, 0); - if (*ep == '\0') { + if (type != LT_CLASS) + li->li_number = (uid_t)strtol(sp, &ep, 0); + + if (type != LT_CLASS && *ep == '\0') { switch (type) { case LT_PGRP: if (li->li_number == 0) @@ -750,6 +773,12 @@ foundtty: if ((st.st_mode & S_IFCHR) == errx(STATUS_BADUSAGE, "Invalid jail ID `%s'", sp); break; + case LT_CLASS: + li->li_number = -1; + li->li_name = strdup(sp); + if (li->li_name == NULL) + err(STATUS_ERROR, "Cannot allocate memory"); + break; default: usage(); } Modified: user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Aug 9 11:52:22 2013 (r254142) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska <mm@FreeBSD.org>. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -769,6 +769,16 @@ ztest_kill(ztest_shared_t *zs) { zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(ztest_spa)); zs->zs_space = metaslab_class_get_space(spa_normal_class(ztest_spa)); + + /* + * Before we kill off ztest, make sure that the config is updated. + * See comment above spa_config_sync(). + */ + mutex_enter(&spa_namespace_lock); + spa_config_sync(ztest_spa, B_FALSE, B_FALSE); + mutex_exit(&spa_namespace_lock); + + zfs_dbgmsg_print(FTAG); (void) kill(getpid(), SIGKILL); } @@ -2733,7 +2743,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t leaf, top; uint64_t ashift = ztest_get_ashift(); uint64_t oldguid, pguid; - size_t oldsize, newsize; + uint64_t oldsize, newsize; char oldpath[MAXPATHLEN], newpath[MAXPATHLEN]; int replacing; int oldvd_has_siblings = B_FALSE; @@ -2892,8 +2902,8 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, if (error != expected_error && expected_error != EBUSY) { fatal(0, "attach (%s %llu, %s %llu, %d) " "returned %d, expected %d", - oldpath, (longlong_t)oldsize, newpath, - (longlong_t)newsize, replacing, error, expected_error); + oldpath, oldsize, newpath, + newsize, replacing, error, expected_error); } VERIFY(mutex_unlock(&ztest_vdev_lock) == 0); @@ -4803,7 +4813,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 */ if (vd0 != NULL && maxfaults != 1 && (!vdev_resilver_needed(vd0->vdev_top, NULL, NULL) || - vd0->vdev_resilvering)) { + vd0->vdev_resilver_txg != 0)) { /* * Make vd0 explicitly claim to be unreadable, * or unwriteable, or reach behind its back @@ -5654,6 +5664,7 @@ ztest_run(ztest_shared_t *zs) zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(spa)); zs->zs_space = metaslab_class_get_space(spa_normal_class(spa)); + zfs_dbgmsg_print(FTAG); umem_free(tid, ztest_opts.zo_threads * sizeof (thread_t)); Modified: user/attilio/vmcontention/contrib/ofed/libsdp/src/linux/sdp_inet.h ============================================================================== --- user/attilio/vmcontention/contrib/ofed/libsdp/src/linux/sdp_inet.h Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/contrib/ofed/libsdp/src/linux/sdp_inet.h Fri Aug 9 11:52:22 2013 (r254142) @@ -29,8 +29,12 @@ */ #ifndef SOLARIS_BUILD +#ifdef __FreeBSD__ +#include <sys/socket.h> +#else #define AF_INET_SDP 27 /* SDP socket protocol family */ #define AF_INET6_SDP 28 /* SDP socket protocol family */ +#endif #else #define AF_INET_SDP 31 /* This is an invalid family on native solaris * and will only work using QuickTransit */ Modified: user/attilio/vmcontention/contrib/ofed/management/infiniband-diags/src/sminfo.c ============================================================================== --- user/attilio/vmcontention/contrib/ofed/management/infiniband-diags/src/sminfo.c Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/contrib/ofed/management/infiniband-diags/src/sminfo.c Fri Aug 9 11:52:22 2013 (r254142) @@ -72,10 +72,10 @@ enum { }; char *statestr[] = { - [SMINFO_NOTACT] "SMINFO_NOTACT", - [SMINFO_DISCOVER] "SMINFO_DISCOVER", - [SMINFO_STANDBY] "SMINFO_STANDBY", - [SMINFO_MASTER] "SMINFO_MASTER", + [SMINFO_NOTACT] = "SMINFO_NOTACT", + [SMINFO_DISCOVER] = "SMINFO_DISCOVER", + [SMINFO_STANDBY] = "SMINFO_STANDBY", + [SMINFO_MASTER] = "SMINFO_MASTER", }; #define STATESTR(s) (((unsigned)(s)) < SMINFO_STATE_LAST ? statestr[s] : "???") Modified: user/attilio/vmcontention/contrib/ofed/management/opensm/opensm/osm_console.c ============================================================================== --- user/attilio/vmcontention/contrib/ofed/management/opensm/opensm/osm_console.c Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/contrib/ofed/management/opensm/opensm/osm_console.c Fri Aug 9 11:52:22 2013 (r254142) @@ -67,7 +67,10 @@ static struct { time_t previous; void (*loop_function) (osm_opensm_t * p_osm, FILE * out); } loop_command = { -on: 0, delay_s: 2, loop_function:NULL}; + .on = 0, + .delay_s = 2, + .loop_function = NULL, +}; static const struct command console_cmds[]; Modified: user/attilio/vmcontention/contrib/ofed/management/opensm/opensm/osm_subnet.c ============================================================================== --- user/attilio/vmcontention/contrib/ofed/management/opensm/opensm/osm_subnet.c Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/contrib/ofed/management/opensm/opensm/osm_subnet.c Fri Aug 9 11:52:22 2013 (r254142) @@ -482,7 +482,7 @@ static void log_report(const char *fmt, va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); - printf(buf); + printf("%s", buf); cl_log_event("OpenSM", CL_LOG_INFO, buf, NULL, 0); } @@ -500,7 +500,7 @@ static void log_config_value(char *name, n = sizeof(buf); snprintf(buf + n, sizeof(buf) - n, "\n"); va_end(args); - printf(buf); + printf("%s", buf); cl_log_event("OpenSM", CL_LOG_INFO, buf, NULL, 0); } Modified: user/attilio/vmcontention/etc/namedb/named.conf ============================================================================== --- user/attilio/vmcontention/etc/namedb/named.conf Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/etc/namedb/named.conf Fri Aug 9 11:52:22 2013 (r254142) @@ -153,6 +153,72 @@ zone "30.172.in-addr.arpa" { type master zone "31.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "168.192.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +// Shared Address Space (RFC 6598) +zone "64.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "65.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "66.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "67.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "68.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "69.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "70.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "71.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "72.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "73.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "74.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "75.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "76.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "77.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "78.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "79.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "80.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "81.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "82.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "83.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "84.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "85.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "86.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "87.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "88.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "89.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "90.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "91.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "92.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "93.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "94.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "95.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "96.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "97.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "98.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "99.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "100.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "101.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "102.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "103.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "104.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "105.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "106.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "107.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "108.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "109.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "110.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "111.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "112.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "113.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "114.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "115.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "116.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "117.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "118.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "119.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "120.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "121.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "122.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "123.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "124.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "125.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "126.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; +zone "127.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; + // Link-local/APIPA (RFCs 3927, 5735 and 6303) zone "254.169.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; Modified: user/attilio/vmcontention/share/man/man9/Makefile ============================================================================== --- user/attilio/vmcontention/share/man/man9/Makefile Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/share/man/man9/Makefile Fri Aug 9 11:52:22 2013 (r254142) @@ -332,11 +332,8 @@ MAN= accept_filter.9 \ vm_page_grab.9 \ vm_page_hold.9 \ vm_page_insert.9 \ - vm_page_io.9 \ vm_page_lookup.9 \ vm_page_rename.9 \ - vm_page_sleep_if_busy.9 \ - vm_page_wakeup.9 \ vm_page_wire.9 \ vm_set_page_size.9 \ vmem.9 \ @@ -1465,6 +1462,21 @@ MLINKS+=vm_page_bits.9 vm_page_clear_dir vm_page_bits.9 vm_page_test_dirty.9 \ vm_page_bits.9 vm_page_undirty.9 \ vm_page_bits.9 vm_page_zero_invalid.9 +MLINKS+=vm_page_busy.9 vm_page_busied.9 \ + vm_page_busy.9 vm_page_busy_downgrade.9 \ + vm_page_busy.9 vm_page_busy_sleep.9 \ + vm_page_busy.9 vm_page_sbusied.9 \ + vm_page_busy.9 vm_page_sbusy.9 \ + vm_page_busy.9 vm_page_sleep_if_busy.9 \ + vm_page_busy.9 vm_page_sunbusy.9 \ + vm_page_busy.9 vm_page_trysbusy.9 \ + vm_page_busy.9 vm_page_tryxbusy.9 \ + vm_page_busy.9 vm_page_xbusied.9 \ + vm_page_busy.9 vm_page_xbusy.9 \ + vm_page_busy.9 vm_page_xunbusy.9 \ + vm_page_busy.9 vm_page_assert_sbusied.9 \ + vm_page_busy.9 vm_page_assert_unbusied.9 \ + vm_page_busy.9 vm_page_assert_xbusied.9 MLINKS+=vm_page_aflag.9 vm_page_aflag_clear.9 \ vm_page_aflag.9 vm_page_aflag_set.9 \ vm_page_aflag.9 vm_page_reference.9 @@ -1473,10 +1485,6 @@ MLINKS+=vm_page_free.9 vm_page_free_toq. vm_page_free.9 vm_page_try_to_free.9 MLINKS+=vm_page_hold.9 vm_page_unhold.9 MLINKS+=vm_page_insert.9 vm_page_remove.9 -MLINKS+=vm_page_io.9 vm_page_io_finish.9 \ - vm_page_io.9 vm_page_io_start.9 -MLINKS+=vm_page_wakeup.9 vm_page_busy.9 \ - vm_page_wakeup.9 vm_page_flash.9 MLINKS+=vm_page_wire.9 vm_page_unwire.9 MLINKS+=VOP_ACCESS.9 VOP_ACCESSX.9 MLINKS+=VOP_ATTRIB.9 VOP_GETATTR.9 \ Modified: user/attilio/vmcontention/share/man/man9/VOP_GETPAGES.9 ============================================================================== --- user/attilio/vmcontention/share/man/man9/VOP_GETPAGES.9 Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/share/man/man9/VOP_GETPAGES.9 Fri Aug 9 11:52:22 2013 (r254142) @@ -102,7 +102,7 @@ When the write completes, the completion call .Xr vm_object_pip_wakeup 9 and -.Xr vm_page_io_finish 9 +.Xr vm_page_sunbusy 9 to clear the busy flag and awaken any other threads waiting for this page, in addition to calling .Xr vm_page_undirty 9 . @@ -139,7 +139,7 @@ For example, .Fn VOP_GETPAGES may either activate a page (if its wanted bit is set) or deactivate it (otherwise), and finally call -.Xr vm_page_wakeup 9 +.Xr vm_page_xunbusy 9 to arouse any threads currently waiting for the page to be faulted in. .Sh RETURN VALUES If it successfully reads @@ -156,9 +156,9 @@ is .Sh SEE ALSO .Xr vm_object_pip_wakeup 9 , .Xr vm_page_free 9 , -.Xr vm_page_io_finish 9 , +.Xr vm_pagge_sunbusy 9 , .Xr vm_page_undirty 9 , -.Xr vm_page_wakeup 9 , +.Xr vm_page_xunbusy 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by Modified: user/attilio/vmcontention/share/man/man9/mutex.9 ============================================================================== --- user/attilio/vmcontention/share/man/man9/mutex.9 Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/share/man/man9/mutex.9 Fri Aug 9 11:52:22 2013 (r254142) @@ -225,8 +225,10 @@ or lock, respectively, and also accept a .Fa flags argument. -In both cases, the only flag presently available for lock acquires is -.Dv MTX_QUIET . +In both cases, the only flags presently available for lock acquires are +.Dv MTX_QUIET +and +.Dv MTX_RECURSE . If the .Dv MTX_QUIET bit is turned on in the @@ -235,6 +237,12 @@ argument, then if .Dv KTR_LOCK tracing is being done, it will be silenced during the lock acquire. +If the +.Dv MTX_RECURSE +bit is turned on in the +.Fa flags +argument, then the mutex can be acquired recursively. +.Pp .Pp The .Fn mtx_trylock Modified: user/attilio/vmcontention/share/man/man9/vm_page_alloc.9 ============================================================================== --- user/attilio/vmcontention/share/man/man9/vm_page_alloc.9 Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/share/man/man9/vm_page_alloc.9 Fri Aug 9 11:52:22 2013 (r254142) @@ -91,9 +91,7 @@ than zero. The optional flags are: .Bl -tag -width ".Dv VM_ALLOC_IFNOTCACHED" .It Dv VM_ALLOC_NOBUSY -The returned page will not have the -.Dv VPO_BUSY -flag set. +The returned page will not be exclusive busy. .It Dv VM_ALLOC_NODUMP The returned page will not be included in any kernel core dumps regardless of whether or not it is mapped in to KVA. @@ -112,6 +110,8 @@ Only allocate the page if it is not cach If the page at the specified .Fa pindex is cached, NULL is returned instead. +.It Dv VM_ALLOC_SBUSY +The returned page will be shared busy. .It Dv VM_ALLOC_WIRED The returned page will be wired. .It Dv VM_ALLOC_ZERO Copied: user/attilio/vmcontention/share/man/man9/vm_page_busy.9 (from r254141, head/share/man/man9/vm_page_busy.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmcontention/share/man/man9/vm_page_busy.9 Fri Aug 9 11:52:22 2013 (r254142, copy of r254141, head/share/man/man9/vm_page_busy.9) @@ -0,0 +1,216 @@ +.\" +.\" Copyright (c) 2013 EMC Corp. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +.\" DAMAGE. +.\" +.\" $FreeBSD$ +.Dd August 07, 2013 +.Dt vm_page_busy 9 +.Os +.Sh NAME +.Nm vm_page_busied , +.Nm vm_page_busy_downgrade , +.Nm vm_page_busy_sleep , +.Nm vm_page_sbusied , +.Nm vm_page_sbusy , +.Nm vm_page_sleep_if_busy , +.Nm vm_page_sunbusy , +.Nm vm_page_trysbusy , +.Nm vm_page_tryxbusy , +.Nm vm_page_xbusied , +.Nm vm_page_xbusy , +.Nm vm_page_xunbusy , +.Nm vm_page_assert_sbusied , +.Nm vm_page_assert_unbusied , +.Nm vm_page_assert_xbusied +.Nd protect page identity changes and page content references +.Sh SYNOPSIS +.In sys/param.h +.In vm/vm.h +.In vm/vm_page.h +.Ft int +.Fn vm_page_busied "vm_page_t m" +.Ft void +.Fn vm_page_busy_downgrade "vm_page_t m" +.Ft void +.Fn vm_page_busy_sleep "vm_page_t m" "const char *msg" +.Ft int +.Fn vm_page_sbusied "vm_page_t m" +.Ft void +.Fn vm_page_sbusy "vm_page_t m" +.Ft int +.Fn vm_page_sleep_if_busy "vm_page_t m" "const char *msg" +.Ft void +.Fn vm_page_sunbusy "vm_page_t m" +.Ft int +.Fn vm_page_trysbusy "vm_page_t m" +.Ft int +.Fn vm_page_tryxbusy "vm_page_t m" +.Ft int +.Fn vm_page_xbusied "vm_page_t m" +.Ft void +.Fn vm_page_xbusy "vm_page_t m" +.Ft void +.Fn vm_page_xunbusy "vm_page_t m" +.Pp +.Cd "options INVARIANTS" +.Cd "options INVARIANT_SUPPORT" +.Ft void +.Fn vm_page_assert_sbusied "vm_page_t m" +.Ft void +.Fn vm_page_assert_unbusied "vm_page_t m" +.Ft void +.Fn vm_page_assert_xbusied "vm_page_t m" +.Sh DESCRIPTION +Page identity is usually protected by higher level locks like vm_object +locks and vm page locks. +However, sometimes it is not possible to hold such locks for the time +necessary to complete the identity change. +In such case the page can be exclusively busied by a thread which needs +to own the identity for a certain amount of time. +.Pp +In other situations, threads do not need to change the identity of the +page but they want to prevent other threads from changing the identity +themselves. +For example, when a thread wants to access or update page contents +without a lock held the page is shared busied. +.Pp +Before busing a page the vm_object lock must be held. +The same rule applies when a page is unbusied. +This makes the vm_object lock a real busy interlock. +.Pp +The +.Fn vm_page_busied +function returns non-zero if the current thread busied +.Fa m +in either exclusive or shared mode. +Returns zero otherwise. +.Pp +The +.Fn vm_page_busy_downgrade +function must be used to downgrade +.Fa m +from an exclusive busy state to a shared busy state. +.Pp +The +.Fn vm_page_busy_sleep +function puts the invoking thread to sleep using the appropriate +waitchannels for the busy mechanism. +The parameter +.Fa msg +is a string describing the sleep condition for userland tools. +.Pp +The +.Fn vm_page_busied +function returns non-zero if the current thread busied +.Fa m +in shared mode. +Returns zero otherwise. +.Pp +The +.Fn vm_page_sbusy +function shared busies +.Fa m . +.Pp +The +.Fn vm_page_sleep_if_busy +function puts the invoking thread to sleep, using the appropriate +waitchannels for the busy mechanism, if +.Fa m . +is busied in either exclusive or shared mode. +If the invoking thread slept a non-zero value is returned, otherwise +0 is returned. +The parameter +.Fa msg +is a string describing the sleep condition for userland tools. +.Pp +The +.Fn vm_page_sunbusy +function shared unbusies +.Fa m . +.Pp +The +.Fn vm_page_trysbusy +attempts to shared busy +.Fa m . +If the operation cannot immediately succeed +.Fn vm_page_trysbusy +returns 0, otherwise a non-zero value is returned. +.Pp +The +.Fn vm_page_tryxbusy +attempts to exclusive busy +.Fa m . +If the operation cannot immediately succeed +.Fn vm_page_tryxbusy +returns 0, otherwise a non-zero value is returned. +.Pp +The +.Fn vm_page_xbusied +function returns non-zero if the current thread busied +.Fa m +in exclusive mode. +Returns zero otherwise. +.Pp +The +.Fn vm_page_xbusy +function exclusive busies +.Fa m . +.Pp +The +.Fn vm_page_xunbusy +function exclusive unbusies +.Fa m . +Assertions on the busy state allow kernels compiled with +.Cd "options INVARIANTS" +and +.Cd "options INVARIANT_SUPPORT" +to panic if they are not respected. +.Pp +The +.Fn vm_page_assert_sbusied +function panics if +.Fa m +is not shared busied. +.Pp +The +.Fn vm_page_assert_unbusied +function panics if +.Fa m +is not unbusied. +.Pp +The +.Fn vm_page_assert_xbusied +function panics if +.Fa m +is not exclusive busied. +.Sh SEE ALSO +.Xr VOP_GETPAGES 9 , +.Xr vm_page_aflag 9 , +.Xr vm_page_alloc 9 , +.Xr vm_page_deactivate 9 , +.Xr vm_page_free 9 , +.Xr vm_page_grab 9 , +.Xr vm_page_insert 9 , +.Xr vm_page_lookup 9 , +.Xr vm_page_rename 9 Modified: user/attilio/vmcontention/sys/amd64/amd64/pmap.c ============================================================================== --- user/attilio/vmcontention/sys/amd64/amd64/pmap.c Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/sys/amd64/amd64/pmap.c Fri Aug 9 11:52:22 2013 (r254142) @@ -283,7 +283,7 @@ static boolean_t pmap_enter_pde(pmap_t p static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp); static void pmap_fill_ptp(pt_entry_t *firstpte, pt_entry_t newpte); -static void pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); +static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); static boolean_t pmap_is_modified_pvh(struct md_page *pvh); static boolean_t pmap_is_referenced_pvh(struct md_page *pvh); static void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mode); @@ -1526,12 +1526,12 @@ pmap_add_delayed_free_list(vm_page_t m, * for mapping a distinct range of virtual addresses. The pmap's collection is * ordered by this virtual address range. */ -static __inline void +static __inline int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte) { PMAP_LOCK_ASSERT(pmap, MA_OWNED); - vm_radix_insert(&pmap->pm_root, mpte); + return (vm_radix_insert(&pmap->pm_root, mpte)); } /* @@ -3439,7 +3439,13 @@ setpte: ("pmap_promote_pde: page table page is out of range")); KASSERT(mpte->pindex == pmap_pde_pindex(va), ("pmap_promote_pde: page table page's pindex is wrong")); - pmap_insert_pt_page(pmap, mpte); + if (pmap_insert_pt_page(pmap, mpte)) { + atomic_add_long(&pmap_pde_p_failures, 1); + CTR2(KTR_PMAP, + "pmap_promote_pde: failure for va %#lx in pmap %p", va, + pmap); + return; + } /* * Promote the pv entries. @@ -3498,7 +3504,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, KASSERT((m->oflags & VPO_UNMANAGED) != 0 || va < kmi.clean_sva || va >= kmi.clean_eva, ("pmap_enter: managed mapping within the clean submap")); - if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0) + if ((m->oflags & VPO_UNMANAGED) == 0 && !vm_page_xbusied(m)) VM_OBJECT_ASSERT_WLOCKED(m->object); pa = VM_PAGE_TO_PHYS(m); newpte = (pt_entry_t)(pa | PG_A | PG_V); @@ -4609,13 +4615,12 @@ pmap_is_modified(vm_page_t m) ("pmap_is_modified: page %p is not managed", m)); /* - * If the page is not VPO_BUSY, then PGA_WRITEABLE cannot be + * If the page is not exclusive busied, then PGA_WRITEABLE cannot be * concurrently set while the object is locked. Thus, if PGA_WRITEABLE * is clear, no PTEs can have PG_M set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if ((m->oflags & VPO_BUSY) == 0 && - (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return (FALSE); rw_wlock(&pvh_global_lock); rv = pmap_is_modified_pvh(&m->md) || @@ -4740,13 +4745,12 @@ pmap_remove_write(vm_page_t m) ("pmap_remove_write: page %p is not managed", m)); /* - * If the page is not VPO_BUSY, then PGA_WRITEABLE cannot be set by - * another thread while the object is locked. Thus, if PGA_WRITEABLE - * is clear, no page table entries need updating. + * If the page is not exclusive busied, then PGA_WRITEABLE cannot be + * set by another thread while the object is locked. Thus, + * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if ((m->oflags & VPO_BUSY) == 0 && - (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return; rw_wlock(&pvh_global_lock); if ((m->flags & PG_FICTITIOUS) != 0) @@ -4924,13 +4928,13 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); VM_OBJECT_ASSERT_WLOCKED(m->object); - KASSERT((m->oflags & VPO_BUSY) == 0, - ("pmap_clear_modify: page %p is busy", m)); + KASSERT(!vm_page_xbusied(m), + ("pmap_clear_modify: page %p is exclusive busied", m)); /* * If the page is not PGA_WRITEABLE, then no PTEs can have PG_M set. * If the object containing the page is locked and the page is not - * VPO_BUSY, then PGA_WRITEABLE cannot be concurrently set. + * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ if ((m->aflags & PGA_WRITEABLE) == 0) return; Modified: user/attilio/vmcontention/sys/amd64/conf/GENERIC ============================================================================== --- user/attilio/vmcontention/sys/amd64/conf/GENERIC Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/sys/amd64/conf/GENERIC Fri Aug 9 11:52:22 2013 (r254142) @@ -74,9 +74,8 @@ options INCLUDE_CONFIG_FILE # Inclu # Debugging support. Always need this: options KDB # Enable kernel debugger support. -# For minimum debugger support (stable branch) use: options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use this instead: +# For full debugger support use (turn off in stable branch): options DDB # Support DDB. options GDB # Support remote GDB. options DEADLKRES # Enable the deadlock resolver Modified: user/attilio/vmcontention/sys/arm/arm/pmap-v6.c ============================================================================== --- user/attilio/vmcontention/sys/arm/arm/pmap-v6.c Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/sys/arm/arm/pmap-v6.c Fri Aug 9 11:52:22 2013 (r254142) @@ -2670,8 +2670,8 @@ pmap_enter_locked(pmap_t pmap, vm_offset pa = systempage.pv_pa; m = NULL; } else { - KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 || - (flags & M_NOWAIT) != 0, + KASSERT((m->oflags & VPO_UNMANAGED) != 0 || + vm_page_xbusied(m) || (flags & M_NOWAIT) != 0, ("pmap_enter_locked: page %p is not busy", m)); pa = VM_PAGE_TO_PHYS(m); } @@ -3934,13 +3934,12 @@ pmap_is_modified(vm_page_t m) ("pmap_is_modified: page %p is not managed", m)); rv = FALSE; /* - * If the page is not VPO_BUSY, then PGA_WRITEABLE cannot be + * If the page is not exclusive busied, then PGA_WRITEABLE cannot be * concurrently set while the object is locked. Thus, if PGA_WRITEABLE * is clear, no PTEs can have PG_M set. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if ((m->oflags & VPO_BUSY) == 0 && - (m->aflags & PGA_WRITEABLE) == 0) + if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) return (rv); rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { @@ -3968,13 +3967,13 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); VM_OBJECT_ASSERT_WLOCKED(m->object); - KASSERT((m->oflags & VPO_BUSY) == 0, - ("pmap_clear_modify: page %p is busy", m)); + KASSERT(!vm_page_xbusied(m), + ("pmap_clear_modify: page %p is exclusive busied", m)); /* * If the page is not PGA_WRITEABLE, then no mappings can be modified. * If the object containing the page is locked and the page is not - * VPO_BUSY, then PGA_WRITEABLE cannot be concurrently set. + * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ if ((m->aflags & PGA_WRITEABLE) == 0) return; @@ -4009,13 +4008,12 @@ pmap_remove_write(vm_page_t m) ("pmap_remove_write: page %p is not managed", m)); /* - * If the page is not VPO_BUSY, then PGA_WRITEABLE cannot be set by - * another thread while the object is locked. Thus, if PGA_WRITEABLE - * is clear, no page table entries need updating. + * If the page is not exclusive busied, then PGA_WRITEABLE cannot be + * set by another thread while the object is locked. Thus, + * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if ((m->oflags & VPO_BUSY) != 0 || - (m->aflags & PGA_WRITEABLE) != 0) + if (vm_page_xbusied(m) || (m->aflags & PGA_WRITEABLE) != 0) pmap_clearbit(m, PVF_WRITE); } Modified: user/attilio/vmcontention/sys/arm/arm/pmap.c ============================================================================== --- user/attilio/vmcontention/sys/arm/arm/pmap.c Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/sys/arm/arm/pmap.c Fri Aug 9 11:52:22 2013 (r254142) @@ -3319,8 +3319,8 @@ pmap_enter_locked(pmap_t pmap, vm_offset pa = systempage.pv_pa; m = NULL; } else { - KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 || - (flags & M_NOWAIT) != 0, + KASSERT((m->oflags & VPO_UNMANAGED) != 0 || + vm_page_xbusied(m) || (flags & M_NOWAIT) != 0, ("pmap_enter_locked: page %p is not busy", m)); pa = VM_PAGE_TO_PHYS(m); } @@ -4555,13 +4555,13 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); VM_OBJECT_ASSERT_WLOCKED(m->object); - KASSERT((m->oflags & VPO_BUSY) == 0, - ("pmap_clear_modify: page %p is busy", m)); + KASSERT(!vm_page_xbusied(m), + ("pmap_clear_modify: page %p is exclusive busied", m)); /* * If the page is not PGA_WRITEABLE, then no mappings can be modified. * If the object containing the page is locked and the page is not - * VPO_BUSY, then PGA_WRITEABLE cannot be concurrently set. + * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. */ if ((m->aflags & PGA_WRITEABLE) == 0) return; @@ -4612,13 +4612,12 @@ pmap_remove_write(vm_page_t m) ("pmap_remove_write: page %p is not managed", m)); /* - * If the page is not VPO_BUSY, then PGA_WRITEABLE cannot be set by - * another thread while the object is locked. Thus, if PGA_WRITEABLE - * is clear, no page table entries need updating. + * If the page is not exclusive busied, then PGA_WRITEABLE cannot be + * set by another thread while the object is locked. Thus, + * if PGA_WRITEABLE is clear, no page table entries need updating. */ VM_OBJECT_ASSERT_WLOCKED(m->object); - if ((m->oflags & VPO_BUSY) != 0 || - (m->aflags & PGA_WRITEABLE) != 0) + if (vm_page_xbusied(m) || (m->aflags & PGA_WRITEABLE) != 0) pmap_clearbit(m, PVF_WRITE); } Modified: user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Fri Aug 9 11:52:22 2013 (r254142) @@ -224,6 +224,7 @@ dsl_scan_setup_sync(void *arg, dmu_tx_t scn->scn_phys.scn_errors = 0; scn->scn_phys.scn_to_examine = spa->spa_root_vdev->vdev_stat.vs_alloc; scn->scn_restart_txg = 0; + scn->scn_done_txg = 0; spa_scan_stat_init(spa); if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { @@ -800,7 +801,7 @@ dsl_scan_visitbp(blkptr_t *bp, const zbo * Don't scan it now unless we need to because something * under it was modified. */ - if (bp->blk_birth <= scn->scn_phys.scn_cur_max_txg) { + if (BP_PHYSICAL_BIRTH(bp) <= scn->scn_phys.scn_cur_max_txg) { scan_funcs[scn->scn_phys.scn_func](dp, bp, zb); } if (buf) @@ -1245,7 +1246,7 @@ dsl_scan_ddt_entry(dsl_scan_t *scn, enum for (int p = 0; p < DDT_PHYS_TYPES; p++, ddp++) { if (ddp->ddp_phys_birth == 0 || - ddp->ddp_phys_birth > scn->scn_phys.scn_cur_max_txg) + ddp->ddp_phys_birth > scn->scn_phys.scn_max_txg) continue; ddt_bp_create(checksum, ddk, ddp, &bp); @@ -1488,6 +1489,16 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * if (scn->scn_phys.scn_state != DSS_SCANNING) return; + if (scn->scn_done_txg == tx->tx_txg) { + ASSERT(!scn->scn_pausing); + /* finished with scan. */ + zfs_dbgmsg("txg %llu scan complete", tx->tx_txg); + dsl_scan_done(scn, B_TRUE, tx); + ASSERT3U(spa->spa_scrub_inflight, ==, 0); + dsl_scan_sync_state(scn, tx); + return; + } + if (scn->scn_phys.scn_ddt_bookmark.ddb_class <= scn->scn_phys.scn_ddt_class_max) { zfs_dbgmsg("doing scan sync txg %llu; " @@ -1523,9 +1534,9 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * (longlong_t)(gethrtime() - scn->scn_sync_start_time) / MICROSEC); if (!scn->scn_pausing) { - /* finished with scan. */ - zfs_dbgmsg("finished scan txg %llu", (longlong_t)tx->tx_txg); - dsl_scan_done(scn, B_TRUE, tx); + scn->scn_done_txg = tx->tx_txg + 1; + zfs_dbgmsg("txg %llu traversal complete, waiting till txg %llu", + tx->tx_txg, scn->scn_done_txg); } if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { Modified: user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Aug 9 11:28:55 2013 (r254141) +++ user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Aug 9 11:52:22 2013 (r254142) @@ -4633,7 +4633,7 @@ spa_vdev_attach(spa_t *spa, uint64_t gui } /* mark the device being resilvered */ - newvd->vdev_resilvering = B_TRUE; + newvd->vdev_resilver_txg = txg; /* * If the parent is not a mirror, or if we're replacing, insert the new @@ -5497,13 +5497,6 @@ spa_vdev_resilver_done_hunt(vdev_t *vd) return (oldvd); } - if (vd->vdev_resilvering && vdev_dtl_empty(vd, DTL_MISSING) && - vdev_dtl_empty(vd, DTL_OUTAGE)) { - ASSERT(vd->vdev_ops->vdev_op_leaf); - vd->vdev_resilvering = B_FALSE; *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308091152.r79BqNlE010725>