svn commit: r258336 - head/sys/vm
Author: mav Date: Tue Nov 19 10:05:53 2013 New Revision: 258336 URL: http://svnweb.freebsd.org/changeset/base/258336 Log: Implement soft pressure on UMA cache bucket sizes. Every time system detects low memory condition decrease bucket sizes for each zone by one item. As result, higher memory pressure will push to smaller bucket sizes and so smaller per-CPU caches and so more efficient memory use. Before this change there was no force to oppose buckets growth as result of practically inevitable zone lock conflicts, and after some run time per-CPU caches could consume enough RAM to kill the system. Modified: head/sys/vm/uma_core.c head/sys/vm/uma_int.h Modified: head/sys/vm/uma_core.c == --- head/sys/vm/uma_core.c Tue Nov 19 09:35:20 2013(r258335) +++ head/sys/vm/uma_core.c Tue Nov 19 10:05:53 2013(r258336) @@ -701,6 +701,13 @@ bucket_cache_drain(uma_zone_t zone) bucket_free(zone, bucket, NULL); ZONE_LOCK(zone); } + + /* +* Shrink further bucket sizes. Price of single zone lock collision +* is probably lower then price of global cache drain. +*/ + if (zone->uz_count > zone->uz_count_min) + zone->uz_count--; } static void @@ -1461,6 +1468,7 @@ zone_ctor(void *mem, int size, void *uda zone->uz_fails = 0; zone->uz_sleeps = 0; zone->uz_count = 0; + zone->uz_count_min = 0; zone->uz_flags = 0; zone->uz_warning = NULL; timevalclear(&zone->uz_ratecheck); @@ -1552,6 +1560,7 @@ out: zone->uz_count = bucket_select(zone->uz_size); else zone->uz_count = BUCKET_MAX; + zone->uz_count_min = zone->uz_count; return (0); } Modified: head/sys/vm/uma_int.h == --- head/sys/vm/uma_int.h Tue Nov 19 09:35:20 2013(r258335) +++ head/sys/vm/uma_int.h Tue Nov 19 10:05:53 2013(r258336) @@ -300,7 +300,8 @@ struct uma_zone { volatile u_long uz_fails; /* Total number of alloc failures */ volatile u_long uz_frees; /* Total number of frees */ uint64_tuz_sleeps; /* Total number of alloc sleeps */ - uint16_tuz_count; /* Highest amount of items in bucket */ + uint16_tuz_count; /* Amount of items in full bucket */ + uint16_tuz_count_min; /* Minimal amount of items there */ /* The next three fields are used to print a rate-limited warnings. */ const char *uz_warning;/* Warning to print on failure */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258337 - head/sys/vm
Author: mav Date: Tue Nov 19 10:10:44 2013 New Revision: 258337 URL: http://svnweb.freebsd.org/changeset/base/258337 Log: Add two new UMA bucket zones to store 3 and 9 items per bucket. These new buckets make bucket size self-tuning more soft and precise. Without them there are buckets for 1, 5, 13, 29, ... items. While at bigger sizes difference about 2x is fine, at smallest ones it is 5x and 2.6x respectively. New buckets make that line look like 1, 3, 5, 9, 13, 29, reducing jumps between steps, making algorithm work softer, allocating and freeing memory in better fitting chunks. Otherwise there is quite a big gap between allocating 128K and 5x128K of RAM at once. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c == --- head/sys/vm/uma_core.c Tue Nov 19 10:05:53 2013(r258336) +++ head/sys/vm/uma_core.c Tue Nov 19 10:10:44 2013(r258337) @@ -207,7 +207,9 @@ struct uma_bucket_zone { struct uma_bucket_zone bucket_zones[] = { { NULL, "4 Bucket", BUCKET_SIZE(4), 4096 }, + { NULL, "6 Bucket", BUCKET_SIZE(6), 3072 }, { NULL, "8 Bucket", BUCKET_SIZE(8), 2048 }, + { NULL, "12 Bucket", BUCKET_SIZE(12), 1536 }, { NULL, "16 Bucket", BUCKET_SIZE(16), 1024 }, { NULL, "32 Bucket", BUCKET_SIZE(32), 512 }, { NULL, "64 Bucket", BUCKET_SIZE(64), 256 }, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258338 - head/sys/vm
Author: mav Date: Tue Nov 19 10:17:10 2013 New Revision: 258338 URL: http://svnweb.freebsd.org/changeset/base/258338 Log: Grow UMA zone bucket size also on lock congestion during item free. Lock congestion is the same, whether it happens on alloc or free, so handle it equally. Now that we have back pressure, there is no problem to grow buckets a bit faster. Any way growth is much slower then in 9.x. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c == --- head/sys/vm/uma_core.c Tue Nov 19 10:10:44 2013(r258337) +++ head/sys/vm/uma_core.c Tue Nov 19 10:17:10 2013(r258338) @@ -2529,6 +2529,7 @@ uma_zfree_arg(uma_zone_t zone, void *ite { uma_cache_t cache; uma_bucket_t bucket; + int lockfail; int cpu; #ifdef UMA_DEBUG_ALLOC_1 @@ -2613,7 +2614,12 @@ zfree_start: if (zone->uz_count == 0 || bucketdisable) goto zfree_item; - ZONE_LOCK(zone); + lockfail = 0; + if (ZONE_TRYLOCK(zone) == 0) { + /* Record contention to size the buckets. */ + ZONE_LOCK(zone); + lockfail = 1; + } critical_enter(); cpu = curcpu; cache = &zone->uz_cpu[cpu]; @@ -2647,7 +2653,12 @@ zfree_start: /* We are no longer associated with this CPU. */ critical_exit(); - /* And the zone.. */ + /* +* We bump the uz count when the cache size is insufficient to +* handle the working set. +*/ + if (lockfail && zone->uz_count < BUCKET_MAX) + zone->uz_count++; ZONE_UNLOCK(zone); #ifdef UMA_DEBUG_ALLOC ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r258328 - head/sys/net
On 19.11.2013 02:58, George V. Neville-Neil wrote: Author: gnn Date: Mon Nov 18 22:58:14 2013 New Revision: 258328 URL: http://svnweb.freebsd.org/changeset/base/258328 Log: Allow ethernet drivers to pass in packets connected via the nextpkt pointer. Handling packets in this way allows drivers to amortize work during packet reception. Great! First, but important step in kernel batching :) Submitted by: Vijay Singh Sponsored by:NetApp Modified: head/sys/net/if_ethersubr.c Modified: head/sys/net/if_ethersubr.c == --- head/sys/net/if_ethersubr.c Mon Nov 18 22:55:50 2013(r258327) +++ head/sys/net/if_ethersubr.c Mon Nov 18 22:58:14 2013(r258328) @@ -708,13 +708,25 @@ static void ether_input(struct ifnet *ifp, struct mbuf *m) { + struct mbuf *mn; + /* -* We will rely on rcvif being set properly in the deferred context, -* so assert it is correct here. +* The drivers are allowed to pass in a chain of packets linked with +* m_nextpkt. We split them up into separate packets here and pass +* them up. This allows the drivers to amortize the receive lock. */ - KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); + while (m) { + mn = m->m_nextpkt; + m->m_nextpkt = NULL; - netisr_dispatch(NETISR_ETHER, m); + /* +* We will rely on rcvif being set properly in the deferred context, +* so assert it is correct here. +*/ + KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); + netisr_dispatch(NETISR_ETHER, m); + m = mn; + } } /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258340 - head/sys/vm
Author: mav Date: Tue Nov 19 10:51:46 2013 New Revision: 258340 URL: http://svnweb.freebsd.org/changeset/base/258340 Log: Implement mechanism to safely but slowly purge UMA per-CPU caches. This is a last resort for very low memory condition in case other measures to free memory were ineffective. Sequentially cycle through all CPUs and extract per-CPU cache buckets into zone cache from where they can be freed. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c == --- head/sys/vm/uma_core.c Tue Nov 19 10:39:48 2013(r258339) +++ head/sys/vm/uma_core.c Tue Nov 19 10:51:46 2013(r258340) @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -684,6 +685,78 @@ cache_drain(uma_zone_t zone) ZONE_UNLOCK(zone); } +static void +cache_shrink(uma_zone_t zone) +{ + + if (zone->uz_flags & UMA_ZFLAG_INTERNAL) + return; + + ZONE_LOCK(zone); + zone->uz_count = (zone->uz_count_min + zone->uz_count) / 2; + ZONE_UNLOCK(zone); +} + +static void +cache_drain_safe_cpu(uma_zone_t zone) +{ + uma_cache_t cache; + + if (zone->uz_flags & UMA_ZFLAG_INTERNAL) + return; + + ZONE_LOCK(zone); + critical_enter(); + cache = &zone->uz_cpu[curcpu]; + if (cache->uc_allocbucket) { + LIST_INSERT_HEAD(&zone->uz_buckets, cache->uc_allocbucket, + ub_link); + cache->uc_allocbucket = NULL; + } + if (cache->uc_freebucket) { + LIST_INSERT_HEAD(&zone->uz_buckets, cache->uc_freebucket, + ub_link); + cache->uc_freebucket = NULL; + } + critical_exit(); + ZONE_UNLOCK(zone); +} + +/* + * Safely drain per-CPU caches of a zone(s) to alloc bucket. + * This is an expensive call because it needs to bind to all CPUs + * one by one and enter a critical section on each of them in order + * to safely access their cache buckets. + * Zone lock must not be held on call this function. + */ +static void +cache_drain_safe(uma_zone_t zone) +{ + int cpu; + + /* +* Polite bucket sizes shrinking was not enouth, shrink aggressively. +*/ + if (zone) + cache_shrink(zone); + else + zone_foreach(cache_shrink); + + CPU_FOREACH(cpu) { + thread_lock(curthread); + sched_bind(curthread, cpu); + thread_unlock(curthread); + + if (zone) + cache_drain_safe_cpu(zone); + else + zone_foreach(cache_drain_safe_cpu); + } + thread_lock(curthread); + sched_unbind(curthread); + thread_unlock(curthread); +} + /* * Drain the cached buckets from a zone. Expects a locked zone on entry. */ @@ -3068,6 +3141,10 @@ uma_reclaim(void) #endif bucket_enable(); zone_foreach(zone_drain); + if (vm_page_count_min()) { + cache_drain_safe(NULL); + zone_foreach(zone_drain); + } /* * Some slabs may have been freed but this zone will be visited early * we visit again so that we can free pages that are empty once other ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r258328 - head/sys/net
On Mon, 18 Nov 2013, George V. Neville-Neil wrote: Allow ethernet drivers to pass in packets connected via the nextpkt pointer. Handling packets in this way allows drivers to amortize work during packet reception. Submitted by: Vijay Singh Sponsored by: NetApp Currently, it is quite easy to make mistakes regarding individual mbuf chains vs. lists of mbuf chains. This leads me to wonder whether a new type, perhaps simply constructed on the stack before passing in, should be used for KPIs that accept lists of packets. E.g., /* * This structure is almost always allocated on a caller stack, so * cannot itself be queued without memory allocation in most cases. */ struct mbuf_queue { struct mbuf *mq_head; }; int ether_input(struct ifnet *ifp, struct mbuf_queue *m) { ... } ... struct mbuf_queue mq = { m }; return (ether_input(ifp, &mq)); ... That way the compiler can help us figure out where we expect an individual packet but have accidentally leaked a queue. Functions that accept only a single packet could also more agressively assert that m->m_nextpkt is NULL: M_ASSERT_ONEPACKET(m); Robert Modified: head/sys/net/if_ethersubr.c Modified: head/sys/net/if_ethersubr.c == --- head/sys/net/if_ethersubr.c Mon Nov 18 22:55:50 2013(r258327) +++ head/sys/net/if_ethersubr.c Mon Nov 18 22:58:14 2013(r258328) @@ -708,13 +708,25 @@ static void ether_input(struct ifnet *ifp, struct mbuf *m) { + struct mbuf *mn; + /* -* We will rely on rcvif being set properly in the deferred context, -* so assert it is correct here. +* The drivers are allowed to pass in a chain of packets linked with +* m_nextpkt. We split them up into separate packets here and pass +* them up. This allows the drivers to amortize the receive lock. */ - KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); + while (m) { + mn = m->m_nextpkt; + m->m_nextpkt = NULL; - netisr_dispatch(NETISR_ETHER, m); + /* +* We will rely on rcvif being set properly in the deferred context, +* so assert it is correct here. +*/ + KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__)); + netisr_dispatch(NETISR_ETHER, m); + m = mn; + } } /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258342 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mav Date: Tue Nov 19 11:19:07 2013 New Revision: 258342 URL: http://svnweb.freebsd.org/changeset/base/258342 Log: Reenable vfs.zfs.zio.use_uma for amd64, disabled at r209261. On machines with seveal CPUs and enough RAM this can easily twice improve ZFS performance or twice reduce CPU usage. It was disabled three years ago due to memory and KVA exhaustion reports, but our VM subsystem got improved a lot since that time, hopefully enough to make another try. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Nov 19 11:11:51 2013(r258341) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Nov 19 11:19:07 2013(r258342) @@ -39,7 +39,11 @@ SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, zio, CTLFLAG_RW, 0, "ZFS ZIO"); +#if defined(__amd64__) +static int zio_use_uma = 1; +#else static int zio_use_uma = 0; +#endif TUNABLE_INT("vfs.zfs.zio.use_uma", &zio_use_uma); SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, use_uma, CTLFLAG_RDTUN, &zio_use_uma, 0, "Use uma(9) for ZIO allocations"); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r258336 - head/sys/vm
Alexander, On Tue, Nov 19, 2013 at 10:05:53AM +, Alexander Motin wrote: A> Author: mav A> Date: Tue Nov 19 10:05:53 2013 A> New Revision: 258336 A> URL: http://svnweb.freebsd.org/changeset/base/258336 A> A> Log: A> Implement soft pressure on UMA cache bucket sizes. A> A> Every time system detects low memory condition decrease bucket sizes for A> each zone by one item. As result, higher memory pressure will push to A> smaller bucket sizes and so smaller per-CPU caches and so more efficient A> memory use. A> A> Before this change there was no force to oppose buckets growth as result A> of practically inevitable zone lock conflicts, and after some run time A> per-CPU caches could consume enough RAM to kill the system. Brief review of patch tells me that system never recovers from this. uz_count it decremented only and never incremented. A> Modified: A> head/sys/vm/uma_core.c A> head/sys/vm/uma_int.h A> A> Modified: head/sys/vm/uma_core.c A> == A> --- head/sys/vm/uma_core.c Tue Nov 19 09:35:20 2013(r258335) A> +++ head/sys/vm/uma_core.c Tue Nov 19 10:05:53 2013(r258336) A> @@ -701,6 +701,13 @@ bucket_cache_drain(uma_zone_t zone) A> bucket_free(zone, bucket, NULL); A> ZONE_LOCK(zone); A> } A> + A> +/* A> + * Shrink further bucket sizes. Price of single zone lock collision A> + * is probably lower then price of global cache drain. A> + */ A> +if (zone->uz_count > zone->uz_count_min) A> +zone->uz_count--; A> } A> A> static void A> @@ -1461,6 +1468,7 @@ zone_ctor(void *mem, int size, void *uda A> zone->uz_fails = 0; A> zone->uz_sleeps = 0; A> zone->uz_count = 0; A> +zone->uz_count_min = 0; A> zone->uz_flags = 0; A> zone->uz_warning = NULL; A> timevalclear(&zone->uz_ratecheck); A> @@ -1552,6 +1560,7 @@ out: A> zone->uz_count = bucket_select(zone->uz_size); A> else A> zone->uz_count = BUCKET_MAX; A> +zone->uz_count_min = zone->uz_count; A> A> return (0); A> } A> A> Modified: head/sys/vm/uma_int.h A> == A> --- head/sys/vm/uma_int.hTue Nov 19 09:35:20 2013(r258335) A> +++ head/sys/vm/uma_int.hTue Nov 19 10:05:53 2013(r258336) A> @@ -300,7 +300,8 @@ struct uma_zone { A> volatile u_long uz_fails; /* Total number of alloc failures */ A> volatile u_long uz_frees; /* Total number of frees */ A> uint64_tuz_sleeps; /* Total number of alloc sleeps */ A> -uint16_tuz_count; /* Highest amount of items in bucket */ A> +uint16_tuz_count; /* Amount of items in full bucket */ A> +uint16_tuz_count_min; /* Minimal amount of items there */ A> A> /* The next three fields are used to print a rate-limited warnings. */ A> const char *uz_warning;/* Warning to print on failure */ -- Totus tuus, Glebius. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r258336 - head/sys/vm
On Tue, Nov 19, 2013 at 04:11:09PM +0400, Gleb Smirnoff wrote: T> Alexander, T> T> On Tue, Nov 19, 2013 at 10:05:53AM +, Alexander Motin wrote: T> A> Author: mav T> A> Date: Tue Nov 19 10:05:53 2013 T> A> New Revision: 258336 T> A> URL: http://svnweb.freebsd.org/changeset/base/258336 T> A> T> A> Log: T> A> Implement soft pressure on UMA cache bucket sizes. T> A> T> A> Every time system detects low memory condition decrease bucket sizes for T> A> each zone by one item. As result, higher memory pressure will push to T> A> smaller bucket sizes and so smaller per-CPU caches and so more efficient T> A> memory use. T> A> T> A> Before this change there was no force to oppose buckets growth as result T> A> of practically inevitable zone lock conflicts, and after some run time T> A> per-CPU caches could consume enough RAM to kill the system. T> T> Brief review of patch tells me that system never recovers from this. uz_count T> it decremented only and never incremented. Do I understand right that r258338 fixes that? -- Totus tuus, Glebius. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258345 - head
Author: tijl Date: Tue Nov 19 13:32:24 2013 New Revision: 258345 URL: http://svnweb.freebsd.org/changeset/base/258345 Log: One more BIND remnant: /etc/mtree/BIND.chroot.dist Discussed with: des Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Tue Nov 19 12:21:47 2013(r258344) +++ head/ObsoleteFiles.inc Tue Nov 19 13:32:24 2013(r258345) @@ -132,6 +132,7 @@ OLD_FILES+=usr/bin/gnu-ranlib OLD_FILES+=usr/share/man/man1/gnu-ar.1.gz OLD_FILES+=usr/share/man/man1/gnu-ranlib.1.gz # 20130930: BIND removed from base +OLD_FILES+=etc/mtree/BIND.chroot.dist OLD_FILES+=etc/namedb OLD_FILES+=etc/periodic/daily/470.status-named OLD_FILES+=usr/bin/dig ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r258336 - head/sys/vm
On 19.11.2013 14:12, Gleb Smirnoff wrote: On Tue, Nov 19, 2013 at 04:11:09PM +0400, Gleb Smirnoff wrote: T> Alexander, T> T> On Tue, Nov 19, 2013 at 10:05:53AM +, Alexander Motin wrote: T> A> Author: mav T> A> Date: Tue Nov 19 10:05:53 2013 T> A> New Revision: 258336 T> A> URL: http://svnweb.freebsd.org/changeset/base/258336 T> A> T> A> Log: T> A> Implement soft pressure on UMA cache bucket sizes. T> A> T> A> Every time system detects low memory condition decrease bucket sizes for T> A> each zone by one item. As result, higher memory pressure will push to T> A> smaller bucket sizes and so smaller per-CPU caches and so more efficient T> A> memory use. T> A> T> A> Before this change there was no force to oppose buckets growth as result T> A> of practically inevitable zone lock conflicts, and after some run time T> A> per-CPU caches could consume enough RAM to kill the system. T> T> Brief review of patch tells me that system never recovers from this. uz_count T> it decremented only and never incremented. You are wrong. uz_count is incremented in uma_zalloc_arg() same as it was always before. Probably it was too brief review. :) Do I understand right that r258338 fixes that? Not fixes (since there was no bug), but adds second increment point. -- Alexander Motin ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258347 - head/lib/libfetch
Author: bdrewery (ports committer) Date: Tue Nov 19 15:35:26 2013 New Revision: 258347 URL: http://svnweb.freebsd.org/changeset/base/258347 Log: Support SNI in libfetch SNI is Server Name Indentification which is a protocol for TLS that indicates the host that is being connected to at the start of the handshake. It allows to use Virtual Hosts on HTTPS. Submitted by: sbz Submitted by: Michael Gmelin [1] PR: kern/183583 [1] Reviewed by: des Approved by: bapt MFC after:1 week Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c == --- head/lib/libfetch/common.c Tue Nov 19 14:24:25 2013(r258346) +++ head/lib/libfetch/common.c Tue Nov 19 15:35:26 2013(r258347) @@ -829,6 +829,15 @@ fetch_ssl(conn_t *conn, const struct url return (-1); } SSL_set_fd(conn->ssl, conn->sd); + +#if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT) + if (!SSL_set_tlsext_host_name(conn->ssl, URL->host)) { + fprintf(stderr, + "TLS server name indication extension failed for host %s\n", + URL->host); + return (-1); + } +#endif while ((ret = SSL_connect(conn->ssl)) == -1) { ssl_err = SSL_get_error(conn->ssl, ret); if (ssl_err != SSL_ERROR_WANT_READ && ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258348 - head/usr.sbin/pkg
Author: bdrewery (ports committer) Date: Tue Nov 19 15:43:27 2013 New Revision: 258348 URL: http://svnweb.freebsd.org/changeset/base/258348 Log: Follow-up to r258227 and document 'enabled' as a boolean instead of a string. Approved by: bapt MFC after:2 days X-MFC-With: r258227 Modified: head/usr.sbin/pkg/pkg.7 Modified: head/usr.sbin/pkg/pkg.7 == --- head/usr.sbin/pkg/pkg.7 Tue Nov 19 15:35:26 2013(r258347) +++ head/usr.sbin/pkg/pkg.7 Tue Nov 19 15:43:27 2013(r258348) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2013 +.Dd November 19, 2013 .Dt PKG 7 .Os .Sh NAME @@ -108,7 +108,7 @@ FreeBSD: { mirror_type: "srv", signature_type: "none", fingerprints: "/usr/share/keys/pkg", - enabled: "yes" + enabled: yes } .Ed .Bl -tag -width signature_type -compact ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258349 - head/lib/libfetch
Author: bdrewery (ports committer) Date: Tue Nov 19 16:11:03 2013 New Revision: 258349 URL: http://svnweb.freebsd.org/changeset/base/258349 Log: Fix build with GCC SSL_set_tlsext_host_name(3) internally does not modify the host buffer pased to it. So it is safe to DECONST the struct url* here. Reported by: gjb Approved by: bapt (implicit) MFC after:1 week X-MFC-With: r258347 Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c == --- head/lib/libfetch/common.c Tue Nov 19 15:43:27 2013(r258348) +++ head/lib/libfetch/common.c Tue Nov 19 16:11:03 2013(r258349) @@ -831,7 +831,8 @@ fetch_ssl(conn_t *conn, const struct url SSL_set_fd(conn->ssl, conn->sd); #if OPENSSL_VERSION_NUMBER >= 0x0090806fL && !defined(OPENSSL_NO_TLSEXT) - if (!SSL_set_tlsext_host_name(conn->ssl, URL->host)) { + if (!SSL_set_tlsext_host_name(conn->ssl, + __DECONST(struct url *, URL)->host)) { fprintf(stderr, "TLS server name indication extension failed for host %s\n", URL->host); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258350 - head/contrib/llvm/lib/Analysis
Author: dim Date: Tue Nov 19 17:53:19 2013 New Revision: 258350 URL: http://svnweb.freebsd.org/changeset/base/258350 Log: Pull in r191896 from upstream llvm trunk: CaptureTracking: Plug a loophole in the "too many uses" heuristic. The heuristic was added to avoid spending too much compile time in a specially crafted test case (PR17461, PR16474) with many uses on a select or bitcast instruction can still trigger the slow case. Add a check for that case. This only affects compile time, don't have a good way to test it. This fixes the excessive compile time spent on a specific file of the graphics/rawtherapee port. Reported by: mandree MFC after:3 days Modified: head/contrib/llvm/lib/Analysis/CaptureTracking.cpp Modified: head/contrib/llvm/lib/Analysis/CaptureTracking.cpp == --- head/contrib/llvm/lib/Analysis/CaptureTracking.cpp Tue Nov 19 16:11:03 2013(r258349) +++ head/contrib/llvm/lib/Analysis/CaptureTracking.cpp Tue Nov 19 17:53:19 2013(r258350) @@ -146,8 +146,14 @@ void llvm::PointerMayBeCaptured(const Va case Instruction::PHI: case Instruction::Select: // The original value is not captured via this if the new value isn't. + Count = 0; for (Instruction::use_iterator UI = I->use_begin(), UE = I->use_end(); UI != UE; ++UI) { +// If there are lots of uses, conservatively say that the value +// is captured to avoid taking too much compile time. +if (Count++ >= Threshold) + return Tracker->tooManyUses(); + Use *U = &UI.getUse(); if (Visited.insert(U)) if (Tracker->shouldExplore(U)) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r258328 - head/sys/net
Robert Watson wrote this message on Tue, Nov 19, 2013 at 11:04 +: > On Mon, 18 Nov 2013, George V. Neville-Neil wrote: > > > Allow ethernet drivers to pass in packets connected via the nextpkt > > pointer. > > Handling packets in this way allows drivers to amortize work during > > packet reception. > > > > Submitted by: Vijay Singh > > Sponsored by: NetApp > > Currently, it is quite easy to make mistakes regarding individual mbuf > chains vs. lists of mbuf chains. This leads me to wonder whether a new > type, perhaps simply constructed on the stack before passing in, should be > used for KPIs that accept lists of packets. E.g., > > /* >* This structure is almost always allocated on a caller stack, so >* cannot itself be queued without memory allocation in most cases. >*/ > struct mbuf_queue { > struct mbuf *mq_head; > }; > > int > ether_input(struct ifnet *ifp, struct mbuf_queue *m) Why not pass in the structure (not a pointer to the struct) if the struct really is the above? It would even be able to save the stack allocation (not that it's that expensive)... so instead: int ether_input(struct ifnet *ifp, struct mbuf_queue m) You can also create the struct via a macro like: #define MAKE_MQ(mbuf) ((struct mbuf_queue){ (mbuf) }) so below would become: return (ether_input(ifp, MAKE_MQ(m))); Just a thought... But I do like using the compiler for this... The above makes the compiler do the work, and it be transparent from the code side... > { > > ... > } > > ... > struct mbuf_queue mq = { m }; > > return (ether_input(ifp, &mq)); > ... > > That way the compiler can help us figure out where we expect an individual > packet but have accidentally leaked a queue. Functions that accept only a > single packet could also more agressively assert that m->m_nextpkt is NULL: > > M_ASSERT_ONEPACKET(m); -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258351 - head/tools/regression/fsx
Author: avg Date: Tue Nov 19 18:35:01 2013 New Revision: 258351 URL: http://svnweb.freebsd.org/changeset/base/258351 Log: fsx: new option to disable msync(MS_SYNC) after each write via mmaped region This option should be useful for testing if a filesystem uses the unified buffer / page cache. Or, if filesystem's emulation of the unified cache works as expected. This should be the case for e.g. ZFS. MFC after:1 week Modified: head/tools/regression/fsx/fsx.c Modified: head/tools/regression/fsx/fsx.c == --- head/tools/regression/fsx/fsx.c Tue Nov 19 17:53:19 2013 (r258350) +++ head/tools/regression/fsx/fsx.c Tue Nov 19 18:35:01 2013 (r258351) @@ -126,6 +126,7 @@ int randomoplen = 1;/* -O flag disable intseed = 1; /* -S flag */ int mapped_writes = 1; /* -W flag disables */ intmapped_reads = 1; /* -R flag disables it */ +int mapped_msync = 1;/* -U flag disables */ intfsxgoodfd = 0; FILE * fsxlogf = NULL; int badoff = -1; @@ -679,12 +680,12 @@ domapwrite(unsigned offset, unsigned siz if ((p = (char *)mmap(0, map_size, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, fd, - (off_t)(offset - pg_offset))) == (char *)-1) { + (off_t)(offset - pg_offset))) == MAP_FAILED) { prterr("domapwrite: mmap"); report_failure(202); } memcpy(p + pg_offset, good_buf + offset, size); - if (msync(p, map_size, 0) != 0) { + if (mapped_msync && msync(p, map_size, MS_SYNC) != 0) { prterr("domapwrite: msync"); report_failure(203); } @@ -886,6 +887,7 @@ usage(void) -S seed: for random # generator (default 1) 0 gets timestamp\n\ -W: mapped write operations DISabled\n\ -R: mapped read operations DISabled)\n\ + -U: msync after mapped write operations DISabled\n\ fname: this filename is REQUIRED (no default)\n"); exit(90); } @@ -941,8 +943,8 @@ main(int argc, char **argv) setvbuf(stdout, (char *)0, _IOLBF, 0); /* line buffered stdout */ - while ((ch = getopt(argc, argv, "b:c:dl:m:no:p:qr:s:t:w:D:LN:OP:RS:W")) - != -1) + while ((ch = getopt(argc, argv, + "b:c:dl:m:no:p:qr:s:t:w:D:LN:OP:RS:UW")) != -1) switch (ch) { case 'b': simulatedopcount = getnum(optarg, &endp); @@ -1057,6 +1059,11 @@ main(int argc, char **argv) if (!quiet) fprintf(stdout, "mapped writes DISABLED\n"); break; + case 'U': + mapped_msync = 0; + if (!quiet) + fprintf(stdout, "mapped msync DISABLED\n"); + break; default: usage(); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258352 - head/tools/regression/fsx
Author: avg Date: Tue Nov 19 18:35:38 2013 New Revision: 258352 URL: http://svnweb.freebsd.org/changeset/base/258352 Log: fsx: add an option to randomly call msync(MS_INVALIDATE) This call should be a sufficiently close approximation of what happens when a filesystem is unmounted and remounted. To be more specific, it should test that the data that was in the page cache is the same data that ends up on a stable storage or in a filesystem's internal cache, if any. This will catch the cases where a page with modified data is marked as a clean page for whatever reason. While there, make logging of the special events (open+close before plus invalidation now) more generic and slightly better than the previous hack. MFC after:10 days Modified: head/tools/regression/fsx/fsx.c Modified: head/tools/regression/fsx/fsx.c == --- head/tools/regression/fsx/fsx.c Tue Nov 19 18:35:01 2013 (r258351) +++ head/tools/regression/fsx/fsx.c Tue Nov 19 18:35:38 2013 (r258352) @@ -90,6 +90,7 @@ int logcount = 0; /* total ops */ #define OP_MAPREAD 5 #define OP_MAPWRITE6 #define OP_SKIPPED 7 +#define OP_INVALIDATE 8 int page_size; int page_mask; @@ -107,6 +108,7 @@ unsigned long testcalls = 0; /* calls t unsigned long simulatedopcount = 0; /* -b flag */ intcloseprob = 0; /* -c flag */ +intinvlprob = 0; /* -i flag */ intdebug = 0; /* -d flag */ unsigned long debugstart = 0; /* -D flag */ unsigned long maxfilelen = 256 * 1024;/* -l flag */ @@ -131,6 +133,7 @@ int fsxgoodfd = 0; FILE * fsxlogf = NULL; int badoff = -1; int closeopen = 0; +int invl = 0; void @@ -182,14 +185,12 @@ prterr(char *prefix) void -log4(int operation, int arg0, int arg1, int arg2) +do_log4(int operation, int arg0, int arg1, int arg2) { struct log_entry *le; le = &oplog[logptr]; le->operation = operation; - if (closeopen) - le->operation = ~ le->operation; le->args[0] = arg0; le->args[1] = arg1; le->args[2] = arg2; @@ -201,10 +202,21 @@ log4(int operation, int arg0, int arg1, void +log4(int operation, int arg0, int arg1, int arg2) +{ + do_log4(operation, arg0, arg1, arg2); + if (closeopen) + do_log4(OP_CLOSEOPEN, 0, 0, 0); + if (invl) + do_log4(OP_INVALIDATE, 0, 0, 0); +} + + +void logdump(void) { - int i, count, down; struct log_entry*lp; + int i, count, down, opnum; prt("LOG DUMP (%d total operations):\n", logcount); if (logcount < LOGSIZE) { @@ -214,15 +226,28 @@ logdump(void) i = logptr; count = LOGSIZE; } + + opnum = i + 1 + (logcount/LOGSIZE)*LOGSIZE; for ( ; count > 0; count--) { - int opnum; + lp = &oplog[i]; + + if (lp->operation == OP_CLOSEOPEN || + lp->operation == OP_INVALIDATE) { + switch (lp->operation) { + case OP_CLOSEOPEN: + prt("\t\tCLOSE/OPEN\n"); + break; + case OP_INVALIDATE: + prt("\t\tMS_INVALIDATE\n"); + break; + } + i++; + if (i == LOGSIZE) + i = 0; + continue; + } - opnum = i+1 + (logcount/LOGSIZE)*LOGSIZE; prt("%d(%d mod 256): ", opnum, opnum%256); - lp = &oplog[i]; - if ((closeopen = lp->operation < 0)) - lp->operation = ~ lp->operation; - switch (lp->operation) { case OP_MAPREAD: prt("MAPREAD\t0x%x thru 0x%x\t(0x%x bytes)", @@ -275,9 +300,8 @@ logdump(void) prt("BOGUS LOG ENTRY (operation code = %d)!", lp->operation); } - if (closeopen) - prt("\n\t\tCLOSE/OPEN"); prt("\n"); + opnum++; i++; if (i == LOGSIZE) i = 0; @@ -779,6 +803,36 @@ docloseopen(void) void +doinvl(void) +{ + char *p; + + if (file_size == 0) + return; + if (testcalls <= simulatedopcount) + return; + if (debug) + prt("%lu msync(MS_INVALIDATE)\n", testcalls); + + if ((p = (char *)mmap(0, file_size, PROT_READ | PROT_WRITE, + MAP_FILE | MAP_SHARED, fd, 0)) == MAP_FAILED) { + prterr("doinvl: mmap"); +
svn commit: r258353 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: avg Date: Tue Nov 19 18:43:47 2013 New Revision: 258353 URL: http://svnweb.freebsd.org/changeset/base/258353 Log: zfs page_busy: fix the boundaries of the cleared range This is a fix for a regression introduced in r246293. vm_page_clear_dirty expects the range to have DEV_BSIZE aligned boundaries, otherwise it extends them. Thus it can happen that the whole page is marked clean while actually having some small dirty region(s). This commit makes the range properly aligned and ensures that only the clean data is marked as such. It would interesting to evaluate how much benefit clearing with DEV_BSIZE granularity produces. Perhaps instead we should clear the whole page when it is completely overwritten and don't bother clearing any bits if only a portion a page is written. Reported by: George Hartzell , Richard Todd Tested by:George Hartzell , Reviewed by: kib MFC after:5 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 19 18:35:38 2013(r258352) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 19 18:43:47 2013(r258353) @@ -329,6 +329,20 @@ page_busy(vnode_t *vp, int64_t start, in { vm_object_t obj; vm_page_t pp; + int64_t end; + + /* +* At present vm_page_clear_dirty extends the cleared range to DEV_BSIZE +* aligned boundaries, if the range is not aligned. As a result a +* DEV_BSIZE subrange with partially dirty data may get marked as clean. +* It may happen that all DEV_BSIZE subranges are marked clean and thus +* the whole page would be considred clean despite have some dirty data. +* For this reason we should shrink the range to DEV_BSIZE aligned +* boundaries before calling vm_page_clear_dirty. +*/ + end = rounddown2(off + nbytes, DEV_BSIZE); + off = roundup2(off, DEV_BSIZE); + nbytes = end - off; obj = vp->v_object; zfs_vmobject_assert_wlocked(obj); @@ -363,7 +377,8 @@ page_busy(vnode_t *vp, int64_t start, in ASSERT3U(pp->valid, ==, VM_PAGE_BITS_ALL); vm_object_pip_add(obj, 1); pmap_remove_write(pp); - vm_page_clear_dirty(pp, off, nbytes); + if (nbytes != 0) + vm_page_clear_dirty(pp, off, nbytes); } break; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258354 - head/sys/kern
Author: avg Date: Tue Nov 19 18:45:29 2013 New Revision: 258354 URL: http://svnweb.freebsd.org/changeset/base/258354 Log: taskqueue_cancel: garbage collect a write-only variable MFC after:3 days Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c == --- head/sys/kern/subr_taskqueue.c Tue Nov 19 18:43:47 2013 (r258353) +++ head/sys/kern/subr_taskqueue.c Tue Nov 19 18:45:29 2013 (r258354) @@ -390,11 +390,9 @@ taskqueue_cancel_locked(struct taskqueue int taskqueue_cancel(struct taskqueue *queue, struct task *task, u_int *pendp) { - u_int pending; int error; TQ_LOCK(queue); - pending = task->ta_pending; error = taskqueue_cancel_locked(queue, task, pendp); TQ_UNLOCK(queue); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258355 - head/usr.sbin/bsdconfig/networking/share
Author: trhodes Date: Tue Nov 19 19:55:41 2013 New Revision: 258355 URL: http://svnweb.freebsd.org/changeset/base/258355 Log: "Tim trailing" -> "Trim trailing" Modified: head/usr.sbin/bsdconfig/networking/share/device.subr Modified: head/usr.sbin/bsdconfig/networking/share/device.subr == --- head/usr.sbin/bsdconfig/networking/share/device.subrTue Nov 19 18:45:29 2013(r258354) +++ head/usr.sbin/bsdconfig/networking/share/device.subrTue Nov 19 19:55:41 2013(r258355) @@ -62,7 +62,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_dialog_menu_netdev() { - local defaultitem="${1%\*}" # Tim trailing asterisk if present + local defaultitem="${1%\*}" # Trim trailing asterisk if present # # Display a message to let the user know we're working... ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r258328 - head/sys/net
On Mon, Nov 18, 2013 at 10:58:14PM +, George V. Neville-Neil wrote: > Author: gnn > Date: Mon Nov 18 22:58:14 2013 > New Revision: 258328 > URL: http://svnweb.freebsd.org/changeset/base/258328 > > Log: > Allow ethernet drivers to pass in packets connected via the nextpkt pointer. > Handling packets in this way allows drivers to amortize work during packet > reception. yes. This is only a first step and eventually we should pass the entire batch to the netisr handler to further reduce overhead. Some of the followup emails suggested to change the argument from struct mbuf * to something else. I do think we should change it, but what we need is a struct with head and tail pointers _and_ a counter, because sometimes the code downstream may have to append the mbuf/batch to a queue, and these extra fields would save iterating through the chain. Related to this: at some point we should also address batching in the transmit path, and for that we will eventually need to introduce a 'more packets to come' flag to the API/mbuf so that intermediate functions in the path will build batches before passing them down. cheers luigi ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258356 - head/sys/arm/ti
Author: ian Date: Tue Nov 19 22:14:35 2013 New Revision: 258356 URL: http://svnweb.freebsd.org/changeset/base/258356 Log: Bugfixes... the host capabilties from FDT data are stored in host.caps, not host.host_ocr, examine the correct field when setting up the hardware. Also, the offset for the capabilties register should be 0x140, not 0x240. Submitted by: Ilya Bakulin Pointy hat to:me Modified: head/sys/arm/ti/ti_sdhci.c Modified: head/sys/arm/ti/ti_sdhci.c == --- head/sys/arm/ti/ti_sdhci.c Tue Nov 19 19:55:41 2013(r258355) +++ head/sys/arm/ti/ti_sdhci.c Tue Nov 19 22:14:35 2013(r258356) @@ -108,7 +108,7 @@ static struct ofw_compat_data compat_dat #defineMMCHS_CON 0x02C #define MMCHS_CON_DW8 (1 << 5) #define MMCHS_CON_DVAL_8_4MS(3 << 9) -#defineMMCHS_SD_CAPA 0x240 +#defineMMCHS_SD_CAPA 0x140 #define MMCHS_SD_CAPA_VS18 (1 << 26) #define MMCHS_SD_CAPA_VS30 (1 << 25) #define MMCHS_SD_CAPA_VS33 (1 << 24) @@ -432,9 +432,9 @@ ti_sdhci_attach(device_t dev) * that it can set the right values in the CAPA register, which can only * be done once and never reset. */ - sc->slot.host.host_ocr |= MMC_OCR_LOW_VOLTAGE; + sc->slot.host.caps |= MMC_OCR_LOW_VOLTAGE; if (sc->mmchs_device_id == 0 || OF_hasprop(node, "ti,dual-volt")) { - sc->slot.host.host_ocr |= MMC_OCR_290_300 | MMC_OCR_300_310; + sc->slot.host.caps |= MMC_OCR_290_300 | MMC_OCR_300_310; } /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258357 - in head: sbin/geom/class/mirror sys/geom/mirror
Author: ae Date: Tue Nov 19 22:55:17 2013 New Revision: 258357 URL: http://svnweb.freebsd.org/changeset/base/258357 Log: Add "resize" verb to gmirror(8) and such functionality to geom_mirror(4). Now it is easy to expand the size of the mirror when all its components are replaced. Also add g_resize method to geom_mirror class. It will write updated metadata to new last sector, when parent provider is resized. Silence from: geom@ MFC after:1 month Modified: head/sbin/geom/class/mirror/geom_mirror.c head/sbin/geom/class/mirror/gmirror.8 head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror_ctl.c Modified: head/sbin/geom/class/mirror/geom_mirror.c == --- head/sbin/geom/class/mirror/geom_mirror.c Tue Nov 19 22:14:35 2013 (r258356) +++ head/sbin/geom/class/mirror/geom_mirror.c Tue Nov 19 22:55:17 2013 (r258357) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -53,6 +54,7 @@ static void mirror_activate(struct gctl_ static void mirror_clear(struct gctl_req *req); static void mirror_dump(struct gctl_req *req); static void mirror_label(struct gctl_req *req); +static void mirror_resize(struct gctl_req *req, unsigned flags); struct g_command class_commands[] = { { "activate", G_FLAG_VERBOSE, mirror_main, G_NULL_OPTS, @@ -112,6 +114,13 @@ struct g_command class_commands[] = { { "remove", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, "[-v] name prov ..." }, + { "resize", G_FLAG_VERBOSE, mirror_resize, + { + { 's', "size", "*", G_TYPE_STRING }, + G_OPT_SENTINEL + }, + "[-s size] [-v] name" + }, { "stop", G_FLAG_VERBOSE, NULL, { { 'f', "force", NULL, G_TYPE_BOOL }, @@ -376,3 +385,96 @@ mirror_activate(struct gctl_req *req) printf("Provider %s activated.\n", path); } } + +static struct gclass * +find_class(struct gmesh *mesh, const char *name) +{ + struct gclass *classp; + + LIST_FOREACH(classp, &mesh->lg_class, lg_class) { + if (strcmp(classp->lg_name, name) == 0) + return (classp); + } + return (NULL); +} + +static struct ggeom * +find_geom(struct gclass *classp, const char *name) +{ + struct ggeom *gp; + + LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { + if (strcmp(gp->lg_name, name) == 0) + return (gp); + } + return (NULL); +} + +static void +mirror_resize(struct gctl_req *req, unsigned flags __unused) +{ + struct gmesh mesh; + struct gclass *classp; + struct ggeom *gp; + struct gprovider *pp; + struct gconsumer *cp; + off_t size; + int error, nargs; + const char *name; + char ssize[30]; + + nargs = gctl_get_int(req, "nargs"); + if (nargs < 1) { + gctl_error(req, "Too few arguments."); + return; + } + error = geom_gettree(&mesh); + if (error) + errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); + name = gctl_get_ascii(req, "class"); + if (name == NULL) + abort(); + classp = find_class(&mesh, name); + if (classp == NULL) + errx(EXIT_FAILURE, "Class %s not found.", name); + name = gctl_get_ascii(req, "arg0"); + if (name == NULL) + abort(); + gp = find_geom(classp, name); + if (gp == NULL) + errx(EXIT_FAILURE, "No such geom: %s.", name); + pp = LIST_FIRST(&gp->lg_provider); + if (pp == NULL) + errx(EXIT_FAILURE, "Provider of geom %s not found.", name); + size = pp->lg_mediasize; + name = gctl_get_ascii(req, "size"); + if (name == NULL) + errx(EXIT_FAILURE, "The size is not specified."); + if (*name == '*') { +#defineCSZ(c) ((c)->lg_provider->lg_mediasize - \ +(c)->lg_provider->lg_sectorsize) + /* Find the maximum possible size */ + LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) { + if (CSZ(cp) > size) + size = CSZ(cp); + } + LIST_FOREACH(cp, &gp->lg_consumer, lg_consumer) { + if (CSZ(cp) < size) + size = CSZ(cp); + } +#undef CSZ + if (size == pp->lg_mediasize) + errx(EXIT_FAILURE, + "Cannot expand provider %s\n", + pp->lg_name); + } else { + error = g_parse_lba(name, pp->lg_sectorsize, &size); + if (error) + errc(EXIT_FAILURE, error, "Invalid size param"); + size *= pp->lg_sectorsize; + } + snprintf(ssize, sizeof(ss
svn commit: r258358 - head/sys/arm/arm
Author: zbb Date: Tue Nov 19 23:31:39 2013 New Revision: 258358 URL: http://svnweb.freebsd.org/changeset/base/258358 Log: Avoid clearing EXEC permission bit when setting the page RW on ARMv6/v7 When emulating modified bit the executable attribute was cleared by mistake when calling pmap_set_prot(). This was not a problem before changes to ref/mod emulation since all the pages were created RW basing on the "prot" argument in pmap_enter(). Now however not all pages are RW and the RW permission can be cleared in the process. Added proper KTRs accordingly. Spotted by: cognet Reviewed by: gber Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c == --- head/sys/arm/arm/pmap-v6.c Tue Nov 19 22:55:17 2013(r258357) +++ head/sys/arm/arm/pmap-v6.c Tue Nov 19 23:31:39 2013(r258358) @@ -1519,10 +1519,10 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_ vm_page_dirty(m); /* Re-enable write permissions for the page */ - pmap_set_prot(ptep, VM_PROT_WRITE, *ptep & L2_S_PROT_U); - CTR1(KTR_PMAP, "pmap_fault_fix: new pte:0x%x", pte); + *ptep = (pte & ~L2_APX); PTE_SYNC(ptep); rv = 1; + CTR1(KTR_PMAP, "pmap_fault_fix: new pte:0x%x", *ptep); } else if (!L2_S_REFERENCED(pte)) { /* * This looks like a good candidate for "page referenced" @@ -1545,6 +1545,7 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_ *ptep = pte | L2_S_REF; PTE_SYNC(ptep); rv = 1; + CTR1(KTR_PMAP, "pmap_fault_fix: new pte:0x%x", *ptep); } /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258359 - head/sys/arm/arm
Author: zbb Date: Tue Nov 19 23:37:50 2013 New Revision: 258359 URL: http://svnweb.freebsd.org/changeset/base/258359 Log: Apply access flags for managed and unmanaged pages properly on ARMv6/v7 When entering a mapping via pmap_enter() unmanaged pages ought to be naturally excluded from the "modified" and "referenced" emulation. RW permission should be granted implicitly when requested, otherwise unmanaged page will not recover from the permission fault since there will be no PV entry to indicate that the page can be written. In addition, only managed pages that participate in "modified" emulation need to be marked as "dirty" and "writeable" when entered with RW permissions. Likewise with "referenced" flag for managed pages. Unmanaged ones however should not be marked as such. Reviewed by: cognet, gber Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c == --- head/sys/arm/arm/pmap-v6.c Tue Nov 19 23:31:39 2013(r258358) +++ head/sys/arm/arm/pmap-v6.c Tue Nov 19 23:37:50 2013(r258359) @@ -3079,36 +3079,38 @@ validate: * then continue setting mapping parameters */ if (m != NULL) { - if (prot & (VM_PROT_ALL)) { - if ((m->oflags & VPO_UNMANAGED) == 0) + if ((m->oflags & VPO_UNMANAGED) == 0) { + if (prot & (VM_PROT_ALL)) { vm_page_aflag_set(m, PGA_REFERENCED); - } else { - /* -* Need to do page referenced emulation. -*/ - npte &= ~L2_S_REF; + } else { + /* +* Need to do page referenced emulation. +*/ + npte &= ~L2_S_REF; + } } if (prot & VM_PROT_WRITE) { - /* -* Enable write permission if the access type -* indicates write intention. Emulate modified -* bit otherwise. -*/ - if ((access & VM_PROT_WRITE) != 0) - npte &= ~(L2_APX); - if ((m->oflags & VPO_UNMANAGED) == 0) { - vm_page_aflag_set(m, PGA_WRITEABLE); /* -* The access type and permissions indicate -* that the page will be written as soon as -* returned from fault service. -* Mark it dirty from the outset. +* Enable write permission if the access type +* indicates write intention. Emulate modified +* bit otherwise. */ - if ((access & VM_PROT_WRITE) != 0) + if ((access & VM_PROT_WRITE) != 0) { + npte &= ~(L2_APX); + vm_page_aflag_set(m, PGA_WRITEABLE); + /* +* The access type and permissions +* indicate that the page will be +* written as soon as returned from +* fault service. +* Mark it dirty from the outset. +*/ vm_page_dirty(m); - } + } + } else + npte &= ~(L2_APX); } if (!(prot & VM_PROT_EXECUTE)) npte |= L2_XN; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258360 - head/usr.sbin/bsdconfig/networking/share
Author: dteske Date: Wed Nov 20 00:17:57 2013 New Revision: 258360 URL: http://svnweb.freebsd.org/changeset/base/258360 Log: Whitespace, style, sub-shells, and standardize variable name (s/interfaces/menu_list/). Modified: head/usr.sbin/bsdconfig/networking/share/device.subr Modified: head/usr.sbin/bsdconfig/networking/share/device.subr == --- head/usr.sbin/bsdconfig/networking/share/device.subrTue Nov 19 23:37:50 2013(r258359) +++ head/usr.sbin/bsdconfig/networking/share/device.subrWed Nov 20 00:17:57 2013(r258360) @@ -62,6 +62,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_dialog_menu_netdev() { + local menu_list # Calculated below local defaultitem="${1%\*}" # Trim trailing asterisk if present # @@ -74,19 +75,15 @@ f_dialog_menu_netdev() # Get list of usable network interfaces # local d='[[:digit:]]+:' - local iflist="`echo "$(ifconfig -l):" | sed -E -e " - # Convert all spaces to colons - y/ /:/ - - # Prune unsavory interfaces - s/lo$d//g - s/ppp$d//g - s/sl$d//g - s/faith$d//g - - # Convert all colons back into spaces - y/:/ / - "`" + local if iflist= # Calculated below + for if in $( ifconfig -l ); do + # Skip unsavory interfaces + case "$if" in + lo[0-9]*|ppp[0-9]*|sl[0-9]*|faith[0-9]*) continue ;; + esac + iflist="$iflist $if" + done + iflist="${iflist# }" # # Optionally kick interfaces in the head to get them to accurately @@ -110,20 +107,17 @@ f_dialog_menu_netdev() # Mark any "active" interfaces with an asterisk (*) # to the right of the device name. # - interfaces=$( + menu_list=$( for ifn in $iflist; do - active=$( ifconfig $ifn | awk \ - ' - ( $1 == "status:" ) \ - { - if ( $2 == "active" ) { print 1; exit } - } - ' ) + active=$( ifconfig $ifn 2> /dev/null | awk ' + ($1 == "status:") { + if ($2 == "active") { print 1; exit } + }' ) printf "'%s%s' '%s'\n" \ $ifn "${active:+*}" "$( f_device_desc $ifn )" done ) - if [ ! "$interfaces" ]; then + if [ ! "$menu_list" ]; then f_show_msg "$msg_no_network_interfaces" return $DIALOG_CANCEL fi @@ -132,8 +126,8 @@ f_dialog_menu_netdev() # Maybe the default item was marked as active # if [ "$defaultitem" ]; then - ifconfig "$defaultitem" 2> /dev/null | awk \ - '( $1 == "status:" && $2 != "active" ) { exit 0 }' || + ifconfig "$defaultitem" 2> /dev/null | + awk '($1 == "status:" && $2 == "active"){exit 1}' || defaultitem="$defaultitem*" fi @@ -149,7 +143,7 @@ f_dialog_menu_netdev() \"\$DIALOG_BACKTITLE\" \ \"\$prompt\" \ \"\$hline\"\ - $interfaces + $menu_list local menu_choice menu_choice=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ @@ -160,7 +154,7 @@ f_dialog_menu_netdev() --default-item \"\$defaultitem\" \ --menu \"\$prompt\"\ $height $width $rows \ - $interfaces\ + $menu_list \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) local retval=$? ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258361 - head/sys/cddl/dev/fbt
Author: jhibbits Date: Wed Nov 20 01:33:13 2013 New Revision: 258361 URL: http://svnweb.freebsd.org/changeset/base/258361 Log: Fix the function search space. Submitted by: Howard Su Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c Modified: head/sys/cddl/dev/fbt/fbt_powerpc.c == --- head/sys/cddl/dev/fbt/fbt_powerpc.c Wed Nov 20 00:17:57 2013 (r258360) +++ head/sys/cddl/dev/fbt/fbt_powerpc.c Wed Nov 20 01:33:13 2013 (r258361) @@ -219,7 +219,7 @@ fbt_provide_module_function(linker_file_ return (0); instr = (u_int32_t *) symval->value; - limit = (u_int32_t *) symval->value + symval->size; + limit = (u_int32_t *) (symval->value + symval->size); for (; instr < limit; instr++) if (*instr == FBT_MFLR_R0) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258362 - in head/cddl/contrib/opensolaris/cmd: plockstat zfs
Author: jhibbits Date: Wed Nov 20 01:42:29 2013 New Revision: 258362 URL: http://svnweb.freebsd.org/changeset/base/258362 Log: Use 'int' to store the return value of getopt(), rather than char. On some architectures (powerpc), char is unsigned by default, which means comparisons against -1 always fail, so the programs get stuck in an infinite loop. MFC after:1 week Modified: head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c == --- head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Wed Nov 20 01:33:13 2013(r258361) +++ head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Wed Nov 20 01:42:29 2013(r258362) @@ -778,7 +778,8 @@ main(int argc, char **argv) #endif int err; int opt_C = 0, opt_H = 0, opt_p = 0, opt_v = 0; - char c, *p, *end; + int c; + char *p, *end; struct sigaction act; int done = 0; Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c == --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cWed Nov 20 01:33:13 2013(r258361) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cWed Nov 20 01:42:29 2013(r258362) @@ -2011,7 +2011,7 @@ zfs_do_upgrade(int argc, char **argv) boolean_t showversions = B_FALSE; int ret = 0; upgrade_cbdata_t cb = { 0 }; - char c; + int c; int flags = ZFS_ITER_ARGS_CAN_BE_PATHS; /* check options */ @@ -3561,7 +3561,7 @@ static int zfs_do_snapshot(int argc, char **argv) { int ret = 0; - char c; + int c; nvlist_t *props; snap_cbdata_t sd = { 0 }; boolean_t multiple_snaps = B_FALSE; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258363 - in head/sys/dev/usb: . serial
Author: truckman Date: Wed Nov 20 02:16:47 2013 New Revision: 258363 URL: http://svnweb.freebsd.org/changeset/base/258363 Log: Add alternate ID for Novatel MiFi 2200 CDMA, which is used by my Virgin Mobile branded device. It needs the U3GINIT_SCSIEJECT quirk. Reviewed by: hselasky MFC after:1 month Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c == --- head/sys/dev/usb/serial/u3g.c Wed Nov 20 01:42:29 2013 (r258362) +++ head/sys/dev/usb/serial/u3g.c Wed Nov 20 02:16:47 2013 (r258363) @@ -345,6 +345,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(NOVATEL, MC547, 0), U3G_DEV(NOVATEL, MC950D, 0), U3G_DEV(NOVATEL, MIFI2200, U3GINIT_SCSIEJECT), + U3G_DEV(NOVATEL, MIFI2200V, U3GINIT_SCSIEJECT), U3G_DEV(NOVATEL, U720, 0), U3G_DEV(NOVATEL, U727, 0), U3G_DEV(NOVATEL, U727_2, 0), Modified: head/sys/dev/usb/usbdevs == --- head/sys/dev/usb/usbdevsWed Nov 20 01:42:29 2013(r258362) +++ head/sys/dev/usb/usbdevsWed Nov 20 02:16:47 2013(r258363) @@ -3174,6 +3174,7 @@ product NOVATEL EU870D0x2420 Expedite product NOVATEL U727 0x4100 Merlin U727 CDMA product NOVATEL MC950D 0x4400 Novatel MC950D HSUPA product NOVATEL ZEROCD 0x5010 Novatel ZeroCD +product NOVATEL MIFI2200V 0x5020 Novatel MiFi 2200 CDMA Virgin Mobile product NOVATEL ZEROCD20x5030 Novatel ZeroCD product NOVATEL MIFI2200 0x5041 Novatel MiFi 2200 CDMA product NOVATEL U727_2 0x5100 Merlin U727 CDMA ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258364 - head/etc/devd
Author: truckman Date: Wed Nov 20 02:20:27 2013 New Revision: 258364 URL: http://svnweb.freebsd.org/changeset/base/258364 Log: Regenerate after r258363 (alternate ID for Novatel MiFi 2200) and r258333 (bus_autoconf.sh tweak). Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf == --- head/etc/devd/usb.conf Wed Nov 20 02:16:47 2013(r258363) +++ head/etc/devd/usb.conf Wed Nov 20 02:20:27 2013(r258364) @@ -1,7 +1,7 @@ # # $FreeBSD$ # -# This file was automatically generated by "tools/bus_autoconf.sh". +# This file was automatically generated by "tools/tools/bus_autoconf/bus_autoconf.sh". # Please do not edit! # @@ -3713,7 +3713,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x1410"; - match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5041|0x5100|0x6000|0x6002|0x7042)"; + match "product" "(0x1100|0x1110|0x1120|0x1130|0x1400|0x1410|0x1420|0x1430|0x1450|0x2100|0x2110|0x2120|0x2130|0x2400|0x2410|0x2420|0x4100|0x4400|0x5010|0x5020|0x5041|0x5100|0x6000|0x6002|0x7042)"; action "kldload -n u3g"; }; @@ -5341,5 +5341,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2573 USB entries processed +# 2574 USB entries processed ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"