Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Apr 2013 19:56:15 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r249275 - in user/attilio/vmobj-readlock: . bin/sh cddl/contrib/opensolaris/cmd/zdb etc/devd sbin/camcontrol share/man/man4 share/man/man9 sys/amd64/include sys/arm/at91 sys/arm/include...
Message-ID:  <201304081956.r38JuF2r000853@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Mon Apr  8 19:56:14 2013
New Revision: 249275
URL: http://svnweb.freebsd.org/changeset/base/249275

Log:
  MFC

Added:
  user/attilio/vmobj-readlock/share/man/man9/counter.9
     - copied unchanged from r249273, user/attilio/vmcontention/share/man/man9/counter.9
  user/attilio/vmobj-readlock/sys/amd64/include/counter.h
     - copied unchanged from r249273, user/attilio/vmcontention/sys/amd64/include/counter.h
  user/attilio/vmobj-readlock/sys/arm/include/counter.h
     - copied unchanged from r249273, user/attilio/vmcontention/sys/arm/include/counter.h
  user/attilio/vmobj-readlock/sys/i386/include/counter.h
     - copied unchanged from r249273, user/attilio/vmcontention/sys/i386/include/counter.h
  user/attilio/vmobj-readlock/sys/ia64/include/counter.h
     - copied unchanged from r249273, user/attilio/vmcontention/sys/ia64/include/counter.h
  user/attilio/vmobj-readlock/sys/kern/subr_counter.c
     - copied unchanged from r249273, user/attilio/vmcontention/sys/kern/subr_counter.c
  user/attilio/vmobj-readlock/sys/mips/include/counter.h
     - copied unchanged from r249273, user/attilio/vmcontention/sys/mips/include/counter.h
  user/attilio/vmobj-readlock/sys/pc98/include/counter.h
     - copied unchanged from r249273, user/attilio/vmcontention/sys/pc98/include/counter.h
  user/attilio/vmobj-readlock/sys/powerpc/include/counter.h
     - copied unchanged from r249273, user/attilio/vmcontention/sys/powerpc/include/counter.h
  user/attilio/vmobj-readlock/sys/sparc64/include/counter.h
     - copied unchanged from r249273, user/attilio/vmcontention/sys/sparc64/include/counter.h
  user/attilio/vmobj-readlock/sys/sys/counter.h
     - copied unchanged from r249273, user/attilio/vmcontention/sys/sys/counter.h
  user/attilio/vmobj-readlock/tools/regression/bin/sh/builtins/eval6.0
     - copied unchanged from r249273, user/attilio/vmcontention/tools/regression/bin/sh/builtins/eval6.0
  user/attilio/vmobj-readlock/usr.sbin/mfiutil/mfi_bbu.c
     - copied unchanged from r249273, user/attilio/vmcontention/usr.sbin/mfiutil/mfi_bbu.c
Deleted:
  user/attilio/vmobj-readlock/sys/dev/ata/ata-queue.c
  user/attilio/vmobj-readlock/sys/modules/ata/atadevel/
