From owner-svn-src-stable-7@FreeBSD.ORG Sun Oct 10 07:28:56 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D54D7106566B; Sun, 10 Oct 2010 07:28:56 +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 C3F8E8FC14; Sun, 10 Oct 2010 07:28:56 +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 o9A7SuPZ074099; Sun, 10 Oct 2010 07:28:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9A7Sur4074097; Sun, 10 Oct 2010 07:28:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010100728.o9A7Sur4074097@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 10 Oct 2010 07:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213666 - stable/7/sys/amd64/amd64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 07:28:57 -0000 Author: kib Date: Sun Oct 10 07:28:56 2010 New Revision: 213666 URL: http://svn.freebsd.org/changeset/base/213666 Log: MFC r213382: In makectx(), always use the tf_rsp from trap frame. %rsp is pushed unconditionally by hardware on the trap. PR: amd64/151167 Modified: stable/7/sys/amd64/amd64/machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/machdep.c Sun Oct 10 07:07:21 2010 (r213665) +++ stable/7/sys/amd64/amd64/machdep.c Sun Oct 10 07:28:56 2010 (r213666) @@ -1443,7 +1443,7 @@ makectx(struct trapframe *tf, struct pcb pcb->pcb_rbp = tf->tf_rbp; pcb->pcb_rbx = tf->tf_rbx; pcb->pcb_rip = tf->tf_rip; - pcb->pcb_rsp = (ISPL(tf->tf_cs)) ? tf->tf_rsp : (long)(tf + 1) - 8; + pcb->pcb_rsp = tf->tf_rsp; } int From owner-svn-src-stable-7@FreeBSD.ORG Sun Oct 10 12:21:36 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5547D1065672; Sun, 10 Oct 2010 12:21:36 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35ED28FC08; Sun, 10 Oct 2010 12:21:36 +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 o9ACLa7Q082449; Sun, 10 Oct 2010 12:21:36 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ACLaDS082447; Sun, 10 Oct 2010 12:21:36 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201010101221.o9ACLaDS082447@svn.freebsd.org> From: Kai Wang Date: Sun, 10 Oct 2010 12:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213671 - stable/7/lib/libelf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 12:21:36 -0000 Author: kaiw Date: Sun Oct 10 12:21:35 2010 New Revision: 213671 URL: http://svn.freebsd.org/changeset/base/213671 Log: MFC r212373: libelf is overly strict about the type and alignment of Elf_Data objects inside one ELF section, which prevents the creation of a ELF section with mixed data types. For example, gcc LTO use libelf to create a .gnu_lto_XXX section that contains integers and a string table, which doesn't work with our libelf implementation. The changes made in this commit include: * Allow Elf_Data type to be different than section type. * Relax Elf_Data alignment check. * Align each Elf_Data by their own alignment instead of section alignment. Modified: stable/7/lib/libelf/elf_update.c Directory Properties: stable/7/lib/libelf/ (props changed) Modified: stable/7/lib/libelf/elf_update.c ============================================================================== --- stable/7/lib/libelf/elf_update.c Sun Oct 10 12:20:04 2010 (r213670) +++ stable/7/lib/libelf/elf_update.c Sun Oct 10 12:21:35 2010 (r213671) @@ -141,7 +141,7 @@ _libelf_compute_section_extents(Elf *e, /* Compute the section alignment. */ STAILQ_FOREACH(d, &s->s_data, d_next) { - if (d->d_type != elftype) { + if (d->d_type > ELF_T_LAST) { LIBELF_SET_ERROR(DATA, 0); return (0); } @@ -149,11 +149,7 @@ _libelf_compute_section_extents(Elf *e, LIBELF_SET_ERROR(VERSION, 0); return (0); } - if ((d_align = d->d_align) % sh_align) { - LIBELF_SET_ERROR(LAYOUT, 0); - return (0); - } - if (d_align == 0 || (d_align & (d_align - 1))) { + if ((d_align = d->d_align) == 0 || (d_align & (d_align - 1))) { LIBELF_SET_ERROR(DATA, 0); return (0); } @@ -168,7 +164,7 @@ _libelf_compute_section_extents(Elf *e, if ((uint64_t) d->d_off + d->d_size > scn_size) scn_size = d->d_off + d->d_size; } else { - scn_size = roundup2(scn_size, scn_alignment); + scn_size = roundup2(scn_size, d->d_align); d->d_off = scn_size; scn_size += d->d_size; } @@ -560,8 +556,6 @@ _libelf_write_scn(Elf *e, char *nf, Elf_ elftype = _libelf_xlate_shtype(sh_type); assert(elftype >= ELF_T_FIRST && elftype <= ELF_T_LAST); - msz = _libelf_msize(elftype, ec, e->e_version); - sh_off = s->s_offset; assert(sh_off % _libelf_falign(elftype, ec) == 0); @@ -608,6 +602,8 @@ _libelf_write_scn(Elf *e, char *nf, Elf_ STAILQ_FOREACH(d, &s->s_data, d_next) { + msz = _libelf_msize(d->d_type, ec, e->e_version); + if ((uint64_t) rc < sh_off + d->d_off) (void) memset(nf + rc, LIBELF_PRIVATE(fillchar), sh_off + d->d_off - rc); @@ -615,13 +611,12 @@ _libelf_write_scn(Elf *e, char *nf, Elf_ rc = sh_off + d->d_off; assert(d->d_buf != NULL); - assert(d->d_type == (Elf_Type) elftype); assert(d->d_version == e->e_version); assert(d->d_size % msz == 0); nobjects = d->d_size / msz; - fsz = _libelf_fsize(elftype, ec, e->e_version, nobjects); + fsz = _libelf_fsize(d->d_type, ec, e->e_version, nobjects); dst.d_buf = nf + rc; dst.d_size = fsz; From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 11 11:25:38 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 078D01065672; Mon, 11 Oct 2010 11:25:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEA238FC20; Mon, 11 Oct 2010 11:25:37 +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 o9BBPbVA013641; Mon, 11 Oct 2010 11:25:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BBPbG9013638; Mon, 11 Oct 2010 11:25:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010111125.o9BBPbG9013638@svn.freebsd.org> From: Xin LI Date: Mon, 11 Oct 2010 11:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213687 - in stable: 7/sys/netinet 7/sys/netinet6 8/sys/netinet 8/sys/netinet6 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 11:25:38 -0000 Author: delphij Date: Mon Oct 11 11:25:37 2010 New Revision: 213687 URL: http://svn.freebsd.org/changeset/base/213687 Log: MFC r213225: Add a bandaid for a long-standing race condition during route entry un-expiring. The previous version of code have no locking when testing rt_refcnt. The result of the lack of locking may result in a condition where a routing entry have a reference count but at the same time have RTPRF_OURS bit set and an expiration timer. These would eventually lead to a panic: panic: rtqkill route really not free When the system have ICMP redirects accepted from local gateway in a moderate frequency, for instance. Commit this workaround for now until we have some better solution. PR: kern/149804 Reviewed by: bz Tested by: Zhao Xin, Pete French Modified: stable/7/sys/netinet/in_rmx.c stable/7/sys/netinet6/in6_rmx.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/netinet/in_rmx.c stable/8/sys/netinet6/in6_rmx.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/7/sys/netinet/in_rmx.c ============================================================================== --- stable/7/sys/netinet/in_rmx.c Mon Oct 11 09:42:30 2010 (r213686) +++ stable/7/sys/netinet/in_rmx.c Mon Oct 11 11:25:37 2010 (r213687) @@ -140,12 +140,13 @@ in_matroute(void *v_arg, struct radix_no struct radix_node *rn = rn_match(v_arg, head); struct rtentry *rt = (struct rtentry *)rn; - /*XXX locking? */ - if (rt && rt->rt_refcnt == 0) { /* this is first reference */ + if (rt) { + RT_LOCK(rt); if (rt->rt_flags & RTPRF_OURS) { rt->rt_flags &= ~RTPRF_OURS; rt->rt_rmx.rmx_expire = 0; } + RT_UNLOCK(rt); } return rn; } Modified: stable/7/sys/netinet6/in6_rmx.c ============================================================================== --- stable/7/sys/netinet6/in6_rmx.c Mon Oct 11 09:42:30 2010 (r213686) +++ stable/7/sys/netinet6/in6_rmx.c Mon Oct 11 11:25:37 2010 (r213687) @@ -207,11 +207,13 @@ in6_matroute(void *v_arg, struct radix_n struct radix_node *rn = rn_match(v_arg, head); struct rtentry *rt = (struct rtentry *)rn; - if (rt && rt->rt_refcnt == 0) { /* this is first reference */ + if (rt) { + RT_LOCK(rt); if (rt->rt_flags & RTPRF_OURS) { rt->rt_flags &= ~RTPRF_OURS; rt->rt_rmx.rmx_expire = 0; } + RT_UNLOCK(rt); } return rn; } From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 11 13:31:10 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 290F4106566B; Mon, 11 Oct 2010 13:31:10 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1780E8FC13; Mon, 11 Oct 2010 13:31:10 +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 o9BDV97H016727; Mon, 11 Oct 2010 13:31:09 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BDV9x1016725; Mon, 11 Oct 2010 13:31:09 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201010111331.o9BDV9x1016725@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 11 Oct 2010 13:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213690 - stable/7/usr.bin/truss X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 13:31:10 -0000 Author: jh Date: Mon Oct 11 13:31:09 2010 New Revision: 213690 URL: http://svn.freebsd.org/changeset/base/213690 Log: MFC r200752: Avoid sharing the file descriptor of the output file with traced processes by setting the FD_CLOEXEC flag for the output file. PR: bin/140493 Modified: stable/7/usr.bin/truss/main.c Directory Properties: stable/7/usr.bin/truss/ (props changed) Modified: stable/7/usr.bin/truss/main.c ============================================================================== --- stable/7/usr.bin/truss/main.c Mon Oct 11 12:57:41 2010 (r213689) +++ stable/7/usr.bin/truss/main.c Mon Oct 11 13:31:09 2010 (r213690) @@ -231,6 +231,12 @@ main(int ac, char **av) if ((trussinfo->outfile = fopen(fname, "w")) == NULL) errx(1, "cannot open %s", fname); } + /* + * Set FD_CLOEXEC, so that the output file is not shared with + * the traced process. + */ + if (fcntl(fileno(trussinfo->outfile), F_SETFD, FD_CLOEXEC) == -1) + warn("fcntl()"); /* * If truss starts the process itself, it will ignore some signals -- From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 11 16:57:02 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8BDD106564A; Mon, 11 Oct 2010 16:57:02 +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 B64588FC13; Mon, 11 Oct 2010 16:57:02 +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 o9BGv216021262; Mon, 11 Oct 2010 16:57:02 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BGv2ax021259; Mon, 11 Oct 2010 16:57:02 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010111657.o9BGv2ax021259@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 11 Oct 2010 16:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213693 - stable/7/lib/libpmc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 16:57:02 -0000 Author: gnn Date: Mon Oct 11 16:57:02 2010 New Revision: 213693 URL: http://svn.freebsd.org/changeset/base/213693 Log: MFC 213402: Fix punctuation and grammar, mostly by ending sentences with a period. Modified: stable/7/lib/libpmc/pmc.westmere.3 stable/7/lib/libpmc/pmc.westmereuc.3 Directory Properties: stable/7/lib/libpmc/ (props changed) Modified: stable/7/lib/libpmc/pmc.westmere.3 ============================================================================== --- stable/7/lib/libpmc/pmc.westmere.3 Mon Oct 11 16:55:17 2010 (r213692) +++ stable/7/lib/libpmc/pmc.westmere.3 Mon Oct 11 16:57:02 2010 (r213693) @@ -388,7 +388,7 @@ requests include both L1D demand RFO mis .It Li L2_RQSTS.RFOS .Pq Event 24H , Umask 0CH Counts all L2 store RFO requests. L2 RFO requests include both L1D demand -RFO misses as well as L1D RFO prefetches.. +RFO misses as well as L1D RFO prefetches. .It Li L2_RQSTS.IFETCH_HIT .Pq Event 24H , Umask 10H Counts number of instruction fetches that hit the L2 cache. L2 instruction @@ -474,13 +474,13 @@ This is a demand RFO request .It Li L2_WRITE.RFO.S_STATE .Pq Event 27H , Umask 02H Counts number of L2 store RFO requests where the cache line to be loaded is -in the S (shared) state. The L1D prefetcher does not issue a RFO prefetch,. -This is a demand RFO request +in the S (shared) state. The L1D prefetcher does not issue a RFO prefetch. +This is a demand RFO request. .It Li L2_WRITE.RFO.M_STATE .Pq Event 27H , Umask 08H Counts number of L2 store RFO requests where the cache line to be loaded is in the M (modified) state. The L1D prefetcher does not issue a RFO prefetch. -This is a demand RFO request +This is a demand RFO request. .It Li L2_WRITE.RFO.HIT .Pq Event 27H , Umask 0EH Counts number of L2 store RFO requests where the cache line to be loaded is @@ -491,7 +491,7 @@ This is a demand RFO request .Pq Event 27H , Umask 0FH Counts all L2 store RFO requests.The L1D prefetcher does not issue a RFO prefetch. -This is a demand RFO request +This is a demand RFO request. .It Li L2_WRITE.LOCK.I_STATE .Pq Event 27H , Umask 10H Counts number of L2 demand lock RFO requests where the cache line to be @@ -539,13 +539,13 @@ Counts all L1 writebacks to the L2. Counts uncore Last Level Cache references. Because cache hierarchy, cache sizes and other implementation-specific characteristics; value comparison to estimate performance differences is not recommended. -see Table A-1 +See Table A-1. .It Li L3_LAT_CACHE.MISS .Pq Event 2EH , Umask 01H Counts uncore Last Level Cache misses. Because cache hierarchy, cache sizes and other implementation-specific characteristics; value comparison to estimate performance differences is not recommended. -see Table A-1 +See Table A-1. .It Li CPU_CLK_UNHALTED.THREAD_P .Pq Event 3CH , Umask 00H Counts the number of thread cycles while the thread is not in a halt state. @@ -601,16 +601,16 @@ Counts Extended Page walk cycles. .It Li L1D.REPL .Pq Event 51H , Umask 01H Counts the number of lines brought into the L1 data cache. -Counter 0, 1 only +Counter 0, 1 only. .It Li L1D.M_REPL .Pq Event 51H , Umask 02H Counts the number of modified lines brought into the L1 data cache. -Counter 0, 1 only +Counter 0, 1 only. .It Li L1D.M_EVICT .Pq Event 51H , Umask 04H Counts the number of modified lines evicted from the L1 data cache due to replacement. -Counter 0, 1 only +Counter 0, 1 only. .It Li L1D.M_SNOOP_EVICT .Pq Event 51H , Umask 08H Counts the number of modified lines evicted from the L1 data cache due to @@ -628,22 +628,22 @@ accepted into the fill buffer. .Pq Event 60H , Umask 01H Counts weighted cycles of offcore demand data read requests. Does not include L2 prefetch requests. -counter 0 +Counter 0. .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.READ_CODE .Pq Event 60H , Umask 02H Counts weighted cycles of offcore demand code read requests. Does not include L2 prefetch requests. -counter 0 +Counter 0. .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.RFO .Pq Event 60H , Umask 04H Counts weighted cycles of offcore demand RFO requests. Does not include L2 prefetch requests. -counter 0 +Counter 0. .It Li OFFCORE_REQUESTS_OUTSTANDING.ANY.READ .Pq Event 60H , Umask 08H Counts weighted cycles of offcore read requests of any kind. Include L2 prefetch requests. -counter 0 +Ccounter 0. .It Li CACHE_LOCK_CYCLES.L1D_L2 .Pq Event 63H , Umask 01H Cycle count during which the L1D and L2 are locked. A lock is asserted when @@ -915,7 +915,7 @@ ports. This is a core count only and can .It Li UOPS_EXECUTED.PORT015 .Pq Event B1H , Umask 40H Counts number of Uops executed that where issued on port 0, 1, or 5. -use cmask=1, invert=1 to count stall cycles +Use cmask=1, invert=1 to count stall cycles. .It Li UOPS_EXECUTED.PORT234 .Pq Event B1H , Umask 80H Counts number of Uops executed that where issued on port 2, 3, or 4. @@ -928,18 +928,18 @@ Counts weighted cycles of snoopq request Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.INVALIDATE .Pq Event B3H , Umask 02H -Counts weighted cycles of snoopq invalidate requests. Counter 0 only +Counts weighted cycles of snoopq invalidate requests. Counter 0 only. Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.CODE .Pq Event B3H , Umask 04H -Counts weighted cycles of snoopq requests for code. Counter 0 only +Counts weighted cycles of snoopq requests for code. Counter 0 only. Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS.CODE .Pq Event B4H , Umask 01H -Counts the number of snoop code requests +Counts the number of snoop code requests. .It Li SNOOPQ_REQUESTS.DATA .Pq Event B4H , Umask 02H -Counts the number of snoop data requests +Counts the number of snoop data requests. .It Li SNOOPQ_REQUESTS.INVALIDATE .Pq Event B4H , Umask 04H Counts the number of snoop invalidate requests @@ -947,7 +947,7 @@ Counts the number of snoop invalidate re .Pq Event B7H , Umask 01H see Section 30.6.1.3, Off-core Response Performance Monitoring in the Processor Core. -Requires programming MSR 01A6H +Requires programming MSR 01A6H. .It Li SNOOP_RESPONSE.HIT .Pq Event B8H , Umask 01H Counts HIT snoop response sent by this thread in response to a snoop @@ -963,8 +963,8 @@ request. .It Li OFF_CORE_RESPONSE_1 .Pq Event BBH , Umask 01H see Section 30.6.1.3, Off-core Response Performance Monitoring in the -Processor Core -Use MSR 01A7H +Processor Core. +Use MSR 01A7H. .It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 01H See Table A-1 @@ -1007,21 +1007,21 @@ Counts the number of machine clears due Counts the number of times that a program writes to a code section. Self-modifying code causes a sever penalty in all Intel 64 and IA-32 processors. The modified cache line is written back to the L2 and L3caches. -.It Li BR_INST_RETIRED.ALL_BRANCHES +.It Li BR_INST_RETIRED.ANY_P .Pq Event C4H , Umask 00H -See Table A-1 +See Table A-1. .It Li BR_INST_RETIRED.CONDITIONAL .Pq Event C4H , Umask 01H Counts the number of conditional branch instructions retired. .It Li BR_INST_RETIRED.NEAR_CALL .Pq Event C4H , Umask 02H -Counts the number of direct & indirect near unconditional calls retired +Counts the number of direct & indirect near unconditional calls retired. .It Li BR_INST_RETIRED.ALL_BRANCHES .Pq Event C4H , Umask 04H -Counts the number of branch instructions retired -.It Li BR_MISP_RETIRED.ALL_BRANCHES +Counts the number of branch instructions retired. +.It Li BR_MISP_RETIRED.ANY_P .Pq Event C5H , Umask 00H -See Table A-1 +See Table A-1. .It Li BR_MISP_RETIRED.CONDITIONAL .Pq Event C5H , Umask 01H Counts mispredicted conditional retired calls. Modified: stable/7/lib/libpmc/pmc.westmereuc.3 ============================================================================== --- stable/7/lib/libpmc/pmc.westmereuc.3 Mon Oct 11 16:55:17 2010 (r213692) +++ stable/7/lib/libpmc/pmc.westmereuc.3 Mon Oct 11 16:57:02 2010 (r213693) @@ -267,10 +267,10 @@ Number of responses to code or data read has the referenced line cached in the M state. .It Li SNP_RESP_TO_REMOTE_HOME.HITM .Pq Event 07H , Umask 24H -Number of HITM snoop responses to a remote home +Number of HITM snoop responses to a remote home. .It Li L3_HITS.READ .Pq Event 08H , Umask 01H -Number of code read, data read and RFO requests that hit in the L3 +Number of code read, data read and RFO requests that hit in the L3. .It Li L3_HITS.WRITE .Pq Event 08H , Umask 02H Number of writeback requests that hit in the L3. Writebacks from the cores From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 12 15:26:37 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D30FF1065674; Tue, 12 Oct 2010 15:26:37 +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 C0EDF8FC16; Tue, 12 Oct 2010 15:26:37 +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 o9CFQb3B051660; Tue, 12 Oct 2010 15:26:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CFQbaj051658; Tue, 12 Oct 2010 15:26:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121526.o9CFQbaj051658@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 15:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213722 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 15:26:37 -0000 Author: jhb Date: Tue Oct 12 15:26:37 2010 New Revision: 213722 URL: http://svn.freebsd.org/changeset/base/213722 Log: MFC 212974: Comment nit, set TDF_NEEDRESCHED after the comment describing why it is done rather than before. Modified: stable/7/sys/kern/sched_ule.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/sched_ule.c ============================================================================== --- stable/7/sys/kern/sched_ule.c Tue Oct 12 15:26:13 2010 (r213721) +++ stable/7/sys/kern/sched_ule.c Tue Oct 12 15:26:37 2010 (r213722) @@ -2556,12 +2556,12 @@ sched_affinity(struct thread *td) } if (!TD_IS_RUNNING(td)) return; - td->td_flags |= TDF_NEEDRESCHED; /* * Force a switch before returning to userspace. If the * target thread is not running locally send an ipi to force * the issue. */ + td->td_flags |= TDF_NEEDRESCHED; if (td != curthread) ipi_selected(1 << ts->ts_cpu, IPI_PREEMPT); #endif From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 12 15:48:28 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F34541065698; Tue, 12 Oct 2010 15:48:27 +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 E105E8FC24; Tue, 12 Oct 2010 15:48: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 o9CFmRZe052199; Tue, 12 Oct 2010 15:48:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CFmR7Q052197; Tue, 12 Oct 2010 15:48:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121548.o9CFmR7Q052197@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 15:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213724 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 15:48:28 -0000 Author: jhb Date: Tue Oct 12 15:48:27 2010 New Revision: 213724 URL: http://svn.freebsd.org/changeset/base/213724 Log: MFC 213271: Account for unlocking a spin mutex in the lock profiling code in the !SMP case. Modified: stable/7/sys/sys/mutex.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sys/mutex.h ============================================================================== --- stable/7/sys/sys/mutex.h Tue Oct 12 15:48:14 2010 (r213723) +++ stable/7/sys/sys/mutex.h Tue Oct 12 15:48:27 2010 (r213724) @@ -247,8 +247,10 @@ void _thread_lock_flags(struct thread *, #define _rel_spin_lock(mp) do { \ if (mtx_recursed((mp))) \ (mp)->mtx_recurse--; \ - else \ + else { \ + lock_profile_release_lock(&(mp)->lock_object); \ (mp)->mtx_lock = MTX_UNOWNED; \ + } \ spinlock_exit(); \ } while (0) #endif /* SMP */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 12 16:09:09 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F3801065675; Tue, 12 Oct 2010 16:09:09 +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 1BE528FC08; Tue, 12 Oct 2010 16:09: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 o9CG997L052845; Tue, 12 Oct 2010 16:09:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CG99aX052842; Tue, 12 Oct 2010 16:09:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121609.o9CG99aX052842@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 16:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213727 - stable/7/sys/net X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 16:09:09 -0000 Author: jhb Date: Tue Oct 12 16:09:08 2010 New Revision: 213727 URL: http://svn.freebsd.org/changeset/base/213727 Log: MFC 213028,213328: - Expand scope of tun/tap softc locks to cover more softc fields and driver-maintained ifnet fields (such as if_drv_flags). - Use soft locks as the mutex that protects each interface's knote list rather than using the global knote list lock. Also, use the softc for kn_hook instead of the cdev. - Use mtx_sleep() instead of tsleep() when blocking in the read routines. This fixes a lost wakeup race. - Remove D_NEEDGIANT now that the cdevsw routines use the softc lock where locking is needed. - Lock IFQ when calculating the result for FIONREAD in tap(4). tun(4) already did this. - Remove remaining spl calls. Modified: stable/7/sys/net/if_tap.c stable/7/sys/net/if_tun.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if_tap.c ============================================================================== --- stable/7/sys/net/if_tap.c Tue Oct 12 16:08:20 2010 (r213726) +++ stable/7/sys/net/if_tap.c Tue Oct 12 16:09:08 2010 (r213727) @@ -132,7 +132,7 @@ static struct filterops tap_write_filter static struct cdevsw tap_cdevsw = { .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT, + .d_flags = D_PSEUDO, .d_open = tapopen, .d_close = tapclose, .d_read = tapread, @@ -209,7 +209,6 @@ static void tap_destroy(struct tap_softc *tp) { struct ifnet *ifp = tp->tap_ifp; - int s; /* Unlocked read. */ KASSERT(!(tp->tap_flags & TAP_OPEN), @@ -217,10 +216,8 @@ tap_destroy(struct tap_softc *tp) knlist_destroy(&tp->tap_rsel.si_note); destroy_dev(tp->tap_dev); - s = splimp(); ether_ifdetach(ifp); if_free_type(ifp, IFT_ETHER); - splx(s); mtx_destroy(&tp->tap_mtx); free(tp, M_TAP); @@ -399,7 +396,7 @@ tapcreate(struct cdev *dev) struct tap_softc *tp = NULL; unsigned short macaddr_hi; uint32_t macaddr_mid; - int unit, s; + int unit; char *name = NULL; u_char eaddr[6]; @@ -443,20 +440,18 @@ tapcreate(struct cdev *dev) ifp->if_ioctl = tapifioctl; ifp->if_mtu = ETHERMTU; ifp->if_flags = (IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST); - ifp->if_snd.ifq_maxlen = ifqmaxlen; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); dev->si_drv1 = tp; tp->tap_dev = dev; - s = splimp(); ether_ifattach(ifp, eaddr); - splx(s); mtx_lock(&tp->tap_mtx); tp->tap_flags |= TAP_INITED; mtx_unlock(&tp->tap_mtx); - knlist_init_mtx(&tp->tap_rsel.si_note, NULL); + knlist_init_mtx(&tp->tap_rsel.si_note, &tp->tap_mtx); TAPDEBUG("interface %s is created. minor = %#x\n", ifp->if_xname, minor(dev)); @@ -473,7 +468,7 @@ tapopen(struct cdev *dev, int flag, int { struct tap_softc *tp = NULL; struct ifnet *ifp = NULL; - int error, s; + int error; if (tapuopen == 0) { error = priv_check(td, PRIV_NET_TAP); @@ -496,14 +491,12 @@ tapopen(struct cdev *dev, int flag, int tp->tap_pid = td->td_proc->p_pid; tp->tap_flags |= TAP_OPEN; ifp = tp->tap_ifp; - mtx_unlock(&tp->tap_mtx); - s = splimp(); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (tapuponopen) ifp->if_flags |= IFF_UP; - splx(s); + mtx_unlock(&tp->tap_mtx); TAPDEBUG("%s is open. minor = %#x\n", ifp->if_xname, minor(dev)); @@ -522,9 +515,9 @@ tapclose(struct cdev *dev, int foo, int struct ifaddr *ifa; struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; - int s; /* junk all pending output */ + mtx_lock(&tp->tap_mtx); IF_DRAIN(&ifp->if_snd); /* @@ -532,27 +525,25 @@ tapclose(struct cdev *dev, int foo, int * interface, if we are in VMnet mode. just close the device. */ - mtx_lock(&tp->tap_mtx); if (((tp->tap_flags & TAP_VMNET) == 0) && (ifp->if_flags & IFF_UP)) { mtx_unlock(&tp->tap_mtx); - s = splimp(); if_down(ifp); + mtx_lock(&tp->tap_mtx); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + mtx_unlock(&tp->tap_mtx); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { rtinit(ifa, (int)RTM_DELETE, 0); } if_purgeaddrs(ifp); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + mtx_lock(&tp->tap_mtx); } - splx(s); - } else - mtx_unlock(&tp->tap_mtx); + } funsetown(&tp->tap_sigio); selwakeuppri(&tp->tap_rsel, PZERO+1); - KNOTE_UNLOCKED(&tp->tap_rsel.si_note, 0); + KNOTE_LOCKED(&tp->tap_rsel.si_note, 0); - mtx_lock(&tp->tap_mtx); tp->tap_flags &= ~TAP_OPEN; tp->tap_pid = 0; mtx_unlock(&tp->tap_mtx); @@ -577,8 +568,10 @@ tapifinit(void *xtp) TAPDEBUG("initializing %s\n", ifp->if_xname); + mtx_lock(&tp->tap_mtx); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + mtx_unlock(&tp->tap_mtx); /* attempt to start output */ tapifstart(ifp); @@ -596,7 +589,7 @@ tapifioctl(struct ifnet *ifp, u_long cmd struct tap_softc *tp = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; struct ifstat *ifs = NULL; - int s, dummy; + int dummy; switch (cmd) { case SIOCSIFFLAGS: /* XXX -- just like vmnet does */ @@ -609,7 +602,6 @@ tapifioctl(struct ifnet *ifp, u_long cmd break; case SIOCGIFSTATUS: - s = splimp(); ifs = (struct ifstat *)data; dummy = strlen(ifs->ascii); mtx_lock(&tp->tap_mtx); @@ -618,14 +610,10 @@ tapifioctl(struct ifnet *ifp, u_long cmd sizeof(ifs->ascii) - dummy, "\tOpened by PID %d\n", tp->tap_pid); mtx_unlock(&tp->tap_mtx); - splx(s); break; default: - s = splimp(); - dummy = ether_ioctl(ifp, cmd, data); - splx(s); - return (dummy); + return (ether_ioctl(ifp, cmd, data)); /* NOT REACHED */ } @@ -642,7 +630,6 @@ static void tapifstart(struct ifnet *ifp) { struct tap_softc *tp = ifp->if_softc; - int s; TAPDEBUG("%s starting\n", ifp->if_xname); @@ -654,32 +641,28 @@ tapifstart(struct ifnet *ifp) mtx_lock(&tp->tap_mtx); if (((tp->tap_flags & TAP_VMNET) == 0) && ((tp->tap_flags & TAP_READY) != TAP_READY)) { - struct mbuf *m = NULL; - - mtx_unlock(&tp->tap_mtx); + struct mbuf *m; /* Unlocked read. */ TAPDEBUG("%s not ready, tap_flags = 0x%x\n", ifp->if_xname, tp->tap_flags); - s = splimp(); - do { + for (;;) { IF_DEQUEUE(&ifp->if_snd, m); - if (m != NULL) + if (m != NULL) { m_freem(m); - ifp->if_oerrors ++; - } while (m != NULL); - splx(s); + ifp->if_oerrors++; + } else + break; + } + mtx_unlock(&tp->tap_mtx); return; } - mtx_unlock(&tp->tap_mtx); - s = splimp(); ifp->if_drv_flags |= IFF_DRV_OACTIVE; - if (ifp->if_snd.ifq_len != 0) { - mtx_lock(&tp->tap_mtx); + if (!IFQ_IS_EMPTY(&ifp->if_snd)) { if (tp->tap_flags & TAP_RWAIT) { tp->tap_flags &= ~TAP_RWAIT; wakeup(tp); @@ -688,16 +671,16 @@ tapifstart(struct ifnet *ifp) if ((tp->tap_flags & TAP_ASYNC) && (tp->tap_sigio != NULL)) { mtx_unlock(&tp->tap_mtx); pgsigio(&tp->tap_sigio, SIGIO, 0); - } else - mtx_unlock(&tp->tap_mtx); + mtx_lock(&tp->tap_mtx); + } selwakeuppri(&tp->tap_rsel, PZERO+1); - KNOTE_UNLOCKED(&tp->tap_rsel.si_note, 0); + KNOTE_LOCKED(&tp->tap_rsel.si_note, 0); ifp->if_opackets ++; /* obytes are counted in ether_output */ } ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - splx(s); + mtx_unlock(&tp->tap_mtx); } /* tapifstart */ @@ -712,7 +695,6 @@ tapioctl(struct cdev *dev, u_long cmd, c struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; struct tapinfo *tapp = NULL; - int s; int f; #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD4) @@ -721,19 +703,21 @@ tapioctl(struct cdev *dev, u_long cmd, c switch (cmd) { case TAPSIFINFO: - s = splimp(); tapp = (struct tapinfo *)data; + mtx_lock(&tp->tap_mtx); ifp->if_mtu = tapp->mtu; ifp->if_type = tapp->type; ifp->if_baudrate = tapp->baudrate; - splx(s); + mtx_unlock(&tp->tap_mtx); break; case TAPGIFINFO: tapp = (struct tapinfo *)data; + mtx_lock(&tp->tap_mtx); tapp->mtu = ifp->if_mtu; tapp->type = ifp->if_type; tapp->baudrate = ifp->if_baudrate; + mtx_unlock(&tp->tap_mtx); break; case TAPSDEBUG: @@ -754,26 +738,26 @@ tapioctl(struct cdev *dev, u_long cmd, c break; case FIOASYNC: - s = splimp(); mtx_lock(&tp->tap_mtx); if (*(int *)data) tp->tap_flags |= TAP_ASYNC; else tp->tap_flags &= ~TAP_ASYNC; mtx_unlock(&tp->tap_mtx); - splx(s); break; case FIONREAD: - s = splimp(); - if (ifp->if_snd.ifq_head) { - struct mbuf *mb = ifp->if_snd.ifq_head; + if (!IFQ_IS_EMPTY(&ifp->if_snd)) { + struct mbuf *mb; - for(*(int *)data = 0;mb != NULL;mb = mb->m_next) + IFQ_LOCK(&ifp->if_snd); + IFQ_POLL_NOLOCK(&ifp->if_snd, mb); + for (*(int *)data = 0; mb != NULL; + mb = mb->m_next) *(int *)data += mb->m_len; + IFQ_UNLOCK(&ifp->if_snd); } else *(int *)data = 0; - splx(s); break; case FIOSETOWN: @@ -794,10 +778,6 @@ tapioctl(struct cdev *dev, u_long cmd, c /* VMware/VMnet port ioctl's */ - case SIOCGIFFLAGS: /* get ifnet flags */ - bcopy(&ifp->if_flags, data, sizeof(ifp->if_flags)); - break; - #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD4) case _IO('V', 0): @@ -811,9 +791,9 @@ tapioctl(struct cdev *dev, u_long cmd, c f &= ~IFF_CANTCHANGE; f |= IFF_UP; - s = splimp(); + mtx_lock(&tp->tap_mtx); ifp->if_flags = f | (ifp->if_flags & IFF_CANTCHANGE); - splx(s); + mtx_unlock(&tp->tap_mtx); break; case OSIOCGIFADDR: /* get MAC address of the remote side */ @@ -848,7 +828,7 @@ tapread(struct cdev *dev, struct uio *ui struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; struct mbuf *m = NULL; - int error = 0, len, s; + int error = 0, len; TAPDEBUG("%s reading, minor = %#x\n", ifp->if_xname, minor(dev)); @@ -864,26 +844,27 @@ tapread(struct cdev *dev, struct uio *ui } tp->tap_flags &= ~TAP_RWAIT; - mtx_unlock(&tp->tap_mtx); /* sleep until we get a packet */ do { - s = splimp(); IF_DEQUEUE(&ifp->if_snd, m); - splx(s); if (m == NULL) { - if (flag & O_NONBLOCK) + if (flag & O_NONBLOCK) { + mtx_unlock(&tp->tap_mtx); return (EWOULDBLOCK); + } - mtx_lock(&tp->tap_mtx); tp->tap_flags |= TAP_RWAIT; - mtx_unlock(&tp->tap_mtx); - error = tsleep(tp,PCATCH|(PZERO+1),"taprd",0); - if (error) + error = mtx_sleep(tp, &tp->tap_mtx, PCATCH | (PZERO + 1), + "taprd", 0); + if (error) { + mtx_unlock(&tp->tap_mtx); return (error); + } } } while (m == NULL); + mtx_unlock(&tp->tap_mtx); /* feed packet to bpf */ BPF_MTAP(ifp, m); @@ -979,14 +960,14 @@ tappoll(struct cdev *dev, int events, st { struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; - int s, revents = 0; + int revents = 0; TAPDEBUG("%s polling, minor = %#x\n", ifp->if_xname, minor(dev)); - s = splimp(); if (events & (POLLIN | POLLRDNORM)) { - if (ifp->if_snd.ifq_len > 0) { + IFQ_LOCK(&ifp->if_snd); + if (!IFQ_IS_EMPTY(&ifp->if_snd)) { TAPDEBUG("%s have data in queue. len = %d, " \ "minor = %#x\n", ifp->if_xname, ifp->if_snd.ifq_len, minor(dev)); @@ -998,12 +979,12 @@ tappoll(struct cdev *dev, int events, st selrecord(td, &tp->tap_rsel); } + IFQ_UNLOCK(&ifp->if_snd); } if (events & (POLLOUT | POLLWRNORM)) revents |= (events & (POLLOUT | POLLWRNORM)); - splx(s); return (revents); } /* tappoll */ @@ -1016,11 +997,9 @@ tappoll(struct cdev *dev, int events, st static int tapkqfilter(struct cdev *dev, struct knote *kn) { - int s; struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; - s = splimp(); switch (kn->kn_filter) { case EVFILT_READ: TAPDEBUG("%s kqfilter: EVFILT_READ, minor = %#x\n", @@ -1037,13 +1016,11 @@ tapkqfilter(struct cdev *dev, struct kno default: TAPDEBUG("%s kqfilter: invalid filter, minor = %#x\n", ifp->if_xname, minor(dev)); - splx(s); return (EINVAL); /* NOT REACHED */ } - splx(s); - kn->kn_hook = (caddr_t) dev; + kn->kn_hook = tp; knlist_add(&tp->tap_rsel.si_note, kn, 0); return (0); @@ -1058,12 +1035,11 @@ tapkqfilter(struct cdev *dev, struct kno static int tapkqread(struct knote *kn, long hint) { - int ret, s; - struct cdev *dev = (struct cdev *)(kn->kn_hook); - struct tap_softc *tp = dev->si_drv1; + int ret; + struct tap_softc *tp = kn->kn_hook; + struct cdev *dev = tp->tap_dev; struct ifnet *ifp = tp->tap_ifp; - s = splimp(); if ((kn->kn_data = ifp->if_snd.ifq_len) > 0) { TAPDEBUG("%s have data in queue. len = %d, minor = %#x\n", ifp->if_xname, ifp->if_snd.ifq_len, minor(dev)); @@ -1073,7 +1049,6 @@ tapkqread(struct knote *kn, long hint) ifp->if_xname, minor(dev)); ret = 0; } - splx(s); return (ret); } /* tapkqread */ @@ -1087,13 +1062,10 @@ tapkqread(struct knote *kn, long hint) static int tapkqwrite(struct knote *kn, long hint) { - int s; - struct tap_softc *tp = ((struct cdev *) kn->kn_hook)->si_drv1; + struct tap_softc *tp = kn->kn_hook; struct ifnet *ifp = tp->tap_ifp; - s = splimp(); kn->kn_data = ifp->if_mtu; - splx(s); return (1); } /* tapkqwrite */ @@ -1102,7 +1074,7 @@ tapkqwrite(struct knote *kn, long hint) static void tapkqdetach(struct knote *kn) { - struct tap_softc *tp = ((struct cdev *) kn->kn_hook)->si_drv1; + struct tap_softc *tp = kn->kn_hook; knlist_remove(&tp->tap_rsel.si_note, kn, 0); } /* tapkqdetach */ Modified: stable/7/sys/net/if_tun.c ============================================================================== --- stable/7/sys/net/if_tun.c Tue Oct 12 16:08:20 2010 (r213726) +++ stable/7/sys/net/if_tun.c Tue Oct 12 16:09:08 2010 (r213727) @@ -162,7 +162,7 @@ static struct filterops tun_write_filter static struct cdevsw tun_cdevsw = { .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT, + .d_flags = D_PSEUDO, .d_open = tunopen, .d_close = tunclose, .d_read = tunread, @@ -333,13 +333,13 @@ tunstart(struct ifnet *ifp) tp->tun_flags &= ~TUN_RWAIT; wakeup(tp); } + selwakeuppri(&tp->tun_rsel, PZERO + 1); + KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); if (tp->tun_flags & TUN_ASYNC && tp->tun_sigio) { mtx_unlock(&tp->tun_mtx); pgsigio(&tp->tun_sigio, SIGIO, 0); } else mtx_unlock(&tp->tun_mtx); - selwakeuppri(&tp->tun_rsel, PZERO + 1); - KNOTE_UNLOCKED(&tp->tun_rsel.si_note, 0); } /* XXX: should return an error code so it can fail. */ @@ -373,7 +373,7 @@ tuncreate(const char *name, struct cdev IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_snd.ifq_drv_maxlen = 0; IFQ_SET_READY(&ifp->if_snd); - knlist_init_mtx(&sc->tun_rsel.si_note, NULL); + knlist_init_mtx(&sc->tun_rsel.si_note, &sc->tun_mtx); if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); @@ -412,9 +412,9 @@ tunopen(struct cdev *dev, int flag, int tp->tun_pid = td->td_proc->p_pid; tp->tun_flags |= TUN_OPEN; - mtx_unlock(&tp->tun_mtx); ifp = TUN2IFP(tp); TUNDEBUG(ifp, "open\n"); + mtx_unlock(&tp->tun_mtx); return (0); } @@ -428,7 +428,6 @@ tunclose(struct cdev *dev, int foo, int { struct tun_softc *tp; struct ifnet *ifp; - int s; tp = dev->si_drv1; ifp = TUN2IFP(tp); @@ -440,22 +439,20 @@ tunclose(struct cdev *dev, int foo, int /* * junk all pending output */ - s = splimp(); IFQ_PURGE(&ifp->if_snd); - splx(s); - mtx_unlock(&tp->tun_mtx); if (ifp->if_flags & IFF_UP) { - s = splimp(); + mtx_unlock(&tp->tun_mtx); if_down(ifp); - splx(s); + mtx_lock(&tp->tun_mtx); } /* Delete all addresses and routes which reference this interface. */ if (ifp->if_drv_flags & IFF_DRV_RUNNING) { struct ifaddr *ifa; - s = splimp(); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + mtx_unlock(&tp->tun_mtx); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { /* deal w/IPv4 PtP destination; unlocked read */ if (ifa->ifa_addr->sa_family == AF_INET) { @@ -466,14 +463,14 @@ tunclose(struct cdev *dev, int foo, int } } if_purgeaddrs(ifp); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - splx(s); + mtx_lock(&tp->tun_mtx); } funsetown(&tp->tun_sigio); selwakeuppri(&tp->tun_rsel, PZERO + 1); - KNOTE_UNLOCKED(&tp->tun_rsel.si_note, 0); + KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); TUNDEBUG (ifp, "closed\n"); + mtx_unlock(&tp->tun_mtx); return (0); } @@ -481,11 +478,14 @@ static int tuninit(struct ifnet *ifp) { struct tun_softc *tp = ifp->if_softc; +#ifdef INET struct ifaddr *ifa; +#endif int error = 0; TUNDEBUG(ifp, "tuninit\n"); + mtx_lock(&tp->tun_mtx); ifp->if_flags |= IFF_UP; ifp->if_drv_flags |= IFF_DRV_RUNNING; getmicrotime(&ifp->if_lastchange); @@ -496,17 +496,16 @@ tuninit(struct ifnet *ifp) struct sockaddr_in *si; si = (struct sockaddr_in *)ifa->ifa_addr; - mtx_lock(&tp->tun_mtx); if (si->sin_addr.s_addr) tp->tun_flags |= TUN_IASET; si = (struct sockaddr_in *)ifa->ifa_dstaddr; if (si && si->sin_addr.s_addr) tp->tun_flags |= TUN_DSTADDR; - mtx_unlock(&tp->tun_mtx); } } #endif + mtx_unlock(&tp->tun_mtx); return (error); } @@ -519,9 +518,8 @@ tunifioctl(struct ifnet *ifp, u_long cmd struct ifreq *ifr = (struct ifreq *)data; struct tun_softc *tp = ifp->if_softc; struct ifstat *ifs; - int error = 0, s; + int error = 0; - s = splimp(); switch(cmd) { case SIOCGIFSTATUS: ifs = (struct ifstat *)data; @@ -550,7 +548,6 @@ tunifioctl(struct ifnet *ifp, u_long cmd default: error = EINVAL; } - splx(s); return (error); } @@ -656,7 +653,6 @@ tunoutput( static int tunioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { - int s; int error; struct tun_softc *tp = dev->si_drv1; struct tuninfo *tunp; @@ -671,15 +667,19 @@ tunioctl(struct cdev *dev, u_long cmd, c if (error) return (error); } + mtx_lock(&tp->tun_mtx); TUN2IFP(tp)->if_mtu = tunp->mtu; TUN2IFP(tp)->if_type = tunp->type; TUN2IFP(tp)->if_baudrate = tunp->baudrate; + mtx_unlock(&tp->tun_mtx); break; case TUNGIFINFO: tunp = (struct tuninfo *)data; + mtx_lock(&tp->tun_mtx); tunp->mtu = TUN2IFP(tp)->if_mtu; tunp->type = TUN2IFP(tp)->if_type; tunp->baudrate = TUN2IFP(tp)->if_baudrate; + mtx_unlock(&tp->tun_mtx); break; case TUNSDEBUG: tundebug = *(int *)data; @@ -706,7 +706,6 @@ tunioctl(struct cdev *dev, u_long cmd, c mtx_unlock(&tp->tun_mtx); break; case TUNGIFHEAD: - /* Could be unlocked read? */ mtx_lock(&tp->tun_mtx); *(int *)data = (tp->tun_flags & TUN_IFHEAD) ? 1 : 0; mtx_unlock(&tp->tun_mtx); @@ -719,9 +718,11 @@ tunioctl(struct cdev *dev, u_long cmd, c switch (*(int *)data & ~IFF_MULTICAST) { case IFF_POINTOPOINT: case IFF_BROADCAST: + mtx_lock(&tp->tun_mtx); TUN2IFP(tp)->if_flags &= ~(IFF_BROADCAST|IFF_POINTOPOINT|IFF_MULTICAST); TUN2IFP(tp)->if_flags |= *(int *)data; + mtx_unlock(&tp->tun_mtx); break; default: return(EINVAL); @@ -743,17 +744,15 @@ tunioctl(struct cdev *dev, u_long cmd, c mtx_unlock(&tp->tun_mtx); break; case FIONREAD: - s = splimp(); if (!IFQ_IS_EMPTY(&TUN2IFP(tp)->if_snd)) { struct mbuf *mb; IFQ_LOCK(&TUN2IFP(tp)->if_snd); IFQ_POLL_NOLOCK(&TUN2IFP(tp)->if_snd, mb); - for( *(int *)data = 0; mb != 0; mb = mb->m_next) + for (*(int *)data = 0; mb != NULL; mb = mb->m_next) *(int *)data += mb->m_len; IFQ_UNLOCK(&TUN2IFP(tp)->if_snd); } else *(int *)data = 0; - splx(s); break; case FIOSETOWN: return (fsetown(*(int *)data, &tp->tun_sigio)); @@ -787,7 +786,7 @@ tunread(struct cdev *dev, struct uio *ui struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); struct mbuf *m; - int error=0, len, s; + int error=0, len; TUNDEBUG (ifp, "read\n"); mtx_lock(&tp->tun_mtx); @@ -798,27 +797,24 @@ tunread(struct cdev *dev, struct uio *ui } tp->tun_flags &= ~TUN_RWAIT; - mtx_unlock(&tp->tun_mtx); - s = splimp(); do { IFQ_DEQUEUE(&ifp->if_snd, m); if (m == NULL) { if (flag & O_NONBLOCK) { - splx(s); + mtx_unlock(&tp->tun_mtx); return (EWOULDBLOCK); } - mtx_lock(&tp->tun_mtx); tp->tun_flags |= TUN_RWAIT; - mtx_unlock(&tp->tun_mtx); - if ((error = tsleep(tp, PCATCH | (PZERO + 1), - "tunread", 0)) != 0) { - splx(s); + error = mtx_sleep(tp, &tp->tun_mtx, PCATCH | (PZERO + 1), + "tunread", 0); + if (error != 0) { + mtx_unlock(&tp->tun_mtx); return (error); } } } while (m == NULL); - splx(s); + mtx_unlock(&tp->tun_mtx); while (m && uio->uio_resid > 0 && error == 0) { len = min(uio->uio_resid, m->m_len); @@ -929,13 +925,11 @@ tunwrite(struct cdev *dev, struct uio *u static int tunpoll(struct cdev *dev, int events, struct thread *td) { - int s; struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); int revents = 0; struct mbuf *m; - s = splimp(); TUNDEBUG(ifp, "tunpoll\n"); if (events & (POLLIN | POLLRDNORM)) { @@ -953,7 +947,6 @@ tunpoll(struct cdev *dev, int events, st if (events & (POLLOUT | POLLWRNORM)) revents |= events & (POLLOUT | POLLWRNORM); - splx(s); return (revents); } @@ -963,11 +956,9 @@ tunpoll(struct cdev *dev, int events, st static int tunkqfilter(struct cdev *dev, struct knote *kn) { - int s; struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); - s = splimp(); switch(kn->kn_filter) { case EVFILT_READ: TUNDEBUG(ifp, "%s kqfilter: EVFILT_READ, minor = %#x\n", @@ -984,12 +975,10 @@ tunkqfilter(struct cdev *dev, struct kno default: TUNDEBUG(ifp, "%s kqfilter: invalid filter, minor = %#x\n", ifp->if_xname, minor(dev)); - splx(s); return(EINVAL); } - splx(s); - kn->kn_hook = (caddr_t) dev; + kn->kn_hook = tp; knlist_add(&tp->tun_rsel.si_note, kn, 0); return (0); @@ -1001,12 +990,11 @@ tunkqfilter(struct cdev *dev, struct kno static int tunkqread(struct knote *kn, long hint) { - int ret, s; - struct cdev *dev = (struct cdev *)(kn->kn_hook); - struct tun_softc *tp = dev->si_drv1; + int ret; + struct tun_softc *tp = kn->kn_hook; + struct cdev *dev = tp->tun_dev; struct ifnet *ifp = TUN2IFP(tp); - s = splimp(); if ((kn->kn_data = ifp->if_snd.ifq_len) > 0) { TUNDEBUG(ifp, "%s have data in the queue. Len = %d, minor = %#x\n", @@ -1018,7 +1006,6 @@ tunkqread(struct knote *kn, long hint) minor(dev)); ret = 0; } - splx(s); return (ret); } @@ -1029,13 +1016,10 @@ tunkqread(struct knote *kn, long hint) static int tunkqwrite(struct knote *kn, long hint) { - int s; - struct tun_softc *tp = ((struct cdev *)kn->kn_hook)->si_drv1; + struct tun_softc *tp = kn->kn_hook; struct ifnet *ifp = TUN2IFP(tp); - s = splimp(); kn->kn_data = ifp->if_mtu; - splx(s); return (1); } @@ -1043,7 +1027,7 @@ tunkqwrite(struct knote *kn, long hint) static void tunkqdetach(struct knote *kn) { - struct tun_softc *tp = ((struct cdev *)kn->kn_hook)->si_drv1; + struct tun_softc *tp = kn->kn_hook; knlist_remove(&tp->tun_rsel.si_note, kn, 0); } From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 12 17:09:34 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38DAE1065672; Tue, 12 Oct 2010 17:09:34 +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 26A1A8FC15; Tue, 12 Oct 2010 17:09:34 +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 o9CH9Y1r054514; Tue, 12 Oct 2010 17:09:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CH9YOf054512; Tue, 12 Oct 2010 17:09:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121709.o9CH9YOf054512@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 17:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213731 - stable/7/contrib/csup X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 17:09:34 -0000 Author: jhb Date: Tue Oct 12 17:09:33 2010 New Revision: 213731 URL: http://svn.freebsd.org/changeset/base/213731 Log: MFC 194070: Remove semicolon that should not have been there. Modified: stable/7/contrib/csup/rcsfile.c Directory Properties: stable/7/contrib/csup/ (props changed) Modified: stable/7/contrib/csup/rcsfile.c ============================================================================== --- stable/7/contrib/csup/rcsfile.c Tue Oct 12 17:04:21 2010 (r213730) +++ stable/7/contrib/csup/rcsfile.c Tue Oct 12 17:09:33 2010 (r213731) @@ -730,7 +730,7 @@ rcsfile_print(struct rcsfile *rf) lprintf(1, "Strict!\n"); if (rf->comment != NULL) lprintf(1, "comment: '%s'\n", rf->comment); - if (rf->expand != EXPAND_DEFAULT); + if (rf->expand != EXPAND_DEFAULT) lprintf(1, "expand: '%s'\n", keyword_encode_expand(rf->expand)); /* Print all deltas. */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 12 17:12:22 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0C0510656A9; Tue, 12 Oct 2010 17:12:22 +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 BEA308FC3F; Tue, 12 Oct 2010 17:12: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 o9CHCMQD054674; Tue, 12 Oct 2010 17:12:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CHCMHs054672; Tue, 12 Oct 2010 17:12:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121712.o9CHCMHs054672@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 17:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213733 - stable/7/contrib/csup X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 17:12:23 -0000 Author: jhb Date: Tue Oct 12 17:12:22 2010 New Revision: 213733 URL: http://svn.freebsd.org/changeset/base/213733 Log: MFC 213300: If an RCS file is truncated, rcsfile_getdelta() will return NULL. Instead of faulting, check for NULL. However, returning an error would cause csup to just abort the entire update. Instead, break out of the loop and return ok. The attempts to update the file will trigger a MD5 failure which will cause csup to download the entire file as a fixup. Modified: stable/7/contrib/csup/rcsparse.c Directory Properties: stable/7/contrib/csup/ (props changed) Modified: stable/7/contrib/csup/rcsparse.c ============================================================================== --- stable/7/contrib/csup/rcsparse.c Tue Oct 12 17:12:13 2010 (r213732) +++ stable/7/contrib/csup/rcsparse.c Tue Oct 12 17:12:22 2010 (r213733) @@ -318,6 +318,14 @@ parse_deltatexts(struct rcsfile *rf, yys d = rcsfile_getdelta(rf, revnum); free(revnum); + /* + * XXX: The RCS file is corrupt, but lie and say it is ok. + * If it is actually broken, then the MD5 mismatch will + * trigger a fixup. + */ + if (d == NULL) + return (0); + /* log string */ asserttoken(sp, KEYWORD); asserttoken(sp, STRING); From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 12 17:12:35 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B11C1065698; Tue, 12 Oct 2010 17:12:35 +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 88C938FC4D; Tue, 12 Oct 2010 17:12:35 +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 o9CHCZx2054715; Tue, 12 Oct 2010 17:12:35 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CHCZKK054713; Tue, 12 Oct 2010 17:12:35 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201010121712.o9CHCZKK054713@svn.freebsd.org> From: Bernhard Schmidt Date: Tue, 12 Oct 2010 17:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213734 - stable/7/sys/dev/iwi X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 17:12:35 -0000 Author: bschmidt Date: Tue Oct 12 17:12:35 2010 New Revision: 213734 URL: http://svn.freebsd.org/changeset/base/213734 Log: When bringing the interface down we clear the command queue but do not reset the sc_cmd_cur and sc_cmd_next indices. If there are still pending commands while clearing the queue those two indices are off by at least one. This leads to no commands being sent to the firmware until the queue overruns. Fix this by also resetting the indices. This is a direct commit as the code does not exist in head. Modified: stable/7/sys/dev/iwi/if_iwi.c Modified: stable/7/sys/dev/iwi/if_iwi.c ============================================================================== --- stable/7/sys/dev/iwi/if_iwi.c Tue Oct 12 17:12:22 2010 (r213733) +++ stable/7/sys/dev/iwi/if_iwi.c Tue Oct 12 17:12:35 2010 (r213734) @@ -3267,6 +3267,7 @@ iwi_stop(void *priv) ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); memset(sc->sc_cmd, 0, sizeof(sc->sc_cmd)); + sc->sc_cmd_cur = sc->sc_cmd_next = 0; sc->sc_tx_timer = 0; sc->sc_rfkill_timer = 0; sc->sc_state_timer = 0; From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 12 19:28:33 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCED3106574E; Tue, 12 Oct 2010 19:28:33 +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 A9F5A8FC20; Tue, 12 Oct 2010 19:28:33 +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 o9CJSXCG059666; Tue, 12 Oct 2010 19:28:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CJSXKu059664; Tue, 12 Oct 2010 19:28:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121928.o9CJSXKu059664@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 19:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213746 - stable/7/sys/i386/i386 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 19:28:33 -0000 Author: jhb Date: Tue Oct 12 19:28:33 2010 New Revision: 213746 URL: http://svn.freebsd.org/changeset/base/213746 Log: MFC 213226: Rewrite the i386 memory probe: - Check for SMAP data from the loader first. If it exists, don't bother doing any VM86 calls at all. This will be more friendly for non-BIOS boot environments such as EFI, etc. - Move the base memory setup into a new basemem_setup() routine instead of duplicating it. - Simplify the XEN case by removing all of the VM86/SMAP parsing code rather than just jumping over it. - Adjust some comments to better explain the code flow. Modified: stable/7/sys/i386/i386/machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/i386/i386/machdep.c ============================================================================== --- stable/7/sys/i386/i386/machdep.c Tue Oct 12 19:28:20 2010 (r213745) +++ stable/7/sys/i386/i386/machdep.c Tue Oct 12 19:28:33 2010 (r213746) @@ -1730,69 +1730,13 @@ add_smap_entry(struct bios_smap *smap, v return (1); } -/* - * Populate the (physmap) array with base/bound pairs describing the - * available physical memory in the system, then test this memory and - * build the phys_avail array describing the actually-available memory. - * - * If we cannot accurately determine the physical memory map, then use - * value from the 0xE801 call, and failing that, the RTC. - * - * Total memory size may be set by the kernel environment variable - * hw.physmem or the compile-time define MAXMEM. - * - * XXX first should be vm_paddr_t. - */ static void -getmemsize(int first) +basemem_setup(void) { - int i, off, physmap_idx, pa_indx, da_indx; - int hasbrokenint12, has_smap; - u_long physmem_tunable; - u_int extmem; - struct vm86frame vmf; - struct vm86context vmc; - vm_paddr_t pa, physmap[PHYSMAP_SIZE]; + vm_paddr_t pa; pt_entry_t *pte; - struct bios_smap *smap, *smapbase, *smapend; - u_int32_t smapsize; - quad_t dcons_addr, dcons_size; - caddr_t kmdp; - - has_smap = 0; -#ifdef XBOX - if (arch_i386_is_xbox) { - /* - * We queried the memory size before, so chop off 4MB for - * the framebuffer and inform the OS of this. - */ - physmap[0] = 0; - physmap[1] = (arch_i386_xbox_memsize * 1024 * 1024) - XBOX_FB_SIZE; - physmap_idx = 0; - goto physmap_done; - } -#endif - - hasbrokenint12 = 0; - TUNABLE_INT_FETCH("hw.hasbrokenint12", &hasbrokenint12); - bzero(&vmf, sizeof(vmf)); - bzero(physmap, sizeof(physmap)); - basemem = 0; - - /* - * Some newer BIOSes has broken INT 12H implementation which cause - * kernel panic immediately. In this case, we need to scan SMAP - * with INT 15:E820 first, then determine base memory size. - */ - if (hasbrokenint12) { - goto int15e820; - } + int i; - /* - * Perform "base memory" related probes & setup - */ - vm86_intcall(0x12, &vmf); - basemem = vmf.vmf_ax; if (basemem > 640) { printf("Preposterous BIOS basemem of %uK, truncating to 640K\n", basemem); @@ -1832,12 +1776,58 @@ getmemsize(int first) pte = (pt_entry_t *)vm86paddr; for (i = basemem / 4; i < 160; i++) pte[i] = (i << PAGE_SHIFT) | PG_V | PG_RW | PG_U; +} + +/* + * Populate the (physmap) array with base/bound pairs describing the + * available physical memory in the system, then test this memory and + * build the phys_avail array describing the actually-available memory. + * + * If we cannot accurately determine the physical memory map, then use + * value from the 0xE801 call, and failing that, the RTC. + * + * Total memory size may be set by the kernel environment variable + * hw.physmem or the compile-time define MAXMEM. + * + * XXX first should be vm_paddr_t. + */ +static void +getmemsize(int first) +{ + int has_smap, off, physmap_idx, pa_indx, da_indx; + u_long physmem_tunable; + vm_paddr_t physmap[PHYSMAP_SIZE]; + pt_entry_t *pte; + quad_t dcons_addr, dcons_size; + int hasbrokenint12, i; + u_int extmem; + struct vm86frame vmf; + struct vm86context vmc; + vm_paddr_t pa; + struct bios_smap *smap, *smapbase, *smapend; + u_int32_t smapsize; + caddr_t kmdp; + + has_smap = 0; +#ifdef XBOX + if (arch_i386_is_xbox) { + /* + * We queried the memory size before, so chop off 4MB for + * the framebuffer and inform the OS of this. + */ + physmap[0] = 0; + physmap[1] = (arch_i386_xbox_memsize * 1024 * 1024) - XBOX_FB_SIZE; + physmap_idx = 0; + goto physmap_done; + } +#endif + bzero(&vmf, sizeof(vmf)); + bzero(physmap, sizeof(physmap)); + basemem = 0; -int15e820: /* - * Fetch the memory map with INT 15:E820. First, check to see - * if the loader supplied it and use that if so. Otherwise, - * use vm86 to invoke the BIOS call directly. + * Check if the loader supplied an SMAP memory map. If so, + * use that and do not make any VM86 calls. */ physmap_idx = 0; smapbase = NULL; @@ -1848,9 +1838,10 @@ int15e820: smapbase = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase != NULL) { - /* subr_module.c says: + /* + * subr_module.c says: * "Consumer may safely assume that size value precedes data." - * ie: an int32_t immediately precedes smap. + * ie: an int32_t immediately precedes SMAP. */ smapsize = *((u_int32_t *)smapbase - 1); smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); @@ -1859,33 +1850,50 @@ int15e820: for (smap = smapbase; smap < smapend; smap++) if (!add_smap_entry(smap, physmap, &physmap_idx)) break; - } else { - /* - * map page 1 R/W into the kernel page table so we can use it - * as a buffer. The kernel will unmap this page later. - */ - pmap_kenter(KERNBASE + (1 << PAGE_SHIFT), 1 << PAGE_SHIFT); - vmc.npages = 0; - smap = (void *)vm86_addpage(&vmc, 1, KERNBASE + - (1 << PAGE_SHIFT)); - vm86_getptr(&vmc, (vm_offset_t)smap, &vmf.vmf_es, &vmf.vmf_di); - - vmf.vmf_ebx = 0; - do { - vmf.vmf_eax = 0xE820; - vmf.vmf_edx = SMAP_SIG; - vmf.vmf_ecx = sizeof(struct bios_smap); - i = vm86_datacall(0x15, &vmf, &vmc); - if (i || vmf.vmf_eax != SMAP_SIG) - break; - has_smap = 1; - if (!add_smap_entry(smap, physmap, &physmap_idx)) - break; - } while (vmf.vmf_ebx != 0); + goto have_smap; + } + + /* + * Some newer BIOSes have a broken INT 12H implementation + * which causes a kernel panic immediately. In this case, we + * need use the SMAP to determine the base memory size. + */ + hasbrokenint12 = 0; + TUNABLE_INT_FETCH("hw.hasbrokenint12", &hasbrokenint12); + if (hasbrokenint12 == 0) { + /* Use INT12 to determine base memory size. */ + vm86_intcall(0x12, &vmf); + basemem = vmf.vmf_ax; + basemem_setup(); } /* - * Perform "base memory" related probes & setup based on SMAP + * Fetch the memory map with INT 15:E820. Map page 1 R/W into + * the kernel page table so we can use it as a buffer. The + * kernel will unmap this page later. + */ + pmap_kenter(KERNBASE + (1 << PAGE_SHIFT), 1 << PAGE_SHIFT); + vmc.npages = 0; + smap = (void *)vm86_addpage(&vmc, 1, KERNBASE + (1 << PAGE_SHIFT)); + vm86_getptr(&vmc, (vm_offset_t)smap, &vmf.vmf_es, &vmf.vmf_di); + + vmf.vmf_ebx = 0; + do { + vmf.vmf_eax = 0xE820; + vmf.vmf_edx = SMAP_SIG; + vmf.vmf_ecx = sizeof(struct bios_smap); + i = vm86_datacall(0x15, &vmf, &vmc); + if (i || vmf.vmf_eax != SMAP_SIG) + break; + has_smap = 1; + if (!add_smap_entry(smap, physmap, &physmap_idx)) + break; + } while (vmf.vmf_ebx != 0); + +have_smap: + /* + * If we didn't fetch the "base memory" size from INT12, + * figure it out from the SMAP (or just guess). */ if (basemem == 0) { for (i = 0; i <= physmap_idx; i += 2) { @@ -1895,49 +1903,39 @@ int15e820: } } - /* - * XXX this function is horribly organized and has to the same - * things that it does above here. - */ + /* XXX: If we couldn't find basemem from SMAP, just guess. */ if (basemem == 0) basemem = 640; - if (basemem > 640) { - printf( - "Preposterous BIOS basemem of %uK, truncating to 640K\n", - basemem); - basemem = 640; - } - - /* - * Let vm86 scribble on pages between basemem and - * ISA_HOLE_START, as above. - */ - for (pa = trunc_page(basemem * 1024); - pa < ISA_HOLE_START; pa += PAGE_SIZE) - pmap_kenter(KERNBASE + pa, pa); - pte = (pt_entry_t *)vm86paddr; - for (i = basemem / 4; i < 160; i++) - pte[i] = (i << PAGE_SHIFT) | PG_V | PG_RW | PG_U; + basemem_setup(); } if (physmap[1] != 0) goto physmap_done; /* - * If we failed above, try memory map with INT 15:E801 + * If we failed to find an SMAP, figure out the extended + * memory size. We will then build a simple memory map with + * two segments, one for "base memory" and the second for + * "extended memory". Note that "extended memory" starts at a + * physical address of 1MB and that both basemem and extmem + * are in units of 1KB. + * + * First, try to fetch the extended memory size via INT 15:E801. */ vmf.vmf_ax = 0xE801; if (vm86_intcall(0x15, &vmf) == 0) { extmem = vmf.vmf_cx + vmf.vmf_dx * 64; } else { + /* + * If INT15:E801 fails, this is our last ditch effort + * to determine the extended memory size. Currently + * we prefer the RTC value over INT15:88. + */ #if 0 vmf.vmf_ah = 0x88; vm86_intcall(0x15, &vmf); extmem = vmf.vmf_ax; #else - /* - * Prefer the RTC value for extended memory. - */ extmem = rtcin(RTC_EXTLO) + (rtcin(RTC_EXTHI) << 8); #endif } From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 12 21:40:43 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB85A106566B; Tue, 12 Oct 2010 21:40:43 +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 D6A088FC14; Tue, 12 Oct 2010 21:40:43 +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 o9CLehOj062877; Tue, 12 Oct 2010 21:40:43 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CLehrL062868; Tue, 12 Oct 2010 21:40:43 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010122140.o9CLehrL062868@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 12 Oct 2010 21:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213750 - in stable/7/tools/tools: mcgrab mctest nanobsd netrate/http netrate/httpd netrate/juggle X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 21:40:44 -0000 Author: gnn Date: Tue Oct 12 21:40:43 2010 New Revision: 213750 URL: http://svn.freebsd.org/changeset/base/213750 Log: MFC 177387,177388,177872,178456,179528,180394,186456,203800,204310,213327: r177387 A multicast test. The mctest program acts as both a source and a sink for multicast packets. Parameters for the interface, packet size, number of packets, and interpacket gap may be given on the command line. The sink records how many packets were missed, and at what time each packet arrived. r177388 Add the correct license. r177872 Add a manual page and a Makefile. Add code to reflect packets back from the sink so that we can measure round trip at the source. r178456 Updated the test to handle multiple sinks. The sinks cut their transmissions by the number of them running so that they do not overwhelm the source. Added a simple shell script to kick off sinks on multiple hosts as well as a source on the host where the shell script is run. The script also collects the output of all the sinks and the source into files named for the host on which the tests are run. A date is appended to each output file to make it unique per run. r179528 Update mctest and its associated script to have a base port to listen on so that multiple copies can be run easily. Update documentation with group and port arguments which are optional. r180394 Add a new program to the multicast test suite. The mcgrab program is used to grab and hold some number of multicast addresses in order to test what happens when an interface goes over the number of multicast addresses it can filter in hardware. r186456 Fix a bug in the man page where we were not showing the correct flags in the explanation. Several of the flags were -i, since it was a copy/paste operation. r203800 Fixed error checking of pthread(3) functions. r204310 Moved mcgrab(1) into a separate directory -- our .mk infrastructure doesn't currently have support for building multiple programs in a single makefile. While here, fixed manpages and makefiles (missing dependencies). r213327 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. Added: stable/7/tools/tools/mcgrab/ - copied from r204310, head/tools/tools/mcgrab/ stable/7/tools/tools/mctest/ - copied from r177387, head/tools/tools/mctest/ stable/7/tools/tools/mctest/Makefile - copied, changed from r177872, head/tools/tools/mctest/Makefile stable/7/tools/tools/mctest/mctest.1 - copied, changed from r177872, head/tools/tools/mctest/mctest.1 stable/7/tools/tools/mctest/mctest_run.sh - copied, changed from r178456, head/tools/tools/mctest/mctest_run.sh Modified: stable/7/tools/tools/mctest/mctest.cc stable/7/tools/tools/mctest/mctest.h stable/7/tools/tools/netrate/http/http.c stable/7/tools/tools/netrate/httpd/httpd.c stable/7/tools/tools/netrate/juggle/juggle.c Directory Properties: stable/7/tools/tools/ (props changed) stable/7/tools/tools/aac/ (props changed) stable/7/tools/tools/crypto/ (props changed) stable/7/tools/tools/editing/ (props changed) stable/7/tools/tools/nanobsd/ (props changed) stable/7/tools/tools/nanobsd/FlashDevice.sub (props changed) stable/7/tools/tools/nanobsd/nanobsd.sh (props changed) stable/7/tools/tools/umastat/ (props changed) stable/7/tools/tools/usb/ (props changed) Copied and modified: stable/7/tools/tools/mctest/Makefile (from r177872, head/tools/tools/mctest/Makefile) ============================================================================== --- head/tools/tools/mctest/Makefile Thu Apr 3 05:26:54 2008 (r177872, copy source) +++ stable/7/tools/tools/mctest/Makefile Tue Oct 12 21:40:43 2010 (r213750) @@ -1,9 +1,7 @@ -# # $FreeBSD$ -# -# A Makefile that builds both the mctest program and its manual page. -PROG_CXX= mctest -LDADD+= -lpthread +PROG_CXX= mctest +DPADD= ${LIBPTHREAD} +LDADD= -lpthread .include Copied and modified: stable/7/tools/tools/mctest/mctest.1 (from r177872, head/tools/tools/mctest/mctest.1) ============================================================================== --- head/tools/tools/mctest/mctest.1 Thu Apr 3 05:26:54 2008 (r177872, copy source) +++ stable/7/tools/tools/mctest/mctest.1 Tue Oct 12 21:40:43 2010 (r213750) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd April 3, 2008 -.Dt mctest 1 +.Dt MCTEST 1 .Os .Sh NAME .Nm mctest @@ -33,38 +33,57 @@ .Sh SYNOPSIS .Nm .Op Fl i Ar interface +.Op Fl g Ar group +.Op Fl b Ar base port .Op Fl n Ar number .Op Fl s Ar size .Op Fl t Ar inter-packet gap +.Op Fl M Ar number of clients (source only) +.Op Fl m Ar my client number (sink only) .Op Fl r .Sh DESCRIPTION -The +The .Nm -command implements a multicast test which involved a source -and a sink. The source sends packets to a pre-configured -multicast address over the interface given as a command line -argument. The sink listens for multicast packets, records -the time at which they're received and then reflects them back -over unicast to the source. When the source has captured all +command implements a multicast test which involves a source +and a sink. +The source sends packets to a pre-configured +multicast address over the interface given as a command line +argument. +The sink listens for multicast packets, records +the time at which they are received and then reflects them back +over unicast to the source. +When the source has captured all the reflected packets it prints out the round trip time of each. .Pp +The source prints out the round trip time of packets sent to the +sinks. The sink prints out the time between the packets received. .Pp The options are as follows: -.Bl -tag -width ".Fl d Ar argument" +.Bl -tag -width ".Fl i Ar interface" .It Fl i Ar interface -Network interface, which can be found with ifconfig(1). +Network interface, which can be found with +.Xr ifconfig 8 . +.It Fl g Ar group +Multicast group. +.It Fl b Ar base port +Port on which to listen. .It Fl s Ar size Packet size in bytes. .It Fl n Ar number Number of packets. .It Fl t Ar gap Inter-packet gap in nanoseconds. +.It Fl M Ar clients +The number of clients that are listening. +.It Fl m Ar my number +The client's number 0, 1, etc. .It Fl r This version of .Nm -is the receiver aka the sink. This option MUST -only be used with one copy of the program at a time. +is the receiver aka the sink. +This option MUST +only be used with one copy of the program at a time. .El .Sh EXAMPLES The following is an example of a typical usage @@ -73,20 +92,21 @@ of the command: .Pp Source -.Dl "mctest -i em0 -s 1024 -n 100 -t 1" +.Dl "mctest -i em0 -M 1 -s 1024 -n 100 -t 1" Sink -.Dl "mctest -i em0 -s 1024 -n 100 -r" +.Dl "mctest -i em0 -m 0 -s 1024 -n 100 -r" .Pp Send 100 packets of 1024 bytes, with an inter-packet gap of 1 nanosecond. .Pp -Gaps are measured with +Gaps are measured with .Xr nanosleep 2 , and so are not accurate down to nanoseconds -but depend on the setting of kern.hz. +but depend on the setting of +.Va kern.hz . .Sh SEE ALSO -.Xr ifconfig 8 , .Xr netstat 1 , -.Xr nanosleep 2 . +.Xr nanosleep 2 , +.Xr ifconfig 8 .Sh HISTORY The .Nm @@ -97,4 +117,5 @@ This manual page was written by .An George V. Neville-Neil Aq gnn@FreeBSD.org . .Sh BUGS -Should be reported to the author or to net@freebsd.org. +Should be reported to the author or to +.Aq net@FreeBSD.org . Modified: stable/7/tools/tools/mctest/mctest.cc ============================================================================== --- head/tools/tools/mctest/mctest.cc Wed Mar 19 12:44:23 2008 (r177387) +++ stable/7/tools/tools/mctest/mctest.cc Tue Oct 12 21:40:43 2010 (r213750) @@ -1,7 +1,28 @@ // +// Copyright 2008, George V. Neville-Neil // All rights reserved. // -// Author: George V. Neville-Neil +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +// SUCH DAMAGE. // // This is a relatively simple multicast test which can act as a // source and sink. The purpose of this test is to determine the @@ -17,6 +38,8 @@ __FBSDID("$FreeBSD$"); // C++ STL and other related includes #include #include +#include +#include // Operating System and other C based includes #include @@ -40,7 +63,7 @@ using namespace std; // void usage() { - cout << "mctest -i interface -g multicast group -s packet size -n number -t inter-packet gap\n"; + cout << "mctest [-r] -M clients -m client number -i interface -g multicast group -s packet size -n number -t inter-packet gap\n"; exit(-1); } @@ -65,13 +88,16 @@ void usage(string message) // @param group ///< multicast group // @param pkt_size ///< packet Size // @param number ///< number of packets we're expecting +// @param clients ///< total number of clients (N) +// @param client ///< our client number (0..N) // // @return 0 for 0K, -1 for error, sets errno // -int sink(char *interface, struct in_addr *group, int pkt_size, int number) { +int sink(char *interface, struct in_addr *group, int pkt_size, int number, + int clients, int client, short base_port) { - int sock; + int sock, backchan; socklen_t recvd_len; struct sockaddr_in local, recvd; struct ip_mreq mreq; @@ -90,6 +116,11 @@ int sink(char *interface, struct in_addr return (-1); } + if ((backchan = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + perror("failed to open back channel socket"); + return (-1); + } + strncpy(ifreq.ifr_name, interface, IFNAMSIZ); if (ioctl(sock, SIOCGIFADDR, &ifreq) < 0) { perror("no such interface"); @@ -138,6 +169,7 @@ int sink(char *interface, struct in_addr perror("setsockopt failed"); while (n < number) { + recvd_len = sizeof(recvd); if (recvfrom(sock, packet, pkt_size, 0, (struct sockaddr *)&recvd, &recvd_len) < 0) { if (errno == EWOULDBLOCK) @@ -145,6 +177,19 @@ int sink(char *interface, struct in_addr perror("recvfrom failed"); return -1; } + /* + * Bandwidth limiting. If there are N clients then we want + * 1/N packets from each, otherwise the clients will overwhelm + * the sender. + */ + if (n % clients == client) { + recvd.sin_port = htons(base_port + client); + if (sendto(backchan, packet, pkt_size, 0, + (struct sockaddr *)&recvd, sizeof(recvd)) < 0) { + perror("sendto failed"); + return -1; + } + } gettimeofday(&packets[ntohl(*(int *)packet)], 0); n++; } @@ -173,6 +218,73 @@ int sink(char *interface, struct in_addr } // +// Structure to hold thread arguments +// +struct server_args { + struct timeval *packets; ///< The timestamps of returning packets + int number; ///< Number of packets to expect. + int pkt_size; ///< Size of the packets + int client; ///< Which client we listen for +}; + +// +// server receives packets sent back from the sink +// +// @param passed ///< Arguments passed from the caller +// +// 0return always NULL +void* server(void *passed) { + + int sock, n =0; + struct timeval timeout; + struct sockaddr_in addr; + server_args *args = (server_args *)passed; + + timerclear(&timeout); + timeout.tv_sec = TIMEOUT; + + if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + perror("could not open server socket"); + return NULL; + } + + bzero(&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = INADDR_ANY; + addr.sin_port = htons(args->client); + addr.sin_len = sizeof(addr); + + if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { + perror("could not bind server socket"); + return NULL; + } + + if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &timeout, + sizeof(timeout)) < 0) + perror("setsockopt failed"); + + char packet[args->pkt_size]; + while (n < args->number) { + if (recvfrom(sock, &packet, args->pkt_size, 0, NULL, 0) < 0) { + if (errno == EWOULDBLOCK) + break; + perror("recvfrom failed"); + return NULL; + } + gettimeofday(&args->packets[ntohl(*(int *)packet)], 0); + n++; + } + + cout << "Packet Reflection Complete" << endl; + + if (n < args->number) + cout << "Missed " << args->number - n << " packets." << endl; + + return NULL; + +} + +// // transmit packets for the multicast test // // @param interface ///< text name of the interface (em0 etc.) @@ -180,11 +292,12 @@ int sink(char *interface, struct in_addr // @param pkt_size ///< packet size // @param number ///< number of packets // @param gap ///< inter packet gap in nano-seconds +// @param clients ///< number of clients we intend to run // // @return 0 for OK, -1 for error, sets errno // int source(char *interface, struct in_addr *group, int pkt_size, - int number, int gap) { + int number, int gap, int clients, short base_port) { int sock; struct sockaddr_in addr; @@ -247,6 +360,22 @@ int source(char *interface, struct in_ad *(int *)packets[i] = htonl(i); } + struct timeval sent[number]; + struct timeval received[clients][number]; + server_args args[clients]; + pthread_t thread[clients]; + + for (int i = 0;i < clients; i++) { + args[i].pkt_size = pkt_size; + args[i].packets = received[i]; + args[i].number = number / clients; + args[i].client = base_port + i; + if (pthread_create(&thread[i], NULL, server, &args[i]) != 0) { + perror("failed to create server thread"); + return -1; + } + } + struct timespec sleeptime; sleeptime.tv_sec = 0; sleeptime.tv_nsec = gap; @@ -257,12 +386,49 @@ int source(char *interface, struct in_ad perror("sendto failed"); return -1; } + gettimeofday(&sent[i], 0); if (gap > 0) if (nanosleep(&sleeptime, NULL) < 0) { perror("nanosleep failed"); return -1; } } + + for (int i = 0; i < clients; i++) { + if (pthread_join(thread[i], NULL) != 0) { + perror("failed to join thread"); + return -1; + } + } + + 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 (&args[client].packets[i].tv_sec == 0) + continue; + timersub(&args[client].packets[i], &sent[i], &result); + 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; } @@ -284,17 +450,20 @@ int main(int argc, char**argv) char ch; ///< character from getopt() extern char* optarg; ///< option argument - char* interface; ///< Name of the interface + char* interface = 0; ///< Name of the interface struct in_addr *group = NULL; ///< the multicast group address - int pkt_size; ///< packet size - int gap; ///< inter packet gap (in nanoseconds) - int number; ///< number of packets to transmit - bool server = false; + int pkt_size = 0; ///< packet size + int gap = 0; ///< inter packet gap (in nanoseconds) + int number = 0; ///< number of packets to transmit + bool server = false; ///< are we on he receiving end of multicast + int client = 0; ///< for receivers which client are we + int clients = 1; ///< for senders how many clients are there + short base_port = SERVER_PORT; ///< to have multiple copies running at once - if (argc < 2 || argc > 11) + if (argc < 2 || argc > 16) usage(); - while ((ch = getopt(argc, argv, "g:i:n:s:t:rh")) != -1) { + while ((ch = getopt(argc, argv, "M:m:g:i:n:s:t:b:rh")) != -1) { switch (ch) { case 'g': group = new (struct in_addr ); @@ -307,7 +476,7 @@ int main(int argc, char**argv) break; case 'n': number = atoi(optarg); - if (number < 0 || number > 10000) + if (number < 0 || number > INT_MAX) usage(argv[0] + string(" Error: ") + optarg + string(" number of packets out of range")); break; @@ -326,6 +495,15 @@ int main(int argc, char**argv) case 'r': server = true; break; + case 'm': + client = atoi(optarg); + break; + case 'M': + clients = atoi(optarg); + break; + case 'b': + base_port = atoi(optarg); + break; case 'h': usage(string("Help\n")); break; @@ -333,9 +511,15 @@ int main(int argc, char**argv) } if (server) { - sink(interface, group, pkt_size, number); + if (clients <= 0 || client < 0) + usage("must specify client (-m) and number of clients (-M)"); + sink(interface, group, pkt_size, number, clients, client, + base_port); } else { - source(interface, group, pkt_size, number, gap); + if (clients <= 0) + usage("must specify number of clients (-M)"); + source(interface, group, pkt_size, number, gap, clients, + base_port); } } Modified: stable/7/tools/tools/mctest/mctest.h ============================================================================== --- head/tools/tools/mctest/mctest.h Wed Mar 19 12:44:23 2008 (r177387) +++ stable/7/tools/tools/mctest/mctest.h Tue Oct 12 21:40:43 2010 (r213750) @@ -28,5 +28,6 @@ // const char* DEFAULT_GROUP = "239.255.255.1"; +const int SERVER_PORT = 9999; const int DEFAULT_PORT = 6666; const int TIMEOUT = 10; Copied and modified: stable/7/tools/tools/mctest/mctest_run.sh (from r178456, head/tools/tools/mctest/mctest_run.sh) ============================================================================== --- head/tools/tools/mctest/mctest_run.sh Thu Apr 24 06:56:45 2008 (r178456, copy source) +++ stable/7/tools/tools/mctest/mctest_run.sh Tue Oct 12 21:40:43 2010 (r213750) @@ -7,18 +7,19 @@ # Defaults size=1024 number=100 -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: $*` +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 @@ -39,8 +40,14 @@ do -c) command=$3; shift 2;; - -i) - interface=$3; + -l) + local_interface=$3; + shift 2;; + -f) + foreign_interface=$3; + shift 2;; + -b) + base=$3; shift 2;; --) shift; break;; @@ -56,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 $# -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 @@ -64,4 +71,4 @@ done # # Start the source/collector on this machine # -$command -M $# -n $number -s $size -i le1 -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 Modified: stable/7/tools/tools/netrate/http/http.c ============================================================================== --- stable/7/tools/tools/netrate/http/http.c Tue Oct 12 21:01:26 2010 (r213749) +++ stable/7/tools/tools/netrate/http/http.c Tue Oct 12 21:40:43 2010 (r213750) @@ -300,15 +300,15 @@ main(int argc, char *argv[]) if (threaded) { if (pthread_barrier_init(&statep->start_barrier, NULL, - numthreads) < 0) - err(-1, "pthread_mutex_init"); + numthreads) != 0) + err(-1, "pthread_barrier_init"); } for (i = 0; i < numthreads; i++) { statep->hwd[i].hwd_count = 0; if (threaded) { if (pthread_create(&statep->hwd[i].hwd_thread, NULL, - http_worker, &statep->hwd[i]) < 0) + http_worker, &statep->hwd[i]) != 0) err(-1, "pthread_create"); } else { curthread = i; @@ -339,7 +339,7 @@ main(int argc, char *argv[]) for (i = 0; i < numthreads; i++) { if (threaded) { if (pthread_join(statep->hwd[i].hwd_thread, NULL) - < 0) + != 0) err(-1, "pthread_join"); } else { pid = waitpid(statep->hwd[i].hwd_pid, NULL, 0); Modified: stable/7/tools/tools/netrate/httpd/httpd.c ============================================================================== --- stable/7/tools/tools/netrate/httpd/httpd.c Tue Oct 12 21:01:26 2010 (r213749) +++ stable/7/tools/tools/netrate/httpd/httpd.c Tue Oct 12 21:40:43 2010 (r213750) @@ -280,7 +280,7 @@ main(int argc, char *argv[]) for (i = 0; i < THREADS; i++) { if (threaded) { if (pthread_create(&statep->hts[i].hts_thread, NULL, - httpd_worker, &statep->hts[i]) < 0) + httpd_worker, &statep->hts[i]) != 0) err(-1, "pthread_create"); } else { pid = fork(); @@ -299,7 +299,7 @@ main(int argc, char *argv[]) for (i = 0; i < THREADS; i++) { if (threaded) { if (pthread_join(statep->hts[i].hts_thread, NULL) - < 0) + != 0) err(-1, "pthread_join"); } else { pid = waitpid(statep->hts[i].hts_pid, NULL, 0); Modified: stable/7/tools/tools/netrate/juggle/juggle.c ============================================================================== --- stable/7/tools/tools/netrate/juggle/juggle.c Tue Oct 12 21:01:26 2010 (r213749) +++ stable/7/tools/tools/netrate/juggle/juggle.c Tue Oct 12 21:40:43 2010 (r213750) @@ -301,15 +301,15 @@ juggling_thread(void *arg) fd2 = *(int *)arg; - if (pthread_mutex_lock(&threaded_mtx) < 0) + if (pthread_mutex_lock(&threaded_mtx) != 0) err(-1, "juggling_thread: pthread_mutex_lock"); threaded_child_ready = 1; - if (pthread_cond_signal(&threaded_cond) < 0) + if (pthread_cond_signal(&threaded_cond) != 0) err(-1, "juggling_thread: pthread_cond_signal"); - if (pthread_mutex_unlock(&threaded_mtx) < 0) + if (pthread_mutex_unlock(&threaded_mtx) != 0) err(-1, "juggling_thread: pthread_mutex_unlock"); for (i = 0; i < NUMCYCLES; i++) { @@ -334,21 +334,21 @@ thread_juggle(int fd1, int fd2, int pipe threaded_pipeline = pipeline; - if (pthread_mutex_init(&threaded_mtx, NULL) < 0) + if (pthread_mutex_init(&threaded_mtx, NULL) != 0) err(-1, "thread_juggle: pthread_mutex_init"); - if (pthread_create(&thread, NULL, juggling_thread, &fd2) < 0) + if (pthread_create(&thread, NULL, juggling_thread, &fd2) != 0) err(-1, "thread_juggle: pthread_create"); - if (pthread_mutex_lock(&threaded_mtx) < 0) + if (pthread_mutex_lock(&threaded_mtx) != 0) err(-1, "thread_juggle: pthread_mutex_lock"); while (!threaded_child_ready) { - if (pthread_cond_wait(&threaded_cond, &threaded_mtx) < 0) + if (pthread_cond_wait(&threaded_cond, &threaded_mtx) != 0) err(-1, "thread_juggle: pthread_cond_wait"); } - if (pthread_mutex_unlock(&threaded_mtx) < 0) + if (pthread_mutex_unlock(&threaded_mtx) != 0) err(-1, "thread_juggle: pthread_mutex_unlock"); if (clock_gettime(CLOCK_REALTIME, &tstart) < 0) @@ -369,7 +369,7 @@ thread_juggle(int fd1, int fd2, int pipe if (clock_gettime(CLOCK_REALTIME, &tfinish) < 0) err(-1, "thread_juggle: clock_gettime"); - if (pthread_join(thread, NULL) < 0) + if (pthread_join(thread, NULL) != 0) err(-1, "thread_juggle: pthread_join"); timespecsub(&tfinish, &tstart); From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 12 21:45:36 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD091106564A; Tue, 12 Oct 2010 21:45:36 +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 AAAF08FC1B; Tue, 12 Oct 2010 21:45:36 +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 o9CLjapx063020; Tue, 12 Oct 2010 21:45:36 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CLjaRZ063018; Tue, 12 Oct 2010 21:45:36 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010122145.o9CLjaRZ063018@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 12 Oct 2010 21:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213751 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 21:45:36 -0000 Author: gnn Date: Tue Oct 12 21:45:36 2010 New Revision: 213751 URL: http://svn.freebsd.org/changeset/base/213751 Log: MFC 213409: Fix two aliases that had the same name but were pointing to different events. These are now disamiguated. Modified: stable/7/sys/dev/hwpmc/pmc_events.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/pmc_events.h ============================================================================== --- stable/7/sys/dev/hwpmc/pmc_events.h Tue Oct 12 21:40:43 2010 (r213750) +++ stable/7/sys/dev/hwpmc/pmc_events.h Tue Oct 12 21:45:36 2010 (r213751) @@ -2243,11 +2243,11 @@ __PMC_EV_ALIAS("UOPS_RETIRED.MACRO_FUSED __PMC_EV_ALIAS("MACHINE_CLEARS.CYCLES", IAP_EVENT_C3H_01H) \ __PMC_EV_ALIAS("MACHINE_CLEARS.MEM_ORDER", IAP_EVENT_C3H_02H) \ __PMC_EV_ALIAS("MACHINE_CLEARS.SMC", IAP_EVENT_C3H_04H) \ -__PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_00H) \ +__PMC_EV_ALIAS("BR_INST_RETIRED.ANY_P", IAP_EVENT_C4H_00H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.CONDITIONAL", IAP_EVENT_C4H_01H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_CALL", IAP_EVENT_C4H_02H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_04H) \ -__PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_00H) \ +__PMC_EV_ALIAS("BR_MISP_RETIRED.ANY_P", IAP_EVENT_C5H_00H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_01H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.NEAR_CALL", IAP_EVENT_C5H_02H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_04H) \ From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 12 22:11:31 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B968E106564A; Tue, 12 Oct 2010 22:11:31 +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 A6E478FC13; Tue, 12 Oct 2010 22:11:31 +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 o9CMBVn3063712; Tue, 12 Oct 2010 22:11:31 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CMBVTX063710; Tue, 12 Oct 2010 22:11:31 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010122211.o9CMBVTX063710@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 12 Oct 2010 22:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213754 - stable/7/usr.sbin/pmccontrol X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 22:11:31 -0000 Author: gnn Date: Tue Oct 12 22:11:31 2010 New Revision: 213754 URL: http://svn.freebsd.org/changeset/base/213754 Log: MFC 213691: Add code to print the number and type of the CPU that is present in the system as well has how many PMCs there are per CPU. In this code CPU and core are equivalent. Modified: stable/7/usr.sbin/pmccontrol/pmccontrol.c Directory Properties: stable/7/usr.sbin/pmccontrol/ (props changed) Modified: stable/7/usr.sbin/pmccontrol/pmccontrol.c ============================================================================== --- stable/7/usr.sbin/pmccontrol/pmccontrol.c Tue Oct 12 22:10:07 2010 (r213753) +++ stable/7/usr.sbin/pmccontrol/pmccontrol.c Tue Oct 12 22:11:31 2010 (r213754) @@ -243,6 +243,10 @@ pmcc_do_list_state(void) if (pmc_cpuinfo(&pc) != 0) err(EX_OSERR, "Unable to determine CPU information"); + printf("%d %s CPUs present, with %d PMCs per CPU\n", pc->pm_ncpu, + pmc_name_of_cputype(pc->pm_cputype), + pc->pm_npmc); + dummy = sizeof(logical_cpus_mask); if (sysctlbyname("machdep.logical_cpus_mask", &logical_cpus_mask, &dummy, NULL, 0) < 0) From owner-svn-src-stable-7@FreeBSD.ORG Thu Oct 14 02:19:53 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DB12106564A; Thu, 14 Oct 2010 02:19:53 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C3888FC0C; Thu, 14 Oct 2010 02:19: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 o9E2JrZw009446; Thu, 14 Oct 2010 02:19:53 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9E2JrTL009444; Thu, 14 Oct 2010 02:19:53 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010140219.o9E2JrTL009444@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 14 Oct 2010 02:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213826 - stable/7/usr.bin/ruptime X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 02:19:53 -0000 Author: obrien Date: Thu Oct 14 02:19:53 2010 New Revision: 213826 URL: http://svn.freebsd.org/changeset/base/213826 Log: MFC r212771: Increase the hostname display width to >12 characters. Modified: stable/7/usr.bin/ruptime/ruptime.c Directory Properties: stable/7/usr.bin/ruptime/ (props changed) Modified: stable/7/usr.bin/ruptime/ruptime.c ============================================================================== --- stable/7/usr.bin/ruptime/ruptime.c Thu Oct 14 02:10:49 2010 (r213825) +++ stable/7/usr.bin/ruptime/ruptime.c Thu Oct 14 02:19:53 2010 (r213826) @@ -244,12 +244,12 @@ ruptime(const char *host, int aflg, int for (i = 0; i < (int)nhosts; i++) { hsp = &hs[i]; if (ISDOWN(hsp)) { - (void)printf("%-12.12s%s\n", hsp->hs_wd->wd_hostname, + (void)printf("%-25.25s%s\n", hsp->hs_wd->wd_hostname, interval(now - hsp->hs_wd->wd_recvtime, "down")); continue; } (void)printf( - "%-12.12s%s, %4d user%s load %*.2f, %*.2f, %*.2f\n", + "%-25.25s%s, %4d user%s load %*.2f, %*.2f, %*.2f\n", hsp->hs_wd->wd_hostname, interval((time_t)hsp->hs_wd->wd_sendtime - (time_t)hsp->hs_wd->wd_boottime, " up"), From owner-svn-src-stable-7@FreeBSD.ORG Thu Oct 14 03:13:21 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3961C106564A; Thu, 14 Oct 2010 03:13:21 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D89D8FC1D; Thu, 14 Oct 2010 03:13:21 +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 o9E3DKWJ010973; Thu, 14 Oct 2010 03:13:20 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9E3DKE9010970; Thu, 14 Oct 2010 03:13:20 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010140313.o9E3DKE9010970@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 14 Oct 2010 03:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213828 - stable/7/usr.bin/script X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 03:13:21 -0000 Author: obrien Date: Thu Oct 14 03:13:20 2010 New Revision: 213828 URL: http://svn.freebsd.org/changeset/base/213828 Log: MFC r212770 & r212832: + Add the SCRIPT environmental variable to the sub-shell. + Add the 'command' argument (if supplied on the command line) to the typescript file. Modified: stable/7/usr.bin/script/script.1 stable/7/usr.bin/script/script.c Directory Properties: stable/7/usr.bin/script/ (props changed) Modified: stable/7/usr.bin/script/script.1 ============================================================================== --- stable/7/usr.bin/script/script.1 Thu Oct 14 03:11:41 2010 (r213827) +++ stable/7/usr.bin/script/script.1 Thu Oct 14 03:13:20 2010 (r213828) @@ -114,9 +114,22 @@ The utility works best with commands that do not manipulate the screen. The results are meant to emulate a hardcopy terminal, not an addressable one. .Sh ENVIRONMENT -The following environment variable is utilized by +The following environment variables are utilized by .Nm : .Bl -tag -width SHELL +.It Ev SCRIPT +The +.Ev SCRIPT +environment variable is added to the sub-shell. +If +.Ev SCRIPT +already existed in the users environment, +its value is overwritten within the sub-shell. +The value of +.Ev SCRIPT +is the name of the +.Ar typescript +file. .It Ev SHELL If the variable .Ev SHELL Modified: stable/7/usr.bin/script/script.c ============================================================================== --- stable/7/usr.bin/script/script.c Thu Oct 14 03:11:41 2010 (r213827) +++ stable/7/usr.bin/script/script.c Thu Oct 14 03:13:20 2010 (r213828) @@ -241,14 +241,21 @@ void doshell(char **av) { const char *shell; + int k; shell = getenv("SHELL"); if (shell == NULL) shell = _PATH_BSHELL; + if (av[0]) + for (k = 0 ; av[k] ; ++k) + fprintf(fscript, "%s%s", k ? " " : "", av[k]); + fprintf(fscript, "\r\n"); + (void)close(master); (void)fclose(fscript); login_tty(slave); + setenv("SCRIPT", fname, 1); if (av[0]) { execvp(av[0], av); warn("%s", av[0]); From owner-svn-src-stable-7@FreeBSD.ORG Thu Oct 14 18:02:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FC0F106564A; Thu, 14 Oct 2010 18:02:32 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43FA78FC12; Thu, 14 Oct 2010 18:02: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 o9EI2WWJ032054; Thu, 14 Oct 2010 18:02:32 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EI2Wvn032052; Thu, 14 Oct 2010 18:02:32 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201010141802.o9EI2Wvn032052@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 14 Oct 2010 18:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213843 - stable/7/sys/cam/scsi X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 18:02:32 -0000 Author: jh Date: Thu Oct 14 18:02:31 2010 New Revision: 213843 URL: http://svn.freebsd.org/changeset/base/213843 Log: MFC r200036 by scottl: Fix several cases where the periph lock was held over malloc. PR: kern/130735 Modified: stable/7/sys/cam/scsi/scsi_cd.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_cd.c Thu Oct 14 17:57:52 2010 (r213842) +++ stable/7/sys/cam/scsi/scsi_cd.c Thu Oct 14 18:02:31 2010 (r213843) @@ -2666,12 +2666,10 @@ cdioctl(struct disk *dp, u_long cmd, voi authinfo = (struct dvd_authinfo *)addr; - cam_periph_lock(periph); if (cmd == DVDIOCREPORTKEY) error = cdreportkey(periph, authinfo); else error = cdsendkey(periph, authinfo); - cam_periph_unlock(periph); break; } case DVDIOCREADSTRUCTURE: { @@ -2679,9 +2677,7 @@ cdioctl(struct disk *dp, u_long cmd, voi dvdstruct = (struct dvd_struct *)addr; - cam_periph_lock(periph); error = cdreaddvdstructure(periph, dvdstruct); - cam_periph_unlock(periph); break; } @@ -3726,8 +3722,6 @@ cdreportkey(struct cam_periph *periph, s databuf = NULL; lba = 0; - ccb = cdgetccb(periph, /* priority */ 1); - switch (authinfo->format) { case DVD_REPORT_AGID: length = sizeof(struct scsi_report_key_data_agid); @@ -3753,9 +3747,7 @@ cdreportkey(struct cam_periph *periph, s length = 0; break; default: - error = EINVAL; - goto bailout; - break; /* NOTREACHED */ + return (EINVAL); } if (length != 0) { @@ -3763,6 +3755,8 @@ cdreportkey(struct cam_periph *periph, s } else databuf = NULL; + cam_periph_lock(periph); + ccb = cdgetccb(periph, /* priority */ 1); scsi_report_key(&ccb->csio, /* retries */ 1, @@ -3863,12 +3857,14 @@ cdreportkey(struct cam_periph *periph, s goto bailout; break; /* NOTREACHED */ } + bailout: + xpt_release_ccb(ccb); + cam_periph_unlock(periph); + if (databuf != NULL) free(databuf, M_DEVBUF); - xpt_release_ccb(ccb); - return(error); } @@ -3883,8 +3879,6 @@ cdsendkey(struct cam_periph *periph, str error = 0; databuf = NULL; - ccb = cdgetccb(periph, /* priority */ 1); - switch(authinfo->format) { case DVD_SEND_CHALLENGE: { struct scsi_report_key_data_challenge *challenge_data; @@ -3936,11 +3930,12 @@ cdsendkey(struct cam_periph *periph, str break; } default: - error = EINVAL; - goto bailout; - break; /* NOTREACHED */ + return (EINVAL); } + cam_periph_lock(periph); + ccb = cdgetccb(periph, /* priority */ 1); + scsi_send_key(&ccb->csio, /* retries */ 1, /* cbfcnp */ cddone, @@ -3955,13 +3950,12 @@ cdsendkey(struct cam_periph *periph, str error = cdrunccb(ccb, cderror, /*cam_flags*/CAM_RETRY_SELTO, /*sense_flags*/SF_RETRY_UA); -bailout: + xpt_release_ccb(ccb); + cam_periph_unlock(periph); if (databuf != NULL) free(databuf, M_DEVBUF); - xpt_release_ccb(ccb); - return(error); } @@ -3979,8 +3973,6 @@ cdreaddvdstructure(struct cam_periph *pe /* The address is reserved for many of the formats */ address = 0; - ccb = cdgetccb(periph, /* priority */ 1); - switch(dvdstruct->format) { case DVD_STRUCT_PHYSICAL: length = sizeof(struct scsi_read_dvd_struct_data_physical); @@ -3998,13 +3990,7 @@ cdreaddvdstructure(struct cam_periph *pe length = sizeof(struct scsi_read_dvd_struct_data_manufacturer); break; case DVD_STRUCT_CMI: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_copy_manage); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_PROTDISCID: length = sizeof(struct scsi_read_dvd_struct_data_prot_discid); break; @@ -4021,21 +4007,9 @@ cdreaddvdstructure(struct cam_periph *pe length = sizeof(struct scsi_read_dvd_struct_data_spare_area); break; case DVD_STRUCT_RMD_LAST: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_rmd_borderout); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_RMD_RMA: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_rmd); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_PRERECORDED: length = sizeof(struct scsi_read_dvd_struct_data_leadin); break; @@ -4043,13 +4017,7 @@ cdreaddvdstructure(struct cam_periph *pe length = sizeof(struct scsi_read_dvd_struct_data_disc_id); break; case DVD_STRUCT_DCB: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_dcb); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_LIST: /* * This is the maximum allocation length for the READ DVD @@ -4061,9 +4029,7 @@ cdreaddvdstructure(struct cam_periph *pe length = 65535; break; default: - error = EINVAL; - goto bailout; - break; /* NOTREACHED */ + return (EINVAL); } if (length != 0) { @@ -4071,6 +4037,9 @@ cdreaddvdstructure(struct cam_periph *pe } else databuf = NULL; + cam_periph_lock(periph); + ccb = cdgetccb(periph, /* priority */ 1); + scsi_read_dvd_structure(&ccb->csio, /* retries */ 1, /* cbfcnp */ cddone, @@ -4158,13 +4127,14 @@ cdreaddvdstructure(struct cam_periph *pe min(sizeof(dvdstruct->data), dvdstruct->length)); break; } + bailout: + xpt_release_ccb(ccb); + cam_periph_unlock(periph); if (databuf != NULL) free(databuf, M_DEVBUF); - xpt_release_ccb(ccb); - return(error); } From owner-svn-src-stable-7@FreeBSD.ORG Thu Oct 14 21:17:33 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36E0C1065693; Thu, 14 Oct 2010 21:17:33 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 249C68FC16; Thu, 14 Oct 2010 21:17:33 +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 o9ELHXR8037623; Thu, 14 Oct 2010 21:17:33 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELHXMG037621; Thu, 14 Oct 2010 21:17:33 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142117.o9ELHXMG037621@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:17:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213860 - stable/7/usr.bin/calendar/calendars X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:17:33 -0000 Author: edwin Date: Thu Oct 14 21:17:32 2010 New Revision: 213860 URL: http://svn.freebsd.org/changeset/base/213860 Log: MFC of r213032 r213033 Fix location and year of the Battle of the Plains of Abraham PR: 150504 Submitted by: Douglas Berry Modified: stable/7/usr.bin/calendar/calendars/calendar.history Directory Properties: stable/7/usr.bin/calendar/ (props changed) Modified: stable/7/usr.bin/calendar/calendars/calendar.history ============================================================================== --- stable/7/usr.bin/calendar/calendars/calendar.history Thu Oct 14 21:16:14 2010 (r213859) +++ stable/7/usr.bin/calendar/calendars/calendar.history Thu Oct 14 21:17:32 2010 (r213860) @@ -303,7 +303,7 @@ 09/12 German paratroopers rescue Mussolini from captivity in Rome, 1943 09/12 Germany annexes Sudetenland, 1938 09/13 58° C (136.4° F) measured at el Azizia, Libya, 1922 -09/13 British defeat the French at Abraham near Quebec City, 1788 +09/13 British defeat the French at the Plains of Abraham, just outside the walls of Quebec City, 1759 09/13 Building of Hadrian's Wall begun, 122 09/13 Chiang Kai-Shek becomes president of China, 1943 09/14 Benjamin Franklin is sent to France as an American minister, 1778 From owner-svn-src-stable-7@FreeBSD.ORG Thu Oct 14 21:19:05 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11B6B1065673; Thu, 14 Oct 2010 21:19:05 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F34408FC1D; Thu, 14 Oct 2010 21:19:04 +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 o9ELJ4UA037771; Thu, 14 Oct 2010 21:19:04 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELJ4ue037769; Thu, 14 Oct 2010 21:19:04 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142119.o9ELJ4ue037769@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213862 - stable/7/usr.bin/calendar/calendars/fr_FR.ISO8859-1 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:19:05 -0000 Author: edwin Date: Thu Oct 14 21:19:04 2010 New Revision: 213862 URL: http://svn.freebsd.org/changeset/base/213862 Log: MFC of r212163 Adding a missing firstname (Monique) PR: conf/150049 Submitted by: Thierry Thomas Modified: stable/7/usr.bin/calendar/calendars/fr_FR.ISO8859-1/calendar.fetes Directory Properties: stable/7/usr.bin/calendar/ (props changed) Modified: stable/7/usr.bin/calendar/calendars/fr_FR.ISO8859-1/calendar.fetes ============================================================================== --- stable/7/usr.bin/calendar/calendars/fr_FR.ISO8859-1/calendar.fetes Thu Oct 14 21:18:18 2010 (r213861) +++ stable/7/usr.bin/calendar/calendars/fr_FR.ISO8859-1/calendar.fetes Thu Oct 14 21:19:04 2010 (r213862) @@ -382,7 +382,7 @@ LANG=fr_FR.ISO8859-1 08/26 Bonne fête aux Zéphirin ! 08/26 Aujourd'hui, c'est la St(e) Eulade. 08/27 N'oubliez pas les Edwige ! -08/27 Bonne fête aux Joseph ! +08/27 Bonne fête aux Monique et aux Joseph ! 08/28 Aujourd'hui, c'est la St(e) Augustin. 08/29 N'oubliez pas les Sabine ! 08/30 Bonne fête aux Fiacre ! From owner-svn-src-stable-7@FreeBSD.ORG Thu Oct 14 21:29:50 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF66B106566C; Thu, 14 Oct 2010 21:29:50 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD3488FC1A; Thu, 14 Oct 2010 21:29:50 +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 o9ELToWT038206; Thu, 14 Oct 2010 21:29:50 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELToEt038204; Thu, 14 Oct 2010 21:29:50 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142129.o9ELToEt038204@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213865 - stable/7/usr.bin/calendar/calendars X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:29:51 -0000 Author: edwin Date: Thu Oct 14 21:29:50 2010 New Revision: 213865 URL: http://svn.freebsd.org/changeset/base/213865 Log: MFC of r206568 Allerheilingen -> Allerheiligen Submitted by: Ronald Klop Modified: stable/7/usr.bin/calendar/calendars/calendar.dutch Directory Properties: stable/7/usr.bin/calendar/ (props changed) Modified: stable/7/usr.bin/calendar/calendars/calendar.dutch ============================================================================== --- stable/7/usr.bin/calendar/calendars/calendar.dutch Thu Oct 14 21:26:06 2010 (r213864) +++ stable/7/usr.bin/calendar/calendars/calendar.dutch Thu Oct 14 21:29:50 2010 (r213865) @@ -17,7 +17,7 @@ LANG=nl_NL.ISO8859-15 05/04 Dodenherdenking 05/05 Bevrijdingsdag 10/04 Dierendag -11/01 Allerheilingen +11/01 Allerheiligen 11/02 Allerzielen 11/11 Sint Maarten 11/11 Elfde-van-de-elfde From owner-svn-src-stable-7@FreeBSD.ORG Thu Oct 14 21:51:54 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34D981065695; Thu, 14 Oct 2010 21:51:54 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 228C08FC31; Thu, 14 Oct 2010 21:51: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 o9ELpsXQ039017; Thu, 14 Oct 2010 21:51:54 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELpscd039015; Thu, 14 Oct 2010 21:51:54 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142151.o9ELpscd039015@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213874 - stable/7/usr.bin/calendar/calendars X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:51:54 -0000 Author: edwin Date: Thu Oct 14 21:51:53 2010 New Revision: 213874 URL: http://svn.freebsd.org/changeset/base/213874 Log: Remove calendar.judaic from RELENG_7: - It is out of date. - It is properly fixed in HEAD and RELENG_8. Deleted: stable/7/usr.bin/calendar/calendars/calendar.judaic Modified: stable/7/usr.bin/calendar/calendars/calendar.world Modified: stable/7/usr.bin/calendar/calendars/calendar.world ============================================================================== --- stable/7/usr.bin/calendar/calendars/calendar.world Thu Oct 14 21:46:53 2010 (r213873) +++ stable/7/usr.bin/calendar/calendars/calendar.world Thu Oct 14 21:51:53 2010 (r213874) @@ -13,7 +13,6 @@ #include #include #include -#include #include #endif /* !_calendar_world_ */ From owner-svn-src-stable-7@FreeBSD.ORG Fri Oct 15 14:33:47 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E875106566C; Fri, 15 Oct 2010 14:33:47 +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 0CBA68FC08; Fri, 15 Oct 2010 14:33: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 o9FEXkdC063849; Fri, 15 Oct 2010 14:33:46 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FEXkg2063847; Fri, 15 Oct 2010 14:33:46 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201010151433.o9FEXkg2063847@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 15 Oct 2010 14:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213891 - stable/7/sys/net X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 14:33:47 -0000 Author: bz Date: Fri Oct 15 14:33:46 2010 New Revision: 213891 URL: http://svn.freebsd.org/changeset/base/213891 Log: MFC r185963 (by csjp in 2008): Consider processes attaching/detaching from tun(4) devices as being link state changes. This change modifies tunopen and tunclose to call the if_link_state_change() function. Among other things, this will result in devd(8) receiving events from devctl(4) for linkup/link down. This allows us to do several useful things, including initializing tunnel parameters and adding routes. Discussed on: freebsd-net Modified: stable/7/sys/net/if_tun.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if_tun.c ============================================================================== --- stable/7/sys/net/if_tun.c Fri Oct 15 05:42:35 2010 (r213890) +++ stable/7/sys/net/if_tun.c Fri Oct 15 14:33:46 2010 (r213891) @@ -413,6 +413,7 @@ tunopen(struct cdev *dev, int flag, int tp->tun_flags |= TUN_OPEN; ifp = TUN2IFP(tp); + if_link_state_change(ifp, LINK_STATE_UP); TUNDEBUG(ifp, "open\n"); mtx_unlock(&tp->tun_mtx); @@ -465,6 +466,7 @@ tunclose(struct cdev *dev, int foo, int if_purgeaddrs(ifp); mtx_lock(&tp->tun_mtx); } + if_link_state_change(ifp, LINK_STATE_DOWN); funsetown(&tp->tun_sigio); selwakeuppri(&tp->tun_rsel, PZERO + 1); From owner-svn-src-stable-7@FreeBSD.ORG Fri Oct 15 15:06:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62B23106564A; Fri, 15 Oct 2010 15:06:32 +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 50CC78FC13; Fri, 15 Oct 2010 15:06: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 o9FF6WOI065165; Fri, 15 Oct 2010 15:06:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FF6WxG065163; Fri, 15 Oct 2010 15:06:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201010151506.o9FF6WxG065163@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 15 Oct 2010 15:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213895 - stable/7/sys/net X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 15:06:32 -0000 Author: bz Date: Fri Oct 15 15:06:32 2010 New Revision: 213895 URL: http://svn.freebsd.org/changeset/base/213895 Log: MFC r186391,186483,186497 (qingli, kmacy 21 months ago): r186391: Provide a condition variable to delay the cloned interface destroy operation until the referenced clone device has been closed by the process properly. The behavior is now consistently with the previous release. r186483: - Close a race during which the open flag could be cleared but the tun_softc would still be referenced by adding a separate TUN_CLOSED flag that is set after tunclose is done referencing it. - drop the tun_mtx after the flag check to avoid holding it across if_detach which can recurse in to if_tun.c r186497: The "tun?" dev need not be opened at all. One is allowed to perform the following operations, e.g.: 1) ifconfig tun0 create 2) ifconfig tun0 10.1.1.1 10.1.1.2 3) route add -net 192.103.54.0/24 -iface tun0 4) ifconfig tun0 destroy If cv wait on the TUN_CLOSED flag, then the last operation (4) will block forever. Revert the previous changes and fix the mtx_unlock() leak. PR: kern/116837 Submitted by: Mikolaj Golub (to.my.trociny gmail.com) (Not used the patch, just did the MFC) Modified: stable/7/sys/net/if_tun.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if_tun.c ============================================================================== --- stable/7/sys/net/if_tun.c Fri Oct 15 15:00:30 2010 (r213894) +++ stable/7/sys/net/if_tun.c Fri Oct 15 15:06:32 2010 (r213895) @@ -56,6 +56,7 @@ #include #include +#include #include @@ -92,6 +93,7 @@ struct tun_softc { struct sigio *tun_sigio; /* information for async I/O */ struct selinfo tun_rsel; /* read select */ struct mtx tun_mtx; /* protect mutable softc fields */ + struct cv tun_cv; /* protect against ref'd dev destroy */ }; #define TUN2IFP(sc) ((sc)->tun_ifp) @@ -242,8 +244,11 @@ tun_destroy(struct tun_softc *tp) struct cdev *dev; /* Unlocked read. */ - KASSERT((tp->tun_flags & TUN_OPEN) == 0, - ("tununits is out of sync - unit %d", TUN2IFP(tp)->if_dunit)); + mtx_lock(&tp->tun_mtx); + if ((tp->tun_flags & TUN_OPEN) != 0) + cv_wait_unlock(&tp->tun_cv, &tp->tun_mtx); + else + mtx_unlock(&tp->tun_mtx); dev = tp->tun_dev; bpfdetach(TUN2IFP(tp)); @@ -252,6 +257,7 @@ tun_destroy(struct tun_softc *tp) destroy_dev(dev); knlist_destroy(&tp->tun_rsel.si_note); mtx_destroy(&tp->tun_mtx); + cv_destroy(&tp->tun_cv); free(tp, M_TUN); } @@ -353,6 +359,7 @@ tuncreate(const char *name, struct cdev MALLOC(sc, struct tun_softc *, sizeof(*sc), M_TUN, M_WAITOK | M_ZERO); mtx_init(&sc->tun_mtx, "tun_mtx", NULL, MTX_DEF); + cv_init(&sc->tun_cv, "tun_condvar"); sc->tun_flags = TUN_INITED; sc->tun_dev = dev; mtx_lock(&tunmtx); @@ -472,6 +479,8 @@ tunclose(struct cdev *dev, int foo, int selwakeuppri(&tp->tun_rsel, PZERO + 1); KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); TUNDEBUG (ifp, "closed\n"); + + cv_broadcast(&tp->tun_cv); mtx_unlock(&tp->tun_mtx); return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Sat Oct 16 11:41:21 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 395C01065670; Sat, 16 Oct 2010 11:41:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 270298FC14; Sat, 16 Oct 2010 11:41:21 +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 o9GBfLA4075585; Sat, 16 Oct 2010 11:41:21 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GBfLG9075583; Sat, 16 Oct 2010 11:41:21 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010161141.o9GBfLG9075583@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 11:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213922 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 11:41:21 -0000 Author: avg Date: Sat Oct 16 11:41:20 2010 New Revision: 213922 URL: http://svn.freebsd.org/changeset/base/213922 Log: MFC r213527: vm.kmem_map_size: a sysctl to query current kmem_map->size Modified: stable/7/sys/kern/kern_malloc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_malloc.c ============================================================================== --- stable/7/sys/kern/kern_malloc.c Sat Oct 16 11:24:27 2010 (r213921) +++ stable/7/sys/kern/kern_malloc.c Sat Oct 16 11:41:20 2010 (r213922) @@ -197,6 +197,11 @@ static u_int vm_kmem_size_scale; SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RDTUN, &vm_kmem_size_scale, 0, "Scale factor for kernel memory size"); +static int sysctl_kmem_map_size(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vm, OID_AUTO, kmem_map_size, + CTLFLAG_RD | CTLTYPE_ULONG | CTLFLAG_MPSAFE, NULL, 0, + sysctl_kmem_map_size, "LU", "Current kmem_map allocation size"); + /* * The malloc_mtx protects the kmemstatistics linked list. */ @@ -233,6 +238,15 @@ SYSCTL_INT(_debug_malloc, OID_AUTO, fail &malloc_failure_count, 0, "Number of imposed M_NOWAIT malloc failures"); #endif +static int +sysctl_kmem_map_size(SYSCTL_HANDLER_ARGS) +{ + u_long size; + + size = kmem_map->size; + return (sysctl_handle_long(oidp, &size, 0, req)); +} + int malloc_last_fail(void) { From owner-svn-src-stable-7@FreeBSD.ORG Sat Oct 16 11:44:58 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFD4E106566C; Sat, 16 Oct 2010 11:44:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADAFF8FC1D; Sat, 16 Oct 2010 11:44:58 +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 o9GBiwVX075722; Sat, 16 Oct 2010 11:44:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GBiwoM075720; Sat, 16 Oct 2010 11:44:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010161144.o9GBiwoM075720@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 11:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213923 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 11:44:58 -0000 Author: avg Date: Sat Oct 16 11:44:58 2010 New Revision: 213923 URL: http://svn.freebsd.org/changeset/base/213923 Log: MFC r213651: add kmem_map_free sysctl: query largest contiguous free range in kmem_map Modified: stable/7/sys/kern/kern_malloc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_malloc.c ============================================================================== --- stable/7/sys/kern/kern_malloc.c Sat Oct 16 11:41:20 2010 (r213922) +++ stable/7/sys/kern/kern_malloc.c Sat Oct 16 11:44:58 2010 (r213923) @@ -202,6 +202,11 @@ SYSCTL_PROC(_vm, OID_AUTO, kmem_map_size CTLFLAG_RD | CTLTYPE_ULONG | CTLFLAG_MPSAFE, NULL, 0, sysctl_kmem_map_size, "LU", "Current kmem_map allocation size"); +static int sysctl_kmem_map_free(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vm, OID_AUTO, kmem_map_free, + CTLFLAG_RD | CTLTYPE_ULONG | CTLFLAG_MPSAFE, NULL, 0, + sysctl_kmem_map_free, "LU", "Largest contiguous free range in kmem_map"); + /* * The malloc_mtx protects the kmemstatistics linked list. */ @@ -247,6 +252,18 @@ sysctl_kmem_map_size(SYSCTL_HANDLER_ARGS return (sysctl_handle_long(oidp, &size, 0, req)); } +static int +sysctl_kmem_map_free(SYSCTL_HANDLER_ARGS) +{ + u_long size; + + vm_map_lock_read(kmem_map); + size = kmem_map->root != NULL ? + kmem_map->root->max_free : kmem_map->size; + vm_map_unlock_read(kmem_map); + return (sysctl_handle_long(oidp, &size, 0, req)); +} + int malloc_last_fail(void) { From owner-svn-src-stable-7@FreeBSD.ORG Sat Oct 16 20:01:41 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB071106566B; Sat, 16 Oct 2010 20:01:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C95D28FC1A; Sat, 16 Oct 2010 20:01:41 +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 o9GK1fOY088466; Sat, 16 Oct 2010 20:01:41 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GK1fuP088464; Sat, 16 Oct 2010 20:01:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010162001.o9GK1fuP088464@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 20:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213935 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 20:01:42 -0000 Author: avg Date: Sat Oct 16 20:01:41 2010 New Revision: 213935 URL: http://svn.freebsd.org/changeset/base/213935 Log: MFC r213648: panic_cpu variable should be volatile Modified: stable/7/sys/kern/kern_shutdown.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_shutdown.c ============================================================================== --- stable/7/sys/kern/kern_shutdown.c Sat Oct 16 19:58:49 2010 (r213934) +++ stable/7/sys/kern/kern_shutdown.c Sat Oct 16 20:01:41 2010 (r213935) @@ -497,10 +497,6 @@ shutdown_reset(void *junk, int howto) /* NOTREACHED */ /* assuming reset worked */ } -#ifdef SMP -static u_int panic_cpu = NOCPU; -#endif - /* * Panic is called on unresolvable fatal errors. It prints "panic: mesg", * and then reboots. If we are called twice, then we avoid trying to sync @@ -509,6 +505,9 @@ static u_int panic_cpu = NOCPU; void panic(const char *fmt, ...) { +#ifdef SMP + static volatile u_int panic_cpu = NOCPU; +#endif struct thread *td = curthread; int bootopt, newpanic; va_list ap;