From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 2 09:03:53 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E404B1065670; Sun, 2 Jan 2011 09:03:53 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7E0E8FC08; Sun, 2 Jan 2011 09:03:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0293rZS039376; Sun, 2 Jan 2011 09:03:53 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0293rYk039374; Sun, 2 Jan 2011 09:03:53 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201101020903.p0293rYk039374@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 2 Jan 2011 09:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216885 - stable/8/sys/dev/wpi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 09:03:54 -0000 Author: bschmidt Date: Sun Jan 2 09:03:53 2011 New Revision: 216885 URL: http://svn.freebsd.org/changeset/base/216885 Log: MFC r216824: The RX path is missing a few bus_dmamap_*() calls, this results in modification of memory which was already free'd and eventually in: wpi0: could not map mbuf (error 12) wpi0: wpi_rx_intr: bus_dmamap_load failed, error 12 and an usuable device. PR: kern/144898 Modified: stable/8/sys/dev/wpi/if_wpi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/8/sys/dev/wpi/if_wpi.c Sun Jan 2 03:16:47 2011 (r216884) +++ stable/8/sys/dev/wpi/if_wpi.c Sun Jan 2 09:03:53 2011 (r216885) @@ -1052,9 +1052,18 @@ wpi_free_rx_ring(struct wpi_softc *sc, s wpi_dma_contig_free(&ring->desc_dma); - for (i = 0; i < WPI_RX_RING_COUNT; i++) - if (ring->data[i].m != NULL) - m_freem(ring->data[i].m); + for (i = 0; i < WPI_RX_RING_COUNT; i++) { + struct wpi_rx_data *data = &ring->data[i]; + + if (data->m != NULL) { + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(ring->data_dmat, data->map); + m_freem(data->m); + } + if (data->map != NULL) + bus_dmamap_destroy(ring->data_dmat, data->map); + } } static int @@ -1461,6 +1470,7 @@ wpi_rx_intr(struct wpi_softc *sc, struct return; } + bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); head = (struct wpi_rx_head *)((caddr_t)(stat + 1) + stat->len); tail = (struct wpi_rx_tail *)((caddr_t)(head + 1) + le16toh(head->len)); @@ -1491,6 +1501,8 @@ wpi_rx_intr(struct wpi_softc *sc, struct ifp->if_ierrors++; return; } + bus_dmamap_unload(ring->data_dmat, data->map); + error = bus_dmamap_load(ring->data_dmat, data->map, mtod(mnew, caddr_t), MJUMPAGESIZE, wpi_dma_map_addr, &paddr, BUS_DMA_NOWAIT); From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 2 13:12:25 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A7F8106564A; Sun, 2 Jan 2011 13:12:25 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07A038FC0C; Sun, 2 Jan 2011 13:12:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p02DCO0L046665; Sun, 2 Jan 2011 13:12:24 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p02DCOAg046661; Sun, 2 Jan 2011 13:12:24 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201101021312.p02DCOAg046661@svn.freebsd.org> From: Lawrence Stewart Date: Sun, 2 Jan 2011 13:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216889 - stable/8/usr.sbin/config X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 13:12:25 -0000 Author: lstewart Date: Sun Jan 2 13:12:24 2011 New Revision: 216889 URL: http://svn.freebsd.org/changeset/base/216889 Log: MFC r210144 (originally committed by imp): Put warnings out to stderr rather than stdout. Modified: stable/8/usr.sbin/config/config.y stable/8/usr.sbin/config/mkmakefile.c stable/8/usr.sbin/config/mkoptions.c Directory Properties: stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/config/SMM.doc/ (props changed) Modified: stable/8/usr.sbin/config/config.y ============================================================================== --- stable/8/usr.sbin/config/config.y Sun Jan 2 12:16:57 2011 (r216888) +++ stable/8/usr.sbin/config/config.y Sun Jan 2 13:12:24 2011 (r216889) @@ -366,7 +366,8 @@ newdev(char *name) struct device *np; if (finddev(&dtab, name)) { - printf("WARNING: duplicate device `%s' encountered.\n", name); + fprintf(stderr, + "WARNING: duplicate device `%s' encountered.\n", name); return; } @@ -426,7 +427,8 @@ newopt(struct opt_head *list, char *name op2 = findopt(list, name); if (op2 != NULL && !append) { - printf("WARNING: duplicate option `%s' encountered.\n", name); + fprintf(stderr, + "WARNING: duplicate option `%s' encountered.\n", name); return; } Modified: stable/8/usr.sbin/config/mkmakefile.c ============================================================================== --- stable/8/usr.sbin/config/mkmakefile.c Sun Jan 2 12:16:57 2011 (r216888) +++ stable/8/usr.sbin/config/mkmakefile.c Sun Jan 2 13:12:24 2011 (r216889) @@ -341,7 +341,8 @@ next: if (eq(wd, "include")) { next_quoted_word(fp, wd); if (wd == 0) { - printf("%s: missing include filename.\n", fname); + fprintf(stderr, "%s: missing include filename.\n", + fname); exit(1); } (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); @@ -353,8 +354,7 @@ next: this = ns(wd); next_word(fp, wd); if (wd == 0) { - printf("%s: No type for %s.\n", - fname, this); + fprintf(stderr, "%s: No type for %s.\n", fname, this); exit(1); } tp = fl_lookup(this); @@ -381,8 +381,9 @@ next: } else if (eq(wd, "mandatory")) { mandatory = 1; } else if (!eq(wd, "optional")) { - printf("%s: %s must be optional, mandatory or standard\n", - fname, this); + fprintf(stderr, + "%s: %s must be optional, mandatory or standard\n", + fname, this); exit(1); } nextparam: @@ -395,7 +396,7 @@ nextparam: } if (eq(wd, "|")) { if (nreqs == 0) { - printf("%s: syntax error describing %s\n", + fprintf(stderr, "%s: syntax error describing %s\n", fname, this); exit(1); } @@ -410,9 +411,9 @@ nextparam: } if (eq(wd, "no-implicit-rule")) { if (compilewith == 0) { - printf("%s: alternate rule required when " - "\"no-implicit-rule\" is specified.\n", - fname); + fprintf(stderr, "%s: alternate rule required when " + "\"no-implicit-rule\" is specified.\n", + fname); } imp_rule++; goto nextparam; @@ -424,8 +425,9 @@ nextparam: if (eq(wd, "dependency")) { next_quoted_word(fp, wd); if (wd == 0) { - printf("%s: %s missing compile command string.\n", - fname, this); + fprintf(stderr, + "%s: %s missing compile command string.\n", + fname, this); exit(1); } depends = ns(wd); @@ -434,8 +436,8 @@ nextparam: if (eq(wd, "clean")) { next_quoted_word(fp, wd); if (wd == 0) { - printf("%s: %s missing clean file list.\n", - fname, this); + fprintf(stderr, "%s: %s missing clean file list.\n", + fname, this); exit(1); } clean = ns(wd); @@ -444,8 +446,9 @@ nextparam: if (eq(wd, "compile-with")) { next_quoted_word(fp, wd); if (wd == 0) { - printf("%s: %s missing compile command string.\n", - fname, this); + fprintf(stderr, + "%s: %s missing compile command string.\n", + fname, this); exit(1); } compilewith = ns(wd); @@ -454,8 +457,9 @@ nextparam: if (eq(wd, "warning")) { next_quoted_word(fp, wd); if (wd == 0) { - printf("%s: %s missing warning text string.\n", - fname, this); + fprintf(stderr, + "%s: %s missing warning text string.\n", + fname, this); exit(1); } warning = ns(wd); @@ -484,13 +488,14 @@ nextparam: goto nextparam; } if (mandatory) { - printf("%s: mandatory device \"%s\" not found\n", + fprintf(stderr, "%s: mandatory device \"%s\" not found\n", fname, wd); exit(1); } if (std) { - printf("standard entry %s has a device keyword - %s!\n", - this, wd); + fprintf(stderr, + "standard entry %s has a device keyword - %s!\n", + this, wd); exit(1); } SLIST_FOREACH(op, &opt, op_next) @@ -501,13 +506,13 @@ nextparam: doneparam: if (std == 0 && nreqs == 0) { - printf("%s: what is %s optional on?\n", + fprintf(stderr, "%s: what is %s optional on?\n", fname, this); exit(1); } if (wd) { - printf("%s: syntax error describing %s\n", + fprintf(stderr, "%s: syntax error describing %s\n", fname, this); exit(1); } @@ -687,7 +692,7 @@ do_rules(FILE *f) STAILQ_FOREACH(ftp, &ftab, f_next) { if (ftp->f_warn) - printf("WARNING: %s\n", ftp->f_warn); + fprintf(stderr, "WARNING: %s\n", ftp->f_warn); cp = (np = ftp->f_fn) + strlen(ftp->f_fn) - 1; och = *cp; if (ftp->f_flags & NO_IMPLCT_RULE) { @@ -732,7 +737,8 @@ do_rules(FILE *f) ftype = "PROFILE"; break; default: - printf("config: don't know rules for %s\n", np); + fprintf(stderr, + "config: don't know rules for %s\n", np); break; } snprintf(cmd, sizeof(cmd), Modified: stable/8/usr.sbin/config/mkoptions.c ============================================================================== --- stable/8/usr.sbin/config/mkoptions.c Sun Jan 2 12:16:57 2011 (r216888) +++ stable/8/usr.sbin/config/mkoptions.c Sun Jan 2 13:12:24 2011 (r216889) @@ -77,12 +77,14 @@ options(void) } if (maxusers == 0) { - /* printf("maxusers not specified; will auto-size\n"); */ + /* fprintf(stderr, "maxusers not specified; will auto-size\n"); */ } else if (maxusers < users.u_min) { - printf("minimum of %d maxusers assumed\n", users.u_min); + fprintf(stderr, "minimum of %d maxusers assumed\n", + users.u_min); maxusers = users.u_min; } else if (maxusers > users.u_max) - printf("warning: maxusers > %d (%d)\n", users.u_max, maxusers); + fprintf(stderr, "warning: maxusers > %d (%d)\n", + users.u_max, maxusers); /* Fake MAXUSERS as an option. */ op = (struct opt *)calloc(1, sizeof(*op)); @@ -112,7 +114,7 @@ options(void) SLIST_FOREACH(ol, &otab, o_next) { if (eq(op->op_name, ol->o_name) && (ol->o_flags & OL_ALIAS)) { - printf("Mapping option %s to %s.\n", + fprintf(stderr, "Mapping option %s to %s.\n", op->op_name, ol->o_file); op->op_name = ol->o_file; break; @@ -123,7 +125,7 @@ options(void) do_option(ol->o_name); SLIST_FOREACH(op, &opt, op_next) { if (!op->op_ownfile && strncmp(op->op_name, "DEV_", 4)) { - printf("%s: unknown option \"%s\"\n", + fprintf(stderr, "%s: unknown option \"%s\"\n", PREFIX, op->op_name); exit(1); } @@ -160,7 +162,7 @@ do_option(char *name) if (value == NULL) value = ns("1"); if (oldvalue != NULL && !eq(value, oldvalue)) - printf( + fprintf(stderr, "%s: option \"%s\" redefined from %s to %s\n", PREFIX, op->op_name, oldvalue, value); @@ -218,12 +220,14 @@ do_option(char *name) if (eq(inw, ol->o_name)) break; if (!eq(inw, name) && !ol) { - printf("WARNING: unknown option `%s' removed from %s\n", - inw, file); + fprintf(stderr, + "WARNING: unknown option `%s' removed from %s\n", + inw, file); tidy++; } else if (ol != NULL && !eq(basefile, ol->o_file)) { - printf("WARNING: option `%s' moved from %s to %s\n", - inw, basefile, ol->o_file); + fprintf(stderr, + "WARNING: option `%s' moved from %s to %s\n", + inw, basefile, ol->o_file); tidy++; } else { op = (struct opt *) calloc(1, sizeof *op); @@ -312,8 +316,8 @@ check_duplicate(const char *fname, const SLIST_FOREACH(po, &otab, o_next) { if (eq(po->o_name, this)) { - printf("%s: Duplicate option %s.\n", - fname, this); + fprintf(stderr, "%s: Duplicate option %s.\n", + fname, this); exit(1); } } @@ -347,7 +351,8 @@ update_option(const char *this, char *va return; } } - printf("Compat option %s not listed in options file.\n", this); + fprintf(stderr, "Compat option %s not listed in options file.\n", + this); exit(1); } @@ -375,8 +380,8 @@ read_option_file(const char *fname, int return (1); if (val == 0) { if (flags) { - printf("%s: compat file requires two words " - "per line at %s\n", fname, this); + fprintf(stderr, "%s: compat file requires two" + " words per line at %s\n", fname, this); exit(1); } char *s = ns(this); From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 3 17:57:44 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ED20106564A; Mon, 3 Jan 2011 17:57:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D4188FC1E; Mon, 3 Jan 2011 17:57:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p03Hvic5000602; Mon, 3 Jan 2011 17:57:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p03HviqA000598; Mon, 3 Jan 2011 17:57:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101031757.p03HviqA000598@svn.freebsd.org> From: John Baldwin Date: Mon, 3 Jan 2011 17:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216923 - in stable/8/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 17:57:44 -0000 Author: jhb Date: Mon Jan 3 17:57:44 2011 New Revision: 216923 URL: http://svn.freebsd.org/changeset/base/216923 Log: MFC 216679: Drop the icu_lock spinlock while pausing briefly after masking the interrupt in the I/O APIC before moving it to a different CPU. Modified: stable/8/sys/amd64/amd64/io_apic.c stable/8/sys/i386/i386/io_apic.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/io_apic.c ============================================================================== --- stable/8/sys/amd64/amd64/io_apic.c Mon Jan 3 17:17:31 2011 (r216922) +++ stable/8/sys/amd64/amd64/io_apic.c Mon Jan 3 17:57:44 2011 (r216923) @@ -359,7 +359,9 @@ ioapic_assign_cpu(struct intsrc *isrc, u if (!intpin->io_masked && !intpin->io_edgetrigger) { ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), intpin->io_lowreg | IOART_INTMSET); + mtx_unlock_spin(&icu_lock); DELAY(100); + mtx_lock_spin(&icu_lock); } intpin->io_cpu = apic_id; Modified: stable/8/sys/i386/i386/io_apic.c ============================================================================== --- stable/8/sys/i386/i386/io_apic.c Mon Jan 3 17:17:31 2011 (r216922) +++ stable/8/sys/i386/i386/io_apic.c Mon Jan 3 17:57:44 2011 (r216923) @@ -359,7 +359,9 @@ ioapic_assign_cpu(struct intsrc *isrc, u if (!intpin->io_masked && !intpin->io_edgetrigger) { ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), intpin->io_lowreg | IOART_INTMSET); + mtx_unlock_spin(&icu_lock); DELAY(100); + mtx_lock_spin(&icu_lock); } intpin->io_cpu = apic_id; From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 3 19:23:44 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 214AF10656F0; Mon, 3 Jan 2011 19:23:44 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EB7A8FC14; Mon, 3 Jan 2011 19:23:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p03JNhoE002828; Mon, 3 Jan 2011 19:23:43 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p03JNhNZ002826; Mon, 3 Jan 2011 19:23:43 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201101031923.p03JNhNZ002826@svn.freebsd.org> From: Martin Matuska Date: Mon, 3 Jan 2011 19:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216927 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 19:23:44 -0000 Author: mm Date: Mon Jan 3 19:23:43 2011 New Revision: 216927 URL: http://svn.freebsd.org/changeset/base/216927 Log: MFC r207745 (trasz): Enforce RLIMIT_FSIZE in ZFS. Note: original implementation without vn_rlimit_fsize (pre-r207662) Reviewed by: trasz Approved by: pjd Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Jan 3 18:34:28 2011 (r216926) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Jan 3 19:23:43 2011 (r216927) @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -4362,6 +4363,17 @@ zfs_freebsd_write(ap) } */ *ap; { + if (ap->a_vp->v_type == VREG && ap->a_uio->uio_td != NULL) { + PROC_LOCK(ap->a_uio->uio_td->td_proc); + if (ap->a_uio->uio_offset + ap->a_uio->uio_resid > + lim_cur(ap->a_uio->uio_td->td_proc, RLIMIT_FSIZE)) { + psignal(ap->a_uio->uio_td->td_proc, SIGXFSZ); + PROC_UNLOCK(ap->a_uio->uio_td->td_proc); + return (EFBIG); + } + PROC_UNLOCK(ap->a_uio->uio_td->td_proc); + } + return (zfs_write(ap->a_vp, ap->a_uio, ioflags(ap->a_ioflag), ap->a_cred, NULL)); } From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 3 20:21:50 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6F90106564A; Mon, 3 Jan 2011 20:21:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 5B9D78FC0A; Mon, 3 Jan 2011 20:21:49 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p03KLkd3054040 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Jan 2011 22:21:46 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p03KLk62005190; Mon, 3 Jan 2011 22:21:46 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p03KLkNU005189; Mon, 3 Jan 2011 22:21:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Jan 2011 22:21:46 +0200 From: Kostik Belousov To: Martin Matuska , trasz@freebsd.org Message-ID: <20110103202146.GG3140@deviant.kiev.zoral.com.ua> References: <201101031923.p03JNhNZ002826@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8S1fMsFYqgBC+BN/" Content-Disposition: inline In-Reply-To: <201101031923.p03JNhNZ002826@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r216927 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 20:21:50 -0000 --8S1fMsFYqgBC+BN/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 03, 2011 at 07:23:43PM +0000, Martin Matuska wrote: > Author: mm > Date: Mon Jan 3 19:23:43 2011 > New Revision: 216927 > URL: http://svn.freebsd.org/changeset/base/216927 >=20 > Log: > MFC r207745 (trasz): > =20 > Enforce RLIMIT_FSIZE in ZFS. > =20 > Note: original implementation without vn_rlimit_fsize (pre-r207662) > =20 Can we merge vn_rlimit_fsize() and stop duplicating this code ? > Reviewed by: trasz > Approved by: pjd >=20 > Modified: > stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) >=20 > Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vno= ps.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c M= on Jan 3 18:34:28 2011 (r216926) > +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c M= on Jan 3 19:23:43 2011 (r216927) > @@ -30,6 +30,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -4362,6 +4363,17 @@ zfs_freebsd_write(ap) > } */ *ap; > { > =20 > + if (ap->a_vp->v_type =3D=3D VREG && ap->a_uio->uio_td !=3D NULL) { > + PROC_LOCK(ap->a_uio->uio_td->td_proc); > + if (ap->a_uio->uio_offset + ap->a_uio->uio_resid > > + lim_cur(ap->a_uio->uio_td->td_proc, RLIMIT_FSIZE)) { > + psignal(ap->a_uio->uio_td->td_proc, SIGXFSZ); > + PROC_UNLOCK(ap->a_uio->uio_td->td_proc); > + return (EFBIG); > + } > + PROC_UNLOCK(ap->a_uio->uio_td->td_proc); > + } > + > return (zfs_write(ap->a_vp, ap->a_uio, ioflags(ap->a_ioflag), > ap->a_cred, NULL)); > } --8S1fMsFYqgBC+BN/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk0iL9kACgkQC3+MBN1Mb4jKoACdGV6OzjiTto3C8Y1KCGBgt9c9 GRoAoIc2Rnms/UmulPGcVoXreNOQ8VXR =Y6+g -----END PGP SIGNATURE----- --8S1fMsFYqgBC+BN/-- From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 4 15:09:42 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB31B106566C; Tue, 4 Jan 2011 15:09:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A0418FC12; Tue, 4 Jan 2011 15:09:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p04F9gjO039801; Tue, 4 Jan 2011 15:09:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p04F9grA039799; Tue, 4 Jan 2011 15:09:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101041509.p04F9grA039799@svn.freebsd.org> From: John Baldwin Date: Tue, 4 Jan 2011 15:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216957 - stable/8/usr.bin/gcore X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 15:09:42 -0000 Author: jhb Date: Tue Jan 4 15:09:42 2011 New Revision: 216957 URL: http://svn.freebsd.org/changeset/base/216957 Log: MFC 216769: Start sentences on a new line to ease life for translators. Tweak the wording in a few places. Modified: stable/8/usr.bin/gcore/gcore.1 Directory Properties: stable/8/usr.bin/gcore/ (props changed) Modified: stable/8/usr.bin/gcore/gcore.1 ============================================================================== --- stable/8/usr.bin/gcore/gcore.1 Tue Jan 4 14:49:54 2011 (r216956) +++ stable/8/usr.bin/gcore/gcore.1 Tue Jan 4 15:09:42 2011 (r216957) @@ -63,12 +63,13 @@ The following options are available: Write the core file to the specified file instead of .Dq Pa core. . .It Fl f -Dumps all the available segments, excluding only the malformed ones and -un-dumpable ones. Unlike the default invocation, it also dumps -device- and sglist-mapped areas that may invalidate the state of -some transactions. This flag must be used very carefully, when the -behavior of the application is fully understood and the fallouts can -be easily controlled. +Dumps all available segments, excluding only malformed and undumpable segments. +Unlike the default invocation, this flag dumps mappings of devices which +may invalidate the state of device transactions or trigger other unexpected +behavior. +As a result, this flag should only be used when the behavior of the +application and any devices it has mapped is fully understood and any side +effects can be controlled or tolerated. .It Fl s Stop the process while gathering the core image, and resume it when done. @@ -94,7 +95,7 @@ Because of the .Xr ptrace 2 usage .Nm -may not work with processes which are actively investigated with +may not work with processes which are actively being investigated with .Xr truss 1 or .Xr gdb 1 . From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 4 16:51:25 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33922106564A; Tue, 4 Jan 2011 16:51:25 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 219418FC12; Tue, 4 Jan 2011 16:51:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p04GpPJg046059; Tue, 4 Jan 2011 16:51:25 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p04GpO15046054; Tue, 4 Jan 2011 16:51:24 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201101041651.p04GpO15046054@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 4 Jan 2011 16:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216964 - stable/8/usr.bin/netstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 16:51:25 -0000 Author: gnn Date: Tue Jan 4 16:51:24 2011 New Revision: 216964 URL: http://svn.freebsd.org/changeset/base/216964 Log: MFC: 215434, 215724 Add new, per connection, statistics for TCP, including: Retransmitted Packets Zero Window Advertisements Out of Order Receives These statistics are available via the -T argument to netstat(1). Modified: stable/8/usr.bin/netstat/inet.c stable/8/usr.bin/netstat/main.c stable/8/usr.bin/netstat/netstat.1 stable/8/usr.bin/netstat/netstat.h Modified: stable/8/usr.bin/netstat/inet.c ============================================================================== --- stable/8/usr.bin/netstat/inet.c Tue Jan 4 16:29:07 2011 (r216963) +++ stable/8/usr.bin/netstat/inet.c Tue Jan 4 16:51:24 2011 (r216964) @@ -408,21 +408,29 @@ protopr(u_long off, const char *name, in if (Lflag) printf("%-5.5s %-14.14s %-22.22s\n", "Proto", "Listen", "Local Address"); - else { + if (Tflag) + printf((Aflag && !Wflag) ? + "%-5.5s %-6.6s %-6.6s %-6.6s %-18.18s %s\n" : + "%-5.5s %-6.6s %-6.6s %-6.6s %-22.22s %s\n", + "Proto", "Rexmit", "OOORcv", "0-win", + "Local Address", "Foreign Address"); + if (xflag) { + printf("%-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s ", + "R-MBUF", "S-MBUF", "R-CLUS", + "S-CLUS", "R-HIWA", "S-HIWA", + "R-LOWA", "S-LOWA", "R-BCNT", + "S-BCNT", "R-BMAX", "S-BMAX"); + printf("%7.7s %7.7s %7.7s %7.7s %7.7s %7.7s\n", + "rexmt", "persist", "keep", + "2msl", "delack", "rcvtime"); + } + if (!xflag && !Tflag) { printf((Aflag && !Wflag) ? "%-5.5s %-6.6s %-6.6s %-18.18s %-18.18s" : "%-5.5s %-6.6s %-6.6s %-22.22s %-22.22s", "Proto", "Recv-Q", "Send-Q", "Local Address", "Foreign Address"); - if (xflag) - printf("%-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %s\n", - "R-MBUF", "S-MBUF", "R-CLUS", - "S-CLUS", "R-HIWA", "S-HIWA", - "R-LOWA", "S-LOWA", "R-BCNT", - "S-BCNT", "R-BMAX", "S-BMAX", - "(state)"); - else - printf("(state)\n"); + printf("(state)\n"); } first = 0; } @@ -449,6 +457,10 @@ protopr(u_long off, const char *name, in snprintf(buf1, 15, "%d/%d/%d", so->so_qlen, so->so_incqlen, so->so_qlimit); printf("%-14.14s ", buf1); + } else if (Tflag) { + if (istcp) + printf("%6u %6u %6u ", tp->t_sndrexmitpack, + tp->t_rcvoopack, tp->t_sndzerowin); } else { printf("%6u %6u ", so->so_rcv.sb_cc, so->so_snd.sb_cc); } @@ -525,7 +537,7 @@ protopr(u_long off, const char *name, in so->so_rcv.sb_mbcnt, so->so_snd.sb_mbcnt, so->so_rcv.sb_mbmax, so->so_snd.sb_mbmax); } - if (istcp && !Lflag) { + if (istcp && !Lflag && !xflag && !Tflag) { if (tp->t_state < 0 || tp->t_state >= TCP_NSTATES) printf("%d", tp->t_state); else { Modified: stable/8/usr.bin/netstat/main.c ============================================================================== --- stable/8/usr.bin/netstat/main.c Tue Jan 4 16:29:07 2011 (r216963) +++ stable/8/usr.bin/netstat/main.c Tue Jan 4 16:51:24 2011 (r216964) @@ -340,6 +340,7 @@ int rflag; /* show routing tables (or r int sflag; /* show protocol statistics */ int tflag; /* show i/f watchdog timers */ int Wflag; /* wide display */ +int Tflag; /* TCP Information */ int xflag; /* extra information, includes all socket buffer info */ int zflag; /* zero stats */ @@ -359,7 +360,8 @@ main(int argc, char *argv[]) af = AF_UNSPEC; - while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:q:rSstuWw:xz")) != -1) + while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:Qq:rSTstuWw:xz")) + != -1) switch(ch) { case 'A': Aflag = 1; @@ -473,6 +475,9 @@ main(int argc, char *argv[]) interval = atoi(optarg); iflag = 1; break; + case 'T': + Tflag = 1; + break; case 'x': xflag = 1; break; @@ -512,6 +517,9 @@ main(int argc, char *argv[]) if (!live) setgid(getgid()); + if (xflag && Tflag) + errx(1, "-x and -T are incompatible, pick one."); + if (Bflag) { if (!live) usage(); @@ -782,7 +790,7 @@ static void usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", -"usage: netstat [-AaLnSWx] [-f protocol_family | -p protocol]\n" +"usage: netstat [-AaLnSTWx] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", " netstat -i | -I interface [-abdhntW] [-f address_family]\n" " [-M core] [-N system]", Modified: stable/8/usr.bin/netstat/netstat.1 ============================================================================== --- stable/8/usr.bin/netstat/netstat.1 Tue Jan 4 16:29:07 2011 (r216963) +++ stable/8/usr.bin/netstat/netstat.1 Tue Jan 4 16:51:24 2011 (r216964) @@ -49,7 +49,7 @@ depending on the options for the informa .It Xo .Bk -words .Nm -.Op Fl AaLnSWx +.Op Fl AaLnSTWx .Op Fl f Ar protocol_family | Fl p Ar protocol .Op Fl M Ar core .Op Fl N Ar system @@ -88,6 +88,10 @@ but show ports symbolically. If .Fl x is present display full socket buffer statistics for each internet socket. +When +.Fl T +is present, display information from the TCP control block, including +retransmits, out-of-order packets received, and zero-sized windows advertised. .It Xo .Bk -words .Nm Modified: stable/8/usr.bin/netstat/netstat.h ============================================================================== --- stable/8/usr.bin/netstat/netstat.h Tue Jan 4 16:29:07 2011 (r216963) +++ stable/8/usr.bin/netstat/netstat.h Tue Jan 4 16:51:24 2011 (r216964) @@ -51,6 +51,7 @@ extern int numeric_port; /* show ports n extern int rflag; /* show routing tables (or routing stats) */ extern int sflag; /* show protocol statistics */ extern int tflag; /* show i/f watchdog timers */ +extern int Tflag; /* show TCP control block info */ extern int Wflag; /* wide display */ extern int xflag; /* extended display, includes all socket buffer info */ extern int zflag; /* zero stats */ From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 4 17:18:54 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25CA6106566C; Tue, 4 Jan 2011 17:18:54 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1490A8FC12; Tue, 4 Jan 2011 17:18:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p04HIrJU048535; Tue, 4 Jan 2011 17:18:53 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p04HIrCa048532; Tue, 4 Jan 2011 17:18:53 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201101041718.p04HIrCa048532@svn.freebsd.org> From: Benedict Reuschling Date: Tue, 4 Jan 2011 17:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216966 - stable/8/share/man/man5 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 17:18:54 -0000 Author: bcr (doc committer) Date: Tue Jan 4 17:18:53 2011 New Revision: 216966 URL: http://svn.freebsd.org/changeset/base/216966 Log: MFC r211397: Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while translating these manual pages. Minor corrections by me. Submitted by: Nobuyuki Koganemaru Reminded by the following PR: docs/153615 Submitted by: Warren Block (wblock at wonkity dot com) Modified: stable/8/share/man/man5/mqueuefs.5 stable/8/share/man/man5/periodic.conf.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/mqueuefs.5 ============================================================================== --- stable/8/share/man/man5/mqueuefs.5 Tue Jan 4 17:06:03 2011 (r216965) +++ stable/8/share/man/man5/mqueuefs.5 Tue Jan 4 17:18:53 2011 (r216966) @@ -36,7 +36,7 @@ .Sh SYNOPSIS To link into kernel: .Pp -.D1 Cd "options P1003_1B_MQUEUE" +.Cd "options P1003_1B_MQUEUE" .Pp To load as a kernel loadable module: .Pp Modified: stable/8/share/man/man5/periodic.conf.5 ============================================================================== --- stable/8/share/man/man5/periodic.conf.5 Tue Jan 4 17:06:03 2011 (r216965) +++ stable/8/share/man/man5/periodic.conf.5 Tue Jan 4 17:18:53 2011 (r216966) @@ -629,7 +629,7 @@ The default value if no value is set is The same as .Va daily_scrub_zfs_default_threshold but specific to the pool -.Va Ns Ao Ar poolname Ac Ns . +.Ao Ar poolname Ac Ns . .It Va daily_local .Pq Vt str Set to a list of extra scripts that should be run after all other From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 4 18:27:01 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52017106564A; Tue, 4 Jan 2011 18:27:01 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 405C58FC15; Tue, 4 Jan 2011 18:27:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p04IR17s050417; Tue, 4 Jan 2011 18:27:01 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p04IR1Be050411; Tue, 4 Jan 2011 18:27:01 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201101041827.p04IR1Be050411@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 4 Jan 2011 18:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216968 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 18:27:01 -0000 Author: gnn Date: Tue Jan 4 18:27:00 2011 New Revision: 216968 URL: http://svn.freebsd.org/changeset/base/216968 Log: MFC: 215434, 215724 Add new, per connection, statistics for TCP, including: Retransmitted Packets Zero Window Advertisements Out of Order Receives These statistics are available via the -T argument to netstat(1). Modified: stable/8/sys/netinet/tcp.h stable/8/sys/netinet/tcp_output.c stable/8/sys/netinet/tcp_reass.c stable/8/sys/netinet/tcp_usrreq.c stable/8/sys/netinet/tcp_var.h Modified: stable/8/sys/netinet/tcp.h ============================================================================== --- stable/8/sys/netinet/tcp.h Tue Jan 4 17:27:17 2011 (r216967) +++ stable/8/sys/netinet/tcp.h Tue Jan 4 18:27:00 2011 (r216968) @@ -217,9 +217,12 @@ struct tcp_info { u_int32_t tcpi_snd_nxt; /* Next egress seqno */ u_int32_t tcpi_rcv_nxt; /* Next ingress seqno */ u_int32_t tcpi_toe_tid; /* HWTID for TOE endpoints */ + u_int32_t tcpi_snd_rexmitpack; /* Retransmitted packets */ + u_int32_t tcpi_rcv_ooopack; /* Out-of-order packets */ + u_int32_t tcpi_snd_zerowin; /* Zero-sized windows sent */ /* Padding to grow without breaking ABI. */ - u_int32_t __tcpi_pad[29]; /* Padding. */ + u_int32_t __tcpi_pad[26]; /* Padding. */ }; #endif Modified: stable/8/sys/netinet/tcp_output.c ============================================================================== --- stable/8/sys/netinet/tcp_output.c Tue Jan 4 17:27:17 2011 (r216967) +++ stable/8/sys/netinet/tcp_output.c Tue Jan 4 18:27:00 2011 (r216968) @@ -783,6 +783,7 @@ send: if ((tp->t_flags & TF_FORCEDATA) && len == 1) TCPSTAT_INC(tcps_sndprobe); else if (SEQ_LT(tp->snd_nxt, tp->snd_max) || sack_rxmit) { + tp->t_sndrexmitpack++; TCPSTAT_INC(tcps_sndrexmitpack); TCPSTAT_ADD(tcps_sndrexmitbyte, len); } else { @@ -1007,9 +1008,10 @@ send: * to read more data than can be buffered prior to transmitting on * the connection. */ - if (th->th_win == 0) + if (th->th_win == 0) { + tp->t_sndzerowin++; tp->t_flags |= TF_RXWIN0SENT; - else + } else tp->t_flags &= ~TF_RXWIN0SENT; if (SEQ_GT(tp->snd_up, tp->snd_nxt)) { th->th_urp = htons((u_short)(tp->snd_up - tp->snd_nxt)); Modified: stable/8/sys/netinet/tcp_reass.c ============================================================================== --- stable/8/sys/netinet/tcp_reass.c Tue Jan 4 17:27:17 2011 (r216967) +++ stable/8/sys/netinet/tcp_reass.c Tue Jan 4 18:27:00 2011 (r216968) @@ -266,6 +266,7 @@ tcp_reass(struct tcpcb *tp, struct tcphd th->th_seq += i; } } + tp->t_rcvoopack++; TCPSTAT_INC(tcps_rcvoopack); TCPSTAT_ADD(tcps_rcvoobyte, *tlenp); Modified: stable/8/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/8/sys/netinet/tcp_usrreq.c Tue Jan 4 17:27:17 2011 (r216967) +++ stable/8/sys/netinet/tcp_usrreq.c Tue Jan 4 18:27:00 2011 (r216968) @@ -1226,6 +1226,9 @@ tcp_fill_info(struct tcpcb *tp, struct t ti->tcpi_rcv_mss = tp->t_maxseg; if (tp->t_flags & TF_TOE) ti->tcpi_options |= TCPI_OPT_TOE; + ti->tcpi_snd_rexmitpack = tp->t_sndrexmitpack; + ti->tcpi_rcv_ooopack = tp->t_rcvoopack; + ti->tcpi_snd_zerowin = tp->t_sndzerowin; } /* Modified: stable/8/sys/netinet/tcp_var.h ============================================================================== --- stable/8/sys/netinet/tcp_var.h Tue Jan 4 17:27:17 2011 (r216967) +++ stable/8/sys/netinet/tcp_var.h Tue Jan 4 18:27:00 2011 (r216968) @@ -177,6 +177,7 @@ struct tcpcb { u_long snd_cwnd_prev; /* cwnd prior to retransmit */ u_long snd_ssthresh_prev; /* ssthresh prior to retransmit */ tcp_seq snd_recover_prev; /* snd_recover prior to retransmit */ + int t_sndzerowin; /* zero-window updates sent */ u_int t_badrxtwin; /* window for retransmit recovery */ u_char snd_limited; /* segments limited transmitted */ /* SACK related state */ @@ -193,6 +194,8 @@ struct tcpcb { u_int32_t rfbuf_ts; /* recv buffer autoscaling timestamp */ int rfbuf_cnt; /* recv buffer autoscaling byte count */ struct toe_usrreqs *t_tu; /* offload operations vector */ + int t_sndrexmitpack; /* retransmit packets sent */ + int t_rcvoopack; /* out-of-order packets received */ void *t_toe; /* TOE pcb pointer */ int t_bytes_acked; /* # bytes acked during current RTT */ From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 4 20:15:17 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D30E1065674; Tue, 4 Jan 2011 20:15:17 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BC388FC12; Tue, 4 Jan 2011 20:15:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p04KFHm0053644; Tue, 4 Jan 2011 20:15:17 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p04KFHwF053641; Tue, 4 Jan 2011 20:15:17 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201101042015.p04KFHwF053641@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 4 Jan 2011 20:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216974 - in stable/8/sys/dev/usb: . serial X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 20:15:17 -0000 Author: gavin Date: Tue Jan 4 20:15:16 2011 New Revision: 216974 URL: http://svn.freebsd.org/changeset/base/216974 Log: Merge r216045 from head: Support the Falcom Twist USB GSM/GPRS modem in uftdi(4) PR: usb/151862 Submitted by: Alessandro de Manzano Modified: stable/8/sys/dev/usb/serial/uftdi.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/8/sys/dev/usb/serial/uftdi.c Tue Jan 4 20:06:26 2011 (r216973) +++ stable/8/sys/dev/usb/serial/uftdi.c Tue Jan 4 20:15:16 2011 (r216974) @@ -220,6 +220,7 @@ static struct usb_device_id uftdi_devs[] UFTDI_DEV(ATMEL, STK541, 8U232AM), UFTDI_DEV(DRESDENELEKTRONIK, SENSORTERMINALBOARD, 8U232AM), UFTDI_DEV(DRESDENELEKTRONIK, WIRELESSHANDHELDTERMINAL, 8U232AM), + UFTDI_DEV(FALCOM, TWIST, 8U232AM), UFTDI_DEV(FTDI, GAMMASCOUT, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U100AX, SIO), UFTDI_DEV(FTDI, SERIAL_2232C, 8U232AM), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Tue Jan 4 20:06:26 2011 (r216973) +++ stable/8/sys/dev/usb/usbdevs Tue Jan 4 20:15:16 2011 (r216974) @@ -1561,6 +1561,9 @@ product ETEK 1COM 0x8007 Serial /* Extended Systems products */ product EXTENDED XTNDACCESS 0x0100 XTNDAccess IrDA +/* Falcom products */ +product FALCOM TWIST 0x0001 USB GSM/GPRS Modem + /* FEIYA products */ product FEIYA 5IN1 0x1132 5-in-1 Card Reader From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 4 21:51:13 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB35C10656A5; Tue, 4 Jan 2011 21:51:12 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from ns1temp.jnielsen.net (ns1temp.jnielsen.net [69.55.230.42]) by mx1.freebsd.org (Postfix) with ESMTP id C02698FC0A; Tue, 4 Jan 2011 21:51:12 +0000 (UTC) Received: from jnielsen.socialserve.com ([12.249.176.26]) (authenticated bits=0) by ns1temp.jnielsen.net (8.14.3/8.14.3) with ESMTP id p04LLH9A096166 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 4 Jan 2011 16:21:18 -0500 (EST) (envelope-from lists@jnielsen.net) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: John Nielsen In-Reply-To: <201101041651.p04GpO15046054@svn.freebsd.org> Date: Tue, 4 Jan 2011 16:21:12 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <394C0FD2-E197-4899-8868-DC761D3AFB03@jnielsen.net> References: <201101041651.p04GpO15046054@svn.freebsd.org> To: "George V. Neville-Neil" X-Mailer: Apple Mail (2.1082) X-DCC-sonic.net-Metrics: ns1temp.jnielsen.net; whitelist X-Virus-Scanned: clamav-milter 0.96.3 at ns1temp.jnielsen.net X-Virus-Status: Clean Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Dan Allen Subject: Re: svn commit: r216964 - stable/8/usr.bin/netstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 21:51:13 -0000 The build on -STABLE is broken for me at at least one other person today = and my guess is that this commit is to blame. My buildworld output: =3D=3D=3D> usr.bin/netstat (all) cc -O2 -pipe -march=3Dk6-3 -fno-strict-aliasing -DIPSEC -DSCTP = -DNETGRAPH -DNDEBUG -std=3Dgnu99 -fstack-protector -Wsystem-headers = -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes = -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized = -Wno-pointer-sign -c /usr/src/usr.bin/netstat/if.c cc -O2 -pipe -march=3Dk6-3 -fno-strict-aliasing -DIPSEC -DSCTP = -DNETGRAPH -DNDEBUG -std=3Dgnu99 -fstack-protector -Wsystem-headers = -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes = -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized = -Wno-pointer-sign -c /usr/src/usr.bin/netstat/inet.c /usr/src/usr.bin/netstat/inet.c: In function 'protopr': /usr/src/usr.bin/netstat/inet.c:462: error: 'struct tcpcb' has no member = named 't_sndrexmitpack' /usr/src/usr.bin/netstat/inet.c:463: error: 'struct tcpcb' has no member = named 't_rcvoopack' /usr/src/usr.bin/netstat/inet.c:463: error: 'struct tcpcb' has no member = named 't_sndzerowin' *** Error code 1 Stop in /usr/src/usr.bin/netstat. *** Error code 1 Stop in /usr/src/usr.bin. *** Error code 1 Stop in /usr/src. *** Error code 1 Stop in /usr/src. *** Error code 1 Stop in /usr/src. JN On Jan 4, 2011, at 11:51 AM, George V. Neville-Neil wrote: > Author: gnn > Date: Tue Jan 4 16:51:24 2011 > New Revision: 216964 > URL: http://svn.freebsd.org/changeset/base/216964 >=20 > Log: > MFC: 215434, 215724 >=20 > Add new, per connection, statistics for TCP, including: > Retransmitted Packets > Zero Window Advertisements > Out of Order Receives >=20 > These statistics are available via the -T argument to > netstat(1). >=20 > Modified: > stable/8/usr.bin/netstat/inet.c > stable/8/usr.bin/netstat/main.c > stable/8/usr.bin/netstat/netstat.1 > stable/8/usr.bin/netstat/netstat.h >=20 > Modified: stable/8/usr.bin/netstat/inet.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/8/usr.bin/netstat/inet.c Tue Jan 4 16:29:07 2011 = (r216963) > +++ stable/8/usr.bin/netstat/inet.c Tue Jan 4 16:51:24 2011 = (r216964) > @@ -408,21 +408,29 @@ protopr(u_long off, const char *name, in > if (Lflag) > printf("%-5.5s %-14.14s %-22.22s\n", > "Proto", "Listen", "Local Address"); > - else { > + if (Tflag)=20 > + printf((Aflag && !Wflag) ? > + "%-5.5s %-6.6s %-6.6s %-6.6s %-18.18s %s\n" = : > + "%-5.5s %-6.6s %-6.6s %-6.6s %-22.22s %s\n", > + "Proto", "Rexmit", "OOORcv", = "0-win", > + "Local Address", "Foreign Address"); > + if (xflag) { > + printf("%-6.6s %-6.6s %-6.6s %-6.6s = %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s ", > + "R-MBUF", "S-MBUF", "R-CLUS",=20 > + "S-CLUS", "R-HIWA", "S-HIWA",=20 > + "R-LOWA", "S-LOWA", "R-BCNT",=20 > + "S-BCNT", "R-BMAX", "S-BMAX"); > + printf("%7.7s %7.7s %7.7s %7.7s %7.7s = %7.7s\n", > + "rexmt", "persist", "keep", > + "2msl", "delack", "rcvtime"); > + } > + if (!xflag && !Tflag) { > printf((Aflag && !Wflag) ?=20 > "%-5.5s %-6.6s %-6.6s %-18.18s = %-18.18s" : > "%-5.5s %-6.6s %-6.6s %-22.22s = %-22.22s", > "Proto", "Recv-Q", "Send-Q", > "Local Address", "Foreign = Address"); > - if (xflag) > - printf("%-6.6s %-6.6s %-6.6s = %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %s\n", > - "R-MBUF", "S-MBUF", = "R-CLUS",=20 > - "S-CLUS", "R-HIWA", = "S-HIWA",=20 > - "R-LOWA", "S-LOWA", = "R-BCNT",=20 > - "S-BCNT", "R-BMAX", = "S-BMAX", > - "(state)"); > - else > - printf("(state)\n"); > + printf("(state)\n"); > } > first =3D 0; > } > @@ -449,6 +457,10 @@ protopr(u_long off, const char *name, in > snprintf(buf1, 15, "%d/%d/%d", so->so_qlen, > so->so_incqlen, so->so_qlimit); > printf("%-14.14s ", buf1); > + } else if (Tflag) { > + if (istcp) > + printf("%6u %6u %6u ", = tp->t_sndrexmitpack, > + tp->t_rcvoopack, = tp->t_sndzerowin); > } else { > printf("%6u %6u ", so->so_rcv.sb_cc, = so->so_snd.sb_cc); > } > @@ -525,7 +537,7 @@ protopr(u_long off, const char *name, in > so->so_rcv.sb_mbcnt, = so->so_snd.sb_mbcnt, > so->so_rcv.sb_mbmax, = so->so_snd.sb_mbmax); > } > - if (istcp && !Lflag) { > + if (istcp && !Lflag && !xflag && !Tflag) { > if (tp->t_state < 0 || tp->t_state >=3D = TCP_NSTATES) > printf("%d", tp->t_state); > else { >=20 > Modified: stable/8/usr.bin/netstat/main.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/8/usr.bin/netstat/main.c Tue Jan 4 16:29:07 2011 = (r216963) > +++ stable/8/usr.bin/netstat/main.c Tue Jan 4 16:51:24 2011 = (r216964) > @@ -340,6 +340,7 @@ int rflag; /* show routing tables = (or r > int sflag; /* show protocol statistics */ > int tflag; /* show i/f watchdog timers */ > int Wflag; /* wide display */ > +int Tflag; /* TCP Information */ > int xflag; /* extra information, includes all socket buffer = info */ > int zflag; /* zero stats */ >=20 > @@ -359,7 +360,8 @@ main(int argc, char *argv[]) >=20 > af =3D AF_UNSPEC; >=20 > - while ((ch =3D getopt(argc, argv, = "AaBbdf:ghI:iLlM:mN:np:q:rSstuWw:xz")) !=3D -1) > + while ((ch =3D getopt(argc, argv, = "AaBbdf:ghI:iLlM:mN:np:Qq:rSTstuWw:xz")) > + !=3D -1) > switch(ch) { > case 'A': > Aflag =3D 1; > @@ -473,6 +475,9 @@ main(int argc, char *argv[]) > interval =3D atoi(optarg); > iflag =3D 1; > break; > + case 'T': > + Tflag =3D 1; > + break; > case 'x': > xflag =3D 1; > break; > @@ -512,6 +517,9 @@ main(int argc, char *argv[]) > if (!live) > setgid(getgid()); >=20 > + if (xflag && Tflag)=20 > + errx(1, "-x and -T are incompatible, pick one."); > + > if (Bflag) { > if (!live) > usage(); > @@ -782,7 +790,7 @@ static void > usage(void) > { > (void)fprintf(stderr, = "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", > -"usage: netstat [-AaLnSWx] [-f protocol_family | -p protocol]\n" > +"usage: netstat [-AaLnSTWx] [-f protocol_family | -p protocol]\n" > " [-M core] [-N system]", > " netstat -i | -I interface [-abdhntW] [-f address_family]\n" > " [-M core] [-N system]", >=20 > Modified: stable/8/usr.bin/netstat/netstat.1 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/8/usr.bin/netstat/netstat.1 Tue Jan 4 16:29:07 2011 = (r216963) > +++ stable/8/usr.bin/netstat/netstat.1 Tue Jan 4 16:51:24 2011 = (r216964) > @@ -49,7 +49,7 @@ depending on the options for the informa > .It Xo > .Bk -words > .Nm > -.Op Fl AaLnSWx > +.Op Fl AaLnSTWx > .Op Fl f Ar protocol_family | Fl p Ar protocol > .Op Fl M Ar core > .Op Fl N Ar system > @@ -88,6 +88,10 @@ but show ports symbolically. > If > .Fl x > is present display full socket buffer statistics for each internet = socket. > +When > +.Fl T > +is present, display information from the TCP control block, including > +retransmits, out-of-order packets received, and zero-sized windows = advertised. > .It Xo > .Bk -words > .Nm >=20 > Modified: stable/8/usr.bin/netstat/netstat.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/8/usr.bin/netstat/netstat.h Tue Jan 4 16:29:07 2011 = (r216963) > +++ stable/8/usr.bin/netstat/netstat.h Tue Jan 4 16:51:24 2011 = (r216964) > @@ -51,6 +51,7 @@ extern int numeric_port; /* show ports n > extern int rflag; /* show routing tables (or routing stats) */ > extern int sflag; /* show protocol statistics */ > extern int tflag; /* show i/f watchdog timers */ > +extern int Tflag; /* show TCP control block info */ > extern int Wflag; /* wide display */ > extern int xflag; /* extended display, includes all socket buffer = info */ > extern int zflag; /* zero stats */ > _______________________________________________ > svn-src-stable-8@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > To unsubscribe, send any mail to = "svn-src-stable-8-unsubscribe@freebsd.org" >=20 From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 4 23:51:13 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2470C106566B; Tue, 4 Jan 2011 23:51:12 +0000 (UTC) (envelope-from gnn@freebsd.org) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id ADE288FC15; Tue, 4 Jan 2011 23:51:12 +0000 (UTC) Received: from smtp.hudson-trading.com ([209.249.190.9] helo=[10.16.241.134]) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1PaEsZ-00024i-I0; Tue, 04 Jan 2011 16:57:19 -0500 Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: George Neville-Neil In-Reply-To: <394C0FD2-E197-4899-8868-DC761D3AFB03@jnielsen.net> Date: Tue, 4 Jan 2011 16:57:18 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <2EDDA230-13BE-45E0-A786-7376124E9626@freebsd.org> References: <201101041651.p04GpO15046054@svn.freebsd.org> <394C0FD2-E197-4899-8868-DC761D3AFB03@jnielsen.net> To: John Nielsen X-Mailer: Apple Mail (2.1082) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - freebsd.org Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, Dan Allen Subject: Re: svn commit: r216964 - stable/8/usr.bin/netstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 23:51:13 -0000 On Jan 4, 2011, at 16:21 , John Nielsen wrote: > The build on -STABLE is broken for me at at least one other person = today and my guess is that this commit is to blame. My buildworld = output: >=20 > =3D=3D=3D> usr.bin/netstat (all) > cc -O2 -pipe -march=3Dk6-3 -fno-strict-aliasing -DIPSEC -DSCTP = -DNETGRAPH -DNDEBUG -std=3Dgnu99 -fstack-protector -Wsystem-headers = -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes = -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized = -Wno-pointer-sign -c /usr/src/usr.bin/netstat/if.c > cc -O2 -pipe -march=3Dk6-3 -fno-strict-aliasing -DIPSEC -DSCTP = -DNETGRAPH -DNDEBUG -std=3Dgnu99 -fstack-protector -Wsystem-headers = -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes = -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized = -Wno-pointer-sign -c /usr/src/usr.bin/netstat/inet.c > /usr/src/usr.bin/netstat/inet.c: In function 'protopr': > /usr/src/usr.bin/netstat/inet.c:462: error: 'struct tcpcb' has no = member named 't_sndrexmitpack' > /usr/src/usr.bin/netstat/inet.c:463: error: 'struct tcpcb' has no = member named 't_rcvoopack' > /usr/src/usr.bin/netstat/inet.c:463: error: 'struct tcpcb' has no = member named 't_sndzerowin' > *** Error code 1 >=20 > Stop in /usr/src/usr.bin/netstat. > *** Error code 1 >=20 > Stop in /usr/src/usr.bin. > *** Error code 1 >=20 > Stop in /usr/src. > *** Error code 1 >=20 > Stop in /usr/src. > *** Error code 1 >=20 > Stop in /usr/src. I am fixing this at the moment. Apologies. Dunce Cap To, George From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 4 23:56:27 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F33B106566B; Tue, 4 Jan 2011 23:56:27 +0000 (UTC) (envelope-from luchesar.iliev@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 204618FC0A; Tue, 4 Jan 2011 23:56:25 +0000 (UTC) Received: by fxm16 with SMTP id 16so14458021fxm.13 for ; Tue, 04 Jan 2011 15:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id :disposition-notification-to:date:from:organization:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type:content-transfer-encoding; bh=KPvl4yrW74iOWWRR0srKy9FJsXMQa3U3NJ6D8UgPzlI=; b=ZiQdWTH3QvX/zBvDc+xXuBnWtoDjJZ2kahQaPPy+nkbXDeC4urAm3zlXqOs3WO+Di6 hs1DAYDpF8pvo/lijj3kHEWQKP//hFJnUe2oFdsE4Ijw6AT4RMKNX51A46ALfCpcm6D4 +TAN6sMzNr854xl9DEz0YDemW7Ta+pre0oj20= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:disposition-notification-to:date:from:organization :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=jv7lfj9OTMm63KkEE4JsSQVTprVl/p6A/NlgzRqOXy9m1CZtHQYn0OnsYB94zrQcrd 4gDASy4pale98rDq5ZgAd/uccaKPi8tRVHXYgPNwTozxIuFtdpzX1nRBpTJacexvF7wr 9hPe5KsFUCpAH2jn3xDQ3X1QF4vQuHZXQbPS0= Received: by 10.223.72.197 with SMTP id n5mr4931253faj.8.1294183633938; Tue, 04 Jan 2011 15:27:13 -0800 (PST) Received: from [79.124.93.41] ([79.124.93.41]) by mx.google.com with ESMTPS id n1sm5300530fam.40.2011.01.04.15.27.11 (version=SSLv3 cipher=RC4-MD5); Tue, 04 Jan 2011 15:27:12 -0800 (PST) Message-ID: <4D23ACCE.6070602@gmail.com> Date: Wed, 05 Jan 2011 01:27:10 +0200 From: "Luchesar V. ILIEV" Organization: Ideaconsult Ltd. User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101229 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: John Nielsen References: <201101041651.p04GpO15046054@svn.freebsd.org> <394C0FD2-E197-4899-8868-DC761D3AFB03@jnielsen.net> In-Reply-To: <394C0FD2-E197-4899-8868-DC761D3AFB03@jnielsen.net> X-Enigmail-Version: 1.1.2 OpenPGP: id=9A1FEEFF; url=https://cert.acad.bg/pgp-keys/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, "George V. Neville-Neil" , svn-src-stable-8@freebsd.org, Dan Allen Subject: Re: svn commit: r216964 - stable/8/usr.bin/netstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 23:56:27 -0000 On 01/04/11 23:21, John Nielsen wrote: > The build on -STABLE is broken for me at at least one other person today and my guess is that this commit is to blame. My buildworld output: > > ===> usr.bin/netstat (all) > cc -O2 -pipe -march=k6-3 -fno-strict-aliasing -DIPSEC -DSCTP -DNETGRAPH -DNDEBUG -std=gnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /usr/src/usr.bin/netstat/if.c > cc -O2 -pipe -march=k6-3 -fno-strict-aliasing -DIPSEC -DSCTP -DNETGRAPH -DNDEBUG -std=gnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /usr/src/usr.bin/netstat/inet.c > /usr/src/usr.bin/netstat/inet.c: In function 'protopr': > /usr/src/usr.bin/netstat/inet.c:462: error: 'struct tcpcb' has no member named 't_sndrexmitpack' > /usr/src/usr.bin/netstat/inet.c:463: error: 'struct tcpcb' has no member named 't_rcvoopack' > /usr/src/usr.bin/netstat/inet.c:463: error: 'struct tcpcb' has no member named 't_sndzerowin' > *** Error code 1 > > Stop in /usr/src/usr.bin/netstat. > *** Error code 1 > > Stop in /usr/src/usr.bin. > *** Error code 1 > > Stop in /usr/src. > *** Error code 1 > > Stop in /usr/src. > *** Error code 1 > > Stop in /usr/src. > > > JN > > <...snip..> > It seems to me that you need to update your src tree, as the variables mentioned in the error message were (later) defined in r216968: http://svn.freebsd.org/viewvc/base?view=revision&revision=216968 specifically http://svn.freebsd.org/viewvc/base/stable/8/sys/netinet/tcp_var.h?r1=214860&r2=216968&pathrev=216968 Hope that helps, Luchesar From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 00:09:46 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24CE7106566B; Wed, 5 Jan 2011 00:09:46 +0000 (UTC) (envelope-from luchesar.iliev@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 030328FC18; Wed, 5 Jan 2011 00:09:44 +0000 (UTC) Received: by fxm16 with SMTP id 16so14465018fxm.13 for ; Tue, 04 Jan 2011 16:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id :disposition-notification-to:date:from:organization:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type:content-transfer-encoding; bh=zzxPz3GvcjrY8SnFD+eTrV6bhcjAdUX+jDC/yFHpkcU=; b=jDW3Iztg9qgJIpB4KUBqc774IHzoHv34eMv1/KnbrJRE7BltNyEEa56DRjQc2haTn/ ckggaYwQxUoTYXp2oSP6RDMOnuw4bMcrnSw8RRq5LKAVcCUWXZPfP3qDLQ2sLc3rbP/r /DzCuXz5xVzWDxOoslzjHlyzQe9tILw50lgCA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:disposition-notification-to:date:from:organization :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=pnSIZxJU5BnKa1+7soxZrNc3QOEkNwvN9iY9p5oX4fZtZ8zTgYmltuys6gRhMQQW1k PyXNwI/83CNp+2Rb1rs6DzczomQvrf3nN82yryN1eSs1/BdjCyswfD3uIWsHGXqQGF6X pPzv5vqc6+ngjpTSPn1moDLlFr1pJbG8i3YfE= Received: by 10.223.104.145 with SMTP id p17mr731816fao.105.1294186183914; Tue, 04 Jan 2011 16:09:43 -0800 (PST) Received: from [79.124.93.41] ([79.124.93.41]) by mx.google.com with ESMTPS id 5sm5331883fak.47.2011.01.04.16.09.42 (version=SSLv3 cipher=RC4-MD5); Tue, 04 Jan 2011 16:09:43 -0800 (PST) Message-ID: <4D23B6C5.7000808@gmail.com> Date: Wed, 05 Jan 2011 02:09:41 +0200 From: "Luchesar V. ILIEV" Organization: Ideaconsult Ltd. User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101229 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: George Neville-Neil References: <201101041651.p04GpO15046054@svn.freebsd.org> <394C0FD2-E197-4899-8868-DC761D3AFB03@jnielsen.net> <2EDDA230-13BE-45E0-A786-7376124E9626@freebsd.org> In-Reply-To: <2EDDA230-13BE-45E0-A786-7376124E9626@freebsd.org> X-Enigmail-Version: 1.1.2 OpenPGP: id=9A1FEEFF; url=https://cert.acad.bg/pgp-keys/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, John Nielsen , svn-src-stable@freebsd.org, Dan Allen , svn-src-stable-8@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r216964 - stable/8/usr.bin/netstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 00:09:46 -0000 On 01/04/11 23:57, George Neville-Neil wrote: > > On Jan 4, 2011, at 16:21 , John Nielsen wrote: > >> The build on -STABLE is broken for me at at least one other person today and my guess is that this commit is to blame. My buildworld output: >> >> ===> usr.bin/netstat (all) >> cc -O2 -pipe -march=k6-3 -fno-strict-aliasing -DIPSEC -DSCTP -DNETGRAPH -DNDEBUG -std=gnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /usr/src/usr.bin/netstat/if.c >> cc -O2 -pipe -march=k6-3 -fno-strict-aliasing -DIPSEC -DSCTP -DNETGRAPH -DNDEBUG -std=gnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /usr/src/usr.bin/netstat/inet.c >> /usr/src/usr.bin/netstat/inet.c: In function 'protopr': >> /usr/src/usr.bin/netstat/inet.c:462: error: 'struct tcpcb' has no member named 't_sndrexmitpack' >> /usr/src/usr.bin/netstat/inet.c:463: error: 'struct tcpcb' has no member named 't_rcvoopack' >> /usr/src/usr.bin/netstat/inet.c:463: error: 'struct tcpcb' has no member named 't_sndzerowin' >> *** Error code 1 >> >> Stop in /usr/src/usr.bin/netstat. >> *** Error code 1 >> >> Stop in /usr/src/usr.bin. >> *** Error code 1 >> >> Stop in /usr/src. >> *** Error code 1 >> >> Stop in /usr/src. >> *** Error code 1 >> >> Stop in /usr/src. > > I am fixing this at the moment. > > Apologies. > > Dunce Cap To, > George Just to confirm that stable/8 builds fine at r216974. Thanks, Luchesar P.S. Sorry for my previous attempt to explain the problem, but for some reason I got this mail just a few minutes ago. From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 11:29:07 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A957106566B; Wed, 5 Jan 2011 11:29:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E1F78FC12; Wed, 5 Jan 2011 11:29:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05BT72v076166; Wed, 5 Jan 2011 11:29:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05BT7kM076164; Wed, 5 Jan 2011 11:29:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101051129.p05BT7kM076164@svn.freebsd.org> From: Marius Strobl Date: Wed, 5 Jan 2011 11:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216989 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 11:29:07 -0000 Author: marius Date: Wed Jan 5 11:29:07 2011 New Revision: 216989 URL: http://svn.freebsd.org/changeset/base/216989 Log: MFC: r216891 Extend the section in which interrupts are disabled in the TLB demap functions, otherwise if we get preempted after checking whether a certain pmap is active on the current CPU but before disabling interrupts we might operate on an outdated state as the pmap might have been deactivated in the meantime. As the same issue may arises when the TLB demap function is interrupted by a TLB demap IPI, just entering a critical section before the check isn't sufficient so we have to fully disable interrupts instead. Modified: stable/8/sys/sparc64/sparc64/tlb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/sparc64/tlb.c ============================================================================== --- stable/8/sys/sparc64/sparc64/tlb.c Wed Jan 5 09:58:41 2011 (r216988) +++ stable/8/sys/sparc64/sparc64/tlb.c Wed Jan 5 11:29:07 2011 (r216989) @@ -80,15 +80,15 @@ tlb_context_demap(struct pmap *pm) */ PMAP_STATS_INC(tlb_ncontext_demap); cookie = ipi_tlb_context_demap(pm); + s = intr_disable(); if (pm->pm_active & PCPU_GET(cpumask)) { KASSERT(pm->pm_context[curcpu] != -1, ("tlb_context_demap: inactive pmap?")); - s = intr_disable(); stxa(TLB_DEMAP_PRIMARY | TLB_DEMAP_CONTEXT, ASI_DMMU_DEMAP, 0); stxa(TLB_DEMAP_PRIMARY | TLB_DEMAP_CONTEXT, ASI_IMMU_DEMAP, 0); flush(KERNBASE); - intr_restore(s); } + intr_restore(s); ipi_wait(cookie); } @@ -101,6 +101,7 @@ tlb_page_demap(struct pmap *pm, vm_offse PMAP_STATS_INC(tlb_npage_demap); cookie = ipi_tlb_page_demap(pm, va); + s = intr_disable(); if (pm->pm_active & PCPU_GET(cpumask)) { KASSERT(pm->pm_context[curcpu] != -1, ("tlb_page_demap: inactive pmap?")); @@ -109,12 +110,11 @@ tlb_page_demap(struct pmap *pm, vm_offse else flags = TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE; - s = intr_disable(); stxa(TLB_DEMAP_VA(va) | flags, ASI_DMMU_DEMAP, 0); stxa(TLB_DEMAP_VA(va) | flags, ASI_IMMU_DEMAP, 0); flush(KERNBASE); - intr_restore(s); } + intr_restore(s); ipi_wait(cookie); } @@ -128,6 +128,7 @@ tlb_range_demap(struct pmap *pm, vm_offs PMAP_STATS_INC(tlb_nrange_demap); cookie = ipi_tlb_range_demap(pm, start, end); + s = intr_disable(); if (pm->pm_active & PCPU_GET(cpumask)) { KASSERT(pm->pm_context[curcpu] != -1, ("tlb_range_demap: inactive pmap?")); @@ -136,13 +137,12 @@ tlb_range_demap(struct pmap *pm, vm_offs else flags = TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE; - s = intr_disable(); for (va = start; va < end; va += PAGE_SIZE) { stxa(TLB_DEMAP_VA(va) | flags, ASI_DMMU_DEMAP, 0); stxa(TLB_DEMAP_VA(va) | flags, ASI_IMMU_DEMAP, 0); flush(KERNBASE); } - intr_restore(s); } + intr_restore(s); ipi_wait(cookie); } From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 11:43:18 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B2B7106566B; Wed, 5 Jan 2011 11:43:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFF1E8FC17; Wed, 5 Jan 2011 11:43:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05BhHXd076554; Wed, 5 Jan 2011 11:43:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05BhHB5076547; Wed, 5 Jan 2011 11:43:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101051143.p05BhHB5076547@svn.freebsd.org> From: Marius Strobl Date: Wed, 5 Jan 2011 11:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216991 - stable/8/sys/dev/bge X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 11:43:18 -0000 Author: marius Date: Wed Jan 5 11:43:17 2011 New Revision: 216991 URL: http://svn.freebsd.org/changeset/base/216991 Log: MFC: r216085 - Remove the remaining support for older (in this case pre-7.0-RELEASE) versions of FreeBSD. In fact we are already missing a lot of conditional code necessary to support older versions of FreeBSD, including alternatives for vital functionality not yet provided by the respective subsystem back then (see for example r199663). So this change shouldn't actually break this driver on versions of FreeBSD that were supported before. Besides, this driver also isn't maintained as an multi-release version outside of the main repository, so removing the conditional code shouldn't be a problem in that regard either. - Sprinkle some more const on tables. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Wed Jan 5 11:29:10 2011 (r216990) +++ stable/8/sys/dev/bge/if_bge.c Wed Jan 5 11:43:17 2011 (r216991) @@ -139,7 +139,7 @@ MODULE_DEPEND(bge, miibus, 1, 1, 1); static const struct bge_type { uint16_t bge_vid; uint16_t bge_did; -} bge_devs[] = { +} const bge_devs[] = { { ALTEON_VENDORID, ALTEON_DEVICEID_BCM5700 }, { ALTEON_VENDORID, ALTEON_DEVICEID_BCM5701 }, @@ -232,7 +232,7 @@ static const struct bge_type { static const struct bge_vendor { uint16_t v_id; const char *v_name; -} bge_vendors[] = { +} const bge_vendors[] = { { ALTEON_VENDORID, "Alteon" }, { ALTIMA_VENDORID, "Altima" }, { APPLE_VENDORID, "Apple" }, @@ -247,7 +247,7 @@ static const struct bge_vendor { static const struct bge_revision { uint32_t br_chipid; const char *br_name; -} bge_revisions[] = { +} const bge_revisions[] = { { BGE_CHIPID_BCM5700_A0, "BCM5700 A0" }, { BGE_CHIPID_BCM5700_A1, "BCM5700 A1" }, { BGE_CHIPID_BCM5700_B0, "BCM5700 B0" }, @@ -317,7 +317,7 @@ static const struct bge_revision { * Some defaults for major revisions, so that newer steppings * that we don't know about have a shot at working. */ -static const struct bge_revision bge_majorrevs[] = { +static const struct bge_revision const bge_majorrevs[] = { { BGE_ASICREV_BCM5700, "unknown BCM5700" }, { BGE_ASICREV_BCM5701, "unknown BCM5701" }, { BGE_ASICREV_BCM5703, "unknown BCM5703" }, @@ -2143,20 +2143,21 @@ bge_lookup_vendor(uint16_t vid) static int bge_probe(device_t dev) { - const struct bge_type *t = bge_devs; + char buf[96]; + char model[64]; + const struct bge_revision *br; + const char *pname; struct bge_softc *sc = device_get_softc(dev); - uint16_t vid, did; + const struct bge_type *t = bge_devs; + const struct bge_vendor *v; + uint32_t id; + uint16_t did, vid; sc->bge_dev = dev; vid = pci_get_vendor(dev); did = pci_get_device(dev); while(t->bge_vid != 0) { if ((vid == t->bge_vid) && (did == t->bge_did)) { - char model[64], buf[96]; - const struct bge_revision *br; - const struct bge_vendor *v; - uint32_t id; - id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> BGE_PCIMISCCTL_ASICREV_SHIFT; if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) { @@ -2177,20 +2178,13 @@ bge_probe(device_t dev) } br = bge_lookup_rev(id); v = bge_lookup_vendor(vid); - { -#if __FreeBSD_version > 700024 - const char *pname; - - if (bge_has_eaddr(sc) && - pci_get_vpd_ident(dev, &pname) == 0) - snprintf(model, 64, "%s", pname); - else -#endif - snprintf(model, 64, "%s %s", - v->v_name, - br != NULL ? br->br_name : - "NetXtreme Ethernet Controller"); - } + if (bge_has_eaddr(sc) && + pci_get_vpd_ident(dev, &pname) == 0) + snprintf(model, 64, "%s", pname); + else + snprintf(model, 64, "%s %s", v->v_name, + br != NULL ? br->br_name : + "NetXtreme Ethernet Controller"); snprintf(buf, 96, "%s, %sASIC rev. %#08x", model, br != NULL ? "" : "unknown ", id); device_set_desc_copy(dev, buf); @@ -3167,7 +3161,6 @@ again: /* * Hookup IRQ last. */ -#if __FreeBSD_version > 700030 if (BGE_IS_5755_PLUS(sc) && sc->bge_flags & BGE_FLAG_MSI) { /* Take advantage of single-shot MSI. */ CSR_WRITE_4(sc, BGE_MSI_MODE, CSR_READ_4(sc, BGE_MSI_MODE) & @@ -3191,10 +3184,6 @@ again: error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, NULL, bge_intr, sc, &sc->bge_intrhand); -#else - error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, - bge_intr, sc, &sc->bge_intrhand); -#endif if (error) { bge_detach(dev); @@ -3643,14 +3632,8 @@ bge_rxeof(struct bge_softc *sc, uint16_t * attach that information to the packet. */ if (have_tag) { -#if __FreeBSD_version > 700022 m->m_pkthdr.ether_vtag = vlan_tag; m->m_flags |= M_VLANTAG; -#else - VLAN_INPUT_TAG_NEW(ifp, m, vlan_tag); - if (m == NULL) - continue; -#endif } if (holdlck != 0) { @@ -4456,21 +4439,10 @@ bge_encap(struct bge_softc *sc, struct m bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, map, BUS_DMASYNC_PREWRITE); -#if __FreeBSD_version > 700022 if (m->m_flags & M_VLANTAG) { csum_flags |= BGE_TXBDFLAG_VLAN_TAG; vlan_tag = m->m_pkthdr.ether_vtag; } -#else - { - struct m_tag *mtag; - - if ((mtag = VLAN_OUTPUT_TAG(sc->bge_ifp, m)) != NULL) { - csum_flags |= BGE_TXBDFLAG_VLAN_TAG; - vlan_tag = VLAN_TAG_VALUE(mtag); - } - } -#endif for (i = 0; ; i++) { d = &sc->bge_ldata.bge_tx_ring[idx]; d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 11:46:17 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1FAC106566B; Wed, 5 Jan 2011 11:46:17 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C073E8FC0A; Wed, 5 Jan 2011 11:46:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05BkH5F076720; Wed, 5 Jan 2011 11:46:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05BkHYs076718; Wed, 5 Jan 2011 11:46:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101051146.p05BkHYs076718@svn.freebsd.org> From: Marius Strobl Date: Wed, 5 Jan 2011 11:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216993 - stable/8/sys/dev/mii X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 11:46:17 -0000 Author: marius Date: Wed Jan 5 11:46:17 2011 New Revision: 216993 URL: http://svn.freebsd.org/changeset/base/216993 Log: MFC: r216623 - Add a comment regarding the fact that as documented in the datasheet manual 1000BASE-T modes of DP83865 only work together with other National Semiconductor PHYs. - Spell 10BASE-T correctly - Remove some redundant braces. Modified: stable/8/sys/dev/mii/nsgphy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mii/nsgphy.c ============================================================================== --- stable/8/sys/dev/mii/nsgphy.c Wed Jan 5 11:43:17 2011 (r216992) +++ stable/8/sys/dev/mii/nsgphy.c Wed Jan 5 11:46:17 2011 (r216993) @@ -140,11 +140,15 @@ nsgphy_attach(device_t dev) mii_phy_reset(sc); /* - * NB: the PHY has the 10baseT BMSR bits hard-wired to 0, - * even though it supports 10baseT. + * NB: the PHY has the 10BASE-T BMSR bits hard-wired to 0, + * even though it supports 10BASE-T. */ sc->mii_capabilities = (PHY_READ(sc, MII_BMSR) | - (BMSR_10TFDX | BMSR_10THDX)) & ma->mii_capmask; + BMSR_10TFDX | BMSR_10THDX) & ma->mii_capmask; + /* + * Note that as documented manual 1000BASE-T modes of DP83865 only + * work together with other National Semiconductor PHYs. + */ if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 12:05:27 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF04F106566B; Wed, 5 Jan 2011 12:05:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82A8E8FC12; Wed, 5 Jan 2011 12:05:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05C5RD9077272; Wed, 5 Jan 2011 12:05:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05C5Rsg077269; Wed, 5 Jan 2011 12:05:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101051205.p05C5Rsg077269@svn.freebsd.org> From: Marius Strobl Date: Wed, 5 Jan 2011 12:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216996 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 12:05:27 -0000 Author: marius Date: Wed Jan 5 12:05:27 2011 New Revision: 216996 URL: http://svn.freebsd.org/changeset/base/216996 Log: MFC: r216628 Extend the hack of r182730 to trick GAS/GCC into compiling access to STICK/STICK_COMPARE independently of the selected instruction set by TICK_COMPARE so tick.c once again can be compiled with gcc -mcpu=v9 for reference purposes. Modified: stable/8/sys/sparc64/include/cpufunc.h stable/8/sys/sparc64/sparc64/tick.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/include/cpufunc.h ============================================================================== --- stable/8/sys/sparc64/include/cpufunc.h Wed Jan 5 11:49:23 2011 (r216995) +++ stable/8/sys/sparc64/include/cpufunc.h Wed Jan 5 12:05:27 2011 (r216996) @@ -174,11 +174,13 @@ int fasword32(u_long asi, void *addr, ui } while (0) /* - * Trick GAS/GCC into compiling access to STICK/STICK_COMPARE independently + * Trick GAS/GCC into compiling access to TICK/(S)TICK_COMPARE independently * of the selected instruction set. */ +#define rdtickcmpr() rd(asr23) #define rdstick() rd(asr24) #define rdstickcmpr() rd(asr25) +#define wrtickcmpr(val, xor) wr(asr23, (val), (xor)) #define wrstick(val, xor) wr(asr24, (val), (xor)) #define wrstickcmpr(val, xor) wr(asr25, (val), (xor)) @@ -191,7 +193,7 @@ int fasword32(u_long asi, void *addr, ui * aligned to a quadword boundary in order to ensure that I$ misses won't * split them up. */ -#define wrtickcmpr(val, xor) ({ \ +#define wrtickcmpr_bbwar(val, xor) ({ \ __asm __volatile( \ " ba,pt %%xcc, 1f ; " \ " nop ; " \ Modified: stable/8/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/8/sys/sparc64/sparc64/tick.c Wed Jan 5 11:49:23 2011 (r216995) +++ stable/8/sys/sparc64/sparc64/tick.c Wed Jan 5 12:05:27 2011 (r216996) @@ -222,7 +222,7 @@ tick_hardclock(struct trapframe *tf) adj = PCPU_GET(tickadj); s = intr_disable(); tick = rd(tick); - wr(tick_cmpr, tick + tick_increment - adj, 0); + wrtickcmpr(tick + tick_increment - adj, 0); intr_restore(s); tick_hardclock_common(tf, tick, adj); critical_exit(); @@ -238,7 +238,7 @@ tick_hardclock_bbwar(struct trapframe *t adj = PCPU_GET(tickadj); s = intr_disable(); tick = rd(tick); - wrtickcmpr(tick + tick_increment - adj, 0); + wrtickcmpr_bbwar(tick + tick_increment - adj, 0); intr_restore(s); tick_hardclock_common(tf, tick, adj); critical_exit(); From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 12:20:54 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA1F2106564A; Wed, 5 Jan 2011 12:20:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC0EF8FC08; Wed, 5 Jan 2011 12:20:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05CKrjQ077762; Wed, 5 Jan 2011 12:20:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05CKrQ1077760; Wed, 5 Jan 2011 12:20:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101051220.p05CKrQ1077760@svn.freebsd.org> From: Marius Strobl Date: Wed, 5 Jan 2011 12:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216998 - stable/8/sys/sparc64/include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 12:20:54 -0000 Author: marius Date: Wed Jan 5 12:20:53 2011 New Revision: 216998 URL: http://svn.freebsd.org/changeset/base/216998 Log: MFC: r216801 Rename the "xor" parameter to "xorval" as the former is a reserved keyword in C++. Submitted by: gahr Modified: stable/8/sys/sparc64/include/cpufunc.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/include/cpufunc.h ============================================================================== --- stable/8/sys/sparc64/include/cpufunc.h Wed Jan 5 12:05:31 2011 (r216997) +++ stable/8/sys/sparc64/include/cpufunc.h Wed Jan 5 12:20:53 2011 (r216998) @@ -157,9 +157,9 @@ int fasword32(u_long asi, void *addr, ui __sr; \ }) -#define wr(name, val, xor) do { \ +#define wr(name, val, xorval) do { \ __asm __volatile("wr %0, %1, %%" #name \ - : : "r" (val), "rI" (xor)); \ + : : "r" (val), "rI" (xorval)); \ } while (0) #define rdpr(name) ({ \ @@ -168,24 +168,24 @@ int fasword32(u_long asi, void *addr, ui __pr; \ }) -#define wrpr(name, val, xor) do { \ +#define wrpr(name, val, xorval) do { \ __asm __volatile("wrpr %0, %1, %%" #name \ - : : "r" (val), "rI" (xor)); \ + : : "r" (val), "rI" (xorval)); \ } while (0) /* * Trick GAS/GCC into compiling access to TICK/(S)TICK_COMPARE independently * of the selected instruction set. */ -#define rdtickcmpr() rd(asr23) -#define rdstick() rd(asr24) -#define rdstickcmpr() rd(asr25) -#define wrtickcmpr(val, xor) wr(asr23, (val), (xor)) -#define wrstick(val, xor) wr(asr24, (val), (xor)) -#define wrstickcmpr(val, xor) wr(asr25, (val), (xor)) +#define rdtickcmpr() rd(asr23) +#define rdstick() rd(asr24) +#define rdstickcmpr() rd(asr25) +#define wrtickcmpr(val, xorval) wr(asr23, (val), (xorval)) +#define wrstick(val, xorval) wr(asr24, (val), (xorval)) +#define wrstickcmpr(val, xorval) wr(asr25, (val), (xorval)) /* - * Macro intended to be used instead of wr(asr23, val, xor) for writing to + * Macro intended to be used instead of wr(asr23, val, xorval) for writing to * the TICK_COMPARE register in order to avoid a bug in BlackBird CPUs that * can cause these writes to fail under certain condidtions which in turn * causes the hardclock to stop. The workaround is to read the TICK_COMPARE @@ -193,14 +193,14 @@ int fasword32(u_long asi, void *addr, ui * aligned to a quadword boundary in order to ensure that I$ misses won't * split them up. */ -#define wrtickcmpr_bbwar(val, xor) ({ \ +#define wrtickcmpr_bbwar(val, xorval) ({ \ __asm __volatile( \ " ba,pt %%xcc, 1f ; " \ " nop ; " \ " .align 128 ; " \ "1: wr %0, %1, %%asr23 ; " \ " rd %%asr23, %%g0 ; " \ - : : "r" (val), "rI" (xor)); \ + : : "r" (val), "rI" (xorval)); \ }) static __inline void From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 12:27:53 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 521EA106564A; Wed, 5 Jan 2011 12:27:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FE2A8FC12; Wed, 5 Jan 2011 12:27:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05CRrMG078034; Wed, 5 Jan 2011 12:27:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05CRrIi078031; Wed, 5 Jan 2011 12:27:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101051227.p05CRrIi078031@svn.freebsd.org> From: Marius Strobl Date: Wed, 5 Jan 2011 12:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217000 - in stable/8/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 12:27:53 -0000 Author: marius Date: Wed Jan 5 12:27:52 2011 New Revision: 217000 URL: http://svn.freebsd.org/changeset/base/217000 Log: MFC: r216802 - Move the macros for generating load and store instructions to asmacros.h so they can be shared by different source files and extend them by a variant for atomic compare and swap. - Consistently use EMPTY. Modified: stable/8/sys/sparc64/include/asmacros.h stable/8/sys/sparc64/sparc64/support.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/include/asmacros.h ============================================================================== --- stable/8/sys/sparc64/include/asmacros.h Wed Jan 5 12:20:55 2011 (r216999) +++ stable/8/sys/sparc64/include/asmacros.h Wed Jan 5 12:27:52 2011 (r217000) @@ -33,7 +33,7 @@ /* * Normal and alternate %g6 point to the pcb of the current process. Normal, - & alternate and interrupt %g7 point to per-cpu data. + * alternate and interrupt %g7 point to per-cpu data. */ #define PCB_REG %g6 #define PCPU_REG %g7 @@ -134,6 +134,19 @@ name: #define EMPTY +/* + * Generate atomic compare and swap, load and store instructions for the + * corresponding width and ASI (or not). Note that we want to evaluate the + * macro args before concatenating, so that EMPTY really turns into nothing. + */ +#define _LD(w, a) ld ## w ## a +#define _ST(w, a) st ## w ## a +#define _CAS(w, a) cas ## w ## a + +#define LD(w, a) _LD(w, a) +#define ST(w, a) _ST(w, a) +#define CAS(w, a) _CAS(w, a) + #endif /* LOCORE */ #endif /* _KERNEL */ Modified: stable/8/sys/sparc64/sparc64/support.S ============================================================================== --- stable/8/sys/sparc64/sparc64/support.S Wed Jan 5 12:20:55 2011 (r216999) +++ stable/8/sys/sparc64/sparc64/support.S Wed Jan 5 12:27:52 2011 (r217000) @@ -44,19 +44,6 @@ __FBSDID("$FreeBSD$"); .register %g3, #ignore .register %g6, #ignore -#define E /* empty */ - -/* - * Generate load and store instructions for the corresponding width and asi - * (or not). Note that we want to evaluate the macro args before - * concatenating, so that E really turns into nothing. - */ -#define _LD(w, a) ld ## w ## a -#define _ST(w, a) st ## w ## a - -#define LD(w, a) _LD(w, a) -#define ST(w, a) _ST(w, a) - /* * Common code for copy routines. * @@ -233,7 +220,7 @@ END(ascopy) */ ENTRY(ascopyfrom) wr %o0, 0, %asi - _MEMCPY(%o2, %o1, %o3, E, E, a, %asi) + _MEMCPY(%o2, %o1, %o3, EMPTY, EMPTY, a, %asi) retl nop END(ascopyfrom) @@ -243,7 +230,7 @@ END(ascopyfrom) */ ENTRY(ascopyto) wr %o1, 0, %asi - _MEMCPY(%o2, %o0, %o3, a, %asi, E, E) + _MEMCPY(%o2, %o0, %o3, a, %asi, EMPTY, EMPTY) retl nop END(ascopyto) @@ -307,7 +294,7 @@ ENTRY(bcopy) /* * Do the fast version. */ -3: _MEMCPY(%o1, %o0, %o2, E, E, E, E) +3: _MEMCPY(%o1, %o0, %o2, EMPTY, EMPTY, EMPTY, EMPTY) retl nop END(bcopy) @@ -316,7 +303,7 @@ END(bcopy) * void bzero(void *b, size_t len) */ ENTRY(bzero) - _MEMSET(%o0, %g0, %o1, E, E) + _MEMSET(%o0, %g0, %o1, EMPTY, EMPTY) retl nop END(bzero) @@ -325,7 +312,7 @@ END(bzero) * int copystr(const void *src, void *dst, size_t len, size_t *done) */ ENTRY(copystr) - _COPYSTR(%o0, %o1, %o2, %o3, E, E, E, E) + _COPYSTR(%o0, %o1, %o2, %o3, EMPTY, EMPTY, EMPTY, EMPTY) retl mov %g1, %o0 END(copystr) @@ -335,7 +322,7 @@ END(copystr) */ ENTRY(memcpy) mov %o0, %o3 - _MEMCPY(%o3, %o1, %o2, E, E, E, E) + _MEMCPY(%o3, %o1, %o2, EMPTY, EMPTY, EMPTY, EMPTY) retl nop END(memcpy) @@ -345,7 +332,7 @@ END(memcpy) */ ENTRY(memset) mov %o0, %o3 - _MEMSET(%o3, %o1, %o2, E, E) + _MEMSET(%o3, %o1, %o2, EMPTY, EMPTY) retl nop END(memset) @@ -359,7 +346,7 @@ copy_nofault_begin: */ ENTRY(copyin) wr %g0, ASI_AIUP, %asi - _MEMCPY(%o1, %o0, %o2, E, E, a, %asi) + _MEMCPY(%o1, %o0, %o2, EMPTY, EMPTY, a, %asi) retl clr %o0 END(copyin) @@ -369,7 +356,7 @@ END(copyin) */ ENTRY(copyinstr) wr %g0, ASI_AIUP, %asi - _COPYSTR(%o0, %o1, %o2, %o3, a, %asi, E, E) + _COPYSTR(%o0, %o1, %o2, %o3, a, %asi, EMPTY, EMPTY) retl mov %g1, %o0 END(copyinstr) @@ -379,7 +366,7 @@ END(copyinstr) */ ENTRY(copyout) wr %g0, ASI_AIUP, %asi - _MEMCPY(%o1, %o0, %o2, a, %asi, E, E) + _MEMCPY(%o1, %o0, %o2, a, %asi, EMPTY, EMPTY) retl clr %o0 END(copyout) From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 12:45:12 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D666106566B; Wed, 5 Jan 2011 12:45:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5D2E8FC14; Wed, 5 Jan 2011 12:45:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05CjBTK078460; Wed, 5 Jan 2011 12:45:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05CjBNx078458; Wed, 5 Jan 2011 12:45:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101051245.p05CjBNx078458@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 5 Jan 2011 12:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217002 - stable/8/sys/dev/md X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 12:45:12 -0000 Author: kib Date: Wed Jan 5 12:45:11 2011 New Revision: 217002 URL: http://svn.freebsd.org/changeset/base/217002 Log: MFC r216793: Add sysctl vm.md_malloc_wait, non-zero value of which switches malloc-backed md(4) to using M_WAITOK malloc calls. Modified: stable/8/sys/dev/md/md.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/md/md.c ============================================================================== --- stable/8/sys/dev/md/md.c Wed Jan 5 12:27:57 2011 (r217001) +++ stable/8/sys/dev/md/md.c Wed Jan 5 12:45:11 2011 (r217002) @@ -103,6 +103,8 @@ static MALLOC_DEFINE(M_MDSECT, "md_secto static int md_debug; SYSCTL_INT(_debug, OID_AUTO, mddebug, CTLFLAG_RW, &md_debug, 0, ""); +static int md_malloc_wait; +SYSCTL_INT(_vm, OID_AUTO, md_malloc_wait, CTLFLAG_RW, &md_malloc_wait, 0, ""); #if defined(MD_ROOT) && defined(MD_ROOT_SIZE) /* @@ -207,11 +209,12 @@ new_indir(u_int shift) { struct indir *ip; - ip = malloc(sizeof *ip, M_MD, M_NOWAIT | M_ZERO); + ip = malloc(sizeof *ip, M_MD, (md_malloc_wait ? M_WAITOK : M_NOWAIT) + | M_ZERO); if (ip == NULL) return (NULL); ip->array = malloc(sizeof(uintptr_t) * NINDIR, - M_MDSECT, M_NOWAIT | M_ZERO); + M_MDSECT, (md_malloc_wait ? M_WAITOK : M_NOWAIT) | M_ZERO); if (ip->array == NULL) { free(ip, M_MD); return (NULL); @@ -455,6 +458,7 @@ mdstart_malloc(struct md_s *sc, struct b } else { if (osp <= 255) { sp = (uintptr_t)uma_zalloc(sc->uma, + md_malloc_wait ? M_WAITOK : M_NOWAIT); if (sp == 0) { error = ENOSPC; @@ -849,7 +853,8 @@ mdcreate_malloc(struct md_s *sc, struct nsectors = sc->mediasize / sc->sectorsize; for (u = 0; u < nsectors; u++) { - sp = (uintptr_t)uma_zalloc(sc->uma, M_NOWAIT | M_ZERO); + sp = (uintptr_t)uma_zalloc(sc->uma, md_malloc_wait ? + M_WAITOK : M_NOWAIT | M_ZERO); if (sp != 0) error = s_write(sc->indir, u, sp); else From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 12:47:42 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D53A91065672; Wed, 5 Jan 2011 12:47:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A99548FC17; Wed, 5 Jan 2011 12:47:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05Clgv1078556; Wed, 5 Jan 2011 12:47:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05ClgZO078553; Wed, 5 Jan 2011 12:47:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101051247.p05ClgZO078553@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 5 Jan 2011 12:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217003 - in stable/8/sys: dev/md geom X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 12:47:42 -0000 Author: kib Date: Wed Jan 5 12:47:42 2011 New Revision: 217003 URL: http://svn.freebsd.org/changeset/base/217003 Log: MFC r216794: Add reporting of GEOM::candelete BIO_GETATTR for md(4) and geom_disk(4). Non-zero value of attribute means that device supports BIO_DELETE. Modified: stable/8/sys/dev/md/md.c stable/8/sys/geom/geom_disk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/md/md.c ============================================================================== --- stable/8/sys/dev/md/md.c Wed Jan 5 12:45:11 2011 (r217002) +++ stable/8/sys/dev/md/md.c Wed Jan 5 12:47:42 2011 (r217003) @@ -716,11 +716,12 @@ md_kthread(void *arg) } mtx_unlock(&sc->queue_mtx); if (bp->bio_cmd == BIO_GETATTR) { - if (sc->fwsectors && sc->fwheads && + if ((sc->fwsectors && sc->fwheads && (g_handleattr_int(bp, "GEOM::fwsectors", sc->fwsectors) || g_handleattr_int(bp, "GEOM::fwheads", - sc->fwheads))) + sc->fwheads))) || + g_handleattr_int(bp, "GEOM::candelete", 1)) error = -1; else error = EOPNOTSUPP; Modified: stable/8/sys/geom/geom_disk.c ============================================================================== --- stable/8/sys/geom/geom_disk.c Wed Jan 5 12:45:11 2011 (r217002) +++ stable/8/sys/geom/geom_disk.c Wed Jan 5 12:47:42 2011 (r217003) @@ -297,7 +297,11 @@ g_disk_start(struct bio *bp) } while (bp2 != NULL); break; case BIO_GETATTR: - if (g_handleattr_int(bp, "GEOM::fwsectors", dp->d_fwsectors)) + if (g_handleattr_int(bp, "GEOM::candelete", + (dp->d_flags & DISKFLAG_CANDELETE) != 0)) + break; + else if (g_handleattr_int(bp, "GEOM::fwsectors", + dp->d_fwsectors)) break; else if (g_handleattr_int(bp, "GEOM::fwheads", dp->d_fwheads)) break; From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 13:26:26 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B854C1065673; Wed, 5 Jan 2011 13:26:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A67A18FC0A; Wed, 5 Jan 2011 13:26:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05DQQES079447; Wed, 5 Jan 2011 13:26:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05DQQK6079444; Wed, 5 Jan 2011 13:26:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201101051326.p05DQQK6079444@svn.freebsd.org> From: Marius Strobl Date: Wed, 5 Jan 2011 13:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217004 - in stable/8/share: examples/etc mk X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 13:26:26 -0000 Author: marius Date: Wed Jan 5 13:26:26 2011 New Revision: 217004 URL: http://svn.freebsd.org/changeset/base/217004 Log: MFC: r216820 - Add CPUTYPE support for sparc64. The net result is that it's now possible to let the compiler optimize for the famility of UltraSPARC-III CPUs as the default already was to optimize for UltraSPARC-I/II and generating generic 64-bit V9 is mainly for reference purposes. At least for SPARC64-V CPUs code optimized for UltraSPARC-I/II still is the most performant one. Thanks go to Michael Moll for testing SPARC64-V. - Move a booke MACHINE_CPU bit into the right section. Modified: stable/8/share/examples/etc/make.conf stable/8/share/mk/bsd.cpu.mk Directory Properties: stable/8/share/examples/ (props changed) stable/8/share/examples/etc/ (props changed) stable/8/share/examples/kld/syscall/ (props changed) stable/8/share/mk/ (props changed) Modified: stable/8/share/examples/etc/make.conf ============================================================================== --- stable/8/share/examples/etc/make.conf Wed Jan 5 12:47:42 2011 (r217003) +++ stable/8/share/examples/etc/make.conf Wed Jan 5 13:26:26 2011 (r217004) @@ -39,6 +39,8 @@ # Alpha/AXP architecture: ev67 ev6 pca56 ev56 ev5 ev45 ev4 # AMD64 architecture: opteron, athlon64, nocona, prescott, core2 # Intel ia64 architecture: itanium2, itanium +# SPARC-V9 architecture: v9 (generic 64-bit V9), ultrasparc (default +# if omitted), ultrasparc3 # # (?= allows to buildworld for a different CPUTYPE.) # Modified: stable/8/share/mk/bsd.cpu.mk ============================================================================== --- stable/8/share/mk/bsd.cpu.mk Wed Jan 5 12:47:42 2011 (r217003) +++ stable/8/share/mk/bsd.cpu.mk Wed Jan 5 13:26:26 2011 (r217004) @@ -15,6 +15,7 @@ MACHINE_CPU = itanium . elif ${MACHINE_ARCH} == "powerpc" MACHINE_CPU = aim . elif ${MACHINE_ARCH} == "sparc64" +MACHINE_CPU = ultrasparc . elif ${MACHINE_ARCH} == "arm" MACHINE_CPU = arm . elif ${MACHINE_ARCH} == "mips" @@ -58,6 +59,12 @@ CPUTYPE = athlon . if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2" CPUTYPE = nocona . endif +. elif ${MACHINE_ARCH} == "sparc64" +. if ${CPUTYPE} == "us" +CPUTYPE = ultrasparc +. elif ${CPUTYPE} == "us3" +CPUTYPE = ultrasparc3 +. endif . endif ############################################################################### @@ -116,7 +123,6 @@ _CPUCFLAGS = -mcpu=${CPUTYPE} . endif . elif ${MACHINE_ARCH} == "powerpc" . if ${CPUTYPE} == "e500" -MACHINE_CPU = booke _CPUCFLAGS = -Wa,-me500 -msoft-float . else _CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64 @@ -135,6 +141,14 @@ _CPUCFLAGS = -march=4kc . elif ${CPUTYPE} == "mips24kc" _CPUCFLAGS = -march=24kc . endif +. elif ${MACHINE_ARCH} == "sparc64" +. if ${CPUTYPE} == "v9" +_CPUCFLAGS = -mcpu=v9 +. elif ${CPUTYPE} == "ultrasparc" +_CPUCFLAGS = -mcpu=ultrasparc +. elif ${CPUTYPE} == "ultrasparc3" +_CPUCFLAGS = -mcpu=ultrasparc3 +. endif . endif # Set up the list of CPU features based on the CPU type. This is an @@ -191,6 +205,18 @@ MACHINE_CPU += amd64 sse2 sse mmx . if ${CPUTYPE} == "itanium" MACHINE_CPU = itanium . endif +. elif ${MACHINE_ARCH} == "powerpc" +. if ${CPUTYPE} == "e500" +MACHINE_CPU = booke +. endif +. elif ${MACHINE_ARCH} == "sparc64" +. if ${CPUTYPE} == "v9" +MACHINE_CPU = v9 +. elif ${CPUTYPE} == "ultrasparc" +MACHINE_CPU = v9 ultrasparc +. elif ${CPUTYPE} == "ultrasparc3" +MACHINE_CPU = v9 ultrasparc ultrasparc3 +. endif . endif .endif @@ -200,7 +226,7 @@ LDFLAGS += -mbig-endian LD += -EB .endif -.if ${MACHINE_ARCH} == "mips" +.if ${MACHINE_ARCH} == "mips" . if defined(TARGET_BIG_ENDIAN) CFLAGS += -EB LDFLAGS += -Wl,-EB From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 13:50:38 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 127A8106566C; Wed, 5 Jan 2011 13:50:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 011268FC08; Wed, 5 Jan 2011 13:50:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05Dobop080133; Wed, 5 Jan 2011 13:50:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05Dobcb080130; Wed, 5 Jan 2011 13:50:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101051350.p05Dobcb080130@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 5 Jan 2011 13:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217008 - stable/8/sys/vm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 13:50:38 -0000 Author: kib Date: Wed Jan 5 13:50:37 2011 New Revision: 217008 URL: http://svn.freebsd.org/changeset/base/217008 Log: MFC r216799: Move the increment of vm object generation count into vm_object_set_writeable_dirty(). Merge two loops in vm_object_page_clean(), doing the removal of write permission and cleaning in the same loop. Clear the OBJ_MIGHTBEDIRTY flag after the cleaning loop, not before. Modified: stable/8/sys/vm/vm_object.c stable/8/sys/vm/vm_page.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/vm/vm_object.c ============================================================================== --- stable/8/sys/vm/vm_object.c Wed Jan 5 13:40:40 2011 (r217007) +++ stable/8/sys/vm/vm_object.c Wed Jan 5 13:50:37 2011 (r217008) @@ -105,7 +105,9 @@ SYSCTL_INT(_vm, OID_AUTO, old_msync, CTL "Use old (insecure) msync behavior"); static int vm_object_page_collect_flush(vm_object_t object, vm_page_t p, - int pagerflags); + int pagerflags, int flags, int *clearobjflags); +static boolean_t vm_object_page_remove_write(vm_page_t p, int flags, + int *clearobjflags); static void vm_object_qcollapse(vm_object_t object); static void vm_object_vndeallocate(vm_object_t object); @@ -739,6 +741,24 @@ vm_object_terminate(vm_object_t object) vm_object_destroy(object); } +static boolean_t +vm_object_page_remove_write(vm_page_t p, int flags, int *clearobjflags) +{ + + /* + * If we have been asked to skip nosync pages and this is a + * nosync page, skip it. Note that the object flags were not + * cleared in this case so we do not have to set them. + */ + if ((flags & OBJPC_NOSYNC) != 0 && (p->oflags & VPO_NOSYNC) != 0) { + *clearobjflags = 0; + return (FALSE); + } else { + pmap_remove_write(p); + return (p->dirty != 0); + } +} + /* * vm_object_page_clean * @@ -786,17 +806,6 @@ vm_object_page_clean(vm_object_t object, * object flags. */ clearobjflags = 1; - for (p = vm_page_find_least(object, start); - p != NULL && p->pindex < tend; p = TAILQ_NEXT(p, listq)) { - if ((flags & OBJPC_NOSYNC) != 0 && - (p->oflags & VPO_NOSYNC) != 0) - clearobjflags = 0; - else - pmap_remove_write(p); - } - - if (clearobjflags && (start == 0) && (tend == object->size)) - vm_object_clear_flag(object, OBJ_MIGHTBEDIRTY); rescan: curgeneration = object->generation; @@ -815,20 +824,11 @@ rescan: np = vm_page_find_least(object, pi); continue; } - vm_page_test_dirty(p); - if (p->dirty == 0) + if (!vm_object_page_remove_write(p, flags, &clearobjflags)) continue; - /* - * If we have been asked to skip nosync pages and this is a - * nosync page, skip it. Note that the object flags were - * not cleared in this case so we do not have to set them. - */ - if ((flags & OBJPC_NOSYNC) != 0 && - (p->oflags & VPO_NOSYNC) != 0) - continue; - - n = vm_object_page_collect_flush(object, p, pagerflags); + n = vm_object_page_collect_flush(object, p, pagerflags, + flags, &clearobjflags); if (object->generation != curgeneration) goto rescan; np = vm_page_find_least(object, pi + n); @@ -839,10 +839,13 @@ rescan: #endif vm_object_clear_flag(object, OBJ_CLEANING); + if (clearobjflags && start == 0 && tend == object->size) + vm_object_clear_flag(object, OBJ_MIGHTBEDIRTY); } static int -vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int pagerflags) +vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int pagerflags, + int flags, int *clearobjflags) { vm_page_t ma[vm_pageout_page_count], p_first, tp; int count, i, mreq, runlen; @@ -856,8 +859,7 @@ vm_object_page_collect_flush(vm_object_t tp = vm_page_next(tp); if (tp == NULL || tp->busy != 0 || (tp->oflags & VPO_BUSY) != 0) break; - vm_page_test_dirty(tp); - if (tp->dirty == 0) + if (!vm_object_page_remove_write(tp, flags, clearobjflags)) break; } @@ -865,8 +867,7 @@ vm_object_page_collect_flush(vm_object_t tp = vm_page_prev(p_first); if (tp == NULL || tp->busy != 0 || (tp->oflags & VPO_BUSY) != 0) break; - vm_page_test_dirty(tp); - if (tp->dirty == 0) + if (!vm_object_page_remove_write(tp, flags, clearobjflags)) break; p_first = tp; mreq++; @@ -1964,8 +1965,10 @@ vm_object_set_writeable_dirty(vm_object_ { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - if (object->type != OBJT_VNODE || - (object->flags & OBJ_MIGHTBEDIRTY) != 0) + if (object->type != OBJT_VNODE) + return; + object->generation++; + if ((object->flags & OBJ_MIGHTBEDIRTY) != 0) return; vm_object_set_flag(object, OBJ_MIGHTBEDIRTY); } Modified: stable/8/sys/vm/vm_page.c ============================================================================== --- stable/8/sys/vm/vm_page.c Wed Jan 5 13:40:40 2011 (r217007) +++ stable/8/sys/vm/vm_page.c Wed Jan 5 13:50:37 2011 (r217008) @@ -687,7 +687,6 @@ vm_page_insert(vm_page_t m, vm_object_t } } object->root = m; - object->generation++; /* * show that the object has one more resident page. From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 18:52:30 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2B1D106564A; Wed, 5 Jan 2011 18:52:30 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0CE88FC19; Wed, 5 Jan 2011 18:52:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05IqUOZ087771; Wed, 5 Jan 2011 18:52:30 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05IqUjK087769; Wed, 5 Jan 2011 18:52:30 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201101051852.p05IqUjK087769@svn.freebsd.org> From: "George V. Neville-Neil" Date: Wed, 5 Jan 2011 18:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217018 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 18:52:30 -0000 Author: gnn Date: Wed Jan 5 18:52:30 2011 New Revision: 217018 URL: http://svn.freebsd.org/changeset/base/217018 Log: Fix binary compatability for netstats across the -x/-T changes that have been previously MFC'd. Reviewed by: rwatson, bz Modified: stable/8/sys/netinet/tcp_var.h Modified: stable/8/sys/netinet/tcp_var.h ============================================================================== --- stable/8/sys/netinet/tcp_var.h Wed Jan 5 18:46:05 2011 (r217017) +++ stable/8/sys/netinet/tcp_var.h Wed Jan 5 18:52:30 2011 (r217018) @@ -177,7 +177,6 @@ struct tcpcb { u_long snd_cwnd_prev; /* cwnd prior to retransmit */ u_long snd_ssthresh_prev; /* ssthresh prior to retransmit */ tcp_seq snd_recover_prev; /* snd_recover prior to retransmit */ - int t_sndzerowin; /* zero-window updates sent */ u_int t_badrxtwin; /* window for retransmit recovery */ u_char snd_limited; /* segments limited transmitted */ /* SACK related state */ @@ -194,14 +193,15 @@ struct tcpcb { u_int32_t rfbuf_ts; /* recv buffer autoscaling timestamp */ int rfbuf_cnt; /* recv buffer autoscaling byte count */ struct toe_usrreqs *t_tu; /* offload operations vector */ - int t_sndrexmitpack; /* retransmit packets sent */ - int t_rcvoopack; /* out-of-order packets received */ void *t_toe; /* TOE pcb pointer */ int t_bytes_acked; /* # bytes acked during current RTT */ - int t_ispare; /* explicit pad for 64bit alignment */ + int t_sndzerowin; /* zero-window updates sent */ + uint64_t t_sndrexmitpack;/* retransmit packets sent */ + uint64_t t_rcvoopack; /* out-of-order packets received */ + void *t_pspare2[6]; /* 2 CC / 4 TBD */ - uint64_t _pad[12]; /* 7 UTO, 5 TBD (1-2 CC/RTT?) */ + uint64_t _pad[10]; /* 7 UTO, 3 TBD (1-2 CC/RTT?) */ }; /* From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 19:25:32 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17CC2106564A; Wed, 5 Jan 2011 19:25:32 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05DDE8FC1A; Wed, 5 Jan 2011 19:25:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05JPVDk088530; Wed, 5 Jan 2011 19:25:31 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05JPVIf088528; Wed, 5 Jan 2011 19:25:31 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201101051925.p05JPVIf088528@svn.freebsd.org> From: "George V. Neville-Neil" Date: Wed, 5 Jan 2011 19:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217019 - stable/8/usr.bin/netstat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 19:25:32 -0000 Author: gnn Date: Wed Jan 5 19:25:31 2011 New Revision: 217019 URL: http://svn.freebsd.org/changeset/base/217019 Log: Update netstat to handle uint64_t based stats for -T. Modified: stable/8/usr.bin/netstat/inet.c Directory Properties: stable/8/usr.bin/netstat/ (props changed) Modified: stable/8/usr.bin/netstat/inet.c ============================================================================== --- stable/8/usr.bin/netstat/inet.c Wed Jan 5 18:52:30 2011 (r217018) +++ stable/8/usr.bin/netstat/inet.c Wed Jan 5 19:25:31 2011 (r217019) @@ -459,8 +459,10 @@ protopr(u_long off, const char *name, in printf("%-14.14s ", buf1); } else if (Tflag) { if (istcp) - printf("%6u %6u %6u ", tp->t_sndrexmitpack, - tp->t_rcvoopack, tp->t_sndzerowin); + printf("%6ju %6ju %6u ", + (uintmax_t)tp->t_sndrexmitpack, + (uintmax_t)tp->t_rcvoopack, + tp->t_sndzerowin); } else { printf("%6u %6u ", so->so_rcv.sb_cc, so->so_snd.sb_cc); } From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 19:26:30 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF2A4106566B; Wed, 5 Jan 2011 19:26:30 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDB568FC18; Wed, 5 Jan 2011 19:26:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05JQUsY088594; Wed, 5 Jan 2011 19:26:30 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05JQUSM088592; Wed, 5 Jan 2011 19:26:30 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201101051926.p05JQUSM088592@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 5 Jan 2011 19:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217020 - stable/8/sys/pc98/pc98 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 19:26:31 -0000 Author: gavin Date: Wed Jan 5 19:26:30 2011 New Revision: 217020 URL: http://svn.freebsd.org/changeset/base/217020 Log: MFC r216892 from head (Which is an MFi386 of r216012 by kib) Calling fill_fpregs() for curthread is legitimate, and ELF coredump does this. Discussed with: kib Modified: stable/8/sys/pc98/pc98/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/pc98/pc98/machdep.c ============================================================================== --- stable/8/sys/pc98/pc98/machdep.c Wed Jan 5 19:25:31 2011 (r217019) +++ stable/8/sys/pc98/pc98/machdep.c Wed Jan 5 19:26:30 2011 (r217020) @@ -2520,7 +2520,8 @@ int fill_fpregs(struct thread *td, struct fpreg *fpregs) { - KASSERT(TD_IS_SUSPENDED(td), ("not suspended thread %p", td)); + KASSERT(td == curthread || TD_IS_SUSPENDED(td), + ("not suspended thread %p", td)); npxgetregs(td); #ifdef CPU_ENABLE_SSE if (cpu_fxsr) From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 19:31:53 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17974106566C; Wed, 5 Jan 2011 19:31:53 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 059868FC08; Wed, 5 Jan 2011 19:31:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05JVqh2088734; Wed, 5 Jan 2011 19:31:52 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05JVqYw088731; Wed, 5 Jan 2011 19:31:52 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201101051931.p05JVqYw088731@svn.freebsd.org> From: "George V. Neville-Neil" Date: Wed, 5 Jan 2011 19:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217021 - stable/8/tools/tools/mctest X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 19:31:53 -0000 Author: gnn Date: Wed Jan 5 19:31:52 2011 New Revision: 217021 URL: http://svn.freebsd.org/changeset/base/217021 Log: MFC: 213327 Change the output of mctest to give a summary of the results instead of printing a long list. Add a default base port, and default mulitcast address to the runner script. Add support for specifying a different local and remote interface in the runner script. Modified: stable/8/tools/tools/mctest/mctest.cc stable/8/tools/tools/mctest/mctest_run.sh Directory Properties: stable/8/tools/tools/mctest/ (props changed) Modified: stable/8/tools/tools/mctest/mctest.cc ============================================================================== --- stable/8/tools/tools/mctest/mctest.cc Wed Jan 5 19:26:30 2011 (r217020) +++ stable/8/tools/tools/mctest/mctest.cc Wed Jan 5 19:31:52 2011 (r217021) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); // C++ STL and other related includes #include #include +#include +#include // Operating System and other C based includes #include @@ -400,15 +402,31 @@ int source(char *interface, struct in_ad } timeval result; + vector deltas; + double idx[] = { .0001, .001, .01, .1, .5, .9, .99, .999, .9999, 0.0 }; + for (int client = 0;client < clients; client++) { + deltas.clear(); cout << "Results from client #" << client << endl; + cout << "in usecs" << endl; for (int i = 0; i < number; i++) { - if (i % clients != client) - continue; +// if (i % clients != client) +// continue; + if (&args[client].packets[i].tv_sec == 0) + continue; timersub(&args[client].packets[i], &sent[i], &result); - cout << "sec: " << result.tv_sec; - cout << " usecs: " << result.tv_usec << endl; + deltas.push_back(result.tv_usec); +// cout << "sec: " << result.tv_sec; +// cout << " usecs: " << result.tv_usec << endl; } + cout << "comparing %lu deltas" << long(deltas.size()) << endl; + cout << "number represents usecs of round-trip time" << endl; + sort(deltas.begin(), deltas.end()); + for (int i = 0; idx[i] != 0; ++i) { + printf("%s% 5d", (i == 0) ? "" : " ", + deltas[(int) (idx[i] * deltas.size())]); + } + printf("\n"); } return 0; Modified: stable/8/tools/tools/mctest/mctest_run.sh ============================================================================== --- stable/8/tools/tools/mctest/mctest_run.sh Wed Jan 5 19:26:30 2011 (r217020) +++ stable/8/tools/tools/mctest/mctest_run.sh Wed Jan 5 19:31:52 2011 (r217021) @@ -7,19 +7,19 @@ # Defaults size=1024 number=100 -base="" -group="" +base=9999 +group="239.255.255.101" interface="cxgb0" remote="ssh" -command="/sources/FreeBSD.CURRENT/src/tools/tools/mctest/mctest" +command="/zoo/tank/users/gnn/svn/Projects/head-exar/src/tools/tools/mctest/mctest" gap=1000 # Arguments are s (size), g (group), n (number), and c (command) followed # by a set of hostnames. -args=`getopt s:g:n:c:i:b: $*` +args=`getopt s:g:n:c:l:f:b: $*` if [ $? != 0 ] then - echo 'Usage: mctest_run -s size -g group -n number -c remote command host1 host2 hostN' + echo 'Usage: mctest_run -l local_interface -f foreign_interface -s size -g group -n number -c remote command host1 host2 hostN' exit 2 fi set == $args @@ -40,8 +40,11 @@ do -c) command=$3; shift 2;; - -i) - interface=$3; + -l) + local_interface=$3; + shift 2;; + -f) + foreign_interface=$3; shift 2;; -b) base=$3; @@ -60,7 +63,7 @@ now=`date "+%Y%m%d%H%M"` for host in $* do output=$host\_$interface\_$size\_$number\.$now - $remote $host $command -r -M $# -b $base -g $group -m $current -n $number -s $size -i $interface > $output & + $remote $host $command -r -M $# -b $base -g $group -m $current -n $number -s $size -i $foreign_interface > $output & sleep 1 current=`expr $current + 1 `; done @@ -68,4 +71,4 @@ done # # Start the source/collector on this machine # -$command -M $# -b $base -g $group -n $number -s $size -i $interface -t $gap > `uname -n`\_$size\_$number\.$now +$command -M $# -b $base -g $group -n $number -s $size -i $local_interface -t $gap > `uname -n`\_$size\_$number\.$now From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 19:33:17 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 586741065675; Wed, 5 Jan 2011 19:33:17 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 463C38FC18; Wed, 5 Jan 2011 19:33:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05JXHlP088821; Wed, 5 Jan 2011 19:33:17 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05JXHlv088819; Wed, 5 Jan 2011 19:33:17 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201101051933.p05JXHlv088819@svn.freebsd.org> From: "George V. Neville-Neil" Date: Wed, 5 Jan 2011 19:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217022 - stable/8/tools/tools/mctest X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 19:33:17 -0000 Author: gnn Date: Wed Jan 5 19:33:16 2011 New Revision: 217022 URL: http://svn.freebsd.org/changeset/base/217022 Log: MFC: 215409 Fix an error in our results printing. Modified: stable/8/tools/tools/mctest/mctest.cc Directory Properties: stable/8/tools/tools/mctest/ (props changed) Modified: stable/8/tools/tools/mctest/mctest.cc ============================================================================== --- stable/8/tools/tools/mctest/mctest.cc Wed Jan 5 19:31:52 2011 (r217021) +++ stable/8/tools/tools/mctest/mctest.cc Wed Jan 5 19:33:16 2011 (r217022) @@ -419,7 +419,7 @@ int source(char *interface, struct in_ad // cout << "sec: " << result.tv_sec; // cout << " usecs: " << result.tv_usec << endl; } - cout << "comparing %lu deltas" << long(deltas.size()) << endl; + cout << "comparing " << long(deltas.size()) << " deltas" << endl; cout << "number represents usecs of round-trip time" << endl; sort(deltas.begin(), deltas.end()); for (int i = 0; idx[i] != 0; ++i) { From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 6 09:34:23 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F29731065670; Thu, 6 Jan 2011 09:34:22 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7B568FC18; Thu, 6 Jan 2011 09:34:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p069YMvm009614; Thu, 6 Jan 2011 09:34:22 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p069YMpl009611; Thu, 6 Jan 2011 09:34:22 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201101060934.p069YMpl009611@svn.freebsd.org> From: Martin Matuska Date: Thu, 6 Jan 2011 09:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217049 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 09:34:23 -0000 Author: mm Date: Thu Jan 6 09:34:22 2011 New Revision: 217049 URL: http://svn.freebsd.org/changeset/base/217049 Log: MFC r216919: MFp4 186485, 186859: Fix a race by defining two tasks in the zio structure as we can still be returning from issue task when interrupt task is used. Reviewed by: pav Approved by: pav Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Jan 6 08:33:48 2011 (r217048) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Jan 6 09:34:22 2011 (r217049) @@ -340,7 +340,8 @@ struct zio { #ifdef _KERNEL /* FreeBSD only. */ - struct ostask io_task; + struct ostask io_task_issue; + struct ostask io_task_interrupt; #endif }; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jan 6 08:33:48 2011 (r217048) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jan 6 09:34:22 2011 (r217049) @@ -947,6 +947,18 @@ zio_taskq_dispatch(zio_t *zio, enum zio_ { spa_t *spa = zio->io_spa; zio_type_t t = zio->io_type; +#ifdef _KERNEL + struct ostask *task; +#endif + + ASSERT(q == ZIO_TASKQ_ISSUE || q == ZIO_TASKQ_INTERRUPT); + +#ifdef _KERNEL + if (q == ZIO_TASKQ_ISSUE) + task = &zio->io_task_issue; + else /* if (q == ZIO_TASKQ_INTERRUPT) */ + task = &zio->io_task_interrupt; +#endif /* * If we're a config writer or a probe, the normal issue and @@ -970,8 +982,13 @@ zio_taskq_dispatch(zio_t *zio, enum zio_ q++; ASSERT3U(q, <, ZIO_TASKQ_TYPES); +#ifdef _KERNEL (void) taskq_dispatch_safe(spa->spa_zio_taskq[t][q], - (task_func_t *)zio_execute, zio, &zio->io_task); + (task_func_t *)zio_execute, zio, task); +#else + (void) taskq_dispatch(spa->spa_zio_taskq[t][q], + (task_func_t *)zio_execute, zio, TQ_SLEEP); +#endif } static boolean_t @@ -2300,9 +2317,16 @@ zio_done(zio_t *zio) * Reexecution is potentially a huge amount of work. * Hand it off to the otherwise-unused claim taskq. */ +#ifdef _KERNEL (void) taskq_dispatch_safe( spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], - (task_func_t *)zio_reexecute, zio, &zio->io_task); + (task_func_t *)zio_reexecute, zio, + &zio->io_task_issue); +#else + (void) taskq_dispatch( + spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], + (task_func_t *)zio_reexecute, zio, TQ_SLEEP); +#endif } return (ZIO_PIPELINE_STOP); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 6 09:40:38 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 244C7106564A; Thu, 6 Jan 2011 09:40:38 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:100:1043::3]) by mx1.freebsd.org (Postfix) with ESMTP id AC5708FC14; Thu, 6 Jan 2011 09:40:37 +0000 (UTC) Received: from core.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id 2107313692C; Thu, 6 Jan 2011 10:40:36 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk ([127.0.0.1]) by core.vx.sk (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DveXd5kAH2zL; Thu, 6 Jan 2011 10:40:34 +0100 (CET) Received: from [10.9.8.1] (chello085216231078.chello.sk [85.216.231.78]) by mail.vx.sk (Postfix) with ESMTPSA id D5E24136923; Thu, 6 Jan 2011 10:40:33 +0100 (CET) Message-ID: <4D258E11.9090402@FreeBSD.org> Date: Thu, 06 Jan 2011 10:40:33 +0100 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org References: <201101060934.p069YMpl009611@svn.freebsd.org> In-Reply-To: <201101060934.p069YMpl009611@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: Re: svn commit: r217049 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 09:40:38 -0000 My mistake: s/pav/pjd/g Dňa 06.01.2011 10:34, Martin Matuska wrote / napísal(a): > Author: mm > Date: Thu Jan 6 09:34:22 2011 > New Revision: 217049 > URL: http://svn.freebsd.org/changeset/base/217049 > > Log: > MFC r216919: > > MFp4 186485, 186859: > Fix a race by defining two tasks in the zio structure > as we can still be returning from issue task when interrupt task is used. > > Reviewed by: pav > Approved by: pav > > Modified: > stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h > stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > > Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h > ============================================================================== > --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Jan 6 08:33:48 2011 (r217048) > +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Jan 6 09:34:22 2011 (r217049) > @@ -340,7 +340,8 @@ struct zio { > > #ifdef _KERNEL > /* FreeBSD only. */ > - struct ostask io_task; > + struct ostask io_task_issue; > + struct ostask io_task_interrupt; > #endif > }; > > > Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c > ============================================================================== > --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jan 6 08:33:48 2011 (r217048) > +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jan 6 09:34:22 2011 (r217049) > @@ -947,6 +947,18 @@ zio_taskq_dispatch(zio_t *zio, enum zio_ > { > spa_t *spa = zio->io_spa; > zio_type_t t = zio->io_type; > +#ifdef _KERNEL > + struct ostask *task; > +#endif > + > + ASSERT(q == ZIO_TASKQ_ISSUE || q == ZIO_TASKQ_INTERRUPT); > + > +#ifdef _KERNEL > + if (q == ZIO_TASKQ_ISSUE) > + task = &zio->io_task_issue; > + else /* if (q == ZIO_TASKQ_INTERRUPT) */ > + task = &zio->io_task_interrupt; > +#endif > > /* > * If we're a config writer or a probe, the normal issue and > @@ -970,8 +982,13 @@ zio_taskq_dispatch(zio_t *zio, enum zio_ > q++; > > ASSERT3U(q, <, ZIO_TASKQ_TYPES); > +#ifdef _KERNEL > (void) taskq_dispatch_safe(spa->spa_zio_taskq[t][q], > - (task_func_t *)zio_execute, zio, &zio->io_task); > + (task_func_t *)zio_execute, zio, task); > +#else > + (void) taskq_dispatch(spa->spa_zio_taskq[t][q], > + (task_func_t *)zio_execute, zio, TQ_SLEEP); > +#endif > } > > static boolean_t > @@ -2300,9 +2317,16 @@ zio_done(zio_t *zio) > * Reexecution is potentially a huge amount of work. > * Hand it off to the otherwise-unused claim taskq. > */ > +#ifdef _KERNEL > (void) taskq_dispatch_safe( > spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], > - (task_func_t *)zio_reexecute, zio, &zio->io_task); > + (task_func_t *)zio_reexecute, zio, > + &zio->io_task_issue); > +#else > + (void) taskq_dispatch( > + spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], > + (task_func_t *)zio_reexecute, zio, TQ_SLEEP); > +#endif > } > return (ZIO_PIPELINE_STOP); > } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 6 12:34:18 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75DD4106566B; Thu, 6 Jan 2011 12:34:18 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62E888FC0C; Thu, 6 Jan 2011 12:34:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p06CYIOH014941; Thu, 6 Jan 2011 12:34:18 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p06CYIYH014937; Thu, 6 Jan 2011 12:34:18 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101061234.p06CYIYH014937@svn.freebsd.org> From: Colin Percival Date: Thu, 6 Jan 2011 12:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217050 - in stable/8/sys/i386: i386 xen X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 12:34:18 -0000 Author: cperciva Date: Thu Jan 6 12:34:18 2011 New Revision: 217050 URL: http://svn.freebsd.org/changeset/base/217050 Log: MFC r200288, r200346, r200352: Make minidump work on i386/XEN. Note that r200288 and r200346 touched i386/i386/dump_machdep.c, but in that file r200346 was a back-out of r200288; so the fact that dump_machdep.c has moved to the x86 tree is not a problem. In the !XEN case the files under i386/i386 are unchanged after preprocessing. Modified: stable/8/sys/i386/i386/machdep.c stable/8/sys/i386/i386/minidump_machdep.c stable/8/sys/i386/xen/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Thu Jan 6 09:34:22 2011 (r217049) +++ stable/8/sys/i386/i386/machdep.c Thu Jan 6 12:34:18 2011 (r217050) @@ -2437,6 +2437,9 @@ do_next: #else phys_avail[0] = physfree; phys_avail[1] = xen_start_info->nr_pages*PAGE_SIZE; + dump_avail[0] = 0; + dump_avail[1] = xen_start_info->nr_pages*PAGE_SIZE; + #endif /* Modified: stable/8/sys/i386/i386/minidump_machdep.c ============================================================================== --- stable/8/sys/i386/i386/minidump_machdep.c Thu Jan 6 09:34:22 2011 (r217049) +++ stable/8/sys/i386/i386/minidump_machdep.c Thu Jan 6 12:34:18 2011 (r217050) @@ -65,6 +65,11 @@ static void *dump_va; static uint64_t counter, progress; CTASSERT(sizeof(*vm_page_dump) == 4); +#ifndef XEN +#define xpmap_mtop(x) (x) +#define xpmap_ptom(x) (x) +#endif + static int is_dumpable(vm_paddr_t pa) @@ -194,7 +199,7 @@ minidumpsys(struct dumperinfo *di) j = va >> PDRSHIFT; if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) { /* This is an entire 2M page. */ - pa = pd[j] & PG_PS_FRAME; + pa = xpmap_mtop(pd[j] & PG_PS_FRAME); for (k = 0; k < NPTEPG; k++) { if (is_dumpable(pa)) dump_add_page(pa); @@ -204,10 +209,10 @@ minidumpsys(struct dumperinfo *di) } if ((pd[j] & PG_V) == PG_V) { /* set bit for each valid page in this 2MB block */ - pt = pmap_kenter_temporary(pd[j] & PG_FRAME, 0); + pt = pmap_kenter_temporary(xpmap_mtop(pd[j] & PG_FRAME), 0); for (k = 0; k < NPTEPG; k++) { if ((pt[k] & PG_V) == PG_V) { - pa = pt[k] & PG_FRAME; + pa = xpmap_mtop(pt[k] & PG_FRAME); if (is_dumpable(pa)) dump_add_page(pa); } @@ -307,8 +312,24 @@ minidumpsys(struct dumperinfo *di) continue; } if ((pd[j] & PG_V) == PG_V) { - pa = pd[j] & PG_FRAME; + pa = xpmap_mtop(pd[j] & PG_FRAME); +#ifndef XEN error = blk_write(di, 0, pa, PAGE_SIZE); +#else + pt = pmap_kenter_temporary(pa, 0); + memcpy(fakept, pt, PAGE_SIZE); + for (i = 0; i < NPTEPG; i++) + fakept[i] = xpmap_mtop(fakept[i]); + error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); + if (error) + goto fail; + /* flush, in case we reuse fakept in the same block */ + error = blk_flush(di); + if (error) + goto fail; + bzero(fakept, sizeof(fakept)); +#endif + if (error) goto fail; } else { Modified: stable/8/sys/i386/xen/pmap.c ============================================================================== --- stable/8/sys/i386/xen/pmap.c Thu Jan 6 09:34:22 2011 (r217049) +++ stable/8/sys/i386/xen/pmap.c Thu Jan 6 12:34:18 2011 (r217050) @@ -3108,9 +3108,10 @@ void * pmap_kenter_temporary(vm_paddr_t pa, int i) { vm_offset_t va; + vm_paddr_t ma = xpmap_ptom(pa); va = (vm_offset_t)crashdumpmap + (i * PAGE_SIZE); - PT_SET_MA(va, (pa & ~PAGE_MASK) | PG_V | pgeflag); + PT_SET_MA(va, (ma & ~PAGE_MASK) | PG_V | pgeflag); invlpg(va); return ((void *)crashdumpmap); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 6 13:02:29 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2DFA1065670; Thu, 6 Jan 2011 13:02:29 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1A3F8FC21; Thu, 6 Jan 2011 13:02:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p06D2TVv015591; Thu, 6 Jan 2011 13:02:29 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p06D2Teu015589; Thu, 6 Jan 2011 13:02:29 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101061302.p06D2Teu015589@svn.freebsd.org> From: Colin Percival Date: Thu, 6 Jan 2011 13:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217051 - stable/8/sys/i386/xen X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 13:02:29 -0000 Author: cperciva Date: Thu Jan 6 13:02:29 2011 New Revision: 217051 URL: http://svn.freebsd.org/changeset/base/217051 Log: MFC r216703: Make i386/XEN not panic when mlock(2) is used. Modified: stable/8/sys/i386/xen/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/i386/xen/pmap.c ============================================================================== --- stable/8/sys/i386/xen/pmap.c Thu Jan 6 12:34:18 2011 (r217050) +++ stable/8/sys/i386/xen/pmap.c Thu Jan 6 13:02:29 2011 (r217051) @@ -1070,7 +1070,9 @@ pmap_pte_release(pt_entry_t *pte) if ((pt_entry_t *)((vm_offset_t)pte & ~PAGE_MASK) == PADDR2) { CTR1(KTR_PMAP, "pmap_pte_release: pte=0x%jx", *PMAP2); + vm_page_lock_queues(); PT_SET_VA(PMAP2, 0, TRUE); + vm_page_unlock_queues(); mtx_unlock(&PMAP2mutex); } } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 6 13:09:03 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50F9C1065695; Thu, 6 Jan 2011 13:09:03 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FDBB8FC14; Thu, 6 Jan 2011 13:09:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p06D93vE015769; Thu, 6 Jan 2011 13:09:03 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p06D93DG015767; Thu, 6 Jan 2011 13:09:03 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101061309.p06D93DG015767@svn.freebsd.org> From: Colin Percival Date: Thu, 6 Jan 2011 13:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217052 - stable/8/sys/i386/xen X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 13:09:03 -0000 Author: cperciva Date: Thu Jan 6 13:09:02 2011 New Revision: 217052 URL: http://svn.freebsd.org/changeset/base/217052 Log: MFC r216762: Don't panic when exiting gstat or 'mdconfig -l' Modified: stable/8/sys/i386/xen/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/i386/xen/pmap.c ============================================================================== --- stable/8/sys/i386/xen/pmap.c Thu Jan 6 13:02:29 2011 (r217051) +++ stable/8/sys/i386/xen/pmap.c Thu Jan 6 13:09:02 2011 (r217052) @@ -2293,19 +2293,8 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t if (oldpte & PG_G) pmap_invalidate_page(kernel_pmap, va); pmap->pm_stats.resident_count -= 1; - /* - * XXX This is not strictly correctly, but somewhere along the line - * we are losing the managed bit on some pages. It is unclear to me - * why, but I think the most likely explanation is that xen's writable - * page table implementation doesn't respect the unused bits. - */ - if ((oldpte & PG_MANAGED) || ((oldpte & PG_V) && (va < VM_MAXUSER_ADDRESS)) - ) { + if (oldpte & PG_MANAGED) { m = PHYS_TO_VM_PAGE(xpmap_mtop(oldpte) & PG_FRAME); - - if (!(oldpte & PG_MANAGED)) - printf("va=0x%x is unmanaged :-( pte=0x%llx\n", va, oldpte); - if (oldpte & PG_M) { KASSERT((oldpte & PG_RW), ("pmap_remove_pte: modified page not writable: va: %#x, pte: %#jx", @@ -2315,9 +2304,7 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t if (oldpte & PG_A) vm_page_flag_set(m, PG_REFERENCED); pmap_remove_entry(pmap, m, va); - } else if ((va < VM_MAXUSER_ADDRESS) && (oldpte & PG_V)) - printf("va=0x%x is unmanaged :-( pte=0x%llx\n", va, oldpte); - + } return (pmap_unuse_pt(pmap, va, free)); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 6 13:21:39 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1429C1065694; Thu, 6 Jan 2011 13:21:39 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02B708FC08; Thu, 6 Jan 2011 13:21:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p06DLcBg016074; Thu, 6 Jan 2011 13:21:38 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p06DLcCT016072; Thu, 6 Jan 2011 13:21:38 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101061321.p06DLcCT016072@svn.freebsd.org> From: Colin Percival Date: Thu, 6 Jan 2011 13:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217053 - stable/8/sys/dev/xen/console X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 13:21:39 -0000 Author: cperciva Date: Thu Jan 6 13:21:38 2011 New Revision: 217053 URL: http://svn.freebsd.org/changeset/base/217053 Log: MFC r216790: Fix Xen console spew: "no input to read" != an infinite supply of \0 bytes. Modified: stable/8/sys/dev/xen/console/console.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/xen/console/console.c ============================================================================== --- stable/8/sys/dev/xen/console/console.c Thu Jan 6 13:09:02 2011 (r217052) +++ stable/8/sys/dev/xen/console/console.c Thu Jan 6 13:21:38 2011 (r217053) @@ -145,17 +145,18 @@ xccngetc(struct consdev *dev) int xccncheckc(struct consdev *dev) { - int ret = (xc_mute ? 0 : -1); + int ret; if (xencons_has_input()) xencons_handle_input(NULL); CN_LOCK(cn_mtx); - if ((rp - rc)) { + if ((rp - rc) && !xc_mute) { /* we need to return only one char */ ret = (int)rbuf[RBUF_MASK(rc)]; rc++; - } + } else + ret = -1; CN_UNLOCK(cn_mtx); return(ret); } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 6 14:19:30 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 291681065694; Thu, 6 Jan 2011 14:19:30 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F15D98FC1C; Thu, 6 Jan 2011 14:19:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p06EJTKq017441; Thu, 6 Jan 2011 14:19:29 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p06EJTc4017439; Thu, 6 Jan 2011 14:19:29 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101061419.p06EJTc4017439@svn.freebsd.org> From: Colin Percival Date: Thu, 6 Jan 2011 14:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217055 - stable/8/sys/xen/evtchn X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 14:19:30 -0000 Author: cperciva Date: Thu Jan 6 14:19:29 2011 New Revision: 217055 URL: http://svn.freebsd.org/changeset/base/217055 Log: MFC r216812: Implement xenpic_dynirq_disable_intr and thereby avoid a kernel panic when a disk is detached from a XEN system. Modified: stable/8/sys/xen/evtchn/evtchn.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/xen/evtchn/evtchn.c ============================================================================== --- stable/8/sys/xen/evtchn/evtchn.c Thu Jan 6 14:12:24 2011 (r217054) +++ stable/8/sys/xen/evtchn/evtchn.c Thu Jan 6 14:19:29 2011 (r217055) @@ -628,6 +628,7 @@ static void xenpic_dynirq_enable_sou static void xenpic_dynirq_disable_source(struct intsrc *isrc, int); static void xenpic_dynirq_eoi_source(struct intsrc *isrc); static void xenpic_dynirq_enable_intr(struct intsrc *isrc); +static void xenpic_dynirq_disable_intr(struct intsrc *isrc); static void xenpic_pirq_enable_source(struct intsrc *isrc); static void xenpic_pirq_disable_source(struct intsrc *isrc, int); @@ -647,6 +648,7 @@ struct pic xenpic_dynirq_template = { .pic_disable_source = xenpic_dynirq_disable_source, .pic_eoi_source = xenpic_dynirq_eoi_source, .pic_enable_intr = xenpic_dynirq_enable_intr, + .pic_disable_intr = xenpic_dynirq_disable_intr, .pic_vector = xenpic_vector, .pic_source_pending = xenpic_source_pending, .pic_suspend = xenpic_suspend, @@ -716,6 +718,20 @@ xenpic_dynirq_enable_intr(struct intsrc } static void +xenpic_dynirq_disable_intr(struct intsrc *isrc) +{ + unsigned int irq; + struct xenpic_intsrc *xp; + + xp = (struct xenpic_intsrc *)isrc; + mtx_lock_spin(&irq_mapping_update_lock); + irq = xenpic_vector(isrc); + mask_evtchn(evtchn_from_irq(irq)); + xp->xp_masked = 1; + mtx_unlock_spin(&irq_mapping_update_lock); +} + +static void xenpic_dynirq_eoi_source(struct intsrc *isrc) { unsigned int irq; From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 6 15:26:07 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2717A106566C; Thu, 6 Jan 2011 15:26:07 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 149628FC08; Thu, 6 Jan 2011 15:26:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p06FQ6UP019031; Thu, 6 Jan 2011 15:26:06 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p06FQ65D019026; Thu, 6 Jan 2011 15:26:06 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101061526.p06FQ65D019026@svn.freebsd.org> From: Colin Percival Date: Thu, 6 Jan 2011 15:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217056 - in stable/8/sys/i386: i386 include xen X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 15:26:07 -0000 Author: cperciva Date: Thu Jan 6 15:26:06 2011 New Revision: 217056 URL: http://svn.freebsd.org/changeset/base/217056 Log: MFC r216843-216847: Fix i386_set_ldt on i386/XEN. Modified: stable/8/sys/i386/i386/sys_machdep.c stable/8/sys/i386/include/pmap.h stable/8/sys/i386/include/segments.h stable/8/sys/i386/xen/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/i386/i386/sys_machdep.c ============================================================================== --- stable/8/sys/i386/i386/sys_machdep.c Thu Jan 6 14:19:29 2011 (r217055) +++ stable/8/sys/i386/i386/sys_machdep.c Thu Jan 6 15:26:06 2011 (r217056) @@ -450,6 +450,7 @@ user_ldt_alloc(struct mdproc *mdp, int l new_ldt->ldt_refcnt = 1; new_ldt->ldt_active = 0; + mtx_lock_spin(&dt_lock); if ((pldt = mdp->md_ldt)) { if (len > pldt->ldt_len) len = pldt->ldt_len; @@ -458,8 +459,10 @@ user_ldt_alloc(struct mdproc *mdp, int l } else { bcopy(ldt, new_ldt->ldt_base, PAGE_SIZE); } + mtx_unlock_spin(&dt_lock); /* XXX kill once pmap locking fixed. */ pmap_map_readonly(kernel_pmap, (vm_offset_t)new_ldt->ldt_base, new_ldt->ldt_len*sizeof(union descriptor)); + mtx_lock_spin(&dt_lock); /* XXX kill once pmap locking fixed. */ return (new_ldt); } #else @@ -520,8 +523,13 @@ user_ldt_free(struct thread *td) } if (td == PCPU_GET(curthread)) { +#ifdef XEN + i386_reset_ldt(&default_proc_ldt); + PCPU_SET(currentldt, (int)&default_proc_ldt); +#else lldt(_default_ldt); PCPU_SET(currentldt, _default_ldt); +#endif } mdp->md_ldt = NULL; @@ -758,10 +766,14 @@ i386_set_ldt_data(struct thread *td, int mtx_assert(&dt_lock, MA_OWNED); - /* Fill in range */ - bcopy(descs, - &((union descriptor *)(pldt->ldt_base))[start], - num * sizeof(union descriptor)); + while (num) { + xen_update_descriptor( + &((union descriptor *)(pldt->ldt_base))[start], + descs); + num--; + start++; + descs++; + } return (0); } #else Modified: stable/8/sys/i386/include/pmap.h ============================================================================== --- stable/8/sys/i386/include/pmap.h Thu Jan 6 14:19:29 2011 (r217055) +++ stable/8/sys/i386/include/pmap.h Thu Jan 6 15:26:06 2011 (r217056) @@ -251,7 +251,6 @@ pte_load_store(pt_entry_t *ptep, pt_entr { pt_entry_t r; - v = xpmap_ptom(v); r = *ptep; PT_SET_VA(ptep, v, TRUE); return (r); Modified: stable/8/sys/i386/include/segments.h ============================================================================== --- stable/8/sys/i386/include/segments.h Thu Jan 6 14:19:29 2011 (r217055) +++ stable/8/sys/i386/include/segments.h Thu Jan 6 15:26:06 2011 (r217056) @@ -249,6 +249,7 @@ struct region_descriptor { #ifdef _KERNEL extern int _default_ldt; #ifdef XEN +extern struct proc_ldt default_proc_ldt; extern union descriptor *gdt; extern union descriptor *ldt; #else Modified: stable/8/sys/i386/xen/pmap.c ============================================================================== --- stable/8/sys/i386/xen/pmap.c Thu Jan 6 14:19:29 2011 (r217055) +++ stable/8/sys/i386/xen/pmap.c Thu Jan 6 15:26:06 2011 (r217056) @@ -3711,7 +3711,9 @@ pmap_map_readonly(pmap_t pmap, vm_offset for (i = 0; i < npages; i++) { pt_entry_t *pte; pte = pmap_pte(pmap, (vm_offset_t)(va + i*PAGE_SIZE)); + vm_page_lock_queues(); pte_store(pte, xpmap_mtop(*pte & ~(PG_RW|PG_M))); + vm_page_unlock_queues(); PMAP_MARK_PRIV(xpmap_mtop(*pte)); pmap_pte_release(pte); } @@ -3725,7 +3727,9 @@ pmap_map_readwrite(pmap_t pmap, vm_offse pt_entry_t *pte; pte = pmap_pte(pmap, (vm_offset_t)(va + i*PAGE_SIZE)); PMAP_MARK_UNPRIV(xpmap_mtop(*pte)); + vm_page_lock_queues(); pte_store(pte, xpmap_mtop(*pte) | (PG_RW|PG_M)); + vm_page_unlock_queues(); pmap_pte_release(pte); } } From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 6 16:25:09 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4323C1065670; Thu, 6 Jan 2011 16:25:09 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 315FB8FC12; Thu, 6 Jan 2011 16:25:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p06GP922021699; Thu, 6 Jan 2011 16:25:09 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p06GP9EY021697; Thu, 6 Jan 2011 16:25:09 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201101061625.p06GP9EY021697@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 6 Jan 2011 16:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217057 - stable/8/sys/dev/acpica X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 16:25:09 -0000 Author: jkim Date: Thu Jan 6 16:25:08 2011 New Revision: 217057 URL: http://svn.freebsd.org/changeset/base/217057 Log: MFC: r216940 Fix parameters for wakeup(9) and tsleep(9). Modified: stable/8/sys/dev/acpica/acpi_ec.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_ec.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_ec.c Thu Jan 6 15:26:06 2011 (r217056) +++ stable/8/sys/dev/acpica/acpi_ec.c Thu Jan 6 16:25:08 2011 (r217057) @@ -707,7 +707,7 @@ EcGpeHandler(void *Context) * address and then data values.) */ atomic_add_int(&sc->ec_gencount, 1); - wakeup(&sc); + wakeup(sc); /* * If the EC_SCI bit of the status register is set, queue a query handler. @@ -858,7 +858,7 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC */ for (i = 0; i < count; i++) { if (gen_count == sc->ec_gencount) - tsleep(&sc, 0, "ecgpe", slp_ival); + tsleep(sc, 0, "ecgpe", slp_ival); /* * Record new generation count. It's possible the GPE was * just to notify us that a query is needed and we need to From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 6 20:54:40 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55A571065670; Thu, 6 Jan 2011 20:54:40 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id E5A058FC15; Thu, 6 Jan 2011 20:54:38 +0000 (UTC) Received: by wyf19 with SMTP id 19so16939859wyf.13 for ; Thu, 06 Jan 2011 12:54:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :organization:user-agent:mime-version:to:cc:subject:references :in-reply-to:x-enigmail-version:content-type; bh=zfglwfJ8ks7BRHVttO8YRHYUz0Kq5lkAMNFZrPe/Zng=; b=p+UClHRMGxa00lIO0OPv44szna3kpISFrwnwnQ8qlJystF+opdzwF8HGyOyYhw6vRO hsTHJtEG2/ShrngzP1xnCjD79YXh13p6H6ptstr/DaeXyXLuZSiuUnhAAPoMKGRYWyrk Vh+uJ0oH40gFw/uWRuWrLoFdRDsPSwUT3VEfo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:organization:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type; b=pF87DzDJKT/uxvkHWO2aaI/coj9VJTwgYJ5QZytib0B//ioSOw3egTvsqR50x6WnYQ LtAWeVUxkNOAqAf9XG+Z65dLFe1UDAt2B4xng0sZWpcPMc9wVuT6tkkvobjE+lc2OqFY U0O5YNF7aLIIVmblpJDbrR7naKCPZqxeurp3k= Received: by 10.227.135.13 with SMTP id l13mr14587401wbt.84.1294345903716; Thu, 06 Jan 2011 12:31:43 -0800 (PST) Received: from centel.dataix.local (adsl-99-19-46-186.dsl.klmzmi.sbcglobal.net [99.19.46.186]) by mx.google.com with ESMTPS id f35sm17090916wbf.2.2011.01.06.12.31.39 (version=SSLv3 cipher=RC4-MD5); Thu, 06 Jan 2011 12:31:41 -0800 (PST) Sender: "J. Hellenthal" Message-ID: <4D2626AA.1080100@DataIX.net> Date: Thu, 06 Jan 2011 15:31:38 -0500 From: "J. Hellenthal" Organization: http://www.DataIX.net User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.13) Gecko/20101230 Lightning/1.0b1 Thunderbird MIME-Version: 1.0 To: Martin Matuska References: <201101060934.p069YMpl009611@svn.freebsd.org> <4D258E11.9090402@FreeBSD.org> In-Reply-To: <4D258E11.9090402@FreeBSD.org> X-Enigmail-Version: 1.1.2 Content-Type: multipart/mixed; boundary="------------040507000300050801060707" Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r217049 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 20:54:40 -0000 This is a multi-part message in MIME format. --------------040507000300050801060707 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Heads-up this currently has broken ~mm/patches/zfs/v28/stable-8-zfsv28-20101218.patch.xz ~mm/patches/zfs/v28/stable-8-zfsv28-20101223-nopython.patch.xz Attached is a reject of the applied patch regarding zio.c and the diff extracted from the above patches with a make.log from script(1). The make.log is from after I worked those changes into zio.c On 01/06/2011 04:40, Martin Matuska wrote: > My mistake: s/pav/pjd/g > > Dňa 06.01.2011 10:34, Martin Matuska wrote / napísal(a): >> Author: mm >> Date: Thu Jan 6 09:34:22 2011 >> New Revision: 217049 >> URL: http://svn.freebsd.org/changeset/base/217049 >> >> Log: >> MFC r216919: >> >> MFp4 186485, 186859: >> Fix a race by defining two tasks in the zio structure >> as we can still be returning from issue task when interrupt task is used. >> >> Reviewed by: pav >> Approved by: pav >> >> Modified: >> stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h >> stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c >> Directory Properties: >> stable/8/sys/ (props changed) >> stable/8/sys/amd64/include/xen/ (props changed) >> stable/8/sys/cddl/contrib/opensolaris/ (props changed) >> stable/8/sys/contrib/dev/acpica/ (props changed) >> stable/8/sys/contrib/pf/ (props changed) >> >> Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h >> ============================================================================== >> --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Jan 6 08:33:48 2011 (r217048) >> +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Jan 6 09:34:22 2011 (r217049) >> @@ -340,7 +340,8 @@ struct zio { >> >> #ifdef _KERNEL >> /* FreeBSD only. */ >> - struct ostask io_task; >> + struct ostask io_task_issue; >> + struct ostask io_task_interrupt; >> #endif >> }; >> >> >> Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c >> ============================================================================== >> --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jan 6 08:33:48 2011 (r217048) >> +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jan 6 09:34:22 2011 (r217049) >> @@ -947,6 +947,18 @@ zio_taskq_dispatch(zio_t *zio, enum zio_ >> { >> spa_t *spa = zio->io_spa; >> zio_type_t t = zio->io_type; >> +#ifdef _KERNEL >> + struct ostask *task; >> +#endif >> + >> + ASSERT(q == ZIO_TASKQ_ISSUE || q == ZIO_TASKQ_INTERRUPT); >> + >> +#ifdef _KERNEL >> + if (q == ZIO_TASKQ_ISSUE) >> + task = &zio->io_task_issue; >> + else /* if (q == ZIO_TASKQ_INTERRUPT) */ >> + task = &zio->io_task_interrupt; >> +#endif >> >> /* >> * If we're a config writer or a probe, the normal issue and >> @@ -970,8 +982,13 @@ zio_taskq_dispatch(zio_t *zio, enum zio_ >> q++; >> >> ASSERT3U(q, <, ZIO_TASKQ_TYPES); >> +#ifdef _KERNEL >> (void) taskq_dispatch_safe(spa->spa_zio_taskq[t][q], >> - (task_func_t *)zio_execute, zio, &zio->io_task); >> + (task_func_t *)zio_execute, zio, task); >> +#else >> + (void) taskq_dispatch(spa->spa_zio_taskq[t][q], >> + (task_func_t *)zio_execute, zio, TQ_SLEEP); >> +#endif >> } >> >> static boolean_t >> @@ -2300,9 +2317,16 @@ zio_done(zio_t *zio) >> * Reexecution is potentially a huge amount of work. >> * Hand it off to the otherwise-unused claim taskq. >> */ >> +#ifdef _KERNEL >> (void) taskq_dispatch_safe( >> spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], >> - (task_func_t *)zio_reexecute, zio, &zio->io_task); >> + (task_func_t *)zio_reexecute, zio, >> + &zio->io_task_issue); >> +#else >> + (void) taskq_dispatch( >> + spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], >> + (task_func_t *)zio_reexecute, zio, TQ_SLEEP); >> +#endif >> } >> return (ZIO_PIPELINE_STOP); >> } > _______________________________________________ > svn-src-stable-8@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8 > To unsubscribe, send any mail to "svn-src-stable-8-unsubscribe@freebsd.org" -- Regards, jhell,v JJH48-ARIN --------------040507000300050801060707 Content-Type: text/x-patch; name="zio.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="zio.c.diff" --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c (revision 216517) +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c (working copy) @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. */ #include @@ -32,6 +31,9 @@ #include #include #include +#include +#include +#include SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, zio, CTLFLAG_RW, 0, "ZFS ZIO"); @@ -57,6 +59,7 @@ 6, /* ZIO_PRIORITY_ASYNC_READ */ 10, /* ZIO_PRIORITY_RESILVER */ 20, /* ZIO_PRIORITY_SCRUB */ + 2, /* ZIO_PRIORITY_DDT_PREFETCH */ }; /* @@ -69,10 +72,6 @@ "zio_ioctl" }; -#define SYNC_PASS_DEFERRED_FREE 1 /* defer frees after this pass */ -#define SYNC_PASS_DONT_COMPRESS 4 /* don't compress after this pass */ -#define SYNC_PASS_REWRITE 1 /* rewrite new bps after this pass */ - /* * ========================================================================== * I/O kmem caches @@ -91,9 +90,16 @@ * An allocating zio is one that either currently has the DVA allocate * stage set or will have it later in its lifetime. */ -#define IO_IS_ALLOCATING(zio) \ - ((zio)->io_orig_pipeline & (1U << ZIO_STAGE_DVA_ALLOCATE)) +#define IO_IS_ALLOCATING(zio) ((zio)->io_orig_pipeline & ZIO_STAGE_DVA_ALLOCATE) +boolean_t zio_requeue_io_start_cut_in_line = B_TRUE; + +#ifdef ZFS_DEBUG +int zio_buf_debug_limit = 16384; +#else +int zio_buf_debug_limit = 0; +#endif + void zio_init(void) { @@ -113,6 +119,7 @@ size_t size = (c + 1) << SPA_MINBLOCKSHIFT; size_t p2 = size; size_t align = 0; + size_t cflags = (size > zio_buf_debug_limit) ? KMC_NODEBUG : 0; while (p2 & (p2 - 1)) p2 &= p2 - 1; @@ -129,11 +136,17 @@ char name[36]; (void) sprintf(name, "zio_buf_%lu", (ulong_t)size); zio_buf_cache[c] = kmem_cache_create(name, size, - align, NULL, NULL, NULL, NULL, NULL, KMC_NODEBUG); + align, NULL, NULL, NULL, NULL, NULL, cflags); + /* + * Since zio_data bufs do not appear in crash dumps, we + * pass KMC_NOTOUCH so that no allocator metadata is + * stored with the buffers. + */ (void) sprintf(name, "zio_data_buf_%lu", (ulong_t)size); zio_data_buf_cache[c] = kmem_cache_create(name, size, - align, NULL, NULL, NULL, NULL, NULL, KMC_NODEBUG); + align, NULL, NULL, NULL, NULL, NULL, + cflags | KMC_NOTOUCH); } } @@ -280,7 +293,8 @@ zt->zt_transform(zio, zt->zt_orig_data, zt->zt_orig_size); - zio_buf_free(zio->io_data, zt->zt_bufsize); + if (zt->zt_bufsize != 0) + zio_buf_free(zio->io_data, zt->zt_bufsize); zio->io_data = zt->zt_orig_data; zio->io_size = zt->zt_orig_size; @@ -309,7 +323,7 @@ { if (zio->io_error == 0 && zio_decompress_data(BP_GET_COMPRESS(zio->io_bp), - zio->io_data, zio->io_size, data, size) != 0) + zio->io_data, data, zio->io_size, size) != 0) zio->io_error = EIO; } @@ -394,6 +408,9 @@ list_insert_head(&pio->io_child_list, zl); list_insert_head(&cio->io_parent_list, zl); + pio->io_child_count++; + cio->io_parent_count++; + mutex_exit(&pio->io_lock); mutex_exit(&cio->io_lock); } @@ -410,6 +427,9 @@ list_remove(&pio->io_child_list, zl); list_remove(&cio->io_parent_list, zl); + pio->io_child_count--; + cio->io_parent_count--; + mutex_exit(&pio->io_lock); mutex_exit(&cio->io_lock); @@ -425,7 +445,7 @@ mutex_enter(&zio->io_lock); ASSERT(zio->io_stall == NULL); if (*countp != 0) { - zio->io_stage--; + zio->io_stage >>= 1; zio->io_stall = countp; waiting = B_TRUE; } @@ -467,10 +487,11 @@ * ========================================================================== */ static zio_t * -zio_create(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, +zio_create(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp, void *data, uint64_t size, zio_done_func_t *done, void *private, - zio_type_t type, int priority, int flags, vdev_t *vd, uint64_t offset, - const zbookmark_t *zb, uint8_t stage, uint32_t pipeline) + zio_type_t type, int priority, enum zio_flag flags, + vdev_t *vd, uint64_t offset, const zbookmark_t *zb, + enum zio_stage stage, enum zio_stage pipeline) { zio_t *zio; @@ -497,14 +518,17 @@ zio->io_child_type = ZIO_CHILD_VDEV; else if (flags & ZIO_FLAG_GANG_CHILD) zio->io_child_type = ZIO_CHILD_GANG; + else if (flags & ZIO_FLAG_DDT_CHILD) + zio->io_child_type = ZIO_CHILD_DDT; else zio->io_child_type = ZIO_CHILD_LOGICAL; if (bp != NULL) { - zio->io_bp = bp; + zio->io_bp = (blkptr_t *)bp; zio->io_bp_copy = *bp; zio->io_bp_orig = *bp; - if (type != ZIO_TYPE_WRITE) + if (type != ZIO_TYPE_WRITE || + zio->io_child_type == ZIO_CHILD_DDT) zio->io_bp = &zio->io_bp_copy; /* so caller can free */ if (zio->io_child_type == ZIO_CHILD_LOGICAL) zio->io_logical = zio; @@ -514,14 +538,14 @@ zio->io_spa = spa; zio->io_txg = txg; - zio->io_data = data; - zio->io_size = size; zio->io_done = done; zio->io_private = private; zio->io_type = type; zio->io_priority = priority; zio->io_vd = vd; zio->io_offset = offset; + zio->io_orig_data = zio->io_data = data; + zio->io_orig_size = zio->io_size = size; zio->io_orig_flags = zio->io_flags = flags; zio->io_orig_stage = zio->io_stage = stage; zio->io_orig_pipeline = zio->io_pipeline = pipeline; @@ -555,7 +579,7 @@ zio_t * zio_null(zio_t *pio, spa_t *spa, vdev_t *vd, zio_done_func_t *done, - void *private, int flags) + void *private, enum zio_flag flags) { zio_t *zio; @@ -567,7 +591,7 @@ } zio_t * -zio_root(spa_t *spa, zio_done_func_t *done, void *private, int flags) +zio_root(spa_t *spa, zio_done_func_t *done, void *private, enum zio_flag flags) { return (zio_null(NULL, spa, NULL, done, private, flags)); } @@ -575,23 +599,24 @@ zio_t * zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, void *data, uint64_t size, zio_done_func_t *done, void *private, - int priority, int flags, const zbookmark_t *zb) + int priority, enum zio_flag flags, const zbookmark_t *zb) { zio_t *zio; - zio = zio_create(pio, spa, bp->blk_birth, (blkptr_t *)bp, + zio = zio_create(pio, spa, BP_PHYSICAL_BIRTH(bp), bp, data, size, done, private, ZIO_TYPE_READ, priority, flags, NULL, 0, zb, - ZIO_STAGE_OPEN, ZIO_READ_PIPELINE); + ZIO_STAGE_OPEN, (flags & ZIO_FLAG_DDT_CHILD) ? + ZIO_DDT_CHILD_READ_PIPELINE : ZIO_READ_PIPELINE); return (zio); } zio_t * zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, - void *data, uint64_t size, zio_prop_t *zp, + void *data, uint64_t size, const zio_prop_t *zp, zio_done_func_t *ready, zio_done_func_t *done, void *private, - int priority, int flags, const zbookmark_t *zb) + int priority, enum zio_flag flags, const zbookmark_t *zb) { zio_t *zio; @@ -601,13 +626,15 @@ zp->zp_compress < ZIO_COMPRESS_FUNCTIONS && zp->zp_type < DMU_OT_NUMTYPES && zp->zp_level < 32 && - zp->zp_ndvas > 0 && - zp->zp_ndvas <= spa_max_replication(spa)); - ASSERT(ready != NULL); + zp->zp_copies > 0 && + zp->zp_copies <= spa_max_replication(spa) && + zp->zp_dedup <= 1 && + zp->zp_dedup_verify <= 1); zio = zio_create(pio, spa, txg, bp, data, size, done, private, ZIO_TYPE_WRITE, priority, flags, NULL, 0, zb, - ZIO_STAGE_OPEN, ZIO_WRITE_PIPELINE); + ZIO_STAGE_OPEN, (flags & ZIO_FLAG_DDT_CHILD) ? + ZIO_DDT_CHILD_WRITE_PIPELINE : ZIO_WRITE_PIPELINE); zio->io_ready = ready; zio->io_prop = *zp; @@ -618,7 +645,7 @@ zio_t * zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data, uint64_t size, zio_done_func_t *done, void *private, int priority, - int flags, zbookmark_t *zb) + enum zio_flag flags, zbookmark_t *zb) { zio_t *zio; @@ -629,33 +656,47 @@ return (zio); } +void +zio_write_override(zio_t *zio, blkptr_t *bp, int copies) +{ + ASSERT(zio->io_type == ZIO_TYPE_WRITE); + ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL); + ASSERT(zio->io_stage == ZIO_STAGE_OPEN); + ASSERT(zio->io_txg == spa_syncing_txg(zio->io_spa)); + + zio->io_prop.zp_copies = copies; + zio->io_bp_override = bp; +} + +void +zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp) +{ + bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); +} + zio_t * -zio_free(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, - zio_done_func_t *done, void *private, int flags) +zio_free_sync(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp, + enum zio_flag flags) { zio_t *zio; + dprintf_bp(bp, "freeing in txg %llu, pass %u", + (longlong_t)txg, spa->spa_sync_pass); + ASSERT(!BP_IS_HOLE(bp)); + ASSERT(spa_syncing_txg(spa) == txg); + ASSERT(spa_sync_pass(spa) <= SYNC_PASS_DEFERRED_FREE); - if (bp->blk_fill == BLK_FILL_ALREADY_FREED) - return (zio_null(pio, spa, NULL, NULL, NULL, flags)); - - if (txg == spa->spa_syncing_txg && - spa_sync_pass(spa) > SYNC_PASS_DEFERRED_FREE) { - bplist_enqueue_deferred(&spa->spa_sync_bplist, bp); - return (zio_null(pio, spa, NULL, NULL, NULL, flags)); - } - zio = zio_create(pio, spa, txg, bp, NULL, BP_GET_PSIZE(bp), - done, private, ZIO_TYPE_FREE, ZIO_PRIORITY_FREE, flags, + NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_FREE, flags, NULL, 0, NULL, ZIO_STAGE_OPEN, ZIO_FREE_PIPELINE); return (zio); } zio_t * -zio_claim(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, - zio_done_func_t *done, void *private, int flags) +zio_claim(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp, + zio_done_func_t *done, void *private, enum zio_flag flags) { zio_t *zio; @@ -669,9 +710,11 @@ * * All claims *must* be resolved in the first txg -- before the SPA * starts allocating blocks -- so that nothing is allocated twice. + * If txg == 0 we just verify that the block is claimable. */ ASSERT3U(spa->spa_uberblock.ub_rootbp.blk_birth, <, spa_first_txg(spa)); - ASSERT3U(spa_first_txg(spa), <=, txg); + ASSERT(txg == spa_first_txg(spa) || txg == 0); + ASSERT(!BP_GET_DEDUP(bp) || !spa_writeable(spa)); /* zdb(1M) */ zio = zio_create(pio, spa, txg, bp, NULL, BP_GET_PSIZE(bp), done, private, ZIO_TYPE_CLAIM, ZIO_PRIORITY_NOW, flags, @@ -682,7 +725,7 @@ zio_t * zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd, - zio_done_func_t *done, void *private, int priority, int flags) + zio_done_func_t *done, void *private, int priority, enum zio_flag flags) { zio_t *zio; int c; @@ -707,7 +750,7 @@ zio_t * zio_read_phys(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size, void *data, int checksum, zio_done_func_t *done, void *private, - int priority, int flags, boolean_t labels) + int priority, enum zio_flag flags, boolean_t labels) { zio_t *zio; @@ -728,7 +771,7 @@ zio_t * zio_write_phys(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size, void *data, int checksum, zio_done_func_t *done, void *private, - int priority, int flags, boolean_t labels) + int priority, enum zio_flag flags, boolean_t labels) { zio_t *zio; @@ -743,9 +786,9 @@ zio->io_prop.zp_checksum = checksum; - if (zio_checksum_table[checksum].ci_zbt) { + if (zio_checksum_table[checksum].ci_eck) { /* - * zbt checksums are necessarily destructive -- they modify + * zec checksums are necessarily destructive -- they modify * the end of the write buffer to hold the verifier/checksum. * Therefore, we must make a local copy in case the data is * being written to multiple places in parallel. @@ -763,10 +806,10 @@ */ zio_t * zio_vdev_child_io(zio_t *pio, blkptr_t *bp, vdev_t *vd, uint64_t offset, - void *data, uint64_t size, int type, int priority, int flags, + void *data, uint64_t size, int type, int priority, enum zio_flag flags, zio_done_func_t *done, void *private) { - uint32_t pipeline = ZIO_VDEV_CHILD_PIPELINE; + enum zio_stage pipeline = ZIO_VDEV_CHILD_PIPELINE; zio_t *zio; ASSERT(vd->vdev_parent == @@ -779,26 +822,33 @@ * detection as close to the leaves as possible and * eliminates redundant checksums in the interior nodes. */ - pipeline |= 1U << ZIO_STAGE_CHECKSUM_VERIFY; - pio->io_pipeline &= ~(1U << ZIO_STAGE_CHECKSUM_VERIFY); + pipeline |= ZIO_STAGE_CHECKSUM_VERIFY; + pio->io_pipeline &= ~ZIO_STAGE_CHECKSUM_VERIFY; } if (vd->vdev_children == 0) offset += VDEV_LABEL_START_SIZE; + flags |= ZIO_VDEV_CHILD_FLAGS(pio) | ZIO_FLAG_DONT_PROPAGATE; + + /* + * If we've decided to do a repair, the write is not speculative -- + * even if the original read was. + */ + if (flags & ZIO_FLAG_IO_REPAIR) + flags &= ~ZIO_FLAG_SPECULATIVE; + zio = zio_create(pio, pio->io_spa, pio->io_txg, bp, data, size, - done, private, type, priority, - (pio->io_flags & ZIO_FLAG_VDEV_INHERIT) | - ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE | flags, - vd, offset, &pio->io_bookmark, - ZIO_STAGE_VDEV_IO_START - 1, pipeline); + done, private, type, priority, flags, vd, offset, &pio->io_bookmark, + ZIO_STAGE_VDEV_IO_START >> 1, pipeline); return (zio); } zio_t * zio_vdev_delegated_io(vdev_t *vd, uint64_t offset, void *data, uint64_t size, - int type, int priority, int flags, zio_done_func_t *done, void *private) + int type, int priority, enum zio_flag flags, + zio_done_func_t *done, void *private) { zio_t *zio; @@ -808,7 +858,7 @@ data, size, done, private, type, priority, flags | ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_RETRY, vd, offset, NULL, - ZIO_STAGE_VDEV_IO_START - 1, ZIO_VDEV_CHILD_PIPELINE); + ZIO_STAGE_VDEV_IO_START >> 1, ZIO_VDEV_CHILD_PIPELINE); return (zio); } @@ -821,6 +871,23 @@ ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY)); } +void +zio_shrink(zio_t *zio, uint64_t size) +{ + ASSERT(zio->io_executor == NULL); + ASSERT(zio->io_orig_size == zio->io_size); + ASSERT(size <= zio->io_size); + + /* + * We don't shrink for raidz because of problems with the + * reconstruction when reading back less than the block size. + * Note, BP_IS_RAIDZ() assumes no compression. + */ + ASSERT(BP_GET_COMPRESS(zio->io_bp) == ZIO_COMPRESS_OFF); + if (!BP_IS_RAIDZ(zio->io_bp)) + zio->io_orig_size = zio->io_size = size; +} + /* * ========================================================================== * Prepare to read and write logical blocks @@ -835,28 +902,33 @@ if (BP_GET_COMPRESS(bp) != ZIO_COMPRESS_OFF && zio->io_child_type == ZIO_CHILD_LOGICAL && !(zio->io_flags & ZIO_FLAG_RAW)) { - uint64_t csize = BP_GET_PSIZE(bp); - void *cbuf = zio_buf_alloc(csize); + uint64_t psize = BP_GET_PSIZE(bp); + void *cbuf = zio_buf_alloc(psize); - zio_push_transform(zio, cbuf, csize, csize, zio_decompress); + zio_push_transform(zio, cbuf, psize, psize, zio_decompress); } if (!dmu_ot[BP_GET_TYPE(bp)].ot_metadata && BP_GET_LEVEL(bp) == 0) zio->io_flags |= ZIO_FLAG_DONT_CACHE; + if (BP_GET_TYPE(bp) == DMU_OT_DDT_ZAP) + zio->io_flags |= ZIO_FLAG_DONT_CACHE; + + if (BP_GET_DEDUP(bp) && zio->io_child_type == ZIO_CHILD_LOGICAL) + zio->io_pipeline = ZIO_DDT_READ_PIPELINE; + return (ZIO_PIPELINE_CONTINUE); } static int zio_write_bp_init(zio_t *zio) { + spa_t *spa = zio->io_spa; zio_prop_t *zp = &zio->io_prop; - int compress = zp->zp_compress; + enum zio_compress compress = zp->zp_compress; blkptr_t *bp = zio->io_bp; - void *cbuf; uint64_t lsize = zio->io_size; - uint64_t csize = lsize; - uint64_t cbufsize = 0; + uint64_t psize = lsize; int pass = 1; /* @@ -870,8 +942,30 @@ if (!IO_IS_ALLOCATING(zio)) return (ZIO_PIPELINE_CONTINUE); - ASSERT(compress != ZIO_COMPRESS_INHERIT); + ASSERT(zio->io_child_type != ZIO_CHILD_DDT); + if (zio->io_bp_override) { + ASSERT(bp->blk_birth != zio->io_txg); + ASSERT(BP_GET_DEDUP(zio->io_bp_override) == 0); + + *bp = *zio->io_bp_override; + zio->io_pipeline = ZIO_INTERLOCK_PIPELINE; + + if (BP_IS_HOLE(bp) || !zp->zp_dedup) + return (ZIO_PIPELINE_CONTINUE); + + ASSERT(zio_checksum_table[zp->zp_checksum].ci_dedup || + zp->zp_dedup_verify); + + if (BP_GET_CHECKSUM(bp) == zp->zp_checksum) { + BP_SET_DEDUP(bp, 1); + zio->io_pipeline |= ZIO_STAGE_DDT_WRITE; + return (ZIO_PIPELINE_CONTINUE); + } + zio->io_bp_override = NULL; + BP_ZERO(bp); + } + if (bp->blk_birth == zio->io_txg) { /* * We're rewriting an existing block, which means we're @@ -882,22 +976,29 @@ * convergence take longer. Therefore, after the first * few passes, stop compressing to ensure convergence. */ - pass = spa_sync_pass(zio->io_spa); + pass = spa_sync_pass(spa); + ASSERT(zio->io_txg == spa_syncing_txg(spa)); + ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL); + ASSERT(!BP_GET_DEDUP(bp)); + if (pass > SYNC_PASS_DONT_COMPRESS) compress = ZIO_COMPRESS_OFF; /* Make sure someone doesn't change their mind on overwrites */ - ASSERT(MIN(zp->zp_ndvas + BP_IS_GANG(bp), - spa_max_replication(zio->io_spa)) == BP_GET_NDVAS(bp)); + ASSERT(MIN(zp->zp_copies + BP_IS_GANG(bp), + spa_max_replication(spa)) == BP_GET_NDVAS(bp)); } if (compress != ZIO_COMPRESS_OFF) { - if (!zio_compress_data(compress, zio->io_data, zio->io_size, - &cbuf, &csize, &cbufsize)) { + void *cbuf = zio_buf_alloc(lsize); + psize = zio_compress_data(compress, zio->io_data, cbuf, lsize); + if (psize == 0 || psize == lsize) { compress = ZIO_COMPRESS_OFF; - } else if (csize != 0) { - zio_push_transform(zio, cbuf, csize, cbufsize, NULL); + zio_buf_free(cbuf, lsize); + } else { + ASSERT(psize < lsize); + zio_push_transform(zio, cbuf, psize, lsize, NULL); } } @@ -909,10 +1010,10 @@ * spa_sync() to allocate new blocks, but force rewrites after that. * There should only be a handful of blocks after pass 1 in any case. */ - if (bp->blk_birth == zio->io_txg && BP_GET_PSIZE(bp) == csize && + if (bp->blk_birth == zio->io_txg && BP_GET_PSIZE(bp) == psize && pass > SYNC_PASS_REWRITE) { - ASSERT(csize != 0); - uint32_t gang_stages = zio->io_pipeline & ZIO_GANG_STAGES; + ASSERT(psize != 0); + enum zio_stage gang_stages = zio->io_pipeline & ZIO_GANG_STAGES; zio->io_pipeline = ZIO_REWRITE_PIPELINE | gang_stages; zio->io_flags |= ZIO_FLAG_IO_REWRITE; } else { @@ -920,22 +1021,41 @@ zio->io_pipeline = ZIO_WRITE_PIPELINE; } - if (csize == 0) { + if (psize == 0) { zio->io_pipeline = ZIO_INTERLOCK_PIPELINE; } else { ASSERT(zp->zp_checksum != ZIO_CHECKSUM_GANG_HEADER); BP_SET_LSIZE(bp, lsize); - BP_SET_PSIZE(bp, csize); + BP_SET_PSIZE(bp, psize); BP_SET_COMPRESS(bp, compress); BP_SET_CHECKSUM(bp, zp->zp_checksum); BP_SET_TYPE(bp, zp->zp_type); BP_SET_LEVEL(bp, zp->zp_level); + BP_SET_DEDUP(bp, zp->zp_dedup); BP_SET_BYTEORDER(bp, ZFS_HOST_BYTEORDER); + if (zp->zp_dedup) { + ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL); + ASSERT(!(zio->io_flags & ZIO_FLAG_IO_REWRITE)); + zio->io_pipeline = ZIO_DDT_WRITE_PIPELINE; + } } return (ZIO_PIPELINE_CONTINUE); } +static int +zio_free_bp_init(zio_t *zio) +{ + blkptr_t *bp = zio->io_bp; + + if (zio->io_child_type == ZIO_CHILD_LOGICAL) { + if (BP_GET_DEDUP(bp)) + zio->io_pipeline = ZIO_DDT_FREE_PIPELINE; + } + + return (ZIO_PIPELINE_CONTINUE); +} + /* * ========================================================================== * Execute the I/O pipeline @@ -943,11 +1063,24 @@ */ static void -zio_taskq_dispatch(zio_t *zio, enum zio_taskq_type q) +zio_taskq_dispatch(zio_t *zio, enum zio_taskq_type q, boolean_t cutinline) { spa_t *spa = zio->io_spa; zio_type_t t = zio->io_type; + int flags = TQ_SLEEP | (cutinline ? TQ_FRONT : 0); +#ifdef _KERNEL + struct ostask *task; +#endif + ASSERT(q == ZIO_TASKQ_ISSUE || q == ZIO_TASKQ_INTERRUPT); + +#ifdef _KERNEL + if (q == ZIO_TASKQ_ISSUE) + task = &zio->io_task_issue; + else /* if (q == ZIO_TASKQ_INTERRUPT) */ + task = &zio->io_task_interrupt; +#endif + /* * If we're a config writer or a probe, the normal issue and * interrupt threads may all be blocked waiting for the config lock. @@ -970,8 +1103,13 @@ q++; ASSERT3U(q, <, ZIO_TASKQ_TYPES); +#ifdef _KERNEL (void) taskq_dispatch_safe(spa->spa_zio_taskq[t][q], - (task_func_t *)zio_execute, zio, &zio->io_task); + (task_func_t *)zio_execute, zio, flags, task); +#else + (void) taskq_dispatch(spa->spa_zio_taskq[t][q], + (task_func_t *)zio_execute, zio, flags); +#endif } static boolean_t @@ -990,7 +1128,7 @@ static int zio_issue_async(zio_t *zio) { - zio_taskq_dispatch(zio, ZIO_TASKQ_ISSUE); + zio_taskq_dispatch(zio, ZIO_TASKQ_ISSUE, B_FALSE); return (ZIO_PIPELINE_STOP); } @@ -998,7 +1136,7 @@ void zio_interrupt(zio_t *zio) { - zio_taskq_dispatch(zio, ZIO_TASKQ_INTERRUPT); + zio_taskq_dispatch(zio, ZIO_TASKQ_INTERRUPT, B_FALSE); } /* @@ -1014,7 +1152,7 @@ * There's no locking on io_stage because there's no legitimate way * for multiple threads to be attempting to process the same I/O. */ -static zio_pipe_stage_t *zio_pipeline[ZIO_STAGES]; +static zio_pipe_stage_t *zio_pipeline[]; void zio_execute(zio_t *zio) @@ -1022,32 +1160,39 @@ zio->io_executor = curthread; while (zio->io_stage < ZIO_STAGE_DONE) { - uint32_t pipeline = zio->io_pipeline; - zio_stage_t stage = zio->io_stage; + enum zio_stage pipeline = zio->io_pipeline; + enum zio_stage stage = zio->io_stage; int rv; ASSERT(!MUTEX_HELD(&zio->io_lock)); + ASSERT(ISP2(stage)); + ASSERT(zio->io_stall == NULL); - while (((1U << ++stage) & pipeline) == 0) - continue; + do { + stage <<= 1; + } while ((stage & pipeline) == 0); ASSERT(stage <= ZIO_STAGE_DONE); - ASSERT(zio->io_stall == NULL); /* * If we are in interrupt context and this pipeline stage * will grab a config lock that is held across I/O, - * issue async to avoid deadlock. + * or may wait for an I/O that needs an interrupt thread + * to complete, issue async to avoid deadlock. + * + * For VDEV_IO_START, we cut in line so that the io will + * be sent to disk promptly. */ - if (((1U << stage) & ZIO_CONFIG_LOCK_BLOCKING_STAGES) && - zio->io_vd == NULL && + if ((stage & ZIO_BLOCKING_STAGES) && zio->io_vd == NULL && zio_taskq_member(zio, ZIO_TASKQ_INTERRUPT)) { - zio_taskq_dispatch(zio, ZIO_TASKQ_ISSUE); + boolean_t cut = (stage == ZIO_STAGE_VDEV_IO_START) ? + zio_requeue_io_start_cut_in_line : B_FALSE; + zio_taskq_dispatch(zio, ZIO_TASKQ_ISSUE, cut); return; } zio->io_stage = stage; - rv = zio_pipeline[stage](zio); + rv = zio_pipeline[highbit(stage) - 1](zio); if (rv == ZIO_PIPELINE_STOP) return; @@ -1130,19 +1275,8 @@ for (int c = 0; c < ZIO_CHILD_TYPES; c++) pio->io_child_error[c] = 0; - if (IO_IS_ALLOCATING(pio)) { - /* - * Remember the failed bp so that the io_ready() callback - * can update its accounting upon reexecution. The block - * was already freed in zio_done(); we indicate this with - * a fill count of -1 so that zio_free() knows to skip it. - */ - blkptr_t *bp = pio->io_bp; - ASSERT(bp->blk_birth == 0 || bp->blk_birth == pio->io_txg); - bp->blk_fill = BLK_FILL_ALREADY_FREED; - pio->io_bp_orig = *bp; - BP_ZERO(bp); - } + if (IO_IS_ALLOCATING(pio)) + BP_ZERO(pio->io_bp); /* * As we reexecute pio's children, new children could be created. @@ -1330,6 +1464,12 @@ zio_checksum_compute(zio, BP_GET_CHECKSUM(bp), data, BP_GET_PSIZE(bp)); } + /* + * If we are here to damage data for testing purposes, + * leave the GBH alone so that we can detect the damage. + */ + if (pio->io_gang_leader->io_flags & ZIO_FLAG_INDUCE_DAMAGE) + zio->io_pipeline &= ~ZIO_VDEV_IO_STAGES; } else { zio = zio_rewrite(pio, pio->io_spa, pio->io_txg, bp, data, BP_GET_PSIZE(bp), NULL, NULL, pio->io_priority, @@ -1343,8 +1483,8 @@ zio_t * zio_free_gang(zio_t *pio, blkptr_t *bp, zio_gang_node_t *gn, void *data) { - return (zio_free(pio, pio->io_spa, pio->io_txg, bp, - NULL, NULL, ZIO_GANG_CHILD_FLAGS(pio))); + return (zio_free_sync(pio, pio->io_spa, pio->io_txg, bp, + ZIO_GANG_CHILD_FLAGS(pio))); } /* ARGSUSED */ @@ -1428,7 +1568,7 @@ blkptr_t *bp = zio->io_bp; ASSERT(gio == zio_unique_parent(zio)); - ASSERT(zio_walk_children(zio) == NULL); + ASSERT(zio->io_child_count == 0); if (zio->io_error) return; @@ -1438,7 +1578,7 @@ ASSERT(zio->io_data == gn->gn_gbh); ASSERT(zio->io_size == SPA_GANGBLOCKSIZE); - ASSERT(gn->gn_gbh->zg_tail.zbt_magic == ZBT_MAGIC); + ASSERT(gn->gn_gbh->zg_tail.zec_magic == ZEC_MAGIC); for (int g = 0; g < SPA_GBH_NBLKPTRS; g++) { blkptr_t *gbp = &gn->gn_gbh->zg_blkptr[g]; @@ -1465,7 +1605,7 @@ zio = zio_gang_issue_func[gio->io_type](pio, bp, gn, data); if (gn != NULL) { - ASSERT(gn->gn_gbh->zg_tail.zbt_magic == ZBT_MAGIC); + ASSERT(gn->gn_gbh->zg_tail.zec_magic == ZEC_MAGIC); for (int g = 0; g < SPA_GBH_NBLKPTRS; g++) { blkptr_t *gbp = &gn->gn_gbh->zg_blkptr[g]; @@ -1534,9 +1674,9 @@ ASSERT(BP_IS_HOLE(&zio->io_bp_orig)); ASSERT(zio->io_child_type == ZIO_CHILD_GANG); - ASSERT3U(zio->io_prop.zp_ndvas, ==, gio->io_prop.zp_ndvas); - ASSERT3U(zio->io_prop.zp_ndvas, <=, BP_GET_NDVAS(zio->io_bp)); - ASSERT3U(pio->io_prop.zp_ndvas, <=, BP_GET_NDVAS(pio->io_bp)); + ASSERT3U(zio->io_prop.zp_copies, ==, gio->io_prop.zp_copies); + ASSERT3U(zio->io_prop.zp_copies, <=, BP_GET_NDVAS(zio->io_bp)); + ASSERT3U(pio->io_prop.zp_copies, <=, BP_GET_NDVAS(pio->io_bp)); ASSERT3U(BP_GET_NDVAS(zio->io_bp), <=, BP_GET_NDVAS(pio->io_bp)); mutex_enter(&pio->io_lock); @@ -1561,13 +1701,13 @@ uint64_t txg = pio->io_txg; uint64_t resid = pio->io_size; uint64_t lsize; - int ndvas = gio->io_prop.zp_ndvas; - int gbh_ndvas = MIN(ndvas + 1, spa_max_replication(spa)); + int copies = gio->io_prop.zp_copies; + int gbh_copies = MIN(copies + 1, spa_max_replication(spa)); zio_prop_t zp; int error; - error = metaslab_alloc(spa, spa->spa_normal_class, SPA_GANGBLOCKSIZE, - bp, gbh_ndvas, txg, pio == gio ? NULL : gio->io_bp, + error = metaslab_alloc(spa, spa_normal_class(spa), SPA_GANGBLOCKSIZE, + bp, gbh_copies, txg, pio == gio ? NULL : gio->io_bp, METASLAB_HINTBP_FAVOR | METASLAB_GANG_HEADER); if (error) { pio->io_error = error; @@ -1603,7 +1743,9 @@ zp.zp_compress = ZIO_COMPRESS_OFF; zp.zp_type = DMU_OT_NONE; zp.zp_level = 0; - zp.zp_ndvas = gio->io_prop.zp_ndvas; + zp.zp_copies = gio->io_prop.zp_copies; + zp.zp_dedup = 0; + zp.zp_dedup_verify = 0; zio_nowait(zio_write(zio, spa, txg, &gbh->zg_blkptr[g], (char *)pio->io_data + (pio->io_size - resid), lsize, &zp, @@ -1624,15 +1766,383 @@ /* * ========================================================================== - * Allocate and free blocks + * Dedup * ========================================================================== */ +static void +zio_ddt_child_read_done(zio_t *zio) +{ + blkptr_t *bp = zio->io_bp; + ddt_entry_t *dde = zio->io_private; + ddt_phys_t *ddp; + zio_t *pio = zio_unique_parent(zio); + mutex_enter(&pio->io_lock); + ddp = ddt_phys_select(dde, bp); + if (zio->io_error == 0) + ddt_phys_clear(ddp); /* this ddp doesn't need repair */ + if (zio->io_error == 0 && dde->dde_repair_data == NULL) + dde->dde_repair_data = zio->io_data; + else + zio_buf_free(zio->io_data, zio->io_size); + mutex_exit(&pio->io_lock); +} + static int +zio_ddt_read_start(zio_t *zio) +{ + blkptr_t *bp = zio->io_bp; + + ASSERT(BP_GET_DEDUP(bp)); + ASSERT(BP_GET_PSIZE(bp) == zio->io_size); + ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL); + + if (zio->io_child_error[ZIO_CHILD_DDT]) { + ddt_t *ddt = ddt_select(zio->io_spa, bp); + ddt_entry_t *dde = ddt_repair_start(ddt, bp); + ddt_phys_t *ddp = dde->dde_phys; + ddt_phys_t *ddp_self = ddt_phys_select(dde, bp); + blkptr_t blk; + + ASSERT(zio->io_vsd == NULL); + zio->io_vsd = dde; + + if (ddp_self == NULL) + return (ZIO_PIPELINE_CONTINUE); + + for (int p = 0; p < DDT_PHYS_TYPES; p++, ddp++) { + if (ddp->ddp_phys_birth == 0 || ddp == ddp_self) + continue; + ddt_bp_create(ddt->ddt_checksum, &dde->dde_key, ddp, + &blk); + zio_nowait(zio_read(zio, zio->io_spa, &blk, + zio_buf_alloc(zio->io_size), zio->io_size, + zio_ddt_child_read_done, dde, zio->io_priority, + ZIO_DDT_CHILD_FLAGS(zio) | ZIO_FLAG_DONT_PROPAGATE, + &zio->io_bookmark)); + } + return (ZIO_PIPELINE_CONTINUE); + } + + zio_nowait(zio_read(zio, zio->io_spa, bp, + zio->io_data, zio->io_size, NULL, NULL, zio->io_priority, + ZIO_DDT_CHILD_FLAGS(zio), &zio->io_bookmark)); + + return (ZIO_PIPELINE_CONTINUE); +} + +static int +zio_ddt_read_done(zio_t *zio) +{ + blkptr_t *bp = zio->io_bp; + + if (zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE)) + return (ZIO_PIPELINE_STOP); + + ASSERT(BP_GET_DEDUP(bp)); + ASSERT(BP_GET_PSIZE(bp) == zio->io_size); + ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL); + + if (zio->io_child_error[ZIO_CHILD_DDT]) { + ddt_t *ddt = ddt_select(zio->io_spa, bp); + ddt_entry_t *dde = zio->io_vsd; + if (ddt == NULL) { + ASSERT(spa_load_state(zio->io_spa) != SPA_LOAD_NONE); + return (ZIO_PIPELINE_CONTINUE); + } + if (dde == NULL) { + zio->io_stage = ZIO_STAGE_DDT_READ_START >> 1; + zio_taskq_dispatch(zio, ZIO_TASKQ_ISSUE, B_FALSE); + return (ZIO_PIPELINE_STOP); + } + if (dde->dde_repair_data != NULL) { + bcopy(dde->dde_repair_data, zio->io_data, zio->io_size); + zio->io_child_error[ZIO_CHILD_DDT] = 0; + } + ddt_repair_done(ddt, dde); + zio->io_vsd = NULL; + } + + ASSERT(zio->io_vsd == NULL); + + return (ZIO_PIPELINE_CONTINUE); +} + +static boolean_t +zio_ddt_collision(zio_t *zio, ddt_t *ddt, ddt_entry_t *dde) +{ + spa_t *spa = zio->io_spa; + + /* + * Note: we compare the original data, not the transformed data, + * because when zio->io_bp is an override bp, we will not have + * pushed the I/O transforms. That's an important optimization + * because otherwise we'd compress/encrypt all dmu_sync() data twice. + */ + for (int p = DDT_PHYS_SINGLE; p <= DDT_PHYS_TRIPLE; p++) { + zio_t *lio = dde->dde_lead_zio[p]; + + if (lio != NULL) { + return (lio->io_orig_size != zio->io_orig_size || + bcmp(zio->io_orig_data, lio->io_orig_data, + zio->io_orig_size) != 0); + } + } + + for (int p = DDT_PHYS_SINGLE; p <= DDT_PHYS_TRIPLE; p++) { + ddt_phys_t *ddp = &dde->dde_phys[p]; + + if (ddp->ddp_phys_birth != 0) { + arc_buf_t *abuf = NULL; + uint32_t aflags = ARC_WAIT; + blkptr_t blk = *zio->io_bp; + int error; + + ddt_bp_fill(ddp, &blk, ddp->ddp_phys_birth); + + ddt_exit(ddt); + + error = arc_read_nolock(NULL, spa, &blk, + arc_getbuf_func, &abuf, ZIO_PRIORITY_SYNC_READ, + ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE, + &aflags, &zio->io_bookmark); + + if (error == 0) { + if (arc_buf_size(abuf) != zio->io_orig_size || + bcmp(abuf->b_data, zio->io_orig_data, + zio->io_orig_size) != 0) + error = EEXIST; + VERIFY(arc_buf_remove_ref(abuf, &abuf) == 1); + } + + ddt_enter(ddt); + return (error != 0); + } + } + + return (B_FALSE); +} + +static void +zio_ddt_child_write_ready(zio_t *zio) +{ + int p = zio->io_prop.zp_copies; + ddt_t *ddt = ddt_select(zio->io_spa, zio->io_bp); + ddt_entry_t *dde = zio->io_private; + ddt_phys_t *ddp = &dde->dde_phys[p]; + zio_t *pio; + + if (zio->io_error) + return; + + ddt_enter(ddt); + + ASSERT(dde->dde_lead_zio[p] == zio); + + ddt_phys_fill(ddp, zio->io_bp); + + while ((pio = zio_walk_parents(zio)) != NULL) + ddt_bp_fill(ddp, pio->io_bp, zio->io_txg); + + ddt_exit(ddt); +} + +static void +zio_ddt_child_write_done(zio_t *zio) +{ + int p = zio->io_prop.zp_copies; + ddt_t *ddt = ddt_select(zio->io_spa, zio->io_bp); + ddt_entry_t *dde = zio->io_private; + ddt_phys_t *ddp = &dde->dde_phys[p]; + + ddt_enter(ddt); + + ASSERT(ddp->ddp_refcnt == 0); + ASSERT(dde->dde_lead_zio[p] == zio); + dde->dde_lead_zio[p] = NULL; + + if (zio->io_error == 0) { + while (zio_walk_parents(zio) != NULL) + ddt_phys_addref(ddp); + } else { + ddt_phys_clear(ddp); + } + + ddt_exit(ddt); +} + +static void +zio_ddt_ditto_write_done(zio_t *zio) +{ + int p = DDT_PHYS_DITTO; + zio_prop_t *zp = &zio->io_prop; + blkptr_t *bp = zio->io_bp; + ddt_t *ddt = ddt_select(zio->io_spa, bp); + ddt_entry_t *dde = zio->io_private; + ddt_phys_t *ddp = &dde->dde_phys[p]; + ddt_key_t *ddk = &dde->dde_key; + + ddt_enter(ddt); + + ASSERT(ddp->ddp_refcnt == 0); + ASSERT(dde->dde_lead_zio[p] == zio); + dde->dde_lead_zio[p] = NULL; + + if (zio->io_error == 0) { + ASSERT(ZIO_CHECKSUM_EQUAL(bp->blk_cksum, ddk->ddk_cksum)); + ASSERT(zp->zp_copies < SPA_DVAS_PER_BP); + ASSERT(zp->zp_copies == BP_GET_NDVAS(bp) - BP_IS_GANG(bp)); + if (ddp->ddp_phys_birth != 0) + ddt_phys_free(ddt, ddk, ddp, zio->io_txg); + ddt_phys_fill(ddp, bp); + } + + ddt_exit(ddt); +} + +static int +zio_ddt_write(zio_t *zio) +{ + spa_t *spa = zio->io_spa; + blkptr_t *bp = zio->io_bp; + uint64_t txg = zio->io_txg; + zio_prop_t *zp = &zio->io_prop; + int p = zp->zp_copies; + int ditto_copies; + zio_t *cio = NULL; + zio_t *dio = NULL; + ddt_t *ddt = ddt_select(spa, bp); + ddt_entry_t *dde; + ddt_phys_t *ddp; + + ASSERT(BP_GET_DEDUP(bp)); + ASSERT(BP_GET_CHECKSUM(bp) == zp->zp_checksum); + ASSERT(BP_IS_HOLE(bp) || zio->io_bp_override); + + ddt_enter(ddt); + dde = ddt_lookup(ddt, bp, B_TRUE); + ddp = &dde->dde_phys[p]; + + if (zp->zp_dedup_verify && zio_ddt_collision(zio, ddt, dde)) { + /* + * If we're using a weak checksum, upgrade to a strong checksum + * and try again. If we're already using a strong checksum, + * we can't resolve it, so just convert to an ordinary write. + * (And automatically e-mail a paper to Nature?) + */ + if (!zio_checksum_table[zp->zp_checksum].ci_dedup) { + zp->zp_checksum = spa_dedup_checksum(spa); + zio_pop_transforms(zio); + zio->io_stage = ZIO_STAGE_OPEN; + BP_ZERO(bp); + } else { + zp->zp_dedup = 0; + } + zio->io_pipeline = ZIO_WRITE_PIPELINE; + ddt_exit(ddt); + return (ZIO_PIPELINE_CONTINUE); + } + + ditto_copies = ddt_ditto_copies_needed(ddt, dde, ddp); + ASSERT(ditto_copies < SPA_DVAS_PER_BP); + + if (ditto_copies > ddt_ditto_copies_present(dde) && + dde->dde_lead_zio[DDT_PHYS_DITTO] == NULL) { + zio_prop_t czp = *zp; + + czp.zp_copies = ditto_copies; + + /* + * If we arrived here with an override bp, we won't have run + * the transform stack, so we won't have the data we need to + * generate a child i/o. So, toss the override bp and restart. + * This is safe, because using the override bp is just an + * optimization; and it's rare, so the cost doesn't matter. + */ + if (zio->io_bp_override) { + zio_pop_transforms(zio); + zio->io_stage = ZIO_STAGE_OPEN; + zio->io_pipeline = ZIO_WRITE_PIPELINE; + zio->io_bp_override = NULL; + BP_ZERO(bp); + ddt_exit(ddt); + return (ZIO_PIPELINE_CONTINUE); + } + + dio = zio_write(zio, spa, txg, bp, zio->io_orig_data, + zio->io_orig_size, &czp, NULL, + zio_ddt_ditto_write_done, dde, zio->io_priority, + ZIO_DDT_CHILD_FLAGS(zio), &zio->io_bookmark); + + zio_push_transform(dio, zio->io_data, zio->io_size, 0, NULL); + dde->dde_lead_zio[DDT_PHYS_DITTO] = dio; + } + + if (ddp->ddp_phys_birth != 0 || dde->dde_lead_zio[p] != NULL) { + if (ddp->ddp_phys_birth != 0) + ddt_bp_fill(ddp, bp, txg); + if (dde->dde_lead_zio[p] != NULL) + zio_add_child(zio, dde->dde_lead_zio[p]); + else + ddt_phys_addref(ddp); + } else if (zio->io_bp_override) { + ASSERT(bp->blk_birth == txg); + ASSERT(BP_EQUAL(bp, zio->io_bp_override)); + ddt_phys_fill(ddp, bp); + ddt_phys_addref(ddp); + } else { + cio = zio_write(zio, spa, txg, bp, zio->io_orig_data, + zio->io_orig_size, zp, zio_ddt_child_write_ready, + zio_ddt_child_write_done, dde, zio->io_priority, + ZIO_DDT_CHILD_FLAGS(zio), &zio->io_bookmark); + + zio_push_transform(cio, zio->io_data, zio->io_size, 0, NULL); + dde->dde_lead_zio[p] = cio; + } + + ddt_exit(ddt); + + if (cio) + zio_nowait(cio); + if (dio) + zio_nowait(dio); + + return (ZIO_PIPELINE_CONTINUE); +} + +ddt_entry_t *freedde; /* for debugging */ + +static int +zio_ddt_free(zio_t *zio) +{ + spa_t *spa = zio->io_spa; + blkptr_t *bp = zio->io_bp; + ddt_t *ddt = ddt_select(spa, bp); + ddt_entry_t *dde; + ddt_phys_t *ddp; + + ASSERT(BP_GET_DEDUP(bp)); + ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL); + + ddt_enter(ddt); + freedde = dde = ddt_lookup(ddt, bp, B_TRUE); + ddp = ddt_phys_select(dde, bp); + ddt_phys_decref(ddp); + ddt_exit(ddt); + + return (ZIO_PIPELINE_CONTINUE); +} + +/* + * ========================================================================== + * Allocate and free blocks + * ========================================================================== + */ +static int zio_dva_allocate(zio_t *zio) { spa_t *spa = zio->io_spa; - metaslab_class_t *mc = spa->spa_normal_class; + metaslab_class_t *mc = spa_normal_class(spa); blkptr_t *bp = zio->io_bp; int error; @@ -1643,12 +2153,12 @@ ASSERT(BP_IS_HOLE(bp)); ASSERT3U(BP_GET_NDVAS(bp), ==, 0); - ASSERT3U(zio->io_prop.zp_ndvas, >, 0); - ASSERT3U(zio->io_prop.zp_ndvas, <=, spa_max_replication(spa)); + ASSERT3U(zio->io_prop.zp_copies, >, 0); + ASSERT3U(zio->io_prop.zp_copies, <=, spa_max_replication(spa)); ASSERT3U(zio->io_size, ==, BP_GET_PSIZE(bp)); error = metaslab_alloc(spa, mc, zio->io_size, bp, - zio->io_prop.zp_ndvas, zio->io_txg, NULL, 0); + zio->io_prop.zp_copies, zio->io_txg, NULL, 0); if (error) { if (error == ENOSPC && zio->io_size > SPA_MINBLOCKSIZE) @@ -1687,36 +2197,11 @@ static void zio_dva_unallocate(zio_t *zio, zio_gang_node_t *gn, blkptr_t *bp) { - spa_t *spa = zio->io_spa; - boolean_t now = !(zio->io_flags & ZIO_FLAG_IO_REWRITE); - ASSERT(bp->blk_birth == zio->io_txg || BP_IS_HOLE(bp)); + ASSERT(zio->io_bp_override == NULL); - if (zio->io_bp == bp && !now) { - /* - * This is a rewrite for sync-to-convergence. - * We can't do a metaslab_free(NOW) because bp wasn't allocated - * during this sync pass, which means that metaslab_sync() - * already committed the allocation. - */ - ASSERT(DVA_EQUAL(BP_IDENTITY(bp), - BP_IDENTITY(&zio->io_bp_orig))); - ASSERT(spa_sync_pass(spa) > 1); - - if (BP_IS_GANG(bp) && gn == NULL) { - /* - * This is a gang leader whose gang header(s) we - * couldn't read now, so defer the free until later. - * The block should still be intact because without - * the headers, we'd never even start the rewrite. - */ - bplist_enqueue_deferred(&spa->spa_sync_bplist, bp); - return; - } - } - if (!BP_IS_HOLE(bp)) - metaslab_free(spa, bp, bp->blk_birth, now); + metaslab_free(zio->io_spa, bp, bp->blk_birth, B_TRUE); if (gn != NULL) { for (int g = 0; g < SPA_GBH_NBLKPTRS; g++) { @@ -1730,25 +2215,31 @@ * Try to allocate an intent log block. Return 0 on success, errno on failure. */ int -zio_alloc_blk(spa_t *spa, uint64_t size, blkptr_t *new_bp, blkptr_t *old_bp, - uint64_t txg) +zio_alloc_zil(spa_t *spa, uint64_t txg, blkptr_t *new_bp, blkptr_t *old_bp, + uint64_t size, boolean_t use_slog) { - int error; + int error = 1; - error = metaslab_alloc(spa, spa->spa_log_class, size, - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID); + ASSERT(txg > spa_syncing_txg(spa)); + if (use_slog) + error = metaslab_alloc(spa, spa_log_class(spa), size, + new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID); + if (error) - error = metaslab_alloc(spa, spa->spa_normal_class, size, + error = metaslab_alloc(spa, spa_normal_class(spa), size, new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID); if (error == 0) { BP_SET_LSIZE(new_bp, size); BP_SET_PSIZE(new_bp, size); BP_SET_COMPRESS(new_bp, ZIO_COMPRESS_OFF); - BP_SET_CHECKSUM(new_bp, ZIO_CHECKSUM_ZILOG); + BP_SET_CHECKSUM(new_bp, + spa_version(spa) >= SPA_VERSION_SLIM_ZIL + ? ZIO_CHECKSUM_ZILOG2 : ZIO_CHECKSUM_ZILOG); BP_SET_TYPE(new_bp, DMU_OT_INTENT_LOG); BP_SET_LEVEL(new_bp, 0); + BP_SET_DEDUP(new_bp, 0); BP_SET_BYTEORDER(new_bp, ZFS_HOST_BYTEORDER); } @@ -1756,15 +2247,15 @@ } /* - * Free an intent log block. We know it can't be a gang block, so there's - * nothing to do except metaslab_free() it. + * Free an intent log block. */ void -zio_free_blk(spa_t *spa, blkptr_t *bp, uint64_t txg) +zio_free_zil(spa_t *spa, uint64_t txg, blkptr_t *bp) { + ASSERT(BP_GET_TYPE(bp) == DMU_OT_INTENT_LOG); ASSERT(!BP_IS_GANG(bp)); - metaslab_free(spa, bp, txg, B_FALSE); + zio_free(spa, txg, bp); } /* @@ -1792,6 +2283,26 @@ return (vdev_mirror_ops.vdev_op_io_start(zio)); } + /* + * We keep track of time-sensitive I/Os so that the scan thread + * can quickly react to certain workloads. In particular, we care + * about non-scrubbing, top-level reads and writes with the following + * characteristics: + * - synchronous writes of user data to non-slog devices + * - any reads of user data + * When these conditions are met, adjust the timestamp of spa_last_io + * which allows the scan thread to adjust its workload accordingly. + */ + if (!(zio->io_flags & ZIO_FLAG_SCAN_THREAD) && zio->io_bp != NULL && + vd == vd->vdev_top && !vd->vdev_islog && + zio->io_bookmark.zb_objset != DMU_META_OBJSET && + zio->io_txg != spa_syncing_txg(spa)) { + uint64_t old = spa->spa_last_io; + uint64_t new = ddi_get_lbolt64(); + if (old != new) + (void) atomic_cas_64(&spa->spa_last_io, old, new); + } + align = 1ULL << vd->vdev_top->vdev_ashift; if (P2PHASE(zio->io_size, align) != 0) { @@ -1807,7 +2318,7 @@ ASSERT(P2PHASE(zio->io_offset, align) == 0); ASSERT(P2PHASE(zio->io_size, align) == 0); - ASSERT(zio->io_type != ZIO_TYPE_WRITE || spa_writeable(spa)); + VERIFY(zio->io_type != ZIO_TYPE_WRITE || spa_writeable(spa)); /* * If this is a repair I/O, and there's no self-healing involved -- @@ -1893,6 +2404,32 @@ return (ZIO_PIPELINE_CONTINUE); } +/* + * For non-raidz ZIOs, we can just copy aside the bad data read from the + * disk, and use that to finish the checksum ereport later. + */ +static void +zio_vsd_default_cksum_finish(zio_cksum_report_t *zcr, + const void *good_buf) +{ + /* no processing needed */ + zfs_ereport_finish_checksum(zcr, good_buf, zcr->zcr_cbdata, B_FALSE); +} + +/*ARGSUSED*/ +void +zio_vsd_default_cksum_report(zio_t *zio, zio_cksum_report_t *zcr, void *ignored) +{ + void *buf = zio_buf_alloc(zio->io_size); + + bcopy(zio->io_data, buf, zio->io_size); + + zcr->zcr_cbinfo = zio->io_size; + zcr->zcr_cbdata = buf; + zcr->zcr_finish = zio_vsd_default_cksum_finish; + zcr->zcr_free = zio_buf_free; +} + static int zio_vdev_io_assess(zio_t *zio) { @@ -1905,7 +2442,7 @@ spa_config_exit(zio->io_spa, SCL_ZIO, zio); if (zio->io_vsd != NULL) { - zio->io_vsd_free(zio); + zio->io_vsd_ops->vsd_free(zio); zio->io_vsd = NULL; } @@ -1914,6 +2451,9 @@ /* * If the I/O failed, determine whether we should attempt to retry it. + * + * On retry, we cut in line in the issue queue, since we don't want + * compression/checksumming/etc. work to prevent our (cheap) IO reissue. */ if (zio->io_error && vd == NULL && !(zio->io_flags & (ZIO_FLAG_DONT_RETRY | ZIO_FLAG_IO_RETRY))) { @@ -1922,8 +2462,9 @@ zio->io_error = 0; zio->io_flags |= ZIO_FLAG_IO_RETRY | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_AGGREGATE; - zio->io_stage = ZIO_STAGE_VDEV_IO_START - 1; - zio_taskq_dispatch(zio, ZIO_TASKQ_ISSUE); + zio->io_stage = ZIO_STAGE_VDEV_IO_START >> 1; + zio_taskq_dispatch(zio, ZIO_TASKQ_ISSUE, + zio_requeue_io_start_cut_in_line); return (ZIO_PIPELINE_STOP); } @@ -1955,7 +2496,7 @@ ASSERT(zio->io_stage == ZIO_STAGE_VDEV_IO_START); ASSERT(zio->io_error == 0); - zio->io_stage--; + zio->io_stage >>= 1; } void @@ -1963,7 +2504,7 @@ { ASSERT(zio->io_stage == ZIO_STAGE_VDEV_IO_DONE); - zio->io_stage--; + zio->io_stage >>= 1; } void @@ -1973,7 +2514,7 @@ ASSERT(zio->io_error == 0); zio->io_flags |= ZIO_FLAG_IO_BYPASS; - zio->io_stage = ZIO_STAGE_VDEV_IO_ASSESS - 1; + zio->io_stage = ZIO_STAGE_VDEV_IO_ASSESS >> 1; } /* @@ -2015,9 +2556,12 @@ static int zio_checksum_verify(zio_t *zio) { + zio_bad_cksum_t info; blkptr_t *bp = zio->io_bp; int error; + ASSERT(zio->io_vd != NULL); + if (bp == NULL) { /* * This is zio_read_phys(). @@ -2029,11 +2573,12 @@ ASSERT(zio->io_prop.zp_checksum == ZIO_CHECKSUM_LABEL); } - if ((error = zio_checksum_error(zio)) != 0) { + if ((error = zio_checksum_error(zio, &info)) != 0) { zio->io_error = error; if (!(zio->io_flags & ZIO_FLAG_SPECULATIVE)) { - zfs_ereport_post(FM_EREPORT_ZFS_CHECKSUM, - zio->io_spa, zio->io_vd, zio, 0, 0); + zfs_ereport_start_checksum(zio->io_spa, + zio->io_vd, zio, zio->io_offset, + zio->io_size, NULL, &info); } } @@ -2046,7 +2591,7 @@ void zio_checksum_verified(zio_t *zio) { - zio->io_pipeline &= ~(1U << ZIO_STAGE_CHECKSUM_VERIFY); + zio->io_pipeline &= ~ZIO_STAGE_CHECKSUM_VERIFY; } /* @@ -2086,7 +2631,8 @@ blkptr_t *bp = zio->io_bp; zio_t *pio, *pio_next; - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY)) + if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) || + zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_READY)) return (ZIO_PIPELINE_STOP); if (zio->io_ready) { @@ -2120,6 +2666,19 @@ zio_notify_parent(pio, zio, ZIO_WAIT_READY); } + if (zio->io_flags & ZIO_FLAG_NODATA) { + if (BP_IS_GANG(bp)) { + zio->io_flags &= ~ZIO_FLAG_NODATA; + } else { + ASSERT((uintptr_t)zio->io_data < SPA_MAXBLOCKSIZE); + zio->io_pipeline &= ~ZIO_VDEV_IO_STAGES; + } + } + + if (zio_injection_enabled && + zio->io_spa->spa_syncing_txg == zio->io_txg) + zio_handle_ignored_writes(zio); + return (ZIO_PIPELINE_CONTINUE); } @@ -2139,6 +2698,7 @@ */ if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE) || zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE) || + zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE) || zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_DONE)) return (ZIO_PIPELINE_STOP); @@ -2149,24 +2709,52 @@ if (bp != NULL) { ASSERT(bp->blk_pad[0] == 0); ASSERT(bp->blk_pad[1] == 0); - ASSERT(bp->blk_pad[2] == 0); ASSERT(bcmp(bp, &zio->io_bp_copy, sizeof (blkptr_t)) == 0 || (bp == zio_unique_parent(zio)->io_bp)); if (zio->io_type == ZIO_TYPE_WRITE && !BP_IS_HOLE(bp) && + zio->io_bp_override == NULL && !(zio->io_flags & ZIO_FLAG_IO_REPAIR)) { ASSERT(!BP_SHOULD_BYTESWAP(bp)); - ASSERT3U(zio->io_prop.zp_ndvas, <=, BP_GET_NDVAS(bp)); + ASSERT3U(zio->io_prop.zp_copies, <=, BP_GET_NDVAS(bp)); ASSERT(BP_COUNT_GANG(bp) == 0 || (BP_COUNT_GANG(bp) == BP_GET_NDVAS(bp))); } } /* - * If there were child vdev or gang errors, they apply to us now. + * If there were child vdev/gang/ddt errors, they apply to us now. */ zio_inherit_child_errors(zio, ZIO_CHILD_VDEV); zio_inherit_child_errors(zio, ZIO_CHILD_GANG); + zio_inherit_child_errors(zio, ZIO_CHILD_DDT); + /* + * If the I/O on the transformed data was successful, generate any + * checksum reports now while we still have the transformed data. + */ + if (zio->io_error == 0) { + while (zio->io_cksum_report != NULL) { + zio_cksum_report_t *zcr = zio->io_cksum_report; + uint64_t align = zcr->zcr_align; + uint64_t asize = P2ROUNDUP(psize, align); + char *abuf = zio->io_data; + + if (asize != psize) { + abuf = zio_buf_alloc(asize); + bcopy(zio->io_data, abuf, psize); + bzero(abuf + psize, asize - psize); + } + + zio->io_cksum_report = zcr->zcr_next; + zcr->zcr_next = NULL; + zcr->zcr_finish(zcr, abuf); + zfs_ereport_free_checksum(zcr); + + if (asize != psize) + zio_buf_free(abuf, asize); + } + } + zio_pop_transforms(zio); /* note: may set zio->io_error */ vdev_stat_update(zio, psize); @@ -2181,8 +2769,9 @@ if (zio->io_error != ECKSUM && vd != NULL && !vdev_is_dead(vd)) zfs_ereport_post(FM_EREPORT_ZFS_IO, spa, vd, zio, 0, 0); - if ((zio->io_error == EIO || - !(zio->io_flags & ZIO_FLAG_SPECULATIVE)) && zio == lio) { + if ((zio->io_error == EIO || !(zio->io_flags & + (ZIO_FLAG_SPECULATIVE | ZIO_FLAG_DONT_PROPAGATE))) && + zio == lio) { /* * For logical I/O requests, tell the SPA to log the * error and generate a logical data ereport. @@ -2199,22 +2788,34 @@ * propagate all the way to the root via zio_notify_parent(). */ ASSERT(vd == NULL && bp != NULL); + ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL); - if (IO_IS_ALLOCATING(zio)) + if (IO_IS_ALLOCATING(zio) && + !(zio->io_flags & ZIO_FLAG_CANFAIL)) { if (zio->io_error != ENOSPC) zio->io_reexecute |= ZIO_REEXECUTE_NOW; else zio->io_reexecute |= ZIO_REEXECUTE_SUSPEND; + } if ((zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_FREE) && + !(zio->io_flags & ZIO_FLAG_SCAN_THREAD) && zio->io_error == ENXIO && - spa->spa_load_state == SPA_LOAD_NONE && + spa_load_state(spa) == SPA_LOAD_NONE && spa_get_failmode(spa) != ZIO_FAILURE_MODE_CONTINUE) zio->io_reexecute |= ZIO_REEXECUTE_SUSPEND; if (!(zio->io_flags & ZIO_FLAG_CANFAIL) && !zio->io_reexecute) zio->io_reexecute |= ZIO_REEXECUTE_SUSPEND; + + /* + * Here is a possibly good place to attempt to do + * either combinatorial reconstruction or error correction + * based on checksums. It also might be a good place + * to send out preliminary ereports before we suspend + * processing. + */ } /* @@ -2225,11 +2826,10 @@ */ zio_inherit_child_errors(zio, ZIO_CHILD_LOGICAL); - if ((zio->io_error || zio->io_reexecute) && IO_IS_ALLOCATING(zio) && - zio->io_child_type == ZIO_CHILD_LOGICAL) { - ASSERT(zio->io_child_type != ZIO_CHILD_GANG); + if ((zio->io_error || zio->io_reexecute) && + IO_IS_ALLOCATING(zio) && zio->io_gang_leader == zio && + !(zio->io_flags & ZIO_FLAG_IO_REWRITE)) zio_dva_unallocate(zio, zio->io_gang_tree, bp); - } zio_gang_tree_free(&zio->io_gang_tree); @@ -2300,18 +2900,36 @@ * Reexecution is potentially a huge amount of work. * Hand it off to the otherwise-unused claim taskq. */ +#ifdef _KERNEL (void) taskq_dispatch_safe( spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], - (task_func_t *)zio_reexecute, zio, &zio->io_task); + (task_func_t *)zio_reexecute, zio, TQ_SLEEP, + &zio->io_task_issue); +#else + (void) taskq_dispatch( + spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], + (task_func_t *)zio_reexecute, zio, TQ_SLEEP); +#endif } return (ZIO_PIPELINE_STOP); } - ASSERT(zio_walk_children(zio) == NULL); + ASSERT(zio->io_child_count == 0); ASSERT(zio->io_reexecute == 0); ASSERT(zio->io_error == 0 || (zio->io_flags & ZIO_FLAG_CANFAIL)); /* + * Report any checksum errors, since the I/O is complete. + */ + while (zio->io_cksum_report != NULL) { + zio_cksum_report_t *zcr = zio->io_cksum_report; + zio->io_cksum_report = zcr->zcr_next; + zcr->zcr_next = NULL; + zcr->zcr_finish(zcr, NULL); + zfs_ereport_free_checksum(zcr); + } + + /* * It is the responsibility of the done callback to ensure that this * particular zio is no longer discoverable for adoption, and as * such, cannot acquire any new parents. @@ -2347,12 +2965,17 @@ * I/O pipeline definition * ========================================================================== */ -static zio_pipe_stage_t *zio_pipeline[ZIO_STAGES] = { +static zio_pipe_stage_t *zio_pipeline[] = { NULL, + zio_read_bp_init, + zio_free_bp_init, zio_issue_async, - zio_read_bp_init, zio_write_bp_init, zio_checksum_generate, + zio_ddt_read_start, + zio_ddt_read_done, + zio_ddt_write, + zio_ddt_free, zio_gang_assemble, zio_gang_issue, zio_dva_allocate, --------------040507000300050801060707 Content-Type: text/plain; name="zio.c.rej" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="zio.c.rej" KioqKioqKioqKioqKioqCioqKiA5NDMsOTUzICoqKioKICAgKi8KICAKICBzdGF0aWMgdm9p ZAotIHppb190YXNrcV9kaXNwYXRjaCh6aW9fdCAqemlvLCBlbnVtIHppb190YXNrcV90eXBl IHEpCiAgewogIAlzcGFfdCAqc3BhID0gemlvLT5pb19zcGE7CiAgCXppb190eXBlX3QgdCA9 IHppby0+aW9fdHlwZTsKICAKICAJLyoKICAJICogSWYgd2UncmUgYSBjb25maWcgd3JpdGVy IG9yIGEgcHJvYmUsIHRoZSBub3JtYWwgaXNzdWUgYW5kCiAgCSAqIGludGVycnVwdCB0aHJl YWRzIG1heSBhbGwgYmUgYmxvY2tlZCB3YWl0aW5nIGZvciB0aGUgY29uZmlnIGxvY2suCi0t LSAxMDYzLDEwODYgLS0tLQogICAqLwogIAogIHN0YXRpYyB2b2lkCisgemlvX3Rhc2txX2Rp c3BhdGNoKHppb190ICp6aW8sIGVudW0gemlvX3Rhc2txX3R5cGUgcSwgYm9vbGVhbl90IGN1 dGlubGluZSkKICB7CiAgCXNwYV90ICpzcGEgPSB6aW8tPmlvX3NwYTsKICAJemlvX3R5cGVf dCB0ID0gemlvLT5pb190eXBlOworIAlpbnQgZmxhZ3MgPSBUUV9TTEVFUCB8IChjdXRpbmxp bmUgPyBUUV9GUk9OVCA6IDApOworICNpZmRlZiBfS0VSTkVMCisgCXN0cnVjdCBvc3Rhc2sg KnRhc2s7CisgI2VuZGlmCiAgCisgCUFTU0VSVChxID09IFpJT19UQVNLUV9JU1NVRSB8fCBx ID09IFpJT19UQVNLUV9JTlRFUlJVUFQpOworIAorICNpZmRlZiBfS0VSTkVMCisgCWlmIChx ID09IFpJT19UQVNLUV9JU1NVRSkKKyAJCXRhc2sgPSAmemlvLT5pb190YXNrX2lzc3VlOwor IAllbHNlIC8qIGlmIChxID09IFpJT19UQVNLUV9JTlRFUlJVUFQpICovCisgCQl0YXNrID0g Jnppby0+aW9fdGFza19pbnRlcnJ1cHQ7CisgI2VuZGlmCisgCiAgCS8qCiAgCSAqIElmIHdl J3JlIGEgY29uZmlnIHdyaXRlciBvciBhIHByb2JlLCB0aGUgbm9ybWFsIGlzc3VlIGFuZAog IAkgKiBpbnRlcnJ1cHQgdGhyZWFkcyBtYXkgYWxsIGJlIGJsb2NrZWQgd2FpdGluZyBmb3Ig dGhlIGNvbmZpZyBsb2NrLgoqKioqKioqKioqKioqKioKKioqIDk3MCw5NzcgKioqKgogIAkJ cSsrOwogIAogIAlBU1NFUlQzVShxLCA8LCBaSU9fVEFTS1FfVFlQRVMpOwogIAkodm9pZCkg dGFza3FfZGlzcGF0Y2hfc2FmZShzcGEtPnNwYV96aW9fdGFza3FbdF1bcV0sCi0gCSAgICAo dGFza19mdW5jX3QgKil6aW9fZXhlY3V0ZSwgemlvLCAmemlvLT5pb190YXNrKTsKICB9CiAg CiAgc3RhdGljIGJvb2xlYW5fdAotLS0gMTEwMywxMTE1IC0tLS0KICAJCXErKzsKICAKICAJ QVNTRVJUM1UocSwgPCwgWklPX1RBU0tRX1RZUEVTKTsKKyAjaWZkZWYgX0tFUk5FTAogIAko dm9pZCkgdGFza3FfZGlzcGF0Y2hfc2FmZShzcGEtPnNwYV96aW9fdGFza3FbdF1bcV0sCisg CSAgICAodGFza19mdW5jX3QgKil6aW9fZXhlY3V0ZSwgemlvLCBmbGFncywgdGFzayk7Cisg I2Vsc2UKKyAJKHZvaWQpIHRhc2txX2Rpc3BhdGNoKHNwYS0+c3BhX3ppb190YXNrcVt0XVtx XSwKKyAJICAgICh0YXNrX2Z1bmNfdCAqKXppb19leGVjdXRlLCB6aW8sIGZsYWdzKTsKKyAj ZW5kaWYKICB9CiAgCiAgc3RhdGljIGJvb2xlYW5fdAoqKioqKioqKioqKioqKioKKioqIDIz MTcsMjMzNCAqKioqCiAgCQkJICogUmVleGVjdXRpb24gaXMgcG90ZW50aWFsbHkgYSBodWdl IGFtb3VudCBvZiB3b3JrLgogIAkJCSAqIEhhbmQgaXQgb2ZmIHRvIHRoZSBvdGhlcndpc2Ut dW51c2VkIGNsYWltIHRhc2txLgogIAkJCSAqLwogIAkJCSh2b2lkKSB0YXNrcV9kaXNwYXRj aF9zYWZlKAogIAkJCSAgICBzcGEtPnNwYV96aW9fdGFza3FbWklPX1RZUEVfQ0xBSU1dW1pJ T19UQVNLUV9JU1NVRV0sCi0gCQkJICAgICh0YXNrX2Z1bmNfdCAqKXppb19yZWV4ZWN1dGUs IHppbywgJnppby0+aW9fdGFzayk7CiAgCQl9CiAgCQlyZXR1cm4gKFpJT19QSVBFTElORV9T VE9QKTsKICAJfQogIAotIAlBU1NFUlQoemlvX3dhbGtfY2hpbGRyZW4oemlvKSA9PSBOVUxM KTsKICAJQVNTRVJUKHppby0+aW9fcmVleGVjdXRlID09IDApOwogIAlBU1NFUlQoemlvLT5p b19lcnJvciA9PSAwIHx8ICh6aW8tPmlvX2ZsYWdzICYgWklPX0ZMQUdfQ0FORkFJTCkpOwog IAogIAkvKgogIAkgKiBJdCBpcyB0aGUgcmVzcG9uc2liaWxpdHkgb2YgdGhlIGRvbmUgY2Fs bGJhY2sgdG8gZW5zdXJlIHRoYXQgdGhpcwogIAkgKiBwYXJ0aWN1bGFyIHppbyBpcyBubyBs b25nZXIgZGlzY292ZXJhYmxlIGZvciBhZG9wdGlvbiwgYW5kIGFzCiAgCSAqIHN1Y2gsIGNh bm5vdCBhY3F1aXJlIGFueSBuZXcgcGFyZW50cy4KLS0tIDI5MTcsMjk1MiAtLS0tCiAgCQkJ ICogUmVleGVjdXRpb24gaXMgcG90ZW50aWFsbHkgYSBodWdlIGFtb3VudCBvZiB3b3JrLgog IAkJCSAqIEhhbmQgaXQgb2ZmIHRvIHRoZSBvdGhlcndpc2UtdW51c2VkIGNsYWltIHRhc2tx LgogIAkJCSAqLworICNpZmRlZiBfS0VSTkVMCiAgCQkJKHZvaWQpIHRhc2txX2Rpc3BhdGNo X3NhZmUoCiAgCQkJICAgIHNwYS0+c3BhX3ppb190YXNrcVtaSU9fVFlQRV9DTEFJTV1bWklP X1RBU0tRX0lTU1VFXSwKKyAJCQkgICAgKHRhc2tfZnVuY190ICopemlvX3JlZXhlY3V0ZSwg emlvLCBUUV9TTEVFUCwKKyAJCQkgICAgJnppby0+aW9fdGFza19pc3N1ZSk7CisgI2Vsc2UK KyAJCQkodm9pZCkgdGFza3FfZGlzcGF0Y2goCisgCQkJICAgIHNwYS0+c3BhX3ppb190YXNr cVtaSU9fVFlQRV9DTEFJTV1bWklPX1RBU0tRX0lTU1VFXSwKKyAJCQkgICAgKHRhc2tfZnVu Y190ICopemlvX3JlZXhlY3V0ZSwgemlvLCBUUV9TTEVFUCk7CisgI2VuZGlmCiAgCQl9CiAg CQlyZXR1cm4gKFpJT19QSVBFTElORV9TVE9QKTsKICAJfQogIAorIAlBU1NFUlQoemlvLT5p b19jaGlsZF9jb3VudCA9PSAwKTsKICAJQVNTRVJUKHppby0+aW9fcmVleGVjdXRlID09IDAp OwogIAlBU1NFUlQoemlvLT5pb19lcnJvciA9PSAwIHx8ICh6aW8tPmlvX2ZsYWdzICYgWklP X0ZMQUdfQ0FORkFJTCkpOwogIAogIAkvKgorIAkgKiBSZXBvcnQgYW55IGNoZWNrc3VtIGVy cm9ycywgc2luY2UgdGhlIEkvTyBpcyBjb21wbGV0ZS4KKyAJICovCisgCXdoaWxlICh6aW8t PmlvX2Nrc3VtX3JlcG9ydCAhPSBOVUxMKSB7CisgCQl6aW9fY2tzdW1fcmVwb3J0X3QgKnpj ciA9IHppby0+aW9fY2tzdW1fcmVwb3J0OworIAkJemlvLT5pb19ja3N1bV9yZXBvcnQgPSB6 Y3ItPnpjcl9uZXh0OworIAkJemNyLT56Y3JfbmV4dCA9IE5VTEw7CisgCQl6Y3ItPnpjcl9m aW5pc2goemNyLCBOVUxMKTsKKyAJCXpmc19lcmVwb3J0X2ZyZWVfY2hlY2tzdW0oemNyKTsK KyAJfQorIAorIAkvKgogIAkgKiBJdCBpcyB0aGUgcmVzcG9uc2liaWxpdHkgb2YgdGhlIGRv bmUgY2FsbGJhY2sgdG8gZW5zdXJlIHRoYXQgdGhpcwogIAkgKiBwYXJ0aWN1bGFyIHppbyBp cyBubyBsb25nZXIgZGlzY292ZXJhYmxlIGZvciBhZG9wdGlvbiwgYW5kIGFzCiAgCSAqIHN1 Y2gsIGNhbm5vdCBhY3F1aXJlIGFueSBuZXcgcGFyZW50cy4K --------------040507000300050801060707 Content-Type: text/plain; name="make.log" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="make.log" U2NyaXB0IHN0YXJ0ZWQgb24gVGh1IEphbiAgNiAxNToyODozOSAyMDExCm1ha2UKY2MgLU8y IC1waXBlIC1ERlJFRUJTRF9OQU1FQ0FDSEUgLURCVUlMRElOR19aRlMgLURERUJVRz0xIC1m bm8tc3RyaWN0LWFsaWFzaW5nIC1XZXJyb3IgLURfS0VSTkVMIC1ES0xEX01PRFVMRSAtbm9z dGRpbmMgIC1JL3Vzci9zcmMvc3lzL21vZHVsZXMvemZzLy4uLy4uL2NkZGwvY29tcGF0L29w ZW5zb2xhcmlzIC1JL3Vzci9zcmMvc3lzL21vZHVsZXMvemZzLy4uLy4uL2NkZGwvY29udHJp Yi9vcGVuc29sYXJpcy91dHMvY29tbW9uL2ZzL3pmcyAtSS91c3Ivc3JjL3N5cy9tb2R1bGVz L3pmcy8uLi8uLi9jZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMvdXRzL2NvbW1vbi96bW9kIC1J L3Vzci9zcmMvc3lzL21vZHVsZXMvemZzLy4uLy4uL2NkZGwvY29udHJpYi9vcGVuc29sYXJp cy91dHMvY29tbW9uIC1JL3Vzci9zcmMvc3lzL21vZHVsZXMvemZzLy4uLy4uIC1JL3Vzci9z cmMvc3lzL21vZHVsZXMvemZzLy4uLy4uL2NkZGwvY29udHJpYi9vcGVuc29sYXJpcy9jb21t b24vemZzIC1JL3Vzci9zcmMvc3lzL21vZHVsZXMvemZzLy4uLy4uL2NkZGwvY29udHJpYi9v cGVuc29sYXJpcy9jb21tb24gLUkvdXNyL3NyYy9zeXMvbW9kdWxlcy96ZnMvLi4vLi4vLi4v aW5jbHVkZSAtSS4gLUlAIC1JQC9jb250cmliL2FsdHEgLWZpbmxpbmUtbGltaXQ9ODAwMCAt LXBhcmFtIGlubGluZS11bml0LWdyb3d0aD0xMDAgLS1wYXJhbSBsYXJnZS1mdW5jdGlvbi1n cm93dGg9MTAwMCAtZm5vLWNvbW1vbiAgLW1uby1hbGlnbi1sb25nLXN0cmluZ3MgLW1wcmVm ZXJyZWQtc3RhY2stYm91bmRhcnk9MiAgLW1uby1tbXggLW1uby0zZG5vdyAtbW5vLXNzZSAt bW5vLXNzZTIgLW1uby1zc2UzIC1mZnJlZXN0YW5kaW5nIC1mc3RhY2stcHJvdGVjdG9yIC1z dGQ9aXNvOTg5OToxOTk5IC1mc3RhY2stcHJvdGVjdG9yIC1XYWxsIC1XcmVkdW5kYW50LWRl Y2xzIC1XbmVzdGVkLWV4dGVybnMgLVdzdHJpY3QtcHJvdG90eXBlcyAgLVdtaXNzaW5nLXBy b3RvdHlwZXMgLVdwb2ludGVyLWFyaXRoIC1XaW5saW5lIC1XY2FzdC1xdWFsICAtV3VuZGVm IC1Xbm8tcG9pbnRlci1zaWduIC1mZm9ybWF0LWV4dGVuc2lvbnMgLVduby11bmtub3duLXBy YWdtYXMgLVduby1taXNzaW5nLXByb3RvdHlwZXMgLVduby11bmRlZiAtV25vLXN0cmljdC1w cm90b3R5cGVzIC1Xbm8tY2FzdC1xdWFsIC1Xbm8tcGFyZW50aGVzZXMgLVduby1yZWR1bmRh bnQtZGVjbHMgLVduby1taXNzaW5nLWJyYWNlcyAtV25vLXVuaW5pdGlhbGl6ZWQgLVduby11 bnVzZWQgLVduby1pbmxpbmUgLVduby1zd2l0Y2ggLVduby1wb2ludGVyLWFyaXRoIC1jIC91 c3Ivc3JjL3N5cy9tb2R1bGVzL3pmcy8uLi8uLi9jZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMv dXRzL2NvbW1vbi9mcy96ZnMvemlvLmMKY2MxOiB3YXJuaW5ncyBiZWluZyB0cmVhdGVkIGFz IGVycm9ycwovdXNyL3NyYy9zeXMvbW9kdWxlcy96ZnMvLi4vLi4vY2RkbC9jb250cmliL29w ZW5zb2xhcmlzL3V0cy9jb21tb24vZnMvemZzL3ppby5jOiBJbiBmdW5jdGlvbiAnemlvX3Rh c2txX2Rpc3BhdGNoJzoKL3Vzci9zcmMvc3lzL21vZHVsZXMvemZzLy4uLy4uL2NkZGwvY29u dHJpYi9vcGVuc29sYXJpcy91dHMvY29tbW9uL2ZzL3pmcy96aW8uYzoxMTA4OiB3YXJuaW5n OiBwYXNzaW5nIGFyZ3VtZW50IDQgb2YgJ3Rhc2txX2Rpc3BhdGNoX3NhZmUnIG1ha2VzIGlu dGVnZXIgZnJvbSBwb2ludGVyIHdpdGhvdXQgYSBjYXN0Ci91c3Ivc3JjL3N5cy9tb2R1bGVz L3pmcy8uLi8uLi9jZGRsL2NvbnRyaWIvb3BlbnNvbGFyaXMvdXRzL2NvbW1vbi9mcy96ZnMv emlvLmM6MTEwODogZXJyb3I6IHRvbyBmZXcgYXJndW1lbnRzIHRvIGZ1bmN0aW9uICd0YXNr cV9kaXNwYXRjaF9zYWZlJwovdXNyL3NyYy9zeXMvbW9kdWxlcy96ZnMvLi4vLi4vY2RkbC9j b250cmliL29wZW5zb2xhcmlzL3V0cy9jb21tb24vZnMvemZzL3ppby5jOiBJbiBmdW5jdGlv biAnemlvX2RvbmUnOgovdXNyL3NyYy9zeXMvbW9kdWxlcy96ZnMvLi4vLi4vY2RkbC9jb250 cmliL29wZW5zb2xhcmlzL3V0cy9jb21tb24vZnMvemZzL3ppby5jOjI5MDc6IHdhcm5pbmc6 IHBhc3NpbmcgYXJndW1lbnQgNCBvZiAndGFza3FfZGlzcGF0Y2hfc2FmZScgbWFrZXMgaW50 ZWdlciBmcm9tIHBvaW50ZXIgd2l0aG91dCBhIGNhc3QKL3Vzci9zcmMvc3lzL21vZHVsZXMv emZzLy4uLy4uL2NkZGwvY29udHJpYi9vcGVuc29sYXJpcy91dHMvY29tbW9uL2ZzL3pmcy96 aW8uYzoyOTA3OiBlcnJvcjogdG9vIGZldyBhcmd1bWVudHMgdG8gZnVuY3Rpb24gJ3Rhc2tx X2Rpc3BhdGNoX3NhZmUnCioqKiBFcnJvciBjb2RlIDEKClN0b3AgaW4gL3Vzci9zcmMvc3lz L21vZHVsZXMvemZzLgoKU2NyaXB0IGRvbmUgb24gVGh1IEphbiAgNiAxNToyODo0MCAyMDEx Cg== --------------040507000300050801060707-- From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 7 00:10:03 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 259511065673; Fri, 7 Jan 2011 00:10:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:100:1043::3]) by mx1.freebsd.org (Postfix) with ESMTP id AC3108FC15; Fri, 7 Jan 2011 00:10:02 +0000 (UTC) Received: from core.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id A7B42118748; Fri, 7 Jan 2011 01:10:01 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk ([127.0.0.1]) by core.vx.sk (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id kfg2grcs2R9e; Fri, 7 Jan 2011 01:09:59 +0100 (CET) Received: from [10.9.8.1] (chello085216231078.chello.sk [85.216.231.78]) by mail.vx.sk (Postfix) with ESMTPSA id C7C58118733; Fri, 7 Jan 2011 01:09:58 +0100 (CET) Message-ID: <4D2659E0.4080409@FreeBSD.org> Date: Fri, 07 Jan 2011 01:10:08 +0100 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: "J. Hellenthal" References: <201101060934.p069YMpl009611@svn.freebsd.org> <4D258E11.9090402@FreeBSD.org> <4D2626AA.1080100@DataIX.net> In-Reply-To: <4D2626AA.1080100@DataIX.net> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r217049 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 00:10:03 -0000 Dear Jason, reporting breakage of custom developer patches (even if they are candidate for merge to -CURRENT) is off-topic for the src-commiters and svn-* lists. Please reply only to my e-mail in private next time or use public discussion lists. P.S: I made a new patch. Dňa 06.01.2011 21:31, J. Hellenthal wrote / napísal(a): > > Heads-up this currently has broken > ~mm/patches/zfs/v28/stable-8-zfsv28-20101218.patch.xz > ~mm/patches/zfs/v28/stable-8-zfsv28-20101223-nopython.patch.xz > > Attached is a reject of the applied patch regarding zio.c and the diff > extracted from the above patches with a make.log from script(1). > > The make.log is from after I worked those changes into zio.c > > On 01/06/2011 04:40, Martin Matuska wrote: >> My mistake: s/pav/pjd/g From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 7 05:34:51 2011 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46B3A106566B; Fri, 7 Jan 2011 05:34:51 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id D2FBE8FC08; Fri, 7 Jan 2011 05:34:50 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id D95BB7E8BA; Fri, 7 Jan 2011 16:15:17 +1100 (EST) Message-ID: <4D26A165.3070001@freebsd.org> Date: Fri, 07 Jan 2011 16:15:17 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101215 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: "George V. Neville-Neil" References: <201101051852.p05IqUjK087769@svn.freebsd.org> In-Reply-To: <201101051852.p05IqUjK087769@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: src-committers@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" , svn-src-stable-8@FreeBSD.org, "Robert N. M. Watson" Subject: Re: svn commit: r217018 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 05:34:51 -0000 Hi George, On 01/06/11 05:52, George V. Neville-Neil wrote: > Author: gnn > Date: Wed Jan 5 18:52:30 2011 > New Revision: 217018 > URL: http://svn.freebsd.org/changeset/base/217018 > > Log: > Fix binary compatability for netstats across the -x/-T changes > that have been previously MFC'd. > > Reviewed by: rwatson, bz > > Modified: > stable/8/sys/netinet/tcp_var.h > > Modified: stable/8/sys/netinet/tcp_var.h > ============================================================================== > --- stable/8/sys/netinet/tcp_var.h Wed Jan 5 18:46:05 2011 (r217017) > +++ stable/8/sys/netinet/tcp_var.h Wed Jan 5 18:52:30 2011 (r217018) > @@ -177,7 +177,6 @@ struct tcpcb { > u_long snd_cwnd_prev; /* cwnd prior to retransmit */ > u_long snd_ssthresh_prev; /* ssthresh prior to retransmit */ > tcp_seq snd_recover_prev; /* snd_recover prior to retransmit */ > - int t_sndzerowin; /* zero-window updates sent */ > u_int t_badrxtwin; /* window for retransmit recovery */ > u_char snd_limited; /* segments limited transmitted */ > /* SACK related state */ > @@ -194,14 +193,15 @@ struct tcpcb { > u_int32_t rfbuf_ts; /* recv buffer autoscaling timestamp */ > int rfbuf_cnt; /* recv buffer autoscaling byte count */ > struct toe_usrreqs *t_tu; /* offload operations vector */ > - int t_sndrexmitpack; /* retransmit packets sent */ > - int t_rcvoopack; /* out-of-order packets received */ > void *t_toe; /* TOE pcb pointer */ > int t_bytes_acked; /* # bytes acked during current RTT */ > > - int t_ispare; /* explicit pad for 64bit alignment */ > + int t_sndzerowin; /* zero-window updates sent */ > + uint64_t t_sndrexmitpack;/* retransmit packets sent */ > + uint64_t t_rcvoopack; /* out-of-order packets received */ > + > void *t_pspare2[6]; /* 2 CC / 4 TBD */ > - uint64_t _pad[12]; /* 7 UTO, 5 TBD (1-2 CC/RTT?) */ > + uint64_t _pad[10]; /* 7 UTO, 3 TBD (1-2 CC/RTT?) */ > }; On my stable/8 machine after updating world but not kernel I see "struct xtcpcb size mismatch" messages which indicates the ABI has been futzed with. Looking at the above diff I think this commit does indeed change the ABI and therefore needs to be tweaked in order to maintain our current ABI preservation policy for stable branches (unless I'm missing something?). If the change to the ABI is intentional, a note in UPDATING would probably be warranted. Cheers, Lawrence From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 7 08:42:59 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84131106566B; Fri, 7 Jan 2011 08:42:59 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7299B8FC14; Fri, 7 Jan 2011 08:42:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p078gxrF044699; Fri, 7 Jan 2011 08:42:59 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p078gxtS044697; Fri, 7 Jan 2011 08:42:59 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201101070842.p078gxtS044697@svn.freebsd.org> From: Brian Somers Date: Fri, 7 Jan 2011 08:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217088 - stable/8/usr.sbin/newsyslog X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 08:42:59 -0000 Author: brian Date: Fri Jan 7 08:42:58 2011 New Revision: 217088 URL: http://svn.freebsd.org/changeset/base/217088 Log: MFC r216832: Make -S functional Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Fri Jan 7 08:34:12 2011 (r217087) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Fri Jan 7 08:42:58 2011 (r217088) @@ -599,7 +599,7 @@ parse_args(int argc, char **argv) *p = '\0'; /* Parse command line options. */ - while ((ch = getopt(argc, argv, "a:d:f:nrst:vCD:FNPR:")) != -1) + while ((ch = getopt(argc, argv, "a:d:f:nrst:vCD:FNPR:S:")) != -1) switch (ch) { case 'a': archtodir++; From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 7 09:40:08 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6EC4106566B; Fri, 7 Jan 2011 09:40:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 3BD118FC15; Fri, 7 Jan 2011 09:40:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id E136041C7A3; Fri, 7 Jan 2011 10:40:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id 60bQJiaOdWXi; Fri, 7 Jan 2011 10:40:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 1705041C7A9; Fri, 7 Jan 2011 10:40:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 253B84448F3; Fri, 7 Jan 2011 09:36:39 +0000 (UTC) Date: Fri, 7 Jan 2011 09:36:38 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Lawrence Stewart In-Reply-To: <4D26A165.3070001@freebsd.org> Message-ID: <20110107091418.H14966@maildrop.int.zabbadoz.net> References: <201101051852.p05IqUjK087769@svn.freebsd.org> <4D26A165.3070001@freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, "George V. Neville-Neil" , svn-src-stable-8@FreeBSD.org, "Robert N. M. Watson" Subject: Re: svn commit: r217018 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 09:40:08 -0000 On Fri, 7 Jan 2011, Lawrence Stewart wrote: > Hi George, > > On 01/06/11 05:52, George V. Neville-Neil wrote: >> Author: gnn >> Date: Wed Jan 5 18:52:30 2011 >> New Revision: 217018 >> URL: http://svn.freebsd.org/changeset/base/217018 >> >> Log: >> Fix binary compatability for netstats across the -x/-T changes >> that have been previously MFC'd. >> >> Reviewed by: rwatson, bz >> >> Modified: >> stable/8/sys/netinet/tcp_var.h >> ... > > On my stable/8 machine after updating world but not kernel I see "struct > xtcpcb size mismatch" messages which indicates the ABI has been futzed with. Be sure that it's not local changes. > Looking at the above diff I think this commit does indeed change the ABI > and therefore needs to be tweaked in order to maintain our current ABI > preservation policy for stable branches (unless I'm missing something?). > If the change to the ABI is intentional, a note in UPDATING would > probably be warranted. I think you are missing that that was the "repair" commit. Are you sure you didn't pickup the wrong versions? There was about a 1 day timeframe, where things were hosed but I believe George fixed them all. Hmm looking at the diff committed more closely I see that the two uint64_t are not were they should be. Are you by any chance on i386 or another 32bit platform? uint64_t t_sndrexmitpack;/* retransmit packets sent */ uint64_t t_rcvoopack; /* out-of-order packets received */ should move after t_pspare2[6] and the patch I had seen had that. Maybe we should even move them after _pad[] to keep the spares together. Can you test this one? http://people.freebsd.org/~bz/20110107-01-restore-xtcpcb-ABI.diff /bz -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 7 14:03:29 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A7561065673; Fri, 7 Jan 2011 14:03:29 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58E218FC16; Fri, 7 Jan 2011 14:03:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p07E3TLg054521; Fri, 7 Jan 2011 14:03:29 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p07E3SQZ054518; Fri, 7 Jan 2011 14:03:28 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101071403.p07E3SQZ054518@svn.freebsd.org> From: Colin Percival Date: Fri, 7 Jan 2011 14:03:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217095 - stable/8/sys/i386/xen X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 14:03:29 -0000 Author: cperciva Date: Fri Jan 7 14:03:28 2011 New Revision: 217095 URL: http://svn.freebsd.org/changeset/base/217095 Log: MFC r216944,r216963,r216960: Improve the stability of the i386/XEN pmap code by correctly protecting page mapping queue variables within a critical section and by adding ham-fisted locking to pmap.c. Modified: stable/8/sys/i386/xen/pmap.c stable/8/sys/i386/xen/xen_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/i386/xen/pmap.c ============================================================================== --- stable/8/sys/i386/xen/pmap.c Fri Jan 7 12:16:17 2011 (r217094) +++ stable/8/sys/i386/xen/pmap.c Fri Jan 7 14:03:28 2011 (r217095) @@ -202,6 +202,11 @@ __FBSDID("$FreeBSD$"); #define pmap_pte_set_prot(pte, v) ((*(int *)pte &= ~PG_PROT), (*(int *)pte |= (v))) +#define HAMFISTED_LOCKING +#ifdef HAMFISTED_LOCKING +static struct mtx createdelete_lock; +#endif + struct pmap kernel_pmap_store; LIST_HEAD(pmaplist, pmap); static struct pmaplist allpmaps; @@ -502,6 +507,10 @@ pmap_bootstrap(vm_paddr_t firstaddr) /* Turn on PG_G on kernel page(s) */ pmap_set_pg(); #endif + +#ifdef HAMFISTED_LOCKING + mtx_init(&createdelete_lock, "pmap create/delete", NULL, MTX_DEF); +#endif } /* @@ -1510,6 +1519,10 @@ pmap_pinit(pmap_t pmap) static int color; int i; +#ifdef HAMFISTED_LOCKING + mtx_lock(&createdelete_lock); +#endif + PMAP_LOCK_INIT(pmap); /* @@ -1521,6 +1534,9 @@ pmap_pinit(pmap_t pmap) NBPTD); if (pmap->pm_pdir == NULL) { PMAP_LOCK_DESTROY(pmap); +#ifdef HAMFISTED_LOCKING + mtx_unlock(&createdelete_lock); +#endif return (0); } #if defined(XEN) && defined(PAE) @@ -1606,6 +1622,9 @@ pmap_pinit(pmap_t pmap) TAILQ_INIT(&pmap->pm_pvchunk); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); +#ifdef HAMFISTED_LOCKING + mtx_unlock(&createdelete_lock); +#endif return (1); } @@ -1841,6 +1860,10 @@ pmap_release(pmap_t pmap) pmap->pm_stats.resident_count)); PT_UPDATES_FLUSH(); +#ifdef HAMFISTED_LOCKING + mtx_lock(&createdelete_lock); +#endif + pmap_lazyfix(pmap); mtx_lock_spin(&allpmaps_lock); LIST_REMOVE(pmap, pm_list); @@ -1876,6 +1899,10 @@ pmap_release(pmap_t pmap) pmap_qremove((vm_offset_t)pmap->pm_pdpt, 1); #endif PMAP_LOCK_DESTROY(pmap); + +#ifdef HAMFISTED_LOCKING + mtx_unlock(&createdelete_lock); +#endif } static int @@ -3242,6 +3269,10 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm CTR5(KTR_PMAP, "pmap_copy: dst_pmap=%p src_pmap=%p dst_addr=0x%x len=%d src_addr=0x%x", dst_pmap, src_pmap, dst_addr, len, src_addr); +#ifdef HAMFISTED_LOCKING + mtx_lock(&createdelete_lock); +#endif + vm_page_lock_queues(); if (dst_pmap < src_pmap) { PMAP_LOCK(dst_pmap); @@ -3331,6 +3362,10 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm vm_page_unlock_queues(); PMAP_UNLOCK(src_pmap); PMAP_UNLOCK(dst_pmap); + +#ifdef HAMFISTED_LOCKING + mtx_unlock(&createdelete_lock); +#endif } static __inline void Modified: stable/8/sys/i386/xen/xen_machdep.c ============================================================================== --- stable/8/sys/i386/xen/xen_machdep.c Fri Jan 7 12:16:17 2011 (r217094) +++ stable/8/sys/i386/xen/xen_machdep.c Fri Jan 7 14:03:28 2011 (r217095) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -249,10 +250,12 @@ _xen_flush_queue(void) SET_VCPU(); int _xpq_idx = XPQ_IDX; int error, i; - /* window of vulnerability here? */ +#ifdef INVARIANTS if (__predict_true(gdtset)) - critical_enter(); + CRITICAL_ASSERT(curthread); +#endif + XPQ_IDX = 0; /* Make sure index is cleared first to avoid double updates. */ error = HYPERVISOR_mmu_update((mmu_update_t *)&XPQ_QUEUE, @@ -286,8 +289,6 @@ _xen_flush_queue(void) } } #endif - if (__predict_true(gdtset)) - critical_exit(); if (__predict_false(error < 0)) { for (i = 0; i < _xpq_idx; i++) printf("val: %llx ptr: %llx\n", @@ -301,7 +302,12 @@ void xen_flush_queue(void) { SET_VCPU(); + + if (__predict_true(gdtset)) + critical_enter(); if (XPQ_IDX != 0) _xen_flush_queue(); + if (__predict_true(gdtset)) + critical_exit(); } static __inline void From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 7 14:46:44 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52B4B106564A; Fri, 7 Jan 2011 14:46:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2229E8FC08; Fri, 7 Jan 2011 14:46:44 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id BDEE646B1A; Fri, 7 Jan 2011 09:46:43 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BEE638A01D; Fri, 7 Jan 2011 09:46:42 -0500 (EST) From: John Baldwin To: "Bjoern A. Zeeb" Date: Fri, 7 Jan 2011 08:04:46 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201101051852.p05IqUjK087769@svn.freebsd.org> <4D26A165.3070001@freebsd.org> <20110107091418.H14966@maildrop.int.zabbadoz.net> In-Reply-To: <20110107091418.H14966@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101070804.46913.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 07 Jan 2011 09:46:42 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: "Robert N. M. Watson" , src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, "George V. Neville-Neil" , svn-src-stable-8@freebsd.org, Lawrence Stewart Subject: Re: svn commit: r217018 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 14:46:44 -0000 On Friday, January 07, 2011 4:36:38 am Bjoern A. Zeeb wrote: > On Fri, 7 Jan 2011, Lawrence Stewart wrote: > > > Hi George, > > > > On 01/06/11 05:52, George V. Neville-Neil wrote: > >> Author: gnn > >> Date: Wed Jan 5 18:52:30 2011 > >> New Revision: 217018 > >> URL: http://svn.freebsd.org/changeset/base/217018 > >> > >> Log: > >> Fix binary compatability for netstats across the -x/-T changes > >> that have been previously MFC'd. > >> > >> Reviewed by: rwatson, bz > >> > >> Modified: > >> stable/8/sys/netinet/tcp_var.h > >> > ... > > > > On my stable/8 machine after updating world but not kernel I see "struct > > xtcpcb size mismatch" messages which indicates the ABI has been futzed with. > > Be sure that it's not local changes. > > > Looking at the above diff I think this commit does indeed change the ABI > > and therefore needs to be tweaked in order to maintain our current ABI > > preservation policy for stable branches (unless I'm missing something?). > > If the change to the ABI is intentional, a note in UPDATING would > > probably be warranted. > > I think you are missing that that was the "repair" commit. Are you > sure you didn't pickup the wrong versions? There was about a 1 day > timeframe, where things were hosed but I believe George fixed them > all. > > Hmm looking at the diff committed more closely I see that the two > uint64_t are not were they should be. Are you by any chance on i386 > or another 32bit platform? > > uint64_t t_sndrexmitpack;/* retransmit packets sent */ > uint64_t t_rcvoopack; /* out-of-order packets received */ > should move after t_pspare2[6] and the patch I had seen had that. > > Maybe we should even move them after _pad[] to keep the spares > together. > > Can you test this one? > http://people.freebsd.org/~bz/20110107-01-restore-xtcpcb-ABI.diff I think something like this is appropriate even regardless as it is cleaner to use the pad[] spots where they were originally. -- John Baldwin From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 7 14:52:44 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAFB4106566C; Fri, 7 Jan 2011 14:52:44 +0000 (UTC) (envelope-from gnn@freebsd.org) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id 6044D8FC1B; Fri, 7 Jan 2011 14:52:44 +0000 (UTC) Received: from smtp.hudson-trading.com ([209.249.190.9] helo=gnnmac.hudson-trading.com) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1PbDgI-0003hV-Dx; Fri, 07 Jan 2011 09:52:42 -0500 Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: George Neville-Neil In-Reply-To: <201101070804.46913.jhb@freebsd.org> Date: Fri, 7 Jan 2011 09:52:42 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201101051852.p05IqUjK087769@svn.freebsd.org> <4D26A165.3070001@freebsd.org> <20110107091418.H14966@maildrop.int.zabbadoz.net> <201101070804.46913.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1082) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - freebsd.org Cc: "Robert N. M. Watson" , src-committers@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , svn-src-stable-8@freebsd.org, Lawrence Stewart Subject: Re: svn commit: r217018 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 14:52:44 -0000 On Jan 7, 2011, at 08:04 , John Baldwin wrote: > On Friday, January 07, 2011 4:36:38 am Bjoern A. Zeeb wrote: >> On Fri, 7 Jan 2011, Lawrence Stewart wrote: >>=20 >>> Hi George, >>>=20 >>> On 01/06/11 05:52, George V. Neville-Neil wrote: >>>> Author: gnn >>>> Date: Wed Jan 5 18:52:30 2011 >>>> New Revision: 217018 >>>> URL: http://svn.freebsd.org/changeset/base/217018 >>>>=20 >>>> Log: >>>> Fix binary compatability for netstats across the -x/-T changes >>>> that have been previously MFC'd. >>>>=20 >>>> Reviewed by: rwatson, bz >>>>=20 >>>> Modified: >>>> stable/8/sys/netinet/tcp_var.h >>>>=20 >> ... >>>=20 >>> On my stable/8 machine after updating world but not kernel I see = "struct >>> xtcpcb size mismatch" messages which indicates the ABI has been = futzed=20 > with. >>=20 >> Be sure that it's not local changes. >>=20 >>> Looking at the above diff I think this commit does indeed change the = ABI >>> and therefore needs to be tweaked in order to maintain our current = ABI >>> preservation policy for stable branches (unless I'm missing = something?). >>> If the change to the ABI is intentional, a note in UPDATING would >>> probably be warranted. >>=20 >> I think you are missing that that was the "repair" commit. Are you >> sure you didn't pickup the wrong versions? There was about a 1 day >> timeframe, where things were hosed but I believe George fixed them >> all. >>=20 >> Hmm looking at the diff committed more closely I see that the two >> uint64_t are not were they should be. Are you by any chance on i386 >> or another 32bit platform? >>=20 >> uint64_t t_sndrexmitpack;/* retransmit packets sent */ >> uint64_t t_rcvoopack; /* out-of-order packets received = */ >> should move after t_pspare2[6] and the patch I had seen had that. >>=20 >> Maybe we should even move them after _pad[] to keep the spares >> together. >>=20 >> Can you test this one? >> http://people.freebsd.org/~bz/20110107-01-restore-xtcpcb-ABI.diff >=20 > I think something like this is appropriate even regardless as it is = cleaner to=20 > use the pad[] spots where they were originally. Yeah, that patch is the right way to go. Best, George From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 7 18:32:03 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DC0D106566B; Fri, 7 Jan 2011 18:32:03 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C8F18FC15; Fri, 7 Jan 2011 18:32:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p07IW3bf061441; Fri, 7 Jan 2011 18:32:03 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p07IW3Xm061439; Fri, 7 Jan 2011 18:32:03 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201101071832.p07IW3Xm061439@svn.freebsd.org> From: Josh Paetzel Date: Fri, 7 Jan 2011 18:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217114 - stable/8/etc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 18:32:03 -0000 Author: jpaetzel (ports committer) Date: Fri Jan 7 18:32:03 2011 New Revision: 217114 URL: http://svn.freebsd.org/changeset/base/217114 Log: MFC r216983: Fix typo in comment. Approved by: Warner Losh Modified: stable/8/etc/devd.conf Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/devd.conf ============================================================================== --- stable/8/etc/devd.conf Fri Jan 7 18:14:58 2011 (r217113) +++ stable/8/etc/devd.conf Fri Jan 7 18:32:03 2011 (r217114) @@ -45,7 +45,7 @@ notify 0 { # # Try to start dhclient on Ethernet like interfaces when the link comes # up. Only devices that are configured to support DHCP will actually -# run it. No link down rule exists because dhclient automaticly exits +# run it. No link down rule exists because dhclient automatically exits # when the link goes down. # notify 0 { From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 7 20:07:30 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CCCE106564A; Fri, 7 Jan 2011 20:07:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B66F8FC13; Fri, 7 Jan 2011 20:07:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p07K7UP5064303; Fri, 7 Jan 2011 20:07:30 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p07K7UkN064301; Fri, 7 Jan 2011 20:07:30 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101072007.p07K7UkN064301@svn.freebsd.org> From: Rick Macklem Date: Fri, 7 Jan 2011 20:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217122 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 20:07:30 -0000 Author: rmacklem Date: Fri Jan 7 20:07:30 2011 New Revision: 217122 URL: http://svn.freebsd.org/changeset/base/217122 Log: MFC: r216692 Simplify vnode locking in the expeimental NFS server's readdir functions. In particular, get rid of two bogus VOP_ISLOCKED() calls. Removing the VOP_ISLOCKED() calls is the only actual bug fixed by this patch. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Fri Jan 7 20:02:05 2011 (r217121) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Fri Jan 7 20:07:30 2011 (r217122) @@ -1486,7 +1486,6 @@ nfsrvd_readdir(struct nfsrv_descript *nd return (0); } not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs"); - NFSVOPUNLOCK(vp, 0, p); MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: eofflag = 0; @@ -1504,10 +1503,8 @@ again: io.uio_segflg = UIO_SYSSPACE; io.uio_rw = UIO_READ; io.uio_td = NULL; - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); nd->nd_repstat = VOP_READDIR(vp, &io, nd->nd_cred, &eofflag, &ncookies, &cookies); - NFSVOPUNLOCK(vp, 0, p); off = (u_int64_t)io.uio_offset; if (io.uio_resid) siz -= io.uio_resid; @@ -1524,7 +1521,7 @@ again: * Handles the failed cases. nd->nd_repstat == 0 past here. */ if (nd->nd_repstat) { - vrele(vp); + vput(vp); free((caddr_t)rbuf, M_TEMP); if (cookies) free((caddr_t)cookies, M_TEMP); @@ -1537,7 +1534,7 @@ again: * rpc reply */ if (siz == 0) { - vrele(vp); + vput(vp); if (nd->nd_flag & ND_NFSV2) { NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); } else { @@ -1584,6 +1581,7 @@ again: toff = off; goto again; } + vput(vp); /* * dirlen is the size of the reply, including all XDR and must @@ -1642,7 +1640,6 @@ again: } if (cpos < cend) eofflag = 0; - vrele(vp); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_UNSIGNED); *tl++ = newnfs_false; if (eofflag) @@ -1852,7 +1849,7 @@ again: toff = off; goto again; } - NFSVOPUNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0); /* * Save this position, in case there is an error before one entry @@ -1938,10 +1935,11 @@ again: dp->d_name[1] == '.') cn.cn_flags |= ISDOTDOT; - if (!VOP_ISLOCKED(vp)) - vn_lock(vp, - LK_EXCLUSIVE | - LK_RETRY); + if (vn_lock(vp, LK_EXCLUSIVE) + != 0) { + nd->nd_repstat = EPERM; + break; + } if ((vp->v_vflag & VV_ROOT) != 0 && (cn.cn_flags & ISDOTDOT) != 0) { @@ -2000,7 +1998,7 @@ again: *tl = txdr_unsigned(*cookiep); dirlen += nfsm_strtom(nd, dp->d_name, nlen); if (nvp != NULL) - NFSVOPUNLOCK(nvp, 0, p); + VOP_UNLOCK(nvp, 0); if (refp != NULL) { dirlen += nfsrv_putreferralattr(nd, &savbits, refp, 0, @@ -2031,10 +2029,7 @@ again: cookiep++; ncookies--; } - if (!usevget && VOP_ISLOCKED(vp)) - vput(vp); - else - vrele(vp); + vrele(vp); /* * If dirlen > cnt, we must strip off the last entry. If that From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 7 20:31:47 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4A2A1065672; Fri, 7 Jan 2011 20:31:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1DCD8FC18; Fri, 7 Jan 2011 20:31:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p07KVluV064951; Fri, 7 Jan 2011 20:31:47 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p07KVlii064947; Fri, 7 Jan 2011 20:31:47 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101072031.p07KVlii064947@svn.freebsd.org> From: Rick Macklem Date: Fri, 7 Jan 2011 20:31:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217124 - in stable/8/sys/fs: nfs nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 20:31:47 -0000 Author: rmacklem Date: Fri Jan 7 20:31:47 2011 New Revision: 217124 URL: http://svn.freebsd.org/changeset/base/217124 Log: MFC: r216693 Add an argument to nfsvno_getattr() in the experimental NFS server, so that it can avoid calling VOP_ISLOCKED() when the vnode is known to be locked. This will allow LK_SHARED to be used for these cases, which happen to be all the cases that can use LK_SHARED. This does not fix any bug, but it reduces the number of calls to VOP_ISLOCKED() and prepares the code so that it can be switched to using LK_SHARED in a future patch. Modified: stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Fri Jan 7 20:26:33 2011 (r217123) +++ stable/8/sys/fs/nfs/nfs_var.h Fri Jan 7 20:31:47 2011 (r217124) @@ -512,7 +512,7 @@ void ncl_invalcaches(vnode_t); /* nfs_nfsdport.c */ int nfsvno_getattr(vnode_t, struct nfsvattr *, struct ucred *, - NFSPROC_T *); + NFSPROC_T *, int); int nfsvno_setattr(vnode_t, struct nfsvattr *, struct ucred *, NFSPROC_T *, struct nfsexstuff *); int nfsvno_getfh(vnode_t, fhandle_t *, NFSPROC_T *); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Fri Jan 7 20:26:33 2011 (r217123) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Fri Jan 7 20:31:47 2011 (r217124) @@ -100,18 +100,24 @@ static struct nfsheur { */ int nfsvno_getattr(struct vnode *vp, struct nfsvattr *nvap, struct ucred *cred, - struct thread *p) + struct thread *p, int vpislocked) { int error, lockedit = 0; - /* Since FreeBSD insists the vnode be locked... */ - if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { - lockedit = 1; - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); + if (vpislocked == 0) { + /* + * When vpislocked == 0, the vnode is either exclusively + * locked by this thread or not locked by this thread. + * As such, shared lock it, if not exclusively locked. + */ + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + lockedit = 1; + vn_lock(vp, LK_SHARED | LK_RETRY); + } } error = VOP_GETATTR(vp, &nvap->na_vattr, cred); - if (lockedit) - NFSVOPUNLOCK(vp, 0, p); + if (lockedit != 0) + VOP_UNLOCK(vp, 0); return (error); } @@ -1375,7 +1381,7 @@ nfsvno_updfilerev(struct vnode *vp, stru VATTR_NULL(&va); getnanotime(&va.va_mtime); (void) VOP_SETATTR(vp, &va, cred); - (void) nfsvno_getattr(vp, nvap, cred, p); + (void) nfsvno_getattr(vp, nvap, cred, p, 1); } /* @@ -1456,7 +1462,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd fullsiz = siz; if (nd->nd_flag & ND_NFSV3) { nd->nd_repstat = getret = nfsvno_getattr(vp, &at, nd->nd_cred, - p); + p, 1); #if 0 /* * va_filerev is not sufficient as a cookie verifier, @@ -1512,7 +1518,7 @@ again: if (!cookies && !nd->nd_repstat) nd->nd_repstat = NFSERR_PERM; if (nd->nd_flag & ND_NFSV3) { - getret = nfsvno_getattr(vp, &at, nd->nd_cred, p); + getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 1); if (!nd->nd_repstat) nd->nd_repstat = getret; } @@ -1723,7 +1729,7 @@ nfsrvd_readdirplus(struct nfsrv_descript NFSZERO_ATTRBIT(&attrbits); } fullsiz = siz; - nd->nd_repstat = getret = nfsvno_getattr(vp, &at, nd->nd_cred, p); + nd->nd_repstat = getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 1); if (!nd->nd_repstat) { if (off && verf != at.na_filerev) { /* @@ -1782,7 +1788,7 @@ again: if (io.uio_resid) siz -= io.uio_resid; - getret = nfsvno_getattr(vp, &at, nd->nd_cred, p); + getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 1); if (!cookies && !nd->nd_repstat) nd->nd_repstat = NFSERR_PERM; @@ -1958,7 +1964,7 @@ again: r = nfsvno_getfh(nvp, &nfh, p); if (!r) r = nfsvno_getattr(nvp, nvap, - nd->nd_cred, p); + nd->nd_cred, p, 1); } } else { nvp = NULL; Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Fri Jan 7 20:26:33 2011 (r217123) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Fri Jan 7 20:31:47 2011 (r217124) @@ -144,7 +144,7 @@ nfsrvd_access(struct nfsrv_descript *nd, } nfsmode &= supported; if (nd->nd_flag & ND_NFSV3) { - getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p); + getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); nfsrv_postopattr(nd, getret, &nva); } vput(vp); @@ -199,7 +199,7 @@ nfsrvd_getattr(struct nfsrv_descript *nd NFSACCCHK_VPISLOCKED, NULL); } if (!nd->nd_repstat) - nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p); + nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); if (!nd->nd_repstat) { if (nd->nd_flag & ND_NFSV4) { if (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_FILEHANDLE)) @@ -255,7 +255,7 @@ nfsrvd_setattr(struct nfsrv_descript *nd error = nfsrv_sattr(nd, &nva, &attrbits, aclp, p); if (error) goto nfsmout; - preat_ret = nfsvno_getattr(vp, &nva2, nd->nd_cred, p); + preat_ret = nfsvno_getattr(vp, &nva2, nd->nd_cred, p, 1); if (!nd->nd_repstat) nd->nd_repstat = preat_ret; if (nd->nd_flag & ND_NFSV3) { @@ -375,7 +375,7 @@ nfsrvd_setattr(struct nfsrv_descript *nd exp); } if (nd->nd_flag & (ND_NFSV2 | ND_NFSV3)) { - postat_ret = nfsvno_getattr(vp, &nva, nd->nd_cred, p); + postat_ret = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); if (!nd->nd_repstat) nd->nd_repstat = postat_ret; } @@ -456,7 +456,7 @@ nfsrvd_lookup(struct nfsrv_descript *nd, if (dirp) { if (nd->nd_flag & ND_NFSV3) dattr_ret = nfsvno_getattr(dirp, &dattr, - nd->nd_cred, p); + nd->nd_cred, p, 0); vrele(dirp); } if (nd->nd_flag & ND_NFSV3) @@ -469,7 +469,7 @@ nfsrvd_lookup(struct nfsrv_descript *nd, vp = named.ni_vp; nd->nd_repstat = nfsvno_getfh(vp, fhp, p); if (!(nd->nd_flag & ND_NFSV4) && !nd->nd_repstat) - nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p); + nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); if (vpp) { NFSVOPUNLOCK(vp, 0, p); *vpp = vp; @@ -479,7 +479,7 @@ nfsrvd_lookup(struct nfsrv_descript *nd, if (dirp) { if (nd->nd_flag & ND_NFSV3) dattr_ret = nfsvno_getattr(dirp, &dattr, nd->nd_cred, - p); + p, 0); vrele(dirp); } if (nd->nd_repstat) { @@ -524,7 +524,7 @@ nfsrvd_readlink(struct nfsrv_descript *n nd->nd_repstat = nfsvno_readlink(vp, nd->nd_cred, p, &mp, &mpend, &len); if (nd->nd_flag & ND_NFSV3) - getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p); + getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); vput(vp); if (nd->nd_flag & ND_NFSV3) nfsrv_postopattr(nd, getret, &nva); @@ -612,7 +612,7 @@ nfsrvd_read(struct nfsrv_descript *nd, _ nd->nd_repstat = (vnode_vtype(vp) == VDIR) ? EISDIR : EINVAL; } - getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p); + getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); if (!nd->nd_repstat) nd->nd_repstat = getret; if (!nd->nd_repstat && @@ -650,7 +650,7 @@ nfsrvd_read(struct nfsrv_descript *nd, _ nd->nd_repstat = nfsvno_read(vp, off, cnt, nd->nd_cred, p, &m3, &m2); if (!(nd->nd_flag & ND_NFSV4)) { - getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p); + getret = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); if (!nd->nd_repstat) nd->nd_repstat = getret; } @@ -788,7 +788,7 @@ nfsrvd_write(struct nfsrv_descript *nd, nd->nd_repstat = (vnode_vtype(vp) == VDIR) ? EISDIR : EINVAL; } - forat_ret = nfsvno_getattr(vp, &forat, nd->nd_cred, p); + forat_ret = nfsvno_getattr(vp, &forat, nd->nd_cred, p, 1); if (!nd->nd_repstat) nd->nd_repstat = forat_ret; if (!nd->nd_repstat && @@ -823,7 +823,7 @@ nfsrvd_write(struct nfsrv_descript *nd, if (nd->nd_flag & ND_NFSV4) aftat_ret = 0; else - aftat_ret = nfsvno_getattr(vp, &nva, nd->nd_cred, p); + aftat_ret = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); vput(vp); if (!nd->nd_repstat) nd->nd_repstat = aftat_ret; @@ -939,7 +939,7 @@ nfsrvd_create(struct nfsrv_descript *nd, nfsvno_relpathbuf(&named); if (nd->nd_flag & ND_NFSV3) { dirfor_ret = nfsvno_getattr(dp, &dirfor, nd->nd_cred, - p); + p, 1); nfsrv_wcc(nd, dirfor_ret, &dirfor, diraft_ret, &diraft); } @@ -954,7 +954,7 @@ nfsrvd_create(struct nfsrv_descript *nd, dirp = NULL; } else { dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, - p); + p, 0); } } if (nd->nd_repstat) { @@ -993,7 +993,7 @@ nfsrvd_create(struct nfsrv_descript *nd, nd->nd_repstat = nfsvno_getfh(vp, &fh, p); if (!nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, - p); + p, 1); vput(vp); if (!nd->nd_repstat) { tverf[0] = nva.na_atime.tv_sec; @@ -1009,7 +1009,7 @@ nfsrvd_create(struct nfsrv_descript *nd, if (exclusive_flag && !nd->nd_repstat && (cverf[0] != tverf[0] || cverf[1] != tverf[1])) nd->nd_repstat = EEXIST; - diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p); + diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p, 0); vrele(dirp); if (!nd->nd_repstat) { (void) nfsm_fhtom(nd, (u_int8_t *)&fh, 0, 1); @@ -1136,7 +1136,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, } } - dirfor_ret = nfsvno_getattr(dp, &dirfor, nd->nd_cred, p); + dirfor_ret = nfsvno_getattr(dp, &dirfor, nd->nd_cred, p, 0); if (!nd->nd_repstat && (nd->nd_flag & ND_NFSV4)) { if (!dirfor_ret && NFSVNO_ISSETGID(&nva) && dirfor.na_gid == nva.na_gid) @@ -1175,7 +1175,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, if (dirp) { if (nd->nd_flag & ND_NFSV3) dirfor_ret = nfsvno_getattr(dirp, &dirfor, - nd->nd_cred, p); + nd->nd_cred, p, 0); vrele(dirp); } #ifdef NFS4_ACL_EXTATTR_NAME @@ -1187,7 +1187,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, return (0); } if (dirp) - dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, p); + dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, p, 0); if ((nd->nd_flag & ND_NFSV4) && (vtyp == VDIR || vtyp == VLNK)) { if (vtyp == VDIR) { @@ -1217,7 +1217,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, nd->nd_repstat = nfsvno_getfh(vp, fhp, p); if ((nd->nd_flag & ND_NFSV3) && !nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, - p); + p, 1); if (vpp) { NFSVOPUNLOCK(vp, 0, p); *vpp = vp; @@ -1226,7 +1226,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, } } - diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p); + diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p, 0); vrele(dirp); if (!nd->nd_repstat) { if (nd->nd_flag & ND_NFSV3) { @@ -1296,7 +1296,7 @@ nfsrvd_remove(struct nfsrv_descript *nd, if (dirp) { if (!(nd->nd_flag & ND_NFSV2)) { dirfor_ret = nfsvno_getattr(dirp, &dirfor, - nd->nd_cred, p); + nd->nd_cred, p, 0); } else { vrele(dirp); dirp = NULL; @@ -1321,7 +1321,7 @@ nfsrvd_remove(struct nfsrv_descript *nd, if (!(nd->nd_flag & ND_NFSV2)) { if (dirp) { diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, - p); + p, 0); vrele(dirp); } if (nd->nd_flag & ND_NFSV3) { @@ -1364,7 +1364,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, return (0); } if (!(nd->nd_flag & ND_NFSV2)) - fdirfor_ret = nfsvno_getattr(dp, &fdirfor, nd->nd_cred, p); + fdirfor_ret = nfsvno_getattr(dp, &fdirfor, nd->nd_cred, p, 1); tond.ni_cnd.cn_nameiop = 0; tond.ni_startdir = NULL; NFSNAMEICNDSET(&fromnd.ni_cnd, nd->nd_cred, DELETE, WANTPARENT | SAVESTART); @@ -1380,7 +1380,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, if (nd->nd_flag & ND_NFSV4) { tdp = todp; tnes = *toexp; - tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p); + tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 0); } else { error = nfsrv_mtofh(nd, &tfh); if (error) { @@ -1395,7 +1395,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, nfsd_fhtovp(nd, &tfh, &tdp, &tnes, &mp, 0, p); if (tdp) { tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, - p); + p, 1); NFSVOPUNLOCK(tdp, 0, p); } } @@ -1463,9 +1463,11 @@ nfsrvd_rename(struct nfsrv_descript *nd, nd->nd_repstat = nfsvno_rename(&fromnd, &tond, nd->nd_repstat, nd->nd_flag, nd->nd_cred, p); if (fdirp) - fdiraft_ret = nfsvno_getattr(fdirp, &fdiraft, nd->nd_cred, p); + fdiraft_ret = nfsvno_getattr(fdirp, &fdiraft, nd->nd_cred, p, + 0); if (tdirp) - tdiraft_ret = nfsvno_getattr(tdirp, &tdiraft, nd->nd_cred, p); + tdiraft_ret = nfsvno_getattr(tdirp, &tdiraft, nd->nd_cred, p, + 0); if (tnes.nes_vfslocked && !exp->nes_vfslocked && !(nd->nd_flag & ND_NFSV4)) nfsvno_unlockvfs(mp); @@ -1580,15 +1582,15 @@ nfsrvd_link(struct nfsrv_descript *nd, i dirp = NULL; } else { dirfor_ret = nfsvno_getattr(dirp, &dirfor, - nd->nd_cred, p); + nd->nd_cred, p, 0); } } if (!nd->nd_repstat) nd->nd_repstat = nfsvno_link(&named, vp, nd->nd_cred, p, exp); if (nd->nd_flag & ND_NFSV3) - getret = nfsvno_getattr(vp, &at, nd->nd_cred, p); + getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 0); if (dirp) { - diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p); + diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p, 0); vrele(dirp); } if (tnes.nes_vfslocked && !exp->nes_vfslocked && @@ -1659,12 +1661,12 @@ nfsrvd_symlink(struct nfsrv_descript *nd if (!nd->nd_repstat) { if (dirp != NULL) dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, - p); + p, 0); nfsrvd_symlinksub(nd, &named, &nva, fhp, vpp, dirp, &dirfor, &diraft, &diraft_ret, NULL, NULL, p, exp, pathcp, pathlen); } else if (dirp != NULL) { - dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, p); + dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, p, 0); vrele(dirp); } if (pathcp) @@ -1701,7 +1703,7 @@ nfsrvd_symlinksub(struct nfsrv_descript nd->nd_repstat = nfsvno_getfh(ndp->ni_vp, fhp, p); if (!nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(ndp->ni_vp, - nvap, nd->nd_cred, p); + nvap, nd->nd_cred, p, 1); } if (vpp) { NFSVOPUNLOCK(ndp->ni_vp, 0, p); @@ -1711,7 +1713,7 @@ nfsrvd_symlinksub(struct nfsrv_descript } } if (dirp) { - *diraft_retp = nfsvno_getattr(dirp, diraftp, nd->nd_cred, p); + *diraft_retp = nfsvno_getattr(dirp, diraftp, nd->nd_cred, p, 0); vrele(dirp); } if ((nd->nd_flag & ND_NFSV4) && !nd->nd_repstat) { @@ -1780,7 +1782,7 @@ nfsrvd_mkdir(struct nfsrv_descript *nd, if (nd->nd_repstat) { if (dirp != NULL) { dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, - p); + p, 0); vrele(dirp); } if (nd->nd_flag & ND_NFSV3) @@ -1789,7 +1791,7 @@ nfsrvd_mkdir(struct nfsrv_descript *nd, return (0); } if (dirp != NULL) - dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, p); + dirfor_ret = nfsvno_getattr(dirp, &dirfor, nd->nd_cred, p, 0); /* * Call nfsrvd_mkdirsub() for the code common to V4 as well. @@ -1836,7 +1838,7 @@ nfsrvd_mkdirsub(struct nfsrv_descript *n nd->nd_repstat = nfsvno_getfh(vp, fhp, p); if (!(nd->nd_flag & ND_NFSV4) && !nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, nvap, nd->nd_cred, - p); + p, 1); if (vpp && !nd->nd_repstat) { NFSVOPUNLOCK(vp, 0, p); *vpp = vp; @@ -1845,7 +1847,7 @@ nfsrvd_mkdirsub(struct nfsrv_descript *n } } if (dirp) { - *diraft_retp = nfsvno_getattr(dirp, diraftp, nd->nd_cred, p); + *diraft_retp = nfsvno_getattr(dirp, diraftp, nd->nd_cred, p, 0); vrele(dirp); } if ((nd->nd_flag & ND_NFSV4) && !nd->nd_repstat) { @@ -1883,10 +1885,10 @@ nfsrvd_commit(struct nfsrv_descript *nd, tl += 2; cnt = fxdr_unsigned(int, *tl); if (nd->nd_flag & ND_NFSV3) - for_ret = nfsvno_getattr(vp, &bfor, nd->nd_cred, p); + for_ret = nfsvno_getattr(vp, &bfor, nd->nd_cred, p, 1); nd->nd_repstat = nfsvno_fsync(vp, off, cnt, nd->nd_cred, p); if (nd->nd_flag & ND_NFSV3) { - aft_ret = nfsvno_getattr(vp, &aft, nd->nd_cred, p); + aft_ret = nfsvno_getattr(vp, &aft, nd->nd_cred, p, 1); nfsrv_wcc(nd, for_ret, &bfor, aft_ret, &aft); } vput(vp); @@ -1921,7 +1923,7 @@ nfsrvd_statfs(struct nfsrv_descript *nd, } sf = &sfs; nd->nd_repstat = nfsvno_statfs(vp, sf); - getret = nfsvno_getattr(vp, &at, nd->nd_cred, p); + getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 1); vput(vp); if (nd->nd_flag & ND_NFSV3) nfsrv_postopattr(nd, getret, &at); @@ -1972,7 +1974,7 @@ nfsrvd_fsinfo(struct nfsrv_descript *nd, nfsrv_postopattr(nd, getret, &at); return (0); } - getret = nfsvno_getattr(vp, &at, nd->nd_cred, p); + getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 1); nfsvno_getfs(&fs, isdgram); vput(vp); nfsrv_postopattr(nd, getret, &at); @@ -2019,7 +2021,7 @@ nfsrvd_pathconf(struct nfsrv_descript *n if (!nd->nd_repstat) nd->nd_repstat = nfsvno_pathconf(vp, _PC_NO_TRUNC, ¬runc, nd->nd_cred, p); - getret = nfsvno_getattr(vp, &at, nd->nd_cred, p); + getret = nfsvno_getattr(vp, &at, nd->nd_cred, p, 1); vput(vp); nfsrv_postopattr(nd, getret, &at); if (!nd->nd_repstat) { @@ -2516,7 +2518,7 @@ nfsrvd_open(struct nfsrv_descript *nd, _ NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); create = fxdr_unsigned(int, *tl); if (!nd->nd_repstat) - nd->nd_repstat = nfsvno_getattr(dp, &dirfor, nd->nd_cred, p); + nd->nd_repstat = nfsvno_getattr(dp, &dirfor, nd->nd_cred, p, 0); if (create == NFSV4OPEN_CREATE) { nva.na_type = VREG; nva.na_mode = 0; @@ -2710,7 +2712,7 @@ nfsrvd_open(struct nfsrv_descript *nd, _ } if (!nd->nd_repstat) { - nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p); + nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); if (!nd->nd_repstat) { tverf[0] = nva.na_atime.tv_sec; tverf[1] = nva.na_atime.tv_nsec; @@ -2736,7 +2738,8 @@ nfsrvd_open(struct nfsrv_descript *nd, _ if (stp) FREE((caddr_t)stp, M_NFSDSTATE); if (!nd->nd_repstat && dirp) - nd->nd_repstat = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p); + nd->nd_repstat = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p, + 0); if (!nd->nd_repstat) { NFSM_BUILD(tl, u_int32_t *, NFSX_STATEID + 6 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(stateid.seqid); @@ -3348,7 +3351,7 @@ nfsrvd_verify(struct nfsrv_descript *nd, struct nfsfsinfo fs; fhandle_t fh; - nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p); + nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); if (!nd->nd_repstat) nd->nd_repstat = nfsvno_statfs(vp, &sf); if (!nd->nd_repstat) From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 7 23:47:19 2011 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8D081065675; Fri, 7 Jan 2011 23:47:19 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 8284A8FC12; Fri, 7 Jan 2011 23:47:19 +0000 (UTC) Received: from lawrence1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 514907E853; Sat, 8 Jan 2011 10:47:18 +1100 (EST) Message-ID: <4D27A605.6090002@freebsd.org> Date: Sat, 08 Jan 2011 10:47:17 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.2.13) Gecko/20101214 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201101051852.p05IqUjK087769@svn.freebsd.org> <4D26A165.3070001@freebsd.org> <20110107091418.H14966@maildrop.int.zabbadoz.net> In-Reply-To: <20110107091418.H14966@maildrop.int.zabbadoz.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: src-committers@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, "George V. Neville-Neil" , svn-src-stable-8@FreeBSD.org, "Robert N. M. Watson" Subject: Re: svn commit: r217018 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 23:47:19 -0000 On 01/07/11 20:36, Bjoern A. Zeeb wrote: > On Fri, 7 Jan 2011, Lawrence Stewart wrote: > >> Hi George, >> >> On 01/06/11 05:52, George V. Neville-Neil wrote: >>> Author: gnn >>> Date: Wed Jan 5 18:52:30 2011 >>> New Revision: 217018 >>> URL: http://svn.freebsd.org/changeset/base/217018 >>> >>> Log: >>> Fix binary compatability for netstats across the -x/-T changes >>> that have been previously MFC'd. >>> >>> Reviewed by: rwatson, bz >>> >>> Modified: >>> stable/8/sys/netinet/tcp_var.h >>> > ... >> >> On my stable/8 machine after updating world but not kernel I see "struct >> xtcpcb size mismatch" messages which indicates the ABI has been futzed >> with. > > Be sure that it's not local changes. Definitely not the issue - this box runs stock stable/8 directly from svn.freebsd.org without any local changes. >> Looking at the above diff I think this commit does indeed change the ABI >> and therefore needs to be tweaked in order to maintain our current ABI >> preservation policy for stable branches (unless I'm missing something?). >> If the change to the ABI is intentional, a note in UPDATING would >> probably be warranted. > > I think you are missing that that was the "repair" commit. Are you > sure you didn't pickup the wrong versions? There was about a 1 day > timeframe, where things were hosed but I believe George fixed them > all. Looking at my kernel.old rev, I updated from stable/8 kernel/world @ r216035 to stable/8 @ r217084. According to my commit mail log, George made the initial change in r216968 and the repair commit was r217018, so I don't think that I should have seen any issues if r217018 didn't mess with the ABI as I hadn't updated in the cross over period. > Hmm looking at the diff committed more closely I see that the two > uint64_t are not were they should be. Are you by any chance on i386 > or another 32bit platform? No: lstewart@lstewart3:~> uname -a FreeBSD lstewart3 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #16 r217084: Fri Jan 7 16:17:03 EST 2011 root@lstewart3:/usr/obj/usr/src/sys/GENERIC amd64 > uint64_t t_sndrexmitpack;/* retransmit packets sent */ > uint64_t t_rcvoopack; /* out-of-order packets received */ > should move after t_pspare2[6] and the patch I had seen had that. > > Maybe we should even move them after _pad[] to keep the spares > together. > > Can you test this one? > http://people.freebsd.org/~bz/20110107-01-restore-xtcpcb-ABI.diff This looks to be on the right track. Will do. Cheers, Lawrence From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 8 01:11:14 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E81C10656AE; Sat, 8 Jan 2011 01:11:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AA448FC13; Sat, 8 Jan 2011 01:11:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p081BEgN071792; Sat, 8 Jan 2011 01:11:14 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p081BEu3071784; Sat, 8 Jan 2011 01:11:14 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101080111.p081BEu3071784@svn.freebsd.org> From: Rick Macklem Date: Sat, 8 Jan 2011 01:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217137 - in stable/8/sys/fs: nfs nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 01:11:14 -0000 Author: rmacklem Date: Sat Jan 8 01:11:14 2011 New Revision: 217137 URL: http://svn.freebsd.org/changeset/base/217137 Log: MFC: r216700 Modify the experimental NFS server so that it uses LK_SHARED for RPC operations when it can. Since VFS_FHTOVP() currently always gets an exclusively locked vnode and is usually called at the beginning of each RPC, the RPCs for a given vnode will still be serialized. As such, passing a lock type argument to VFS_FHTOVP() would be preferable to doing the vn_lock() with LK_DOWNGRADE after the VFS_FHTOVP() call. Modified: stable/8/sys/fs/nfs/nfs.h stable/8/sys/fs/nfs/nfs_commonsubs.c stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs.h ============================================================================== --- stable/8/sys/fs/nfs/nfs.h Sat Jan 8 00:48:00 2011 (r217136) +++ stable/8/sys/fs/nfs/nfs.h Sat Jan 8 01:11:14 2011 (r217137) @@ -568,6 +568,7 @@ struct nfsv4_opflag { int needscfh; int savereply; int modifyfs; + int lktype; }; /* Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonsubs.c Sat Jan 8 00:48:00 2011 (r217136) +++ stable/8/sys/fs/nfs/nfs_commonsubs.c Sat Jan 8 01:11:14 2011 (r217137) @@ -84,46 +84,46 @@ NFSSOCKMUTEX; * Define it here, since it is used by both the client and server. */ struct nfsv4_opflag nfsv4_opflag[NFSV4OP_NOPS] = { - { 0, 0, 0, 0 }, /* undef */ - { 0, 0, 0, 0 }, /* undef */ - { 0, 0, 0, 0 }, /* undef */ - { 0, 1, 0, 0 }, /* Access */ - { 0, 1, 0, 0 }, /* Close */ - { 0, 2, 0, 1 }, /* Commit */ - { 1, 2, 1, 1 }, /* Create */ - { 0, 0, 0, 0 }, /* Delegpurge */ - { 0, 1, 0, 0 }, /* Delegreturn */ - { 0, 1, 0, 0 }, /* Getattr */ - { 0, 1, 0, 0 }, /* GetFH */ - { 2, 1, 1, 1 }, /* Link */ - { 0, 1, 0, 0 }, /* Lock */ - { 0, 1, 0, 0 }, /* LockT */ - { 0, 1, 0, 0 }, /* LockU */ - { 1, 1, 0, 0 }, /* Lookup */ - { 1, 1, 0, 0 }, /* Lookupp */ - { 0, 1, 0, 0 }, /* NVerify */ - { 1, 1, 0, 1 }, /* Open */ - { 1, 1, 0, 0 }, /* OpenAttr */ - { 0, 1, 0, 0 }, /* OpenConfirm */ - { 0, 1, 0, 0 }, /* OpenDowngrade */ - { 1, 0, 0, 0 }, /* PutFH */ - { 1, 0, 0, 0 }, /* PutPubFH */ - { 1, 0, 0, 0 }, /* PutRootFH */ - { 0, 1, 0, 0 }, /* Read */ - { 0, 1, 0, 0 }, /* Readdir */ - { 0, 1, 0, 0 }, /* ReadLink */ - { 0, 2, 1, 1 }, /* Remove */ - { 2, 1, 1, 1 }, /* Rename */ - { 0, 0, 0, 0 }, /* Renew */ - { 0, 0, 0, 0 }, /* RestoreFH */ - { 0, 1, 0, 0 }, /* SaveFH */ - { 0, 1, 0, 0 }, /* SecInfo */ - { 0, 2, 1, 1 }, /* Setattr */ - { 0, 0, 0, 0 }, /* SetClientID */ - { 0, 0, 0, 0 }, /* SetClientIDConfirm */ - { 0, 1, 0, 0 }, /* Verify */ - { 0, 2, 1, 1 }, /* Write */ - { 0, 0, 0, 0 }, /* ReleaseLockOwner */ + { 0, 0, 0, 0, LK_EXCLUSIVE }, /* undef */ + { 0, 0, 0, 0, LK_EXCLUSIVE }, /* undef */ + { 0, 0, 0, 0, LK_EXCLUSIVE }, /* undef */ + { 0, 1, 0, 0, LK_SHARED }, /* Access */ + { 0, 1, 0, 0, LK_EXCLUSIVE }, /* Close */ + { 0, 2, 0, 1, LK_EXCLUSIVE }, /* Commit */ + { 1, 2, 1, 1, LK_EXCLUSIVE }, /* Create */ + { 0, 0, 0, 0, LK_EXCLUSIVE }, /* Delegpurge */ + { 0, 1, 0, 0, LK_EXCLUSIVE }, /* Delegreturn */ + { 0, 1, 0, 0, LK_SHARED }, /* Getattr */ + { 0, 1, 0, 0, LK_EXCLUSIVE }, /* GetFH */ + { 2, 1, 1, 1, LK_EXCLUSIVE }, /* Link */ + { 0, 1, 0, 0, LK_EXCLUSIVE }, /* Lock */ + { 0, 1, 0, 0, LK_EXCLUSIVE }, /* LockT */ + { 0, 1, 0, 0, LK_EXCLUSIVE }, /* LockU */ + { 1, 1, 0, 0, LK_EXCLUSIVE }, /* Lookup */ + { 1, 1, 0, 0, LK_EXCLUSIVE }, /* Lookupp */ + { 0, 1, 0, 0, LK_EXCLUSIVE }, /* NVerify */ + { 1, 1, 0, 1, LK_EXCLUSIVE }, /* Open */ + { 1, 1, 0, 0, LK_EXCLUSIVE }, /* OpenAttr */ + { 0, 1, 0, 0, LK_EXCLUSIVE }, /* OpenConfirm */ + { 0, 1, 0, 0, LK_EXCLUSIVE }, /* OpenDowngrade */ + { 1, 0, 0, 0, LK_EXCLUSIVE }, /* PutFH */ + { 1, 0, 0, 0, LK_EXCLUSIVE }, /* PutPubFH */ + { 1, 0, 0, 0, LK_EXCLUSIVE }, /* PutRootFH */ + { 0, 1, 0, 0, LK_EXCLUSIVE }, /* Read */ + { 0, 1, 0, 0, LK_SHARED }, /* Readdir */ + { 0, 1, 0, 0, LK_SHARED }, /* ReadLink */ + { 0, 2, 1, 1, LK_EXCLUSIVE }, /* Remove */ + { 2, 1, 1, 1, LK_EXCLUSIVE }, /* Rename */ + { 0, 0, 0, 0, LK_EXCLUSIVE }, /* Renew */ + { 0, 0, 0, 0, LK_EXCLUSIVE }, /* RestoreFH */ + { 0, 1, 0, 0, LK_EXCLUSIVE }, /* SaveFH */ + { 0, 1, 0, 0, LK_EXCLUSIVE }, /* SecInfo */ + { 0, 2, 1, 1, LK_EXCLUSIVE }, /* Setattr */ + { 0, 0, 0, 0, LK_EXCLUSIVE }, /* SetClientID */ + { 0, 0, 0, 0, LK_EXCLUSIVE }, /* SetClientIDConfirm */ + { 0, 1, 0, 0, LK_EXCLUSIVE }, /* Verify */ + { 0, 2, 1, 1, LK_EXCLUSIVE }, /* Write */ + { 0, 0, 0, 0, LK_EXCLUSIVE }, /* ReleaseLockOwner */ }; #endif /* !APPLEKEXT */ @@ -2001,12 +2001,14 @@ nfsv4_fillattr(struct nfsrv_descript *nd NFSCLRBIT_ATTRBIT(retbitp, NFSATTRBIT_ACL); #ifdef NFS4_ACL_EXTATTR_NAME } else if (naclp != NULL) { - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); - error = VOP_ACCESS(vp, VREAD_ACL, cred, p); - if (error == 0) - error = VOP_GETACL(vp, ACL_TYPE_NFS4, naclp, - cred, p); - NFSVOPUNLOCK(vp, 0, p); + if (vn_lock(vp, LK_SHARED) == 0) { + error = VOP_ACCESS(vp, VREAD_ACL, cred, p); + if (error == 0) + error = VOP_GETACL(vp, ACL_TYPE_NFS4, + naclp, cred, p); + VOP_UNLOCK(vp, 0); + } else + error = NFSERR_PERM; if (error != 0) { if (reterr) { nd->nd_repstat = NFSERR_ACCES; Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Sat Jan 8 00:48:00 2011 (r217136) +++ stable/8/sys/fs/nfs/nfs_var.h Sat Jan 8 01:11:14 2011 (r217137) @@ -279,7 +279,7 @@ int nfscl_request(struct nfsrv_descript void nfsm_stateidtom(struct nfsrv_descript *, nfsv4stateid_t *, int); /* nfs_nfsdsubs.c */ -void nfsd_fhtovp(struct nfsrv_descript *, struct nfsrvfh *, +void nfsd_fhtovp(struct nfsrv_descript *, struct nfsrvfh *, int, vnode_t *, struct nfsexstuff *, mount_t *, int, NFSPROC_T *); int nfsd_excred(struct nfsrv_descript *, struct nfsexstuff *, struct ucred *); @@ -566,7 +566,7 @@ int nfsv4_sattr(struct nfsrv_descript *, NFSACL_T *, NFSPROC_T *); int nfsvno_checkexp(mount_t, NFSSOCKADDR_T, struct nfsexstuff *, struct ucred **); -int nfsvno_fhtovp(mount_t, fhandle_t *, NFSSOCKADDR_T, +int nfsvno_fhtovp(mount_t, fhandle_t *, NFSSOCKADDR_T, int, vnode_t *, struct nfsexstuff *, struct ucred **); int nfsvno_pathconf(vnode_t, int, register_t *, struct ucred *, NFSPROC_T *); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Jan 8 00:48:00 2011 (r217136) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sat Jan 8 01:11:14 2011 (r217137) @@ -180,7 +180,7 @@ nfsvno_accchk(struct vnode *vp, accmode_ return (ETXTBSY); } if (vpislocked == 0) - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(vp, LK_SHARED | LK_RETRY); /* * Should the override still be applied when ACLs are enabled? @@ -218,7 +218,7 @@ nfsvno_accchk(struct vnode *vp, accmode_ } } if (vpislocked == 0) - NFSVOPUNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0); return (error); } @@ -1916,7 +1916,7 @@ again: if (refp == NULL) { if (usevget) r = VFS_VGET(vp->v_mount, - dp->d_fileno, LK_EXCLUSIVE, + dp->d_fileno, LK_SHARED, &nvp); else r = EOPNOTSUPP; @@ -1925,7 +1925,7 @@ again: usevget = 0; cn.cn_nameiop = LOOKUP; cn.cn_lkflags = - LK_EXCLUSIVE | + LK_SHARED | LK_RETRY; cn.cn_cred = nd->nd_cred; @@ -1941,7 +1941,7 @@ again: dp->d_name[1] == '.') cn.cn_flags |= ISDOTDOT; - if (vn_lock(vp, LK_EXCLUSIVE) + if (vn_lock(vp, LK_SHARED) != 0) { nd->nd_repstat = EPERM; break; @@ -2454,7 +2454,8 @@ nfsvno_checkexp(struct mount *mp, struct */ int nfsvno_fhtovp(struct mount *mp, fhandle_t *fhp, struct sockaddr *nam, - struct vnode **vpp, struct nfsexstuff *exp, struct ucred **credp) + int lktype, struct vnode **vpp, struct nfsexstuff *exp, + struct ucred **credp) { int i, error, *secflavors; @@ -2481,6 +2482,13 @@ nfsvno_fhtovp(struct mount *mp, fhandle_ exp->nes_secflavors[i] = secflavors[i]; } } + if (error == 0 && lktype == LK_SHARED) + /* + * It would be much better to pass lktype to VFS_FHTOVP(), + * but this will have to do until VFS_FHTOVP() has a lock + * type argument like VFS_VGET(). + */ + vn_lock(*vpp, LK_DOWNGRADE | LK_RETRY); return (error); } @@ -2518,7 +2526,7 @@ nfsvno_pathconf(struct vnode *vp, int fl * call VFS_LOCK_GIANT() */ void -nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh *nfp, +nfsd_fhtovp(struct nfsrv_descript *nd, struct nfsrvfh *nfp, int lktype, struct vnode **vpp, struct nfsexstuff *exp, struct mount **mpp, int startwrite, struct thread *p) { @@ -2555,7 +2563,7 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s if (startwrite) vn_start_write(NULL, mpp, V_WAIT); - nd->nd_repstat = nfsvno_fhtovp(mp, fhp, nd->nd_nam, vpp, exp, + nd->nd_repstat = nfsvno_fhtovp(mp, fhp, nd->nd_nam, lktype, vpp, exp, &credanon); /* Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sat Jan 8 00:48:00 2011 (r217136) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Sat Jan 8 01:11:14 2011 (r217137) @@ -1392,7 +1392,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, nd->nd_cred->cr_uid = nd->nd_saveduid; /* Won't lock vfs if already locked, mp == NULL */ tnes.nes_vfslocked = exp->nes_vfslocked; - nfsd_fhtovp(nd, &tfh, &tdp, &tnes, &mp, 0, p); + nfsd_fhtovp(nd, &tfh, LK_EXCLUSIVE, &tdp, &tnes, &mp, 0, p); if (tdp) { tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred, p, 1); @@ -1546,7 +1546,8 @@ nfsrvd_link(struct nfsrv_descript *nd, i } /* Won't lock vfs if already locked, mp == NULL */ tnes.nes_vfslocked = exp->nes_vfslocked; - nfsd_fhtovp(nd, &dfh, &dp, &tnes, &mp, 0, p); + nfsd_fhtovp(nd, &dfh, LK_EXCLUSIVE, &dp, &tnes, &mp, 0, + p); if (dp) NFSVOPUNLOCK(dp, 0, p); } @@ -3141,7 +3142,7 @@ nfsrvd_secinfo(struct nfsrv_descript *nd vput(vp); savflag = nd->nd_flag; if (!nd->nd_repstat) { - nfsd_fhtovp(nd, &fh, &vp, &retnes, &mp, 0, p); + nfsd_fhtovp(nd, &fh, LK_SHARED, &vp, &retnes, &mp, 0, p); if (vp) vput(vp); } Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Jan 8 00:48:00 2011 (r217136) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsocket.c Sat Jan 8 01:11:14 2011 (r217137) @@ -354,7 +354,7 @@ APPLESTATIC void nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram, NFSPROC_T *p) { - int error = 0; + int error = 0, lktype; vnode_t vp; mount_t mp = NULL; struct nfsrvfh fh; @@ -380,12 +380,20 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, nd->nd_repstat = NFSERR_GARBAGE; return; } + if (nd->nd_procnum == NFSPROC_READ || + nd->nd_procnum == NFSPROC_READDIR || + nd->nd_procnum == NFSPROC_READLINK || + nd->nd_procnum == NFSPROC_GETATTR || + nd->nd_procnum == NFSPROC_ACCESS) + lktype = LK_SHARED; + else + lktype = LK_EXCLUSIVE; nes.nes_vfslocked = 0; if (nd->nd_flag & ND_PUBLOOKUP) - nfsd_fhtovp(nd, &nfs_pubfh, &vp, &nes, + nfsd_fhtovp(nd, &nfs_pubfh, lktype, &vp, &nes, &mp, nfs_writerpc[nd->nd_procnum], p); else - nfsd_fhtovp(nd, &fh, &vp, &nes, + nfsd_fhtovp(nd, &fh, lktype, &vp, &nes, &mp, nfs_writerpc[nd->nd_procnum], p); if (nd->nd_repstat == NFSERR_PROGNOTV4) return; @@ -700,7 +708,7 @@ nfsrvd_compound(struct nfsrv_descript *n goto nfsmout; if (!nd->nd_repstat) { nes.nes_vfslocked = vpnes.nes_vfslocked; - nfsd_fhtovp(nd, &fh, &nvp, &nes, &mp, + nfsd_fhtovp(nd, &fh, LK_SHARED, &nvp, &nes, &mp, 0, p); } /* For now, allow this for non-export FHs */ @@ -715,7 +723,7 @@ nfsrvd_compound(struct nfsrv_descript *n case NFSV4OP_PUTPUBFH: if (nfs_pubfhset) { nes.nes_vfslocked = vpnes.nes_vfslocked; - nfsd_fhtovp(nd, &nfs_pubfh, &nvp, + nfsd_fhtovp(nd, &nfs_pubfh, LK_SHARED, &nvp, &nes, &mp, 0, p); } else { nd->nd_repstat = NFSERR_NOFILEHANDLE; @@ -731,7 +739,7 @@ nfsrvd_compound(struct nfsrv_descript *n case NFSV4OP_PUTROOTFH: if (nfs_rootfhset) { nes.nes_vfslocked = vpnes.nes_vfslocked; - nfsd_fhtovp(nd, &nfs_rootfh, &nvp, + nfsd_fhtovp(nd, &nfs_rootfh, LK_SHARED, &nvp, &nes, &mp, 0, p); if (!nd->nd_repstat) { if (vp) @@ -907,24 +915,28 @@ nfsrvd_compound(struct nfsrv_descript *n if (nfsv4_opflag[op].retfh != 0) panic("nfsrvd_compound"); if (nfsv4_opflag[op].needscfh) { - if (vp) { - VREF(vp); - if (nfsv4_opflag[op].modifyfs) - NFS_STARTWRITE(NULL, &mp); - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); - } else { + if (vp != NULL) { + if (vn_lock(vp, nfsv4_opflag[op].lktype) + != 0) + nd->nd_repstat = NFSERR_PERM; + } else nd->nd_repstat = NFSERR_NOFILEHANDLE; + if (nd->nd_repstat != 0) { if (op == NFSV4OP_SETATTR) { - /* - * Setattr reply requires a bitmap - * even for errors like these. - */ - NFSM_BUILD(tl, u_int32_t *, - NFSX_UNSIGNED); - *tl = 0; + /* + * Setattr reply requires a + * bitmap even for errors like + * these. + */ + NFSM_BUILD(tl, u_int32_t *, + NFSX_UNSIGNED); + *tl = 0; } break; } + VREF(vp); + if (nfsv4_opflag[op].modifyfs) + NFS_STARTWRITE(NULL, &mp); error = (*(nfsrv4_ops0[op]))(nd, isdgram, vp, p, &vpnes); if (nfsv4_opflag[op].modifyfs) From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 8 02:24:00 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BA091065674; Sat, 8 Jan 2011 02:24:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39A7A8FC16; Sat, 8 Jan 2011 02:24:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p082O0VM073695; Sat, 8 Jan 2011 02:24:00 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p082O0Hh073693; Sat, 8 Jan 2011 02:24:00 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201101080224.p082O0Hh073693@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 8 Jan 2011 02:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217141 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 02:24:00 -0000 Author: bz Date: Sat Jan 8 02:23:59 2011 New Revision: 217141 URL: http://svn.freebsd.org/changeset/base/217141 Log: Move the uint64_t to were the padding was before, rather than before all pad. Keep them to the end so that the two pad[]s are kept together. This should restore ABI as well on platforms, where sizeof(void *) != sizeof(uint64_t) after r216968, r217018. Reviewed by: gnn, jhb, lstewart Modified: stable/8/sys/netinet/tcp_var.h Modified: stable/8/sys/netinet/tcp_var.h ============================================================================== --- stable/8/sys/netinet/tcp_var.h Sat Jan 8 01:57:23 2011 (r217140) +++ stable/8/sys/netinet/tcp_var.h Sat Jan 8 02:23:59 2011 (r217141) @@ -197,11 +197,12 @@ struct tcpcb { int t_bytes_acked; /* # bytes acked during current RTT */ int t_sndzerowin; /* zero-window updates sent */ - uint64_t t_sndrexmitpack;/* retransmit packets sent */ - uint64_t t_rcvoopack; /* out-of-order packets received */ void *t_pspare2[6]; /* 2 CC / 4 TBD */ uint64_t _pad[10]; /* 7 UTO, 3 TBD (1-2 CC/RTT?) */ + + uint64_t t_sndrexmitpack;/* retransmit packets sent */ + uint64_t t_rcvoopack; /* out-of-order packets received */ }; /* From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 8 19:49:27 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F086A1065670; Sat, 8 Jan 2011 19:49:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C54598FC16; Sat, 8 Jan 2011 19:49:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p08JnR4F002394; Sat, 8 Jan 2011 19:49:27 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p08JnR3f002392; Sat, 8 Jan 2011 19:49:27 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201101081949.p08JnR3f002392@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 8 Jan 2011 19:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217162 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 19:49:28 -0000 Author: bz Date: Sat Jan 8 19:49:27 2011 New Revision: 217162 URL: http://svn.freebsd.org/changeset/base/217162 Log: MFC r216861: Mfp4 CH177924: Add and export constants of array sizes of jail parameters as compiled into the kernel. This is the least intrusive way to allow kvm to read the (sparse) arrays independent of the options the kernel was compiled with. Reviewed by: jhb (originally) MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH Modified: stable/8/sys/kern/kern_jail.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_jail.c ============================================================================== --- stable/8/sys/kern/kern_jail.c Sat Jan 8 18:51:15 2011 (r217161) +++ stable/8/sys/kern/kern_jail.c Sat Jan 8 19:49:27 2011 (r217162) @@ -140,7 +140,9 @@ static int prison_restrict_ip6(struct pr #define PD_LIST_XLOCKED 0x10 /* - * Parameter names corresponding to PR_* flag values + * Parameter names corresponding to PR_* flag values. Size values are for kvm + * as we cannot figure out the size of a sparse array, or an array without a + * terminating entry. */ static char *pr_flag_names[] = { [0] = "persist", @@ -151,6 +153,7 @@ static char *pr_flag_names[] = { [8] = "ip6.saddrsel", #endif }; +const size_t pr_flag_names_size = sizeof(pr_flag_names); static char *pr_flag_nonames[] = { [0] = "nopersist", @@ -161,6 +164,7 @@ static char *pr_flag_nonames[] = { [8] = "ip6.nosaddrsel", #endif }; +const size_t pr_flag_nonames_size = sizeof(pr_flag_nonames); struct jailsys_flags { const char *name; @@ -178,6 +182,7 @@ struct jailsys_flags { { "ip6", PR_IP6_USER | PR_IP6_DISABLE, PR_IP6_USER }, #endif }; +const size_t pr_flag_jailsys_size = sizeof(pr_flag_jailsys); static char *pr_allow_names[] = { "allow.set_hostname", @@ -188,6 +193,7 @@ static char *pr_allow_names[] = { "allow.quotas", "allow.socket_af", }; +const size_t pr_allow_names_size = sizeof(pr_allow_names); static char *pr_allow_nonames[] = { "allow.noset_hostname", @@ -198,6 +204,7 @@ static char *pr_allow_nonames[] = { "allow.noquotas", "allow.nosocket_af", }; +const size_t pr_allow_nonames_size = sizeof(pr_allow_nonames); #define JAIL_DEFAULT_ALLOW PR_ALLOW_SET_HOSTNAME #define JAIL_DEFAULT_ENFORCE_STATFS 2 From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 8 21:02:27 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F6B0106564A; Sat, 8 Jan 2011 21:02:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E3BF8FC1A; Sat, 8 Jan 2011 21:02:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p08L2Rdl006418; Sat, 8 Jan 2011 21:02:27 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p08L2Rh7006416; Sat, 8 Jan 2011 21:02:27 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201101082102.p08L2Rh7006416@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 8 Jan 2011 21:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217166 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 21:02:27 -0000 Author: bz Date: Sat Jan 8 21:02:27 2011 New Revision: 217166 URL: http://svn.freebsd.org/changeset/base/217166 Log: MFC r216856: Print the vnet pointer under DDB when iterating over flowtables of each virtual network stack instance. Modified: stable/8/sys/net/flowtable.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Sat Jan 8 20:25:13 2011 (r217165) +++ stable/8/sys/net/flowtable.c Sat Jan 8 21:02:27 2011 (r217166) @@ -1816,6 +1816,9 @@ DB_SHOW_COMMAND(flowtables, db_show_flow VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); +#ifdef VIMAGE + db_printf("vnet %p\n", vnet_iter); +#endif flowtable_show_vnet(); CURVNET_RESTORE(); } From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 8 21:37:44 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C914106566C; Sat, 8 Jan 2011 21:37:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B6828FC17; Sat, 8 Jan 2011 21:37:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p08Lbie1010123; Sat, 8 Jan 2011 21:37:44 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p08Lbiul010121; Sat, 8 Jan 2011 21:37:44 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201101082137.p08Lbiul010121@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 8 Jan 2011 21:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217167 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 21:37:44 -0000 Author: bz Date: Sat Jan 8 21:37:43 2011 New Revision: 217167 URL: http://svn.freebsd.org/changeset/base/217167 Log: MFC r216859: Use NULL rather than 0 to invalidate a pointer. Rather than duplicating the LLE_FREE_LOCKED() macro code in LLE_FREE(), call it directly (like we do for the RT_* macros). Modified: stable/8/sys/net/if_llatbl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/net/if_llatbl.h ============================================================================== --- stable/8/sys/net/if_llatbl.h Sat Jan 8 21:02:27 2011 (r217166) +++ stable/8/sys/net/if_llatbl.h Sat Jan 8 21:37:43 2011 (r217167) @@ -115,19 +115,12 @@ struct llentry { LLE_WUNLOCK(lle); \ } \ /* guard against invalid refs */ \ - lle = 0; \ + lle = NULL; \ } while (0) #define LLE_FREE(lle) do { \ LLE_WLOCK(lle); \ - if ((lle)->lle_refcnt <= 1) \ - (lle)->lle_tbl->llt_free((lle)->lle_tbl, (lle));\ - else { \ - (lle)->lle_refcnt--; \ - LLE_WUNLOCK(lle); \ - } \ - /* guard against invalid refs */ \ - lle = NULL; \ + LLE_FREE_LOCKED(lle); \ } while (0) From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 8 22:08:24 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 487C11065670; Sat, 8 Jan 2011 22:08:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C2C18FC17; Sat, 8 Jan 2011 22:08:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p08M8OWw013367; Sat, 8 Jan 2011 22:08:24 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p08M8O5k013365; Sat, 8 Jan 2011 22:08:24 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201101082208.p08M8O5k013365@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 8 Jan 2011 22:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217168 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 22:08:24 -0000 Author: bz Date: Sat Jan 8 22:08:23 2011 New Revision: 217168 URL: http://svn.freebsd.org/changeset/base/217168 Log: MFC r216855: Move the increment operation under the lock and split the condition variable into two so that we can see on which one we are waiting. This might also more properly propagate the update of the flowclean_cycles flag and avoid "hangs" people were seeing. Suggested by: rwatson [1] Sponsored by: ISPsystem [1] Reviewed by: julian [1] Updated by: Mikolaj Golub (to.my.trociny gmail.com) Tested by: Mikolaj Golub (to.my.trociny gmail.com) [1] Early 2010, initial version. Modified: stable/8/sys/net/flowtable.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Sat Jan 8 21:37:43 2011 (r217167) +++ stable/8/sys/net/flowtable.c Sat Jan 8 22:08:23 2011 (r217168) @@ -195,7 +195,8 @@ static VNET_DEFINE(uma_zone_t, flow_ipv6 #define V_flow_ipv6_zone VNET(flow_ipv6_zone) -static struct cv flowclean_cv; +static struct cv flowclean_f_cv; +static struct cv flowclean_c_cv; static struct mtx flowclean_lock; static uint32_t flowclean_cycles; static uint32_t flowclean_freq; @@ -954,7 +955,7 @@ flow_full(struct flowtable *ft) if ((ft->ft_flags & FL_HASH_ALL) == 0) ft->ft_udp_idle = ft->ft_fin_wait_idle = ft->ft_syn_idle = ft->ft_tcp_idle = 5; - cv_broadcast(&flowclean_cv); + cv_broadcast(&flowclean_c_cv); } else if (!full && ft->ft_full) { flowclean_freq = 20*hz; if ((ft->ft_flags & FL_HASH_ALL) == 0) @@ -1567,14 +1568,14 @@ flowtable_cleaner(void) } VNET_LIST_RUNLOCK(); - flowclean_cycles++; /* * The 10 second interval between cleaning checks * is arbitrary */ mtx_lock(&flowclean_lock); - cv_broadcast(&flowclean_cv); - cv_timedwait(&flowclean_cv, &flowclean_lock, flowclean_freq); + flowclean_cycles++; + cv_broadcast(&flowclean_f_cv); + cv_timedwait(&flowclean_c_cv, &flowclean_lock, flowclean_freq); mtx_unlock(&flowclean_lock); } } @@ -1587,8 +1588,8 @@ flowtable_flush(void *unused __unused) mtx_lock(&flowclean_lock); start = flowclean_cycles; while (start == flowclean_cycles) { - cv_broadcast(&flowclean_cv); - cv_wait(&flowclean_cv, &flowclean_lock); + cv_broadcast(&flowclean_c_cv); + cv_wait(&flowclean_f_cv, &flowclean_lock); } mtx_unlock(&flowclean_lock); } @@ -1620,7 +1621,8 @@ static void flowtable_init(const void *unused __unused) { - cv_init(&flowclean_cv, "flowcleanwait"); + cv_init(&flowclean_c_cv, "c_flowcleanwait"); + cv_init(&flowclean_f_cv, "f_flowcleanwait"); mtx_init(&flowclean_lock, "flowclean lock", NULL, MTX_DEF); EVENTHANDLER_REGISTER(ifnet_departure_event, flowtable_flush, NULL, EVENTHANDLER_PRI_ANY);