Modified:
  user/attilio/vmobj-readlock/UPDATING
  user/attilio/vmobj-readlock/bin/sh/nodes.c.pat
  user/attilio/vmobj-readlock/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  user/attilio/vmobj-readlock/etc/devd/usb.conf
  user/attilio/vmobj-readlock/sbin/camcontrol/camcontrol.8
  user/attilio/vmobj-readlock/sbin/camcontrol/camcontrol.c
  user/attilio/vmobj-readlock/share/man/man4/mld.4
  user/attilio/vmobj-readlock/share/man/man9/Makefile
  user/attilio/vmobj-readlock/share/man/man9/sbuf.9
  user/attilio/vmobj-readlock/share/man/man9/zone.9
  user/attilio/vmobj-readlock/sys/amd64/include/pcpu.h
  user/attilio/vmobj-readlock/sys/arm/at91/at91_pio.c
  user/attilio/vmobj-readlock/sys/arm/at91/at91_piovar.h
  user/attilio/vmobj-readlock/sys/arm/include/pcpu.h
  user/attilio/vmobj-readlock/sys/boot/ficl/arm/sysdep.h
  user/attilio/vmobj-readlock/sys/boot/ficl/tools.c
  user/attilio/vmobj-readlock/sys/cam/ata/ata_all.h
  user/attilio/vmobj-readlock/sys/cam/ata/ata_da.c
  user/attilio/vmobj-readlock/sys/cam/ata/ata_xpt.c
  user/attilio/vmobj-readlock/sys/cam/cam_ccb.h
  user/attilio/vmobj-readlock/sys/cam/cam_sim.h
  user/attilio/vmobj-readlock/sys/cam/ctl/ctl.c
  user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c
  user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h
  user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
  user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
  user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c
  user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
  user/attilio/vmobj-readlock/sys/conf/files
  user/attilio/vmobj-readlock/sys/conf/options
  user/attilio/vmobj-readlock/sys/contrib/ipfilter/netinet/ip_auth.c
  user/attilio/vmobj-readlock/sys/dev/ata/ata-all.c
  user/attilio/vmobj-readlock/sys/dev/ata/ata-all.h
  user/attilio/vmobj-readlock/sys/dev/ata/ata-cbus.c
  user/attilio/vmobj-readlock/sys/dev/ata/ata-isa.c
  user/attilio/vmobj-readlock/sys/dev/ata/ata-lowlevel.c
  user/attilio/vmobj-readlock/sys/dev/ata/ata-pci.c
  user/attilio/vmobj-readlock/sys/dev/ata/ata-sata.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-acard.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-acerlabs.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-adaptec.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-ahci.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-amd.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-ati.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-cenatek.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-cypress.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-cyrix.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-fsl.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-highpoint.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-intel.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-ite.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-jmicron.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-marvell.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-micron.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-national.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-netcell.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-nvidia.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-promise.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-serverworks.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-siliconimage.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-sis.c
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-via.c
  user/attilio/vmobj-readlock/sys/dev/drm2/drm_dp_iic_helper.c
  user/attilio/vmobj-readlock/sys/dev/mfi/mfi_debug.c
  user/attilio/vmobj-readlock/sys/dev/mfi/mfireg.h
  user/attilio/vmobj-readlock/sys/dev/usb/controller/at91dci_atmelarm.c
  user/attilio/vmobj-readlock/sys/dev/usb/serial/uftdi.c
  user/attilio/vmobj-readlock/sys/dev/usb/usbdevs
  user/attilio/vmobj-readlock/sys/fs/ext2fs/ext2_alloc.c
  user/attilio/vmobj-readlock/sys/i386/include/pcpu.h
  user/attilio/vmobj-readlock/sys/ia64/include/pcpu.h
  user/attilio/vmobj-readlock/sys/kern/imgact_elf.c
  user/attilio/vmobj-readlock/sys/kern/kern_descrip.c
  user/attilio/vmobj-readlock/sys/kern/uipc_mqueue.c
  user/attilio/vmobj-readlock/sys/kern/uipc_sem.c
  user/attilio/vmobj-readlock/sys/kern/uipc_shm.c
  user/attilio/vmobj-readlock/sys/kern/vfs_subr.c
  user/attilio/vmobj-readlock/sys/mips/include/pcpu.h
  user/attilio/vmobj-readlock/sys/modules/ata/atacard/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atacbus/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atacore/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/ataisa/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/ataacard/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/ataacerlabs/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/ataadaptec/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/ataahci/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/ataamd/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/ataati/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atacenatek/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atacypress/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atacyrix/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atahighpoint/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/ataintel/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/ataite/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atajmicron/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atamarvell/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atamicron/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atanational/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atanetcell/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atanvidia/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atapromise/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/ataserverworks/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atasiliconimage/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atasis/Makefile
  user/attilio/vmobj-readlock/sys/modules/ata/atapci/chipsets/atavia/Makefile
  user/attilio/vmobj-readlock/sys/modules/cam/Makefile
  user/attilio/vmobj-readlock/sys/modules/usb/umass/Makefile
  user/attilio/vmobj-readlock/sys/modules/usb/urio/Makefile
  user/attilio/vmobj-readlock/sys/modules/usb/usfs/Makefile
  user/attilio/vmobj-readlock/sys/powerpc/include/pcpu.h
  user/attilio/vmobj-readlock/sys/powerpc/powermac/ata_dbdma.c
  user/attilio/vmobj-readlock/sys/powerpc/powermac/ata_kauai.c
  user/attilio/vmobj-readlock/sys/powerpc/powermac/ata_macio.c
  user/attilio/vmobj-readlock/sys/powerpc/psim/ata_iobus.c
  user/attilio/vmobj-readlock/sys/rpc/svc_vc.c
  user/attilio/vmobj-readlock/sys/sparc64/include/pcpu.h
  user/attilio/vmobj-readlock/sys/sys/pcpu.h
  user/attilio/vmobj-readlock/sys/sys/sysctl.h
  user/attilio/vmobj-readlock/sys/ufs/ffs/ffs_softdep.c
  user/attilio/vmobj-readlock/sys/ufs/ffs/ffs_vfsops.c
  user/attilio/vmobj-readlock/sys/vm/uma.h
  user/attilio/vmobj-readlock/sys/vm/uma_core.c
  user/attilio/vmobj-readlock/sys/vm/uma_int.h
  user/attilio/vmobj-readlock/sys/vm/vm_pager.c
  user/attilio/vmobj-readlock/sys/vm/vm_radix.c
  user/attilio/vmobj-readlock/usr.bin/calendar/calendar.1
  user/attilio/vmobj-readlock/usr.sbin/mfiutil/Makefile
  user/attilio/vmobj-readlock/usr.sbin/mfiutil/mfi_show.c
  user/attilio/vmobj-readlock/usr.sbin/mfiutil/mfi_volume.c
  user/attilio/vmobj-readlock/usr.sbin/mfiutil/mfiutil.8
  user/attilio/vmobj-readlock/usr.sbin/mfiutil/mfiutil.c
  user/attilio/vmobj-readlock/usr.sbin/mfiutil/mfiutil.h
  user/attilio/vmobj-readlock/usr.sbin/rarpd/rarpd.c
  user/attilio/vmobj-readlock/usr.sbin/watchdogd/watchdogd.c
Directory Properties:
  user/attilio/vmobj-readlock/   (props changed)
  user/attilio/vmobj-readlock/cddl/   (props changed)
  user/attilio/vmobj-readlock/cddl/contrib/opensolaris/   (props changed)
  user/attilio/vmobj-readlock/sbin/   (props changed)
  user/attilio/vmobj-readlock/share/man/man4/   (props changed)
  user/attilio/vmobj-readlock/sys/   (props changed)
  user/attilio/vmobj-readlock/sys/boot/   (props changed)
  user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/   (props changed)
  user/attilio/vmobj-readlock/sys/conf/   (props changed)
  user/attilio/vmobj-readlock/usr.bin/calendar/   (props changed)

Modified: user/attilio/vmobj-readlock/UPDATING
==============================================================================
--- user/attilio/vmobj-readlock/UPDATING	Mon Apr  8 19:53:02 2013	(r249274)
+++ user/attilio/vmobj-readlock/UPDATING	Mon Apr  8 19:56:14 2013	(r249275)
@@ -26,6 +26,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
 	disable the most expensive debugging functionality run
 	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20130404:
+	Legacy ATA stack, disabled and replaced by new CAM-based one since
+	FreeBSD 9.0, completely removed from the sources.  Kernel modules
+	atadisk and atapi*, user-level tools atacontrol and burncd are
+	removed.  Kernel option `options ATA_CAM` is now permanently enabled
+	and removed.
+
+20130319:
+	SOCK_CLOEXEC and SOCK_NONBLOCK flags have been added to socket(2)
+	and socketpair(2). Software, in particular Kerberos, may
+	automatically detect and use these during building. The resulting
+	binaries will not work on older kernels.
+
 20130308:
 	CTL_DISABLE has also been added to the sparc64 GENERIC (for further
 	information, see the respective 20130304 entry).

Modified: user/attilio/vmobj-readlock/bin/sh/nodes.c.pat
==============================================================================
--- user/attilio/vmobj-readlock/bin/sh/nodes.c.pat	Mon Apr  8 19:53:02 2013	(r249274)
+++ user/attilio/vmobj-readlock/bin/sh/nodes.c.pat	Mon Apr  8 19:56:14 2013	(r249275)
@@ -58,7 +58,7 @@ static void calcsize(union node *);
 static void sizenodelist(struct nodelist *);
 static union node *copynode(union node *);
 static struct nodelist *copynodelist(struct nodelist *);
-static char *nodesavestr(char *);
+static char *nodesavestr(const char *);
 
 
 struct funcdef {
@@ -147,9 +147,9 @@ copynodelist(struct nodelist *lp)
 
 
 static char *
-nodesavestr(char *s)
+nodesavestr(const char *s)
 {
-	char *p = s;
+	const char *p = s;
 	char *q = funcstring;
 	char   *rtn = funcstring;
 

Modified: user/attilio/vmobj-readlock/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- user/attilio/vmobj-readlock/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Mon Apr  8 19:53:02 2013	(r249274)
+++ user/attilio/vmobj-readlock/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Mon Apr  8 19:56:14 2013	(r249275)
@@ -21,10 +21,11 @@
 
 /*
  * 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.
  */
 
 #include <stdio.h>
+#include <unistd.h>
 #include <stdio_ext.h>
 #include <stdlib.h>
 #include <ctype.h>
@@ -237,18 +238,18 @@ zdb_nicenum(uint64_t num, char *buf)
 		nicenum(num, buf);
 }
 
-const char dump_zap_stars[] = "****************************************";
-const int dump_zap_width = sizeof (dump_zap_stars) - 1;
+const char histo_stars[] = "****************************************";
+const int histo_width = sizeof (histo_stars) - 1;
 
 static void
-dump_zap_histogram(uint64_t histo[ZAP_HISTOGRAM_SIZE])
+dump_histogram(const uint64_t *histo, int size)
 {
 	int i;
-	int minidx = ZAP_HISTOGRAM_SIZE - 1;
+	int minidx = size - 1;
 	int maxidx = 0;
 	uint64_t max = 0;
 
-	for (i = 0; i < ZAP_HISTOGRAM_SIZE; i++) {
+	for (i = 0; i < size; i++) {
 		if (histo[i] > max)
 			max = histo[i];
 		if (histo[i] > 0 && i > maxidx)
@@ -257,12 +258,14 @@ dump_zap_histogram(uint64_t histo[ZAP_HI
 			minidx = i;
 	}
 
-	if (max < dump_zap_width)
-		max = dump_zap_width;
+	if (max < histo_width)
+		max = histo_width;
 
-	for (i = minidx; i <= maxidx; i++)
-		(void) printf("\t\t\t%u: %6llu %s\n", i, (u_longlong_t)histo[i],
-		    &dump_zap_stars[(max - histo[i]) * dump_zap_width / max]);
+	for (i = minidx; i <= maxidx; i++) {
+		(void) printf("\t\t\t%3u: %6llu %s\n",
+		    i, (u_longlong_t)histo[i],
+		    &histo_stars[(max - histo[i]) * histo_width / max]);
+	}
 }
 
 static void
@@ -313,19 +316,19 @@ dump_zap_stats(objset_t *os, uint64_t ob
 	    (u_longlong_t)zs.zs_salt);
 
 	(void) printf("\t\tLeafs with 2^n pointers:\n");
-	dump_zap_histogram(zs.zs_leafs_with_2n_pointers);
+	dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE);
 
 	(void) printf("\t\tBlocks with n*5 entries:\n");
-	dump_zap_histogram(zs.zs_blocks_with_n5_entries);
+	dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE);
 
 	(void) printf("\t\tBlocks n/10 full:\n");
-	dump_zap_histogram(zs.zs_blocks_n_tenths_full);
+	dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE);
 
 	(void) printf("\t\tEntries with n chunks:\n");
-	dump_zap_histogram(zs.zs_entries_using_n_chunks);
+	dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE);
 
 	(void) printf("\t\tBuckets with n entries:\n");
-	dump_zap_histogram(zs.zs_buckets_with_n_entries);
+	dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE);
 }
 
 /*ARGSUSED*/
@@ -947,7 +950,7 @@ sprintf_blkptr_compact(char *blkbuf, con
 	const dva_t *dva = bp->blk_dva;
 	int ndvas = dump_opt['d'] > 5 ? BP_GET_NDVAS(bp) : 1;
 
-	if (dump_opt['b'] >= 5) {
+	if (dump_opt['b'] >= 6) {
 		sprintf_blkptr(blkbuf, bp);
 		return;
 	}
@@ -1986,11 +1989,13 @@ dump_one_dir(const char *dsname, void *a
 /*
  * Block statistics.
  */
+#define	PSIZE_HISTO_SIZE (SPA_MAXBLOCKSIZE / SPA_MINBLOCKSIZE + 1)
 typedef struct zdb_blkstats {
-	uint64_t	zb_asize;
-	uint64_t	zb_lsize;
-	uint64_t	zb_psize;
-	uint64_t	zb_count;
+	uint64_t zb_asize;
+	uint64_t zb_lsize;
+	uint64_t zb_psize;
+	uint64_t zb_count;
+	uint64_t zb_psize_histogram[PSIZE_HISTO_SIZE];
 } zdb_blkstats_t;
 
 /*
@@ -2014,6 +2019,9 @@ typedef struct zdb_cb {
 	zdb_blkstats_t	zcb_type[ZB_TOTAL + 1][ZDB_OT_TOTAL + 1];
 	uint64_t	zcb_dedup_asize;
 	uint64_t	zcb_dedup_blocks;
+	uint64_t	zcb_start;
+	uint64_t	zcb_lastprint;
+	uint64_t	zcb_totalasize;
 	uint64_t	zcb_errors[256];
 	int		zcb_readfails;
 	int		zcb_haderrors;
@@ -2040,6 +2048,7 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *
 		zb->zb_lsize += BP_GET_LSIZE(bp);
 		zb->zb_psize += BP_GET_PSIZE(bp);
 		zb->zb_count++;
+		zb->zb_psize_histogram[BP_GET_PSIZE(bp) >> SPA_MINBLOCKSHIFT]++;
 	}
 
 	if (dump_opt['L'])
@@ -2126,7 +2135,7 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog
 
 	zcb->zcb_readfails = 0;
 
-	if (dump_opt['b'] >= 4) {
+	if (dump_opt['b'] >= 5) {
 		sprintf_blkptr(blkbuf, bp);
 		(void) printf("objset %llu object %llu "
 		    "level %lld offset 0x%llx %s\n",
@@ -2137,6 +2146,28 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog
 		    blkbuf);
 	}
 
+	if (dump_opt['b'] < 5 && isatty(STDERR_FILENO) &&
+	    gethrtime() > zcb->zcb_lastprint + NANOSEC) {
+		uint64_t now = gethrtime();
+		char buf[10];
+		uint64_t bytes = zcb->zcb_type[ZB_TOTAL][ZDB_OT_TOTAL].zb_asize;
+		int kb_per_sec =
+		    1 + bytes / (1 + ((now - zcb->zcb_start) / 1000 / 1000));
+		int sec_remaining =
+		    (zcb->zcb_totalasize - bytes) / 1024 / kb_per_sec;
+
+		zfs_nicenum(bytes, buf, sizeof (buf));
+		(void) fprintf(stderr,
+		    "\r%5s completed (%4dMB/s) "
+		    "estimated time remaining: %uhr %02umin %02usec        ",
+		    buf, kb_per_sec / 1024,
+		    sec_remaining / 60 / 60,
+		    sec_remaining / 60 % 60,
+		    sec_remaining % 60);
+
+		zcb->zcb_lastprint = now;
+	}
+
 	return (0);
 }
 
@@ -2268,7 +2299,7 @@ count_block_cb(void *arg, const blkptr_t
 {
 	zdb_cb_t *zcb = arg;
 
-	if (dump_opt['b'] >= 4) {
+	if (dump_opt['b'] >= 5) {
 		char blkbuf[BP_SPRINTF_LEN];
 		sprintf_blkptr(blkbuf, bp);
 		(void) printf("[%s] %s\n",
@@ -2287,7 +2318,7 @@ dump_block_stats(spa_t *spa)
 	int flags = TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA | TRAVERSE_HARD;
 	int leaks = 0;
 
-	(void) printf("\nTraversing all blocks %s%s%s%s%s...\n",
+	(void) printf("\nTraversing all blocks %s%s%s%s%s...\n\n",
 	    (dump_opt['c'] || !dump_opt['L']) ? "to verify " : "",
 	    (dump_opt['c'] == 1) ? "metadata " : "",
 	    dump_opt['c'] ? "checksums " : "",
@@ -2323,6 +2354,8 @@ dump_block_stats(spa_t *spa)
 	if (dump_opt['c'] > 1)
 		flags |= TRAVERSE_PREFETCH_DATA;
 
+	zcb.zcb_totalasize = metaslab_class_get_alloc(spa_normal_class(spa));
+	zcb.zcb_start = zcb.zcb_lastprint = gethrtime();
 	zcb.zcb_haderrors |= traverse_pool(spa, 0, flags, zdb_blkptr_cb, &zcb);
 
 	if (zcb.zcb_haderrors) {
@@ -2450,6 +2483,14 @@ dump_block_stats(spa_t *spa)
 				else
 					(void) printf("    L%d %s\n",
 					    level, typename);
+
+				if (dump_opt['b'] >= 4) {
+					(void) printf("psize "
+					    "(in 512-byte sectors): "
+					    "number of blocks\n");
+					dump_histogram(zb->zb_psize_histogram,
+					    PSIZE_HISTO_SIZE);
+				}
 			}
 		}
 	}

Modified: user/attilio/vmobj-readlock/etc/devd/usb.conf
==============================================================================
--- user/attilio/vmobj-readlock/etc/devd/usb.conf	Mon Apr  8 19:53:02 2013	(r249274)
+++ user/attilio/vmobj-readlock/etc/devd/usb.conf	Mon Apr  8 19:56:14 2013	(r249275)
@@ -120,7 +120,23 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x03f0";
-	match "product" "(0x2016|0x2116|0x2216|0x3016|0x3116|0x3216)";
+	match "product" "(0x2016|0x2116|0x2216|0x3016|0x3116)";
+	action "kldload -n uipaq";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x03f0";
+	match "product" "0x311d";
+	action "kldload -n ng_ubt";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x03f0";
+	match "product" "0x3216";
 	action "kldload -n uipaq";
 };
 
@@ -168,7 +184,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0403";
-	match "product" "(0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed74|0xee18|0xeee8|0xeee9|0xeeea|0xeee
 b|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)";
+	match "product" "(0x6001|0x6004|0x6006|0x6006|0x6010|0x6011|0x6014|0x8372|0x9378|0x9379|0x937a|0x937c|0x9868|0x9e90|0x9f80|0xa6d0|0xabb8|0xb810|0xb811|0xb812|0xbaf8|0xbbe2|0xbca0|0xbca1|0xbca2|0xbca4|0xbcd8|0xbcd9|0xbcda|0xbdc8|0xbfd8|0xbfd9|0xbfda|0xbfdb|0xbfdc|0xc7d0|0xc850|0xc991|0xcaa0|0xcc48|0xcc49|0xcc4a|0xd010|0xd011|0xd012|0xd013|0xd014|0xd015|0xd016|0xd017|0xd070|0xd071|0xd388|0xd389|0xd38a|0xd38b|0xd38c|0xd38d|0xd38e|0xd38f|0xd578|0xd678|0xd738|0xd780|0xdaf8|0xdaf9|0xdafa|0xdafb|0xdafc|0xdafd|0xdafe|0xdaff|0xdc00|0xdc01|0xdd20|0xdf28|0xdf30|0xdf31|0xdf32|0xdf33|0xdf35|0xe000|0xe001|0xe002|0xe004|0xe006|0xe008|0xe009|0xe00a|0xe050|0xe0e8|0xe0e9|0xe0ea|0xe0eb|0xe0ec|0xe0ed|0xe0ee|0xe0ef|0xe0f0|0xe0f1|0xe0f2|0xe0f3|0xe0f4|0xe0f5|0xe0f6|0xe0f7|0xe40b|0xe520|0xe548|0xe6c8|0xe700|0xe729|0xe808|0xe809|0xe80a|0xe80b|0xe80c|0xe80d|0xe80e|0xe80f|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xe88d|0xe88e|0xe88f|0xea90|0xebe0|0xec88|0xec89|0xed22|0xed71|0xed72|0xed73|0xed74|0xee18|0xeee8|0xeee
 9|0xeeea|0xeeeb|0xeeec|0xeeed|0xeeee|0xeeef|0xef50|0xef51|0xf068|0xf069|0xf06a|0xf06b|0xf06c|0xf06d|0xf06e|0xf06f|0xf070|0xf0c0|0xf0c8|0xf208|0xf2d0|0xf3c0|0xf3c1|0xf3c2|0xf448|0xf449|0xf44a|0xf44b|0xf44c|0xf460|0xf608|0xf60b|0xf680|0xf850|0xf857|0xf9d0|0xf9d1|0xf9d2|0xf9d3|0xf9d4|0xf9d5|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfa05|0xfa06|0xfa10|0xfa33|0xfa88|0xfad0|0xfaf0|0xfb58|0xfb59|0xfb5a|0xfb5b|0xfb5c|0xfb5d|0xfb5e|0xfb5f|0xfb80|0xfb99|0xfbfa|0xfc08|0xfc09|0xfc0a|0xfc0b|0xfc0c|0xfc0d|0xfc0e|0xfc0f|0xfc60|0xfc70|0xfc71|0xfc72|0xfc73|0xfc82|0xfd60|0xfe38|0xff00|0xff18|0xff1c|0xff1d|0xff20|0xff38|0xff39|0xff3a|0xff3b|0xff3c|0xff3d|0xff3e|0xff3f|0xffa8)";
 	action "kldload -n uftdi";
 };
 
@@ -280,7 +296,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0411";
-	match "product" "(0x0116|0x0119)";
+	match "product" "(0x00f4|0x0116|0x0119)";
 	action "kldload -n if_rum";
 };
 
@@ -423,6 +439,14 @@ nomatch 32 {
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x0489";
+	match "product" "(0xe027|0xe02c|0xe036|0xe03c|0xe03d|0xe04e|0xe056|0xe057)";
+	action "kldload -n ng_ubt";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x0499";
 	match "product" "(0x1000|0x1001|0x1002|0x1003|0x1004|0x1005|0x1006|0x1007|0x1008|0x1009|0x100a|0x100c|0x100d|0x100e|0x100f|0x1010|0x1011|0x1012|0x1013|0x1014|0x1015|0x1016|0x1017|0x1018|0x1019|0x101a|0x101b|0x101c|0x101d|0x101e|0x101f|0x1020|0x1021|0x1022|0x1023|0x1024|0x1025|0x1026|0x1027|0x1028|0x1029|0x102a|0x102b|0x102e|0x1030|0x1031|0x1032|0x1033|0x1034|0x1035|0x1036|0x1037|0x1038|0x1039|0x103a|0x103b|0x103c|0x103d|0x103e|0x103f|0x1040|0x1041|0x1042|0x1043|0x1044|0x1045|0x104e|0x104f|0x1050|0x1051|0x1052|0x1053|0x1054|0x1055|0x1056|0x1057|0x1058|0x1059|0x105a|0x105b|0x105c|0x105d|0x1503|0x2000|0x2001|0x2002|0x2003|0x5000|0x5001|0x5002|0x5003|0x5004|0x5005|0x5006|0x5007|0x5008|0x5009|0x500a|0x500b|0x500c|0x500d|0x500e|0x500f|0x7000|0x7010)";
 	action "kldload -n snd_uaudio";
@@ -559,6 +583,14 @@ nomatch 32 {
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x04ca";
+	match "product" "(0x3005|0x3006|0x3008)";
+	action "kldload -n ng_ubt";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x04da";
 	match "product" "0x2500";
 	action "kldload -n uipaq";
@@ -800,7 +832,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0525";
-	match "product" "0x1080";
+	match "product" "(0x1080|0xa4a0)";
 	action "kldload -n udbp";
 };
 
@@ -1103,6 +1135,14 @@ nomatch 32 {
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x065a";
+	match "product" "(0xc000|0xc001)";
+	action "kldload -n uftdi";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x066b";
 	match "product" "(0x200c|0x2202)";
 	action "kldload -n if_aue";
@@ -1344,7 +1384,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0789";
-	match "product" "(0x0162|0x0163|0x0164|0x0166|0x0168)";
+	match "product" "(0x0162|0x0163|0x0164|0x0166|0x0168|0x0169)";
 	action "kldload -n if_run";
 };
 
@@ -1800,6 +1840,14 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x0930";
+	match "product" "(0x0215|0x0219)";
+	action "kldload -n ng_ubt";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x0930";
 	match "product" "(0x0700|0x0705|0x0706|0x0707|0x0708|0x0709|0x070a|0x070b)";
 	action "kldload -n uipaq";
 };
@@ -2375,6 +2423,14 @@ nomatch 32 {
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x0cf3";
+	match "product" "(0x3002|0x3004|0x311d|0xe004|0xe019)";
+	action "kldload -n ng_ubt";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x0d3a";
 	match "product" "0x0300";
 	action "kldload -n uftdi";
@@ -3224,15 +3280,39 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x13d3";
-	match "product" "(0x3247|0x3262|0x3273|0x3284|0x3305)";
+	match "product" "(0x3247|0x3262|0x3273|0x3284)";
+	action "kldload -n if_run";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x13d3";
+	match "product" "0x3304";
+	action "kldload -n ng_ubt";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x13d3";
+	match "product" "0x3305";
 	action "kldload -n if_run";
 };
 
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x13d3";
+	match "product" "(0x3362|0x3375|0x3393)";
+	action "kldload -n ng_ubt";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x1410";
-	match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5100|0x6000|0x6002|0x7042)";
+	match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5041|0x5100|0x6000|0x6002|0x7042)";
 	action "kldload -n u3g";
 };
 
@@ -4040,7 +4120,7 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x2001";
-	match "product" "0x1a00";
+	match "product" "(0x1a00|0x1a02)";
 	action "kldload -n if_axe";
 };
 
@@ -4096,7 +4176,23 @@ nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
 	match "vendor" "0x2001";
-	match "product" "(0x4001|0x4002|0x4003|0x400b|0x4102|0xabc1)";
+	match "product" "(0x4001|0x4002|0x4003|0x400b|0x4102)";
+	action "kldload -n if_aue";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x2001";
+	match "product" "(0x7e12|0xa805)";
+	action "kldload -n u3g";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
+	match "vendor" "0x2001";
+	match "product" "0xabc1";
 	action "kldload -n if_aue";
 };
 
@@ -4215,6 +4311,14 @@ nomatch 32 {
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x22b8";
+	match "product" "0x710f";
+	action "kldload -n u3g";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "vendor" "0x22de";
 	match "product" "0x6801";
 	action "kldload -n u3g";
@@ -4495,6 +4599,16 @@ nomatch 32 {
 nomatch 32 {
 	match "bus" "uhub[0-9]+";
 	match "mode" "host";
+	match "vendor" "0x0a5c";
+	match "intclass" "0xff";
+	match "intsubclass" "0x01";
+	match "intprotocol" "0x01";
+	action "kldload -n ng_ubt";
+};
+
+nomatch 32 {
+	match "bus" "uhub[0-9]+";
+	match "mode" "host";
 	match "intclass" "0x02";
 	match "intsubclass" "0x02";
 	match "intprotocol" "0x01";
@@ -4635,5 +4749,5 @@ nomatch 32 {
 	action "kldload -n umass";
 };
 
-# 2386 USB entries processed
+# 2422 USB entries processed
 

Modified: user/attilio/vmobj-readlock/sbin/camcontrol/camcontrol.8
==============================================================================
--- user/attilio/vmobj-readlock/sbin/camcontrol/camcontrol.8	Mon Apr  8 19:53:02 2013	(r249274)
+++ user/attilio/vmobj-readlock/sbin/camcontrol/camcontrol.8	Mon Apr  8 19:56:14 2013	(r249275)
@@ -1118,14 +1118,15 @@ usually takes just a few seconds.
 Freeze the security configuration of the specified device.
 .Pp
 After command completion any other commands that update the device lock mode
-shall be command aborted. Frozen mode is disabled by power-off or hardware reset. 
+shall be command aborted.
+Frozen mode is disabled by power-off or hardware reset.
 .It Fl h Ar pwd
 .Pp
 Enhanced erase the device using the given password for the selected user.
 .Pp
 .Em WARNING! WARNING! WARNING!
 .Pp
-Issuing an enhanced secure erase will 
+Issuing an enhanced secure erase will
 .Em ERASE ALL
 user data on the device and may take several hours to complete.
 .Pp
@@ -1378,7 +1379,7 @@ camcontrol security ada0
 .Pp
 Report security support and settings for ada0
 .Bd -literal -offset indent
-camcontrol security ada0 -u user -s MyPass 
+camcontrol security ada0 -u user -s MyPass
 .Ed
 .Pp
 Enable security on device ada0 with the password MyPass

Modified: user/attilio/vmobj-readlock/sbin/camcontrol/camcontrol.c
==============================================================================
--- user/attilio/vmobj-readlock/sbin/camcontrol/camcontrol.c	Mon Apr  8 19:53:02 2013	(r249274)
+++ user/attilio/vmobj-readlock/sbin/camcontrol/camcontrol.c	Mon Apr  8 19:56:14 2013	(r249275)
@@ -1734,7 +1734,7 @@ enum {
 	ATA_SECURITY_ACTION_ERASE,
 	ATA_SECURITY_ACTION_ERASE_ENHANCED,
 	ATA_SECURITY_ACTION_SET_PASSWORD
-} atasecurity_action;
+};
 
 static void
 atasecurity_print_time(u_int16_t tw)

Modified: user/attilio/vmobj-readlock/share/man/man4/mld.4
==============================================================================
--- user/attilio/vmobj-readlock/share/man/man4/mld.4	Mon Apr  8 19:53:02 2013	(r249274)
+++ user/attilio/vmobj-readlock/share/man/man4/mld.4	Mon Apr  8 19:56:14 2013	(r249275)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 27, 2009
+.Dd April 8, 2013
 .Dt MLD 4
 .Os
 .Sh NAME
@@ -68,11 +68,6 @@ to the protocol.
 .Sh SYSCTL VARIABLES
 .Bl -tag -width indent
 .\"
-.It net.inet6.mld.stats
-This opaque read-only variable exposes the stack-wide MLDv2
-protocol statistics to
-.Xr netstat 1 .
-.\"
 .It net.inet6.mld.ifinfo
 This opaque read-only variable exposes the per-link MLDv2 status to
 .Xr ifmcstat 8 .
@@ -94,11 +89,12 @@ This sysctl is normally enabled by defau
 .\"
 .El
 .Sh SEE ALSO
-.Xr ifmcstat 8 ,
+.Xr netstat 1 ,
+.Xr sourcefilter 3 ,
+.Xr icmp6 4 ,
 .Xr inet 4 ,
 .Xr multicast 4 ,
-.Xr netstat 1 ,
-.Xr sourcefilter 3
+.Xr ifmcstat 8
 .Sh HISTORY
 The
 .Nm

Modified: user/attilio/vmobj-readlock/share/man/man9/Makefile
==============================================================================
--- user/attilio/vmobj-readlock/share/man/man9/Makefile	Mon Apr  8 19:53:02 2013	(r249274)
+++ user/attilio/vmobj-readlock/share/man/man9/Makefile	Mon Apr  8 19:56:14 2013	(r249275)
@@ -51,6 +51,7 @@ MAN=	accept_filter.9 \
 	config_intrhook.9 \
 	contigmalloc.9 \
 	copy.9 \
+	counter.9 \
 	cr_cansee.9 \
 	critical_enter.9 \
 	cr_seeothergids.9 \
@@ -569,6 +570,14 @@ MLINKS+=copy.9 copyin.9 \
 	copy.9 copyout.9 \
 	copy.9 copyout_nofault.9 \
 	copy.9 copystr.9
+MLINKS+=counter.9 counter_u64_alloc.9 \
+	counter.9 counter_u64_free.9 \
+	counter.9 counter_u64_add.9 \
+	counter.9 counter_enter.9 \
+	counter.9 counter_exit.9 \
+	counter.9 counter_u64_add_protected.9 \
+	counter.9 counter_u64_fetch.9 \
+	counter.9 counter_u64_zero.9
 MLINKS+=critical_enter.9 critical.9 \
 	critical_enter.9 critical_exit.9
 MLINKS+=crypto.9 crypto_dispatch.9 \

Copied: user/attilio/vmobj-readlock/share/man/man9/counter.9 (from r249273, user/attilio/vmcontention/share/man/man9/counter.9)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/attilio/vmobj-readlock/share/man/man9/counter.9	Mon Apr  8 19:56:14 2013	(r249275, copy of r249273, user/attilio/vmcontention/share/man/man9/counter.9)
@@ -0,0 +1,200 @@
+.\"-
+.\" Copyright (c) 2013 Gleb Smirnoff <glebius@FreeBSD.org>
+.\" 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 April 3, 2013
+.Dt COUNTER 9
+.Os
+.Sh NAME
+.Nm counter
+.Nd "SMP-friendly kernel counter implementation"
+.Sh SYNOPSIS
+.In sys/types.h
+.In sys/counter.h
+.Ft counter_u64_t
+.Fn counter_u64_alloc "int wait"
+.Ft void
+.Fn counter_u64_free "counter_u64_t c"
+.Ft void
+.Fn counter_u64_add "counter_u64_t c" "int64_t v"
+.Ft void
+.Fn counter_enter
+.Ft void
+.Fn counter_exit
+.Ft void
+.Fn counter_u64_add_protected "counter_u64_t c" "int64_t v"
+.Ft uint64_t
+.Fn counter_u64_fetch "counter_u64_t c"
+.Ft void
+.Fn counter_u64_zero "counter_u64_t c"
+.In sys/sysctl.h
+.Fn SYSCTL_COUNTER_U64 parent nbr name access ptr val descr
+.Fn SYSCTL_ADD_COUNTER_U64 ctx parent nbr name access ptr descr
+.Sh DESCRIPTION
+.Nm
+is a generic facility to create counters
+that can be utilized for any purpose (such as collecting statistical
+data).
+A
+.Nm
+is guaranteed to be lossless when several kernel threads do simultaneous
+updates.
+However,
+.Nm
+does not block the calling thread,
+also no
+.Xr atomic 9
+operations are used for the update, therefore the counters
+can be used in any non-interrupt context.
+Moreover,
+.Nm
+has special optimisations for SMP environments, making
+.Nm
+update faster than simple arithmetic on the global variable.
+Thus
+.Nm
+is considered suitable for accounting in the performance-critical
+code pathes.
+.Bl -tag -width indent
+.It Fn counter_u64_alloc how
+Allocate a new 64-bit unsigned counter.
+The
+.Fa wait
+argument is the
+.Xr malloc 9
+wait flag, should be either
+.Va M_NOWAIT
+or
+.Va M_WAITOK .
+If
+.Va M_WAITOK
+is specified the operation may fail.
+.It Fn counter_u64_free c
+Free the previously allocated counter
+.Fa c .
+.It Fn counter_u64_add c v
+Add
+.Fa v
+to
+.Fa c .
+The KPI does not guarantee any protection from wraparound.
+.It Fn counter_enter
+Enter mode that would allow to safely update several counters via
+.Fn counter_u64_add_protected .
+On some machines this expands to
+.Xr critical 9
+section, while on other is a nop.
+See
+.Sx IMPLEMENTATION DETAILS .
+.It Fn counter_exit
+Exit mode for updating several counters.
+.It Fn counter_u64_add_protected c v
+Same as
+.Fn counter_u64_add ,
+but should be preceded by
+.Fn counter_enter .
+.It Fn counter_u64_fetch c
+Take a snapshot of counter
+.Fa c .
+The data obtained is not guaranteed to reflect the real cumulative
+value for any moment.
+.It Fn counter_u64_zero c
+Clear the counter
+.Fa c
+and set it to zero.
+.It Fn SYSCTL_COUNTER_U64 parent nbr name access ptr val descr
+Declare a static
+.Xr sysctl
+oid that would represent a
+.Nm .
+The
+.Fa ptr
+argument should be a pointer to allocated
+.Vt counter_u64_t .
+A read of the oid returns value obtained through
+.Fn counter_u64_fetch .
+Any write to the oid zeroes it.
+.It Fn SYSCTL_ADD_COUNTER_U64 ctx parent nbr name access ptr descr
+Create a
+.Xr sysctl
+oid that would represent a
+.Nm .
+The
+.Fa ptr
+argument should be a pointer to allocated
+.Vt counter_u64_t .
+A read of the oid returns value obtained through
+.Fn counter_u64_fetch .
+Any write to the oid zeroes it.
+.El
+.Sh IMPLEMENTATION DETAILS
+On all architectures
+.Nm
+is implemented using per-CPU data fields that are specially aligned
+in memory, to avoid inter-CPU bus traffic due to shared use
+of the variables between CPUs.
+These are allocated using
+.Va UMA_ZONE_PCPU
+.Xr uma 9
+zone.
+The update operation only touches the field that is private to current CPU.
+Fetch operation loops through all per-CPU fields and obtains a snapshot
+sum of all fields.
+.Pp
+On amd64 a
+.Nm counter
+update is implemented as a single instruction without lock semantics,
+operating on the private data for the current CPU,
+which is safe against preemption and interrupts.
+.Pp
+On i386 architecture, when machine supports the cmpxchg8 instruction,
+this instruction is used.
+The multi-instruction sequence provides the same guarantees as the
+amd64 single-instruction implementation.
+.Pp
+On some architectures updating a counter require a
+.Xr critical 9
+section.
+.Sh SEE ALSO
+.Xr atomic 9 ,
+.Xr critical 9 ,
+.Xr locking 9 ,
+.Xr malloc 9 ,
+.Xr sysctl 9 ,
+.Xr uma 9
+.Sh HISTORY
+The
+.Nm
+facility first appeared in
+.Fx 10.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+facility was written by
+.An Gleb Smirnoff
+and
+.An Konstantin Belousov .

Modified: user/attilio/vmobj-readlock/share/man/man9/sbuf.9
==============================================================================
--- user/attilio/vmobj-readlock/share/man/man9/sbuf.9	Mon Apr  8 19:53:02 2013	(r249274)
+++ user/attilio/vmobj-readlock/share/man/man9/sbuf.9	Mon Apr  8 19:56:14 2013	(r249275)
@@ -94,7 +94,7 @@
 .Fn sbuf_finish "struct sbuf *s"
 .Ft char *
 .Fn sbuf_data "struct sbuf *s"
-.Ft int
+.Ft ssize_t
 .Fn sbuf_len "struct sbuf *s"
 .Ft int
 .Fn sbuf_done "struct sbuf *s"

Modified: user/attilio/vmobj-readlock/share/man/man9/zone.9
==============================================================================
--- user/attilio/vmobj-readlock/share/man/man9/zone.9	Mon Apr  8 19:53:02 2013	(r249274)
+++ user/attilio/vmobj-readlock/share/man/man9/zone.9	Mon Apr  8 19:56:14 2013	(r249275)
@@ -153,6 +153,23 @@ See
 .Fn uma_find_refcnt .
 .It Dv UMA_ZONE_NODUMP
 Pages belonging to the zone will not be included into mini-dumps.
+.It Dv UMA_ZONE_PCPU
+An allocation from zone would have
+.Va mp_ncpu
+shadow copies, that are privately assigned to CPUs.
+A CPU can address its private copy using base allocation address plus
+multiple of current CPU id and
+.Fn sizeof "struct pcpu" :
+.Bd -literal -offset indent
+foo_zone = uma_zcreate(..., UMA_ZONE_PCPU);
+ ...
+foo_base = uma_zalloc(foo_zone, ...);
+ ...
+critical_enter();
+foo_pcpu = (foo_t *)zpcpu_get(foo_base);
+/* do something with foo_pcpu */
+critical_exit();
+.Ed
 .It Dv UMA_ZONE_OFFPAGE
 By default book-keeping of items within a slab is done in the slab page itself.
 This flag explicitly tells subsystem that book-keeping structure should be

Copied: user/attilio/vmobj-readlock/sys/amd64/include/counter.h (from r249273, user/attilio/vmcontention/sys/amd64/include/counter.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/attilio/vmobj-readlock/sys/amd64/include/counter.h	Mon Apr  8 19:56:14 2013	(r249275, copy of r249273, user/attilio/vmcontention/sys/amd64/include/counter.h)
@@ -0,0 +1,51 @@
+/*-
+ * Copyright (c) 2012 Konstantin Belousov <kib@FreeBSD.org>
+ * 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$
+ */
+
+#ifndef __MACHINE_COUNTER_H__
+#define __MACHINE_COUNTER_H__
+
+#include <sys/pcpu.h>
+
+extern struct pcpu __pcpu[1];
+
+#define	counter_enter()	do {} while (0)
+#define	counter_exit()	do {} while (0)
+
+#define	counter_u64_add_protected(c, i)	counter_u64_add(c, i)
+
+static inline void
+counter_u64_add(counter_u64_t c, int64_t inc)
+{
+
+	__asm __volatile("addq\t%1,%%gs:(%0)"
+	    :
+	    : "r" ((char *)c - (char *)&__pcpu[0]), "r" (inc)
+	    : "memory", "cc");
+}
+
+#endif	/* ! __MACHINE_COUNTER_H__ */

Modified: user/attilio/vmobj-readlock/sys/amd64/include/pcpu.h
==============================================================================
--- user/attilio/vmobj-readlock/sys/amd64/include/pcpu.h	Mon Apr  8 19:53:02 2013	(r249274)
+++ user/attilio/vmobj-readlock/sys/amd64/include/pcpu.h	Mon Apr  8 19:56:14 2013	(r249275)
@@ -77,7 +77,9 @@
 	/* Pointer to the CPU TSS descriptor */				\
 	struct system_segment_descriptor *pc_tss;			\
 	u_int	pc_cmci_mask		/* MCx banks for CMCI */	\
-	PCPU_XEN_FIELDS
+	PCPU_XEN_FIELDS;						\
+	char	__pad[293]		/* be divisor of PAGE_SIZE	\
+					   after cache alignment */
 
 #ifdef _KERNEL
 

Modified: user/attilio/vmobj-readlock/sys/arm/at91/at91_pio.c
==============================================================================
--- user/attilio/vmobj-readlock/sys/arm/at91/at91_pio.c	Mon Apr  8 19:53:02 2013	(r249274)
+++ user/attilio/vmobj-readlock/sys/arm/at91/at91_pio.c	Mon Apr  8 19:56:14 2013	(r249275)
@@ -554,12 +554,12 @@ at91_pio_gpio_clear(uint32_t pio, uint32
 	PIO[PIO_CODR / 4] = data_mask;
 }
 
-uint8_t
+uint32_t
 at91_pio_gpio_get(uint32_t pio, uint32_t data_mask)
 {
 	uint32_t *PIO = (uint32_t *)(AT91_BASE + pio);
 
-	return ((PIO[PIO_PDSR / 4] & data_mask));
+	return (PIO[PIO_PDSR / 4] & data_mask);
 }
 
 void

Modified: user/attilio/vmobj-readlock/sys/arm/at91/at91_piovar.h
==============================================================================
--- user/attilio/vmobj-readlock/sys/arm/at91/at91_piovar.h	Mon Apr  8 19:53:02 2013	(r249274)
+++ user/attilio/vmobj-readlock/sys/arm/at91/at91_piovar.h	Mon Apr  8 19:56:14 2013	(r249275)
@@ -39,7 +39,7 @@ void at91_pio_gpio_output(uint32_t pio, 
 void at91_pio_gpio_high_z(uint32_t pio, uint32_t high_z_mask, int enable);
 void at91_pio_gpio_set(uint32_t pio, uint32_t data_mask);
 void at91_pio_gpio_clear(uint32_t pio, uint32_t data_mask);
-uint8_t at91_pio_gpio_get(uint32_t pio, uint32_t data_mask);
+uint32_t at91_pio_gpio_get(uint32_t pio, uint32_t data_mask);
 void at91_pio_gpio_set_deglitch(uint32_t pio, uint32_t data_mask,
     int use_deglitch);
 void at91_pio_gpio_set_interrupt(uint32_t pio, uint32_t data_mask,

Copied: user/attilio/vmobj-readlock/sys/arm/include/counter.h (from r249273, user/attilio/vmcontention/sys/arm/include/counter.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/attilio/vmobj-readlock/sys/arm/include/counter.h	Mon Apr  8 19:56:14 2013	(r249275, copy of r249273, user/attilio/vmcontention/sys/arm/include/counter.h)
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 2012 Konstantin Belousov <kib@FreeBSD.org>
+ * 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$
+ */
+
+#ifndef __MACHINE_COUNTER_H__
+#define __MACHINE_COUNTER_H__
+
+#include <sys/pcpu.h>
+#ifdef INVARIANTS
+#include <sys/proc.h>
+#endif
+
+#define	counter_enter()	critical_enter()
+#define	counter_exit()	critical_exit()
+
+#define	counter_u64_add_protected(c, inc)	do {	\
+	CRITICAL_ASSERT(curthread);			\
+	*(uint64_t *)zpcpu_get(c) += (inc);		\
+} while (0)
+
+static inline void
+counter_u64_add(counter_u64_t c, int64_t inc)
+{
+
+	counter_enter();
+	counter_u64_add_protected(c, inc);
+	counter_exit();

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



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