svn commit: r248264 - head/sys/dev/ath
Author: adrian Date: Thu Mar 14 06:20:02 2013 New Revision: 248264 URL: http://svnweb.freebsd.org/changeset/base/248264 Log: Implement holding buffers per TX queue rather than globally. When working on TDMA, Sam Leffler found that the MAC DMA hardware would re-read the last TX descriptor when getting ready to transmit the next one. Thus the whole ATH_BUF_BUSY came into existance - the descriptor must be left alone (very specifically the link pointer must be maintained) until the hardware has moved onto the next frame. He saw this in TDMA because the MAC would be frequently stopping during active transmit (ie, when it wasn't its turn to transmit.) Fast-forward to today. It turns out that this is a problem not with a single MAC DMA instance, but with each QCU (from 0-9). They each maintain separate descriptor pointers and will re-read the last descriptor when starting to transmit the next. So when your AP is busy transmitting from multiple TX queues, you'll (more) frequently see one QCU stopped, waiting for a higher-priority QCU to finsh transmitting, before it'll go ahead and continue. If you mess up the descriptor (ie by freeing it) then you're short of luck. Thanks to rpaulo for sticking with me whilst I diagnosed this issue that he was quite reliably triggering in his environment. This is a reimplementation; it doesn't have anything in common with the ath9k or the Qualcomm Atheros reference driver. Now - it in theory doesn't apply on the EDMA chips, as long as you push one complete frame into the FIFO at a time. But the MAC can DMA from a list of frames pushed into the hardware queue (ie, you concat 'n' frames together with link pointers, and then push the head pointer into the TXQ FIFO.) Since that's likely how I'm going to implement CABQ handling in hostap mode, it's likely that I will end up teaching the EDMA TX completion code about busy buffers, just to be sure this doesn't creep up. Tested - iperf ap-sta and sta-ap (with both sides running this code): * AR5416 STA * AR9160/AR9220 hostap To validate that it doesn't break the EDMA (FIFO) chips: * AR9380, AR9485, AR9462 STA Using iperf with the -S tos byte decimal value to set the TCP client side DSCP bits, mapping to different TIDs and thus different TX queues. TODO: * Make this work on the EDMA chips, if we end up pushing lists of frames to the hardware (eg how we eventually will handle cabq in hostap/ibss mode.) Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c == --- head/sys/dev/ath/if_ath.c Thu Mar 14 05:24:25 2013(r248263) +++ head/sys/dev/ath/if_ath.c Thu Mar 14 06:20:02 2013(r248264) @@ -3750,39 +3750,6 @@ ath_tx_update_ratectrl(struct ath_softc } /* - * Update the busy status of the last frame on the free list. - * When doing TDMA, the busy flag tracks whether the hardware - * currently points to this buffer or not, and thus gated DMA - * may restart by re-reading the last descriptor in this - * buffer. - * - * This should be called in the completion function once one - * of the buffers has been used. - */ -static void -ath_tx_update_busy(struct ath_softc *sc) -{ - struct ath_buf *last; - - /* -* Since the last frame may still be marked -* as ATH_BUF_BUSY, unmark it here before -* finishing the frame processing. -* Since we've completed a frame (aggregate -* or otherwise), the hardware has moved on -* and is no longer referencing the previous -* descriptor. -*/ - ATH_TXBUF_LOCK_ASSERT(sc); - last = TAILQ_LAST(sc-sc_txbuf_mgmt, ath_bufhead_s); - if (last != NULL) - last-bf_flags = ~ATH_BUF_BUSY; - last = TAILQ_LAST(sc-sc_txbuf, ath_bufhead_s); - if (last != NULL) - last-bf_flags = ~ATH_BUF_BUSY; -} - -/* * Process the completion of the given buffer. * * This calls the rate control update and then the buffer completion. @@ -3901,7 +3868,6 @@ ath_tx_processq(struct ath_softc *sc, st break; } ATH_TXQ_REMOVE(txq, bf, bf_list); -#ifdef IEEE80211_SUPPORT_TDMA if (txq-axq_depth 0) { /* * More frames follow. Mark the buffer busy @@ -3914,9 +3880,6 @@ ath_tx_processq(struct ath_softc *sc, st */ bf-bf_last-bf_flags |= ATH_BUF_BUSY; } else -#else - if (txq-axq_depth == 0) -#endif txq-axq_link = NULL; if (bf-bf_state.bfs_aggr) txq-axq_aggr_depth--; @@ -4188,6 +4151,51 @@ ath_returnbuf_head(struct ath_softc *sc, } /* + * Free the
svn commit: r248265 - head/cddl/contrib/opensolaris/cmd/zfs
Author: mm Date: Thu Mar 14 08:18:40 2013 New Revision: 248265 URL: http://svnweb.freebsd.org/changeset/base/248265 Log: Update zfs.8 manpage date (missing in r247585) MFC: together with r247585 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 == --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Mar 14 06:20:02 2013 (r248264) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Mar 14 08:18:40 2013 (r248265) @@ -28,7 +28,7 @@ .\ .\ $FreeBSD$ .\ -.Dd February 10, 2013 +.Dd March 1, 2013 .Dt ZFS 8 .Os .Sh NAME ___ 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: r248267 - in head/cddl/contrib/opensolaris/cmd: zdb zpool
Author: mm Date: Thu Mar 14 10:02:59 2013 New Revision: 248267 URL: http://svnweb.freebsd.org/changeset/base/248267 Log: MFV r248266: Import minor ZFS changes from vendor Illumos ZFS issues: 3604 zdb should print bpobjs more verbosely (fix zdb hang) 3606 zpool status -x shouldn't warn about old on-disk format MFC after:3 days Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c == --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Mar 14 08:25:10 2013 (r248266) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Mar 14 10:02:59 2013 (r248267) @@ -1225,6 +1225,7 @@ dump_bpobj(bpobj_t *bpo, char *name, int continue; } dump_bpobj(subbpo, subobj, indent + 1); + bpobj_close(subbpo); } } else { (void) printf(%*s: object %llu, %llu blkptrs, %s\n, Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 == --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Mar 14 08:25:10 2013(r248266) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Mar 14 10:02:59 2013(r248267) @@ -25,7 +25,7 @@ .\ .\ $FreeBSD$ .\ -.Dd November 15, 2012 +.Dd March 14, 2013 .Dt ZPOOL 8 .Os .Sh NAME @@ -1608,14 +1608,15 @@ is specified, the command exits after .Ar count reports are printed. .Pp -If a scrub or resilver is in progress, this command reports the percentage done -and the estimated time to completion. Both of these are only approximate, +If a scrub or resilver is in progress, this command reports the percentage +done and the estimated time to completion. Both of these are only approximate, because the amount of data in the pool and the other workloads on the system can change. .Bl -tag -width indent .It Fl x Only display status for pools that are exhibiting errors or are otherwise unavailable. +Warnings about pools not using the latest on-disk format will not be included. .It Fl v Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub. Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c == --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cThu Mar 14 08:25:10 2013(r248266) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.cThu Mar 14 10:02:59 2013(r248267) @@ -4031,7 +4031,10 @@ status_callback(zpool_handle_t *zhp, voi * If we were given 'zpool status -x', only report those pools with * problems. */ - if (reason == ZPOOL_STATUS_OK cbp-cb_explain) { + if (cbp-cb_explain + (reason == ZPOOL_STATUS_OK || + reason == ZPOOL_STATUS_VERSION_OLDER || + reason == ZPOOL_STATUS_FEAT_DISABLED)) { if (!cbp-cb_allpools) { (void) printf(gettext(pool '%s' is healthy\n), zpool_get_name(zhp)); ___ 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: r248257 - head/share/man/man4
On Wed, Mar 13, 2013 at 10:27:01PM +, Joel Dahl wrote: J Author: joel (doc committer) J Date: Wed Mar 13 22:27:01 2013 J New Revision: 248257 J URL: http://svnweb.freebsd.org/changeset/base/248257 J J Log: J vinum isn't a new product. vinum is actually not present in modern FreeBSD, gvinum is. Well, the gvinum.4 page isn't written, but I strongly doubt that vinum.4 page has at least 20% of content that would precisely apply to geom_vinum module. IMO, it would be better to remove the vinum.4 page. -- 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: r248257 - head/share/man/man4
On Thu, Mar 14, 2013 at 02:09:45PM +0400, Gleb Smirnoff wrote: On Wed, Mar 13, 2013 at 10:27:01PM +, Joel Dahl wrote: J Author: joel (doc committer) J Date: Wed Mar 13 22:27:01 2013 J New Revision: 248257 J URL: http://svnweb.freebsd.org/changeset/base/248257 J J Log: J vinum isn't a new product. vinum is actually not present in modern FreeBSD, gvinum is. Well, the gvinum.4 page isn't written, but I strongly doubt that vinum.4 page has at least 20% of content that would precisely apply to geom_vinum module. IMO, it would be better to remove the vinum.4 page. No objection from me. -- Joel ___ 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: r248273 - head/share/man/man4
Author: joel (doc committer) Date: Thu Mar 14 18:46:11 2013 New Revision: 248273 URL: http://svnweb.freebsd.org/changeset/base/248273 Log: Add GEOM_* kernel options to the SYNOPSIS. Modified: head/share/man/man4/geom.4 Modified: head/share/man/man4/geom.4 == --- head/share/man/man4/geom.4 Thu Mar 14 17:48:07 2013(r248272) +++ head/share/man/man4/geom.4 Thu Mar 14 18:46:11 2013(r248273) @@ -34,12 +34,47 @@ .\ .\ $FreeBSD$ .\ -.Dd May 25, 2006 +.Dd March 14, 2013 .Dt GEOM 4 .Os .Sh NAME .Nm GEOM .Nd modular disk I/O request transformation framework +.Sh SYNOPSIS +.Cd options GEOM_AES +.Cd options GEOM_BDE +.Cd options GEOM_BSD +.Cd options GEOM_CACHE +.Cd options GEOM_CONCAT +.Cd options GEOM_ELI +.Cd options GEOM_FOX +.Cd options GEOM_GATE +.Cd options GEOM_JOURNAL +.Cd options GEOM_LABEL +.Cd options GEOM_LINUX_LVM +.Cd options GEOM_MBR +.Cd options GEOM_MIRROR +.Cd options GEOM_MULTIPATH +.Cd options GEOM_NOP +.Cd options GEOM_PART_APM +.Cd options GEOM_PART_BSD +.Cd options GEOM_PART_EBR +.Cd options GEOM_PART_EBR_COMPAT +.Cd options GEOM_PART_GPT +.Cd options GEOM_PART_LDM +.Cd options GEOM_PART_MBR +.Cd options GEOM_PART_PC98 +.Cd options GEOM_PART_VTOC8 +.Cd options GEOM_PC98 +.Cd options GEOM_RAID +.Cd options GEOM_RAID3 +.Cd options GEOM_SHSEC +.Cd options GEOM_STRIPE +.Cd options GEOM_SUNLABEL +.Cd options GEOM_UZIP +.Cd options GEOM_VIRSTOR +.Cd options GEOM_VOL +.Cd options GEOM_ZERO .Sh DESCRIPTION The .Nm ___ 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: r248274 - head/sbin/gvinum
Author: joel (doc committer) Date: Thu Mar 14 18:55:41 2013 New Revision: 248274 URL: http://svnweb.freebsd.org/changeset/base/248274 Log: Minor mdoc fixes. Modified: head/sbin/gvinum/gvinum.8 Modified: head/sbin/gvinum/gvinum.8 == --- head/sbin/gvinum/gvinum.8 Thu Mar 14 18:46:11 2013(r248273) +++ head/sbin/gvinum/gvinum.8 Thu Mar 14 18:55:41 2013(r248274) @@ -388,7 +388,10 @@ documentation were added by .An Chris Jones through the 2005 Google Summer of Code program. -.Ic a partial rewrite of gvinum was done by Lukas Ertl and Ulf Lilleengen +A partial rewrite of gvinum was done by +.An Lukas Ertl +and +.An Ulf Lilleengen through the 2007 Google Summer of Code program. The documentation have been updated to reflect the new functionality. .Sh AUTHORS ___ 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: r248275 - head/sys/conf
Author: joel (doc committer) Date: Thu Mar 14 19:36:20 2013 New Revision: 248275 URL: http://svnweb.freebsd.org/changeset/base/248275 Log: Fix minor spelling error in a comment. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES == --- head/sys/conf/NOTES Thu Mar 14 18:55:41 2013(r248274) +++ head/sys/conf/NOTES Thu Mar 14 19:36:20 2013(r248275) @@ -986,7 +986,7 @@ options DUMMYNET # See zero_copy(9) for more details. # XXX: The COW based send mechanism is not safe and may result in # kernel crashes. -# XXX: None of the current NIC drivers support disposeable pages. +# XXX: None of the current NIC drivers support disposable pages. optionsSOCKET_SEND_COW optionsSOCKET_RECV_PFLIP ___ 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: r248276 - head/sys/kern
Author: kib Date: Thu Mar 14 19:48:25 2013 New Revision: 248276 URL: http://svnweb.freebsd.org/changeset/base/248276 Log: Rewrite the vfs_bio_clrbuf(9) to not access the b_data for B_VMIO buffers directly, use pmap_zero_page_area(9) for each zeroing page region instead. Sponsored by: The FreeBSD Foundation Tested by:pho MFC after:2 weeks Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c == --- head/sys/kern/vfs_bio.c Thu Mar 14 19:36:20 2013(r248275) +++ head/sys/kern/vfs_bio.c Thu Mar 14 19:48:25 2013(r248276) @@ -3712,8 +3712,7 @@ vfs_bio_set_valid(struct buf *bp, int ba void vfs_bio_clrbuf(struct buf *bp) { - int i, j, mask; - caddr_t sa, ea; + int i, j, mask, sa, ea, slide; if ((bp-b_flags (B_VMIO | B_MALLOC)) != B_VMIO) { clrbuf(bp); @@ -3731,30 +3730,33 @@ vfs_bio_clrbuf(struct buf *bp) if ((bp-b_pages[0]-valid mask) == mask) goto unlock; if ((bp-b_pages[0]-valid mask) == 0) { - bzero(bp-b_data, bp-b_bufsize); + pmap_zero_page_area(bp-b_pages[0], 0, bp-b_bufsize); bp-b_pages[0]-valid |= mask; goto unlock; } } - ea = sa = bp-b_data; - for(i = 0; i bp-b_npages; i++, sa = ea) { - ea = (caddr_t)trunc_page((vm_offset_t)sa + PAGE_SIZE); - ea = (caddr_t)(vm_offset_t)ulmin( - (u_long)(vm_offset_t)ea, - (u_long)(vm_offset_t)bp-b_data + bp-b_bufsize); + sa = bp-b_offset PAGE_MASK; + slide = 0; + for (i = 0; i bp-b_npages; i++, sa = 0) { + slide = imin(slide + PAGE_SIZE, bp-b_offset + bp-b_bufsize); + ea = slide PAGE_MASK; + if (ea == 0) + ea = PAGE_SIZE; if (bp-b_pages[i] == bogus_page) continue; - j = ((vm_offset_t)sa PAGE_MASK) / DEV_BSIZE; + j = sa / DEV_BSIZE; mask = ((1 ((ea - sa) / DEV_BSIZE)) - 1) j; VM_OBJECT_ASSERT_WLOCKED(bp-b_pages[i]-object); if ((bp-b_pages[i]-valid mask) == mask) continue; if ((bp-b_pages[i]-valid mask) == 0) - bzero(sa, ea - sa); + pmap_zero_page_area(bp-b_pages[i], sa, ea - sa); else { for (; sa ea; sa += DEV_BSIZE, j++) { - if ((bp-b_pages[i]-valid (1 j)) == 0) - bzero(sa, DEV_BSIZE); + if ((bp-b_pages[i]-valid (1 j)) == 0) { + pmap_zero_page_area(bp-b_pages[i], + sa, DEV_BSIZE); + } } } bp-b_pages[i]-valid |= mask; ___ 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: r248277 - head/sys/vm
Author: kib Date: Thu Mar 14 19:50:09 2013 New Revision: 248277 URL: http://svnweb.freebsd.org/changeset/base/248277 Log: Remove excessive and inconsistent initializers for the various kernel maps and submaps. MFC after:2 weeks Modified: head/sys/vm/vm_kern.c Modified: head/sys/vm/vm_kern.c == --- head/sys/vm/vm_kern.c Thu Mar 14 19:48:25 2013(r248276) +++ head/sys/vm/vm_kern.c Thu Mar 14 19:50:09 2013(r248277) @@ -85,11 +85,11 @@ __FBSDID($FreeBSD$); #include vm/vm_extern.h #include vm/uma.h -vm_map_t kernel_map=0; -vm_map_t kmem_map=0; -vm_map_t exec_map=0; +vm_map_t kernel_map; +vm_map_t kmem_map; +vm_map_t exec_map; vm_map_t pipe_map; -vm_map_t buffer_map=0; +vm_map_t buffer_map; const void *zero_region; CTASSERT((ZERO_REGION_SIZE PAGE_MASK) == 0); ___ 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: r248278 - head/share/man/man4
Author: joel (doc committer) Date: Thu Mar 14 19:56:21 2013 New Revision: 248278 URL: http://svnweb.freebsd.org/changeset/base/248278 Log: Sort sections. Modified: head/share/man/man4/udp.4 Modified: head/share/man/man4/udp.4 == --- head/share/man/man4/udp.4 Thu Mar 14 19:50:09 2013(r248277) +++ head/share/man/man4/udp.4 Thu Mar 14 19:56:21 2013(r248278) @@ -103,29 +103,6 @@ transport level may be used with .Tn UDP ; see .Xr ip 4 . -.Sh ERRORS -A socket operation may fail with one of the following errors returned: -.Bl -tag -width Er -.It Bq Er EISCONN -when trying to establish a connection on a socket which -already has one, or when trying to send a datagram with the destination -address specified and the socket is already connected; -.It Bq Er ENOTCONN -when trying to send a datagram, but -no destination address is specified, and the socket has not been -connected; -.It Bq Er ENOBUFS -when the system runs out of memory for -an internal data structure; -.It Bq Er EADDRINUSE -when an attempt -is made to create a socket with a port which has already been -allocated; -.It Bq Er EADDRNOTAVAIL -when an attempt is made to create a -socket with a network address for which no network interface -exists. -.El .Sh MIB VARIABLES The .Nm @@ -154,6 +131,29 @@ listening, do not return an ICMP port un See .Xr blackhole 4 . ) .El +.Sh ERRORS +A socket operation may fail with one of the following errors returned: +.Bl -tag -width Er +.It Bq Er EISCONN +when trying to establish a connection on a socket which +already has one, or when trying to send a datagram with the destination +address specified and the socket is already connected; +.It Bq Er ENOTCONN +when trying to send a datagram, but +no destination address is specified, and the socket has not been +connected; +.It Bq Er ENOBUFS +when the system runs out of memory for +an internal data structure; +.It Bq Er EADDRINUSE +when an attempt +is made to create a socket with a port which has already been +allocated; +.It Bq Er EADDRNOTAVAIL +when an attempt is made to create a +socket with a network address for which no network interface +exists. +.El .Sh SEE ALSO .Xr getsockopt 2 , .Xr recv 2 , ___ 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: r248280 - in head/sys: amd64/amd64 arm/arm arm/include i386/i386 i386/xen ia64/ia64 mips/mips powerpc/aim powerpc/booke powerpc/powerpc sparc64/sparc64 vm
Author: kib Date: Thu Mar 14 20:18:12 2013 New Revision: 248280 URL: http://svnweb.freebsd.org/changeset/base/248280 Log: Add pmap function pmap_copy_pages(), which copies the content of the pages around, taking array of vm_page_t both for source and destination. Starting offsets and total transfer size are specified. The function implements optimal algorithm for copying using the platform-specific optimizations. For instance, on the architectures were the direct map is available, no transient mappings are created, for i386 the per-cpu ephemeral page frame is used. The code was typically borrowed from the pmap_copy_page() for the same architecture. Only i386/amd64, powerpc aim and arm/arm-v6 implementations were tested at the time of commit. High-level code, not committed yet to the tree, ensures that the use of the function is only allowed after explicit enablement. For sparc64, the existing code has known issues and a stab is added instead, to allow the kernel linking. Sponsored by: The FreeBSD Foundation Tested by:pho (i386, amd64), scottl (amd64), ian (arm and arm-v6) MFC after:2 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/arm/include/pmap.h head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/ia64/ia64/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/sparc64/sparc64/pmap.c head/sys/vm/pmap.h Modified: head/sys/amd64/amd64/pmap.c == --- head/sys/amd64/amd64/pmap.c Thu Mar 14 20:05:49 2013(r248279) +++ head/sys/amd64/amd64/pmap.c Thu Mar 14 20:18:12 2013(r248280) @@ -4272,6 +4272,30 @@ pmap_copy_page(vm_page_t msrc, vm_page_t pagecopy((void *)src, (void *)dst); } +void +pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], +vm_offset_t b_offset, int xfersize) +{ + void *a_cp, *b_cp; + vm_offset_t a_pg_offset, b_pg_offset; + int cnt; + + while (xfersize 0) { + a_pg_offset = a_offset PAGE_MASK; + cnt = min(xfersize, PAGE_SIZE - a_pg_offset); + a_cp = (char *)PHYS_TO_DMAP(ma[a_offset PAGE_SHIFT]- + phys_addr) + a_pg_offset; + b_pg_offset = b_offset PAGE_MASK; + cnt = min(cnt, PAGE_SIZE - b_pg_offset); + b_cp = (char *)PHYS_TO_DMAP(mb[b_offset PAGE_SHIFT]- + phys_addr) + b_pg_offset; + bcopy(a_cp, b_cp, cnt); + a_offset += cnt; + b_offset += cnt; + xfersize -= cnt; + } +} + /* * Returns true if the pmap's pv is one of the first * 16 pvs linked to from this page. This count may Modified: head/sys/arm/arm/pmap-v6.c == --- head/sys/arm/arm/pmap-v6.c Thu Mar 14 20:05:49 2013(r248279) +++ head/sys/arm/arm/pmap-v6.c Thu Mar 14 20:18:12 2013(r248280) @@ -3313,6 +3313,45 @@ pmap_copy_page_generic(vm_paddr_t src, v } void +pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[], +vm_offset_t b_offset, int xfersize) +{ + vm_page_t a_pg, b_pg; + vm_offset_t a_pg_offset, b_pg_offset; + int cnt; + + mtx_lock(cmtx); + while (xfersize 0) { + a_pg = ma[a_offset PAGE_SHIFT]; + a_pg_offset = a_offset PAGE_MASK; + cnt = min(xfersize, PAGE_SIZE - a_pg_offset); + b_pg = mb[b_offset PAGE_SHIFT]; + b_pg_offset = b_offset PAGE_MASK; + cnt = min(cnt, PAGE_SIZE - b_pg_offset); + *csrc_pte = L2_S_PROTO | VM_PAGE_TO_PHYS(a_pg) | + pte_l2_s_cache_mode; + pmap_set_prot(csrc_pte, VM_PROT_READ, 0); + PTE_SYNC(csrc_pte); + *cdst_pte = L2_S_PROTO | VM_PAGE_TO_PHYS(b_pg) | + pte_l2_s_cache_mode; + pmap_set_prot(cdst_pte, VM_PROT_READ | VM_PROT_WRITE, 0); + PTE_SYNC(cdst_pte); + cpu_tlb_flushD_SE(csrcp); + cpu_tlb_flushD_SE(cdstp); + cpu_cpwait(); + bcopy((char *)csrcp + a_pg_offset, (char *)cdstp + b_pg_offset, + cnt); + cpu_idcache_wbinv_range(cdstp + b_pg_offset, cnt); + pmap_l2cache_wbinv_range(cdstp + b_pg_offset, + VM_PAGE_TO_PHYS(b_pg) + b_pg_offset, cnt); + xfersize -= cnt; + a_offset += cnt; + b_offset += cnt; + } + mtx_unlock(cmtx); +} + +void pmap_copy_page(vm_page_t src, vm_page_t dst) { Modified: head/sys/arm/arm/pmap.c
svn commit: r248281 - head/lib/libutil
Author: pjd Date: Thu Mar 14 20:22:52 2013 New Revision: 248281 URL: http://svnweb.freebsd.org/changeset/base/248281 Log: When pidptr was passed as NULL to pidfile_open(3), we were returning EAGAIN/EWOULDBLOCK when another daemon was running and had the pidfile open. We should return EEXIST in that case, fix it. Reported by: Dirk Engling erdge...@erdgeist.org Reviewed by: jhb, Dirk Engling erdge...@erdgeist.org MFC after:1 week Modified: head/lib/libutil/pidfile.c Modified: head/lib/libutil/pidfile.c == --- head/lib/libutil/pidfile.c Thu Mar 14 20:18:12 2013(r248280) +++ head/lib/libutil/pidfile.c Thu Mar 14 20:22:52 2013(r248281) @@ -126,20 +126,25 @@ pidfile_open(const char *path, mode_t mo fd = flopen(pfh-pf_path, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NONBLOCK, mode); if (fd == -1) { - if (errno == EWOULDBLOCK pidptr != NULL) { - count = 20; - rqtp.tv_sec = 0; - rqtp.tv_nsec = 500; - for (;;) { - errno = pidfile_read(pfh-pf_path, pidptr); - if (errno != EAGAIN || --count == 0) - break; - nanosleep(rqtp, 0); - } - if (errno == EAGAIN) - *pidptr = -1; - if (errno == 0 || errno == EAGAIN) + if (errno == EWOULDBLOCK) { + if (pidptr == NULL) { errno = EEXIST; + } else { + count = 20; + rqtp.tv_sec = 0; + rqtp.tv_nsec = 500; + for (;;) { + errno = pidfile_read(pfh-pf_path, + pidptr); + if (errno != EAGAIN || --count == 0) + break; + nanosleep(rqtp, 0); + } + if (errno == EAGAIN) + *pidptr = -1; + if (errno == 0 || errno == EAGAIN) + errno = EEXIST; + } } free(pfh); return (NULL); ___ 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: r248282 - in head/sys: fs/cd9660 fs/ext2fs fs/msdosfs fs/udf kern sys ufs/ffs
Author: kib Date: Thu Mar 14 20:28:26 2013 New Revision: 248282 URL: http://svnweb.freebsd.org/changeset/base/248282 Log: Add currently unused flag argument to the cluster_read(), cluster_write() and cluster_wbuild() functions. The flags to be allowed are a subset of the GB_* flags for getblk(). Sponsored by: The FreeBSD Foundation Tested by:pho Modified: head/sys/fs/cd9660/cd9660_vnops.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/fs/udf/udf_vnops.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/sys/buf.h head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/fs/cd9660/cd9660_vnops.c == --- head/sys/fs/cd9660/cd9660_vnops.c Thu Mar 14 20:22:52 2013 (r248281) +++ head/sys/fs/cd9660/cd9660_vnops.c Thu Mar 14 20:28:26 2013 (r248282) @@ -329,7 +329,7 @@ cd9660_read(ap) if (lblktosize(imp, rablock) ip-i_size) error = cluster_read(vp, (off_t)ip-i_size, lbn, size, NOCRED, uio-uio_resid, -(ap-a_ioflag 16), bp); +(ap-a_ioflag 16), 0, bp); else error = bread(vp, lbn, size, NOCRED, bp); } else { Modified: head/sys/fs/ext2fs/ext2_balloc.c == --- head/sys/fs/ext2fs/ext2_balloc.cThu Mar 14 20:22:52 2013 (r248281) +++ head/sys/fs/ext2fs/ext2_balloc.cThu Mar 14 20:28:26 2013 (r248282) @@ -276,7 +276,7 @@ ext2_balloc(struct inode *ip, int32_t lb if (seqcount (vp-v_mount-mnt_flag MNT_NOCLUSTERR) == 0) { error = cluster_read(vp, ip-i_size, lbn, (int)fs-e2fs_bsize, NOCRED, - MAXBSIZE, seqcount, nbp); + MAXBSIZE, seqcount, 0, nbp); } else { error = bread(vp, lbn, (int)fs-e2fs_bsize, NOCRED, nbp); } Modified: head/sys/fs/ext2fs/ext2_vnops.c == --- head/sys/fs/ext2fs/ext2_vnops.c Thu Mar 14 20:22:52 2013 (r248281) +++ head/sys/fs/ext2fs/ext2_vnops.c Thu Mar 14 20:28:26 2013 (r248282) @@ -1618,10 +1618,11 @@ ext2_read(struct vop_read_args *ap) if (lblktosize(fs, nextlbn) = ip-i_size) error = bread(vp, lbn, size, NOCRED, bp); - else if ((vp-v_mount-mnt_flag MNT_NOCLUSTERR) == 0) + else if ((vp-v_mount-mnt_flag MNT_NOCLUSTERR) == 0) { error = cluster_read(vp, ip-i_size, lbn, size, - NOCRED, blkoffset + uio-uio_resid, seqcount, bp); - else if (seqcount 1) { + NOCRED, blkoffset + uio-uio_resid, seqcount, + 0, bp); + } else if (seqcount 1) { int nextsize = blksize(fs, ip, nextlbn); error = breadn(vp, lbn, size, nextlbn, nextsize, 1, NOCRED, bp); @@ -1831,7 +1832,7 @@ ext2_write(struct vop_write_args *ap) } else if (xfersize + blkoffset == fs-e2fs_fsize) { if ((vp-v_mount-mnt_flag MNT_NOCLUSTERW) == 0) { bp-b_flags |= B_CLUSTEROK; - cluster_write(vp, bp, ip-i_size, seqcount); + cluster_write(vp, bp, ip-i_size, seqcount, 0); } else { bawrite(bp); } Modified: head/sys/fs/msdosfs/msdosfs_vnops.c == --- head/sys/fs/msdosfs/msdosfs_vnops.c Thu Mar 14 20:22:52 2013 (r248281) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Thu Mar 14 20:28:26 2013 (r248282) @@ -600,7 +600,7 @@ msdosfs_read(ap) error = bread(vp, lbn, blsize, NOCRED, bp); } else if ((vp-v_mount-mnt_flag MNT_NOCLUSTERR) == 0) { error = cluster_read(vp, dep-de_FileSize, lbn, blsize, - NOCRED, on + uio-uio_resid, seqcount, bp); + NOCRED, on + uio-uio_resid, seqcount, 0, bp); } else if (seqcount 1) { rasize = blsize; error = breadn(vp, lbn, @@ -820,7 +820,7 @@ msdosfs_write(ap) else if (n + croffset == pmp-pm_bpcluster) { if ((vp-v_mount-mnt_flag MNT_NOCLUSTERW) == 0) cluster_write(vp, bp, dep-de_FileSize,
svn commit: r248283 - in head/sys: kern ufs/ffs vm
Author: kib Date: Thu Mar 14 20:31:39 2013 New Revision: 248283 URL: http://svnweb.freebsd.org/changeset/base/248283 Log: Some style fixes. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/ufs/ffs/ffs_balloc.c head/sys/vm/vnode_pager.c Modified: head/sys/kern/vfs_bio.c == --- head/sys/kern/vfs_bio.c Thu Mar 14 20:28:26 2013(r248282) +++ head/sys/kern/vfs_bio.c Thu Mar 14 20:31:39 2013(r248283) @@ -830,9 +830,8 @@ breada(struct vnode * vp, daddr_t * rabl * getblk(). Also starts asynchronous I/O on read-ahead blocks. */ int -breadn_flags(struct vnode * vp, daddr_t blkno, int size, -daddr_t * rablkno, int *rabsize, int cnt, -struct ucred * cred, int flags, struct buf **bpp) +breadn_flags(struct vnode *vp, daddr_t blkno, int size, daddr_t *rablkno, +int *rabsize, int cnt, struct ucred *cred, int flags, struct buf **bpp) { struct buf *bp; int rv = 0, readwait = 0; @@ -1809,7 +1808,7 @@ vfs_bio_awrite(struct buf *bp) nwritten = bp-b_bufsize; (void) bwrite(bp); - return nwritten; + return (nwritten); } /* @@ -2631,7 +2630,7 @@ vfs_setdirty_locked_object(struct buf *b * prior to issuing the READ. biodone() will *not* clear B_INVAL. */ struct buf * -getblk(struct vnode * vp, daddr_t blkno, int size, int slpflag, int slptimeo, +getblk(struct vnode *vp, daddr_t blkno, int size, int slpflag, int slptimeo, int flags) { struct buf *bp; @@ -2709,9 +2708,8 @@ loop: } /* -* check for size inconsistancies for non-VMIO case. +* check for size inconsistencies for non-VMIO case. */ - if (bp-b_bcount != size) { if ((bp-b_flags B_VMIO) == 0 || (size bp-b_kvasize)) { Modified: head/sys/kern/vfs_cluster.c == --- head/sys/kern/vfs_cluster.c Thu Mar 14 20:28:26 2013(r248282) +++ head/sys/kern/vfs_cluster.c Thu Mar 14 20:31:39 2013(r248283) @@ -563,7 +563,7 @@ cluster_wbuild_wb(struct vnode *vp, long { int r = 0; - switch(write_behind) { + switch (write_behind) { case 2: if (start_lbn len) break; Modified: head/sys/ufs/ffs/ffs_balloc.c == --- head/sys/ufs/ffs/ffs_balloc.c Thu Mar 14 20:28:26 2013 (r248282) +++ head/sys/ufs/ffs/ffs_balloc.c Thu Mar 14 20:31:39 2013 (r248283) @@ -679,9 +679,9 @@ ffs_balloc_ufs2(struct vnode *vp, off_t if (osize fs-fs_bsize osize 0) { UFS_LOCK(ump); error = ffs_realloccg(ip, nb, dp-di_db[nb], - ffs_blkpref_ufs2(ip, lastlbn, (int)nb, - dp-di_db[0]), osize, (int)fs-fs_bsize, - flags, cred, bp); + ffs_blkpref_ufs2(ip, lastlbn, (int)nb, + dp-di_db[0]), osize, (int)fs-fs_bsize, + flags, cred, bp); if (error) return (error); if (DOINGSOFTDEP(vp)) @@ -733,7 +733,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t UFS_LOCK(ump); error = ffs_realloccg(ip, lbn, dp-di_db[lbn], ffs_blkpref_ufs2(ip, lbn, (int)lbn, - dp-di_db[0]), osize, nsize, flags, + dp-di_db[0]), osize, nsize, flags, cred, bp); if (error) return (error); Modified: head/sys/vm/vnode_pager.c == --- head/sys/vm/vnode_pager.c Thu Mar 14 20:28:26 2013(r248282) +++ head/sys/vm/vnode_pager.c Thu Mar 14 20:31:39 2013(r248283) @@ -900,7 +900,7 @@ vnode_pager_generic_getpages(vp, m, byte } bp = getpbuf(vnode_pbuf_freecnt); - kva = (vm_offset_t) bp-b_data; + kva = (vm_offset_t)bp-b_data; /* * and map the pages to be read into the kva ___ 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: r248285 - head/share/misc
Author: joel (doc committer) Date: Thu Mar 14 21:20:46 2013 New Revision: 248285 URL: http://svnweb.freebsd.org/changeset/base/248285 Log: Add FreeBSD 9.1. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree == --- head/share/misc/bsd-family-tree Thu Mar 14 21:18:19 2013 (r248284) +++ head/share/misc/bsd-family-tree Thu Mar 14 21:20:46 2013 (r248285) @@ -252,12 +252,14 @@ FreeBSD 5.2 | | | | | | OpenBSD 5.0 | *--FreeBSD| | | | | |9.0 | | | | DragonFly 3.0.1 - | vFreeBSD | | | | - |8.3 | | OpenBSD 5.1 | - | Mac OS X | | | - | 10.8| | | - || NetBSD 6.0 | | - || | OpenBSD 5.2 DragonFly 3.2.1 + | |FreeBSD | | | | + | | 8.3 | | OpenBSD 5.1 | + | | Mac OS X | | | + | | 10.8| | | + | | | NetBSD 6.0 | | + | | | | OpenBSD 5.2 DragonFly 3.2.1 + | FreeBSD | | | | + |9.1 | | | | || | | | FreeBSD 10 -current | NetBSD -current OpenBSD -current | || | | | @@ -555,6 +557,7 @@ Mac OS X 10.8 2012-07-25 [APL] NetBSD 6.0 2012-10-17 [NBD] OpenBSD 5.22012-11-01 [OBD] DragonFly 3.2.12012-11-02 [DFB] +FreeBSD 9.12012-12-30 [FBD] Bibliography ___ 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: r248286 - head/sbin/hastctl
Author: pjd Date: Thu Mar 14 21:21:14 2013 New Revision: 248286 URL: http://svnweb.freebsd.org/changeset/base/248286 Log: Removed redundant includes. Modified: head/sbin/hastctl/hastctl.c Modified: head/sbin/hastctl/hastctl.c == --- head/sbin/hastctl/hastctl.c Thu Mar 14 21:20:46 2013(r248285) +++ head/sbin/hastctl/hastctl.c Thu Mar 14 21:21:14 2013(r248286) @@ -31,21 +31,11 @@ __FBSDID($FreeBSD$); #include sys/param.h -#include sys/disk.h -#include sys/ioctl.h -#include sys/stat.h -#include sys/sysctl.h #include err.h -#include errno.h -#include fcntl.h #include libutil.h -#include limits.h -#include signal.h #include stdio.h -#include stdlib.h #include string.h -#include sysexits.h #include unistd.h #include activemap.h ___ 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: r248290 - head/sys/conf
Author: brooks Date: Thu Mar 14 22:16:13 2013 New Revision: 248290 URL: http://svnweb.freebsd.org/changeset/base/248290 Log: FDT_DTS_FILE is expanded in a Makefile so use :R to remove the suffix rather than using echo|cut to remove everything after the first '.'. Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Thu Mar 14 22:04:53 2013(r248289) +++ head/sys/conf/files Thu Mar 14 22:16:13 2013(r248290) @@ -55,9 +55,9 @@ aic79xx_reg_print.o optional ahd pci ah # from the specified source (DTS) file: platform.dts - platform.dtb # fdt_dtb_file optional fdt \ - compile-with if [ -f $S/boot/fdt/dts/${FDT_DTS_FILE} ]; then dtc -O dtb -o `echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 -p 1024 $S/boot/fdt/dts/${FDT_DTS_FILE}; fi \ + compile-with if [ -f $S/boot/fdt/dts/${FDT_DTS_FILE} ]; then dtc -O dtb -o ${FDT_DTS_FILE:R}.dtb -b 0 -p 1024 $S/boot/fdt/dts/${FDT_DTS_FILE}; fi \ no-obj no-implicit-rule before-depend \ - clean `echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb + clean ${FDT_DTS_FILE:R}.dtb fdt_static_dtb.h optional fdt fdt_dtb_static \ compile-with sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} . \ no-obj no-implicit-rule before-depend \ ___ 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: r248291 - head/sbin/hastctl
Author: marck (doc committer) Date: Thu Mar 14 22:29:37 2013 New Revision: 248291 URL: http://svnweb.freebsd.org/changeset/base/248291 Log: Rename 'status' command to 'list' and introduce new 'status' which produces more terse output more observable for both scripts and humans. Also, it shifts hastctl closer to GEOM utilities with their list/status command pairs. Approved by: pjd MFC after:4 weeks Modified: head/sbin/hastctl/hastctl.8 head/sbin/hastctl/hastctl.c Modified: head/sbin/hastctl/hastctl.8 == --- head/sbin/hastctl/hastctl.8 Thu Mar 14 22:16:13 2013(r248290) +++ head/sbin/hastctl/hastctl.8 Thu Mar 14 22:29:37 2013(r248291) @@ -27,7 +27,7 @@ .\ .\ $FreeBSD$ .\ -.Dd April 10, 2011 +.Dd March 14, 2013 .Dt HASTCTL 8 .Os .Sh NAME @@ -49,6 +49,11 @@ .Aq init | primary | secondary .Ar all | name ... .Nm +.Cm list +.Op Fl d +.Op Fl c Ar config +.Op Ar all | name ... +.Nm .Cm status .Op Fl d .Op Fl c Ar config @@ -139,8 +144,11 @@ GEOM provider .Pa /dev/hast/name will not be created on secondary node. .El +.It Cm list +Present verbose status of the configured resources. .It Cm status -Present status of the configured resources. +Present terse (and more easy machine-parseable) status of the configured +resources. .It Cm dump Dump metadata stored on local component for the configured resources. .El Modified: head/sbin/hastctl/hastctl.c == --- head/sbin/hastctl/hastctl.c Thu Mar 14 22:16:13 2013(r248290) +++ head/sbin/hastctl/hastctl.c Thu Mar 14 22:29:37 2013(r248291) @@ -60,7 +60,8 @@ enum { CMD_CREATE, CMD_ROLE, CMD_STATUS, - CMD_DUMP + CMD_DUMP, + CMD_LIST }; static __dead2 void @@ -75,6 +76,9 @@ usage(void) %s role [-d] [-c config] init | primary | secondary all | name ...\n, getprogname()); fprintf(stderr, + %s list [-d] [-c config] [all | name ...]\n, + getprogname()); + fprintf(stderr, %s status [-d] [-c config] [all | name ...]\n, getprogname()); fprintf(stderr, @@ -287,7 +291,7 @@ control_set_role(struct nv *nv, const ch } static int -control_status(struct nv *nv) +control_list(struct nv *nv) { unsigned int ii; const char *str; @@ -351,6 +355,43 @@ control_status(struct nv *nv) return (ret); } +static int +control_status(struct nv *nv) +{ + unsigned int ii; + const char *str; + int error, hprinted, ret; + + hprinted = 0; + ret = 0; + + for (ii = 0; ; ii++) { + str = nv_get_string(nv, resource%u, ii); + if (str == NULL) + break; + if (!hprinted) { + printf(Name\tStatus\t Role\t\tComponents\n); + hprinted = 1; + } + printf(%s\t, str); + error = nv_get_int16(nv, error%u, ii); + if (error != 0) { + if (ret == 0) + ret = error; + printf(ERR%d\n, error); + continue; + } + str = nv_get_string(nv, status%u, ii); + printf(%-9s, (str != NULL) ? str : -); + printf(%-15s, nv_get_string(nv, role%u, ii)); + printf(%s\t, + nv_get_string(nv, localpath%u, ii)); + printf(%s\n, + nv_get_string(nv, remoteaddr%u, ii)); + } + return (ret); +} + int main(int argc, char *argv[]) { @@ -371,6 +412,9 @@ main(int argc, char *argv[]) } else if (strcmp(argv[1], role) == 0) { cmd = CMD_ROLE; optstr = c:dh; + } else if (strcmp(argv[1], list) == 0) { + cmd = CMD_LIST; + optstr = c:dh; } else if (strcmp(argv[1], status) == 0) { cmd = CMD_STATUS; optstr = c:dh; @@ -459,8 +503,19 @@ main(int argc, char *argv[]) for (ii = 0; ii argc - 1; ii++) nv_add_string(nv, argv[ii + 1], resource%d, ii); break; + case CMD_LIST: + /* Obtain verbose status of the given resources. */ + nv = nv_alloc(); + nv_add_uint8(nv, HASTCTL_CMD_STATUS, cmd); + if (argc == 0) + nv_add_string(nv, all, resource%d, 0); + else { + for (ii = 0; ii argc; ii++) + nv_add_string(nv, argv[ii], resource%d, ii); + } + break; case CMD_STATUS: - /* Obtain status of the given resources. */ + /* Obtain brief status of the given resources. */ nv
svn commit: r248294 - head/sbin/hastd
Author: pjd Date: Thu Mar 14 23:03:48 2013 New Revision: 248294 URL: http://svnweb.freebsd.org/changeset/base/248294 Log: Delete requests can be larger than MAXPHYS. Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c == --- head/sbin/hastd/secondary.c Thu Mar 14 22:57:27 2013(r248293) +++ head/sbin/hastd/secondary.c Thu Mar 14 23:03:48 2013(r248294) @@ -582,7 +582,7 @@ requnpack(struct hast_resource *res, str hio-hio_error = EINVAL; goto end; } - if (hio-hio_length MAXPHYS) { + if (hio-hio_cmd != HIO_DELETE hio-hio_length MAXPHYS) { pjdlog_error(Data length is too large (%ju %ju)., (uintmax_t)hio-hio_length, (uintmax_t)MAXPHYS); hio-hio_error = EINVAL; ___ 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: r248295 - head/sys/geom/gate
Author: pjd Date: Thu Mar 14 23:07:01 2013 New Revision: 248295 URL: http://svnweb.freebsd.org/changeset/base/248295 Log: We don't need buffer to handle BIO_DELETE, so don't check buffer size for it. This fixes handling BIO_DELETE larger than MAXPHYS. Modified: head/sys/geom/gate/g_gate.c Modified: head/sys/geom/gate/g_gate.c == --- head/sys/geom/gate/g_gate.c Thu Mar 14 23:03:48 2013(r248294) +++ head/sys/geom/gate/g_gate.c Thu Mar 14 23:07:01 2013(r248295) @@ -813,7 +813,7 @@ g_gate_ioctl(struct cdev *dev, u_long cm } } ggio-gctl_cmd = bp-bio_cmd; - if ((bp-bio_cmd == BIO_DELETE || bp-bio_cmd == BIO_WRITE) + if (bp-bio_cmd == BIO_WRITE bp-bio_length ggio-gctl_length) { mtx_unlock(sc-sc_queue_mtx); ggio-gctl_length = bp-bio_length; ___ 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: r248296 - head/sbin/hastd
Author: pjd Date: Thu Mar 14 23:11:52 2013 New Revision: 248296 URL: http://svnweb.freebsd.org/changeset/base/248296 Log: Minor corrections. Modified: head/sbin/hastd/hastd.8 Modified: head/sbin/hastd/hastd.8 == --- head/sbin/hastd/hastd.8 Thu Mar 14 23:07:01 2013(r248295) +++ head/sbin/hastd/hastd.8 Thu Mar 14 23:11:52 2013(r248296) @@ -51,7 +51,7 @@ Only one machine (cluster node) can acti This machine is called primary. The .Nm -daemon operates on block level, which makes it transparent for file +daemon operates on block level, which makes it transparent to file systems and applications. .Pp There is one main @@ -68,7 +68,7 @@ The exact format is: hastd: resource name (role) .Ed .Pp -When (and only when) +If (and only if) .Nm operates in primary role for the given resource, corresponding .Pa /dev/hast/name @@ -77,8 +77,8 @@ File systems and applications can use th requests to. Every write, delete and flush operation .Dv ( BIO_WRITE , BIO_DELETE , BIO_FLUSH ) -is send to local component and synchronously replicated -to the remote (secondary) node if it is available. +is send to local component and replicated to the remote (secondary) node if it +is available. Read operations .Dv ( BIO_READ ) are handled locally unless I/O error occurs or local version of the data ___ 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: r248297 - head/sbin/hastd
Author: pjd Date: Thu Mar 14 23:14:47 2013 New Revision: 248297 URL: http://svnweb.freebsd.org/changeset/base/248297 Log: Now that ioctl(2) is allowed in capability mode and we can limit ioctls for the given descriptors, use Capsicum sandboxing for hastd in primary and secondary modes. Allow for DIOCGDELETE and DIOCGFLUSH ioctls on provider descriptor and for G_GATE_CMD_MODIFY, G_GATE_CMD_START, G_GATE_CMD_DONE and G_GATE_CMD_DESTROY on GEOM Gate descriptor. Sponsored by: The FreeBSD Foundation Modified: head/sbin/hastd/subr.c Modified: head/sbin/hastd/subr.c == --- head/sbin/hastd/subr.c Thu Mar 14 23:11:52 2013(r248296) +++ head/sbin/hastd/subr.c Thu Mar 14 23:14:47 2013(r248297) @@ -31,14 +31,15 @@ #include sys/cdefs.h __FBSDID($FreeBSD$); -#ifdef HAVE_CAPSICUM -#include sys/capability.h -#endif #include sys/param.h #include sys/disk.h #include sys/ioctl.h #include sys/jail.h #include sys/stat.h +#ifdef HAVE_CAPSICUM +#include sys/capability.h +#include geom/gate/g_gate.h +#endif #include errno.h #include fcntl.h @@ -224,22 +225,53 @@ drop_privs(const struct hast_resource *r return (-1); } - /* -* Until capsicum doesn't allow ioctl(2) we cannot use it to sandbox -* primary and secondary worker processes, as primary uses GGATE -* ioctls and secondary uses ioctls to handle BIO_DELETE and BIO_FLUSH. -* For now capsicum is only used to sandbox hastctl. -*/ #ifdef HAVE_CAPSICUM - if (res == NULL) { - capsicum = (cap_enter() == 0); - if (!capsicum) { - pjdlog_common(LOG_DEBUG, 1, errno, - Unable to sandbox using capsicum); + capsicum = (cap_enter() == 0); + if (!capsicum) { + pjdlog_common(LOG_DEBUG, 1, errno, + Unable to sandbox using capsicum); + } else if (res != NULL) { + static const unsigned long geomcmds[] = { + DIOCGDELETE, + DIOCGFLUSH + }; + + PJDLOG_ASSERT(res-hr_role == HAST_ROLE_PRIMARY || + res-hr_role == HAST_ROLE_SECONDARY); + + if (cap_rights_limit(res-hr_localfd, + CAP_FLOCK | CAP_IOCTL | CAP_PREAD | CAP_PWRITE) == -1) { + pjdlog_errno(LOG_ERR, + Unable to limit capability rights on local descriptor); + } + if (cap_ioctls_limit(res-hr_localfd, geomcmds, + sizeof(geomcmds) / sizeof(geomcmds[0])) == -1) { + pjdlog_errno(LOG_ERR, + Unable to limit allowed GEOM ioctls); + } + + if (res-hr_role == HAST_ROLE_PRIMARY) { + static const unsigned long ggatecmds[] = { + G_GATE_CMD_MODIFY, + G_GATE_CMD_START, + G_GATE_CMD_DONE, + G_GATE_CMD_DESTROY + }; + + if (cap_rights_limit(res-hr_ggatefd, CAP_IOCTL) == -1) { + pjdlog_errno(LOG_ERR, + Unable to limit capability rights to CAP_IOCTL on ggate descriptor); + } + if (cap_ioctls_limit(res-hr_ggatefd, ggatecmds, + sizeof(ggatecmds) / sizeof(ggatecmds[0])) == -1) { + pjdlog_errno(LOG_ERR, + Unable to limit allowed ggate ioctls); + } } - } else + } +#else + capsicum = false; #endif - capsicum = false; /* * Better be sure that everything succeeded. ___ 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: r248298 - head/sys/kern
Author: trasz Date: Thu Mar 14 23:20:18 2013 New Revision: 248298 URL: http://svnweb.freebsd.org/changeset/base/248298 Log: Accessing td_state requires thread lock to be held. Submitted by: Rudo Tomori Reviewed by: kib Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c == --- head/sys/kern/kern_racct.c Thu Mar 14 23:14:47 2013(r248297) +++ head/sys/kern/kern_racct.c Thu Mar 14 23:20:18 2013(r248298) @@ -1033,6 +1033,7 @@ racct_proc_throttle(struct proc *p) p-p_throttled = 1; FOREACH_THREAD_IN_PROC(p, td) { + thread_lock(td); switch (td-td_state) { case TDS_RUNQ: /* @@ -1041,27 +1042,24 @@ racct_proc_throttle(struct proc *p) * TDF_NEEDRESCHED for the thread, so that once it is * running, it is taken off the cpu as soon as possible. */ - thread_lock(td); td-td_flags |= TDF_NEEDRESCHED; - thread_unlock(td); break; case TDS_RUNNING: /* * If the thread is running, we request a context * switch for it by setting the TDF_NEEDRESCHED flag. */ - thread_lock(td); td-td_flags |= TDF_NEEDRESCHED; #ifdef SMP cpuid = td-td_oncpu; if ((cpuid != NOCPU) (td != curthread)) ipi_cpu(cpuid, IPI_AST); #endif - thread_unlock(td); break; default: break; } + thread_unlock(td); } } ___ 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: r248300 - head/sys/kern
Author: trasz Date: Thu Mar 14 23:25:42 2013 New Revision: 248300 URL: http://svnweb.freebsd.org/changeset/base/248300 Log: When throttling a process to enforce RACCT limits, do not use neither PBDRY (which simply doesn't make any sense) nor PCATCH (which could be used by a malicious process to work around the PCPU limit). Submitted by: Rudo Tomori Reviewed by: kib Modified: head/sys/kern/subr_trap.c Modified: head/sys/kern/subr_trap.c == --- head/sys/kern/subr_trap.c Thu Mar 14 23:25:01 2013(r248299) +++ head/sys/kern/subr_trap.c Thu Mar 14 23:25:42 2013(r248300) @@ -100,9 +100,6 @@ void userret(struct thread *td, struct trapframe *frame) { struct proc *p = td-td_proc; -#ifdef RACCT - int sig; -#endif CTR3(KTR_SYSC, userret: thread %p (pid %d, %s), td, p-p_pid, td-td_name); @@ -175,12 +172,8 @@ userret(struct thread *td, struct trapfr #endif #ifdef RACCT PROC_LOCK(p); - while (p-p_throttled == 1) { - sig = msleep(p-p_racct, p-p_mtx, PCATCH | PBDRY, racct, - hz); - if ((sig == EINTR) || (sig == ERESTART)) - break; - } + while (p-p_throttled == 1) + msleep(p-p_racct, p-p_mtx, 0, racct, 0); PROC_UNLOCK(p); #endif } ___ 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: r248302 - in head: contrib/libc-vis lib/libc/gen
Author: brooks Date: Thu Mar 14 23:51:47 2013 New Revision: 248302 URL: http://svnweb.freebsd.org/changeset/base/248302 Log: Update to the latest (un)vis(3) sources from NetBSD. This adds multibyte support[0] and the new functions strenvisx and strsenvisx. Add MLINKS for vis(3) functions add by this and the initial import from NetBSD[1]. PR: bin/166364, bin/175418 Submitted by: J.R. Oldroyd f...@opal.com[0] stefanf[1] Obtained from:NetBSD MFC after:2 weeks Modified: head/contrib/libc-vis/unvis.3 head/contrib/libc-vis/unvis.c head/contrib/libc-vis/vis.3 head/contrib/libc-vis/vis.c head/contrib/libc-vis/vis.h head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map Directory Properties: head/contrib/libc-vis/ (props changed) Modified: head/contrib/libc-vis/unvis.3 == --- head/contrib/libc-vis/unvis.3 Thu Mar 14 23:35:52 2013 (r248301) +++ head/contrib/libc-vis/unvis.3 Thu Mar 14 23:51:47 2013 (r248302) @@ -1,4 +1,4 @@ -.\$NetBSD: unvis.3,v 1.23 2011/03/17 14:06:29 wiz Exp $ +.\$NetBSD: unvis.3,v 1.27 2012/12/15 07:34:36 wiz Exp $ .\$FreeBSD$ .\ .\ Copyright (c) 1989, 1991, 1993 @@ -126,15 +126,17 @@ The function has several return codes that must be handled properly. They are: .Bl -tag -width UNVIS_VALIDPUSH -.It Li \0 (zero) +.It Li \0 No (zero) Another character is necessary; nothing has been recognized yet. .It Dv UNVIS_VALID A valid character has been recognized and is available at the location -pointed to by cp. +pointed to by +.Fa cp . .It Dv UNVIS_VALIDPUSH A valid character has been recognized and is available at the location -pointed to by cp; however, the character currently passed in should -be passed in again. +pointed to by +.Fa cp ; +however, the character currently passed in should be passed in again. .It Dv UNVIS_NOCHAR A valid sequence was detected, but no character was produced. This return code is necessary to indicate a logical break between characters. @@ -150,7 +152,7 @@ one more time with flag set to to extract any remaining character (the character passed in is ignored). .Pp The -.Ar flag +.Fa flag argument is also used to specify the encoding style of the source. If set to .Dv VIS_HTTPSTYLE @@ -161,7 +163,8 @@ will decode URI strings as specified in If set to .Dv VIS_HTTP1866 , .Fn unvis -will decode URI strings as specified in RFC 1866. +will decode entity references and numeric character references +as specified in RFC 1866. If set to .Dv VIS_MIMESTYLE , .Fn unvis @@ -169,7 +172,9 @@ will decode MIME Quoted-Printable string If set to .Dv VIS_NOESCAPE , .Fn unvis -will not decode \e quoted characters. +will not decode +.Ql \e +quoted characters. .Pp The following code fragment illustrates a proper use of .Fn unvis . @@ -204,7 +209,7 @@ The functions and .Fn strnunvisx will return \-1 on error and set -.Va errno +.Va errno to: .Bl -tag -width Er .It Bq Er EINVAL @@ -212,7 +217,7 @@ An invalid escape sequence was detected, .El .Pp In addition the functions -.Fn strnunvis +.Fn strnunvis and .Fn strnunvisx will can also set @@ -244,4 +249,14 @@ and functions appeared in .Nx 6.0 and -.Fx 10.0 . +.Fx 9.2 . +.Sh BUGS +The names +.Dv VIS_HTTP1808 +and +.Dv VIS_HTTP1866 +are wrong. +Percent-encoding was defined in RFC 1738, the original RFC for URL. +RFC 1866 defines HTML 2.0, an application of SGML, from which it +inherits concepts of numeric character references and entity +references. Modified: head/contrib/libc-vis/unvis.c == --- head/contrib/libc-vis/unvis.c Thu Mar 14 23:35:52 2013 (r248301) +++ head/contrib/libc-vis/unvis.c Thu Mar 14 23:51:47 2013 (r248302) @@ -1,4 +1,4 @@ -/* $NetBSD: unvis.c,v 1.40 2012/12/14 21:31:01 christos Exp $ */ +/* $NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = @(#)unvis.c8.1 (Berkeley) 6/4/93; #else -__RCSID($NetBSD: unvis.c,v 1.40 2012/12/14 21:31:01 christos Exp $); +__RCSID($NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $); #endif #endif /* LIBC_SCCS and not lint */ __FBSDID($FreeBSD$); @@ -90,7 +90,7 @@ __weak_alias(strnunvisx,_strnunvisx) * RFC 1866 */ static const struct nv { - const char name[7]; + char name[7]; uint8_t value; } nv[] = { { AElig, 198 }, /* capital AE diphthong (ligature) */ Modified: head/contrib/libc-vis/vis.3 == --- head/contrib/libc-vis/vis.3 Thu Mar 14 23:35:52 2013(r248301) +++ head/contrib/libc-vis/vis.3 Thu Mar 14 23:51:47 2013(r248302) @@ -1,4 +1,4 @@ -.\$NetBSD: vis.3,v 1.29 2012/12/14 22:55:59 christos Exp $ +.\
svn commit: r248303 - in head: contrib/unvis contrib/vis usr.bin/unvis usr.bin/vis
Author: brooks Date: Fri Mar 15 00:05:50 2013 New Revision: 248303 URL: http://svnweb.freebsd.org/changeset/base/248303 Log: Replace our (un)vis(1) commands with implementations from NetBSD to match our import of the (un)vis(3) APIs. This adds support for multibyte encoding and the -h and -m flags which support HTTP and MIME encoding respectively. PR: bin/175418 Obtained from:NetBSD Added: head/contrib/unvis/ - copied from r247132, vendor/NetBSD/unvis/dist/ head/contrib/vis/ - copied from r247132, vendor/NetBSD/vis/dist/ Deleted: head/usr.bin/unvis/unvis.1 head/usr.bin/unvis/unvis.c head/usr.bin/vis/extern.h head/usr.bin/vis/foldit.c head/usr.bin/vis/vis.1 head/usr.bin/vis/vis.c Modified: head/usr.bin/unvis/Makefile head/usr.bin/vis/Makefile Modified: head/usr.bin/unvis/Makefile == --- head/usr.bin/unvis/Makefile Thu Mar 14 23:51:47 2013(r248302) +++ head/usr.bin/unvis/Makefile Fri Mar 15 00:05:50 2013(r248303) @@ -3,4 +3,6 @@ PROG= unvis +.PATH: ${.CURDIR}/../../contrib/unvis + .include bsd.prog.mk Modified: head/usr.bin/vis/Makefile == --- head/usr.bin/vis/Makefile Thu Mar 14 23:51:47 2013(r248302) +++ head/usr.bin/vis/Makefile Fri Mar 15 00:05:50 2013(r248303) @@ -1,6 +1,10 @@ # @(#)Makefile8.1 (Berkeley) 6/6/93 +# $FreeBSD$ PROG= vis SRCS= vis.c foldit.c +.PATH: ${.CURDIR}/../../contrib/vis +CFLAGS+= -I${.CURDIR}/../../contrib/vis + .include bsd.prog.mk ___ 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: r248304 - head/tools/regression/pjdfstest/tests
Author: pjd Date: Fri Mar 15 00:10:38 2013 New Revision: 248304 URL: http://svnweb.freebsd.org/changeset/base/248304 Log: Make file name generation to work with both new and old versions of OpenSSL. Sponsored by: The FreeBSD Foundation Modified: head/tools/regression/pjdfstest/tests/misc.sh Modified: head/tools/regression/pjdfstest/tests/misc.sh == --- head/tools/regression/pjdfstest/tests/misc.sh Fri Mar 15 00:05:50 2013(r248303) +++ head/tools/regression/pjdfstest/tests/misc.sh Fri Mar 15 00:10:38 2013(r248304) @@ -89,7 +89,7 @@ todo() namegen() { - echo pjdfstest_`dd if=/dev/urandom bs=1k count=1 2/dev/null | openssl md5` + echo pjdfstest_`dd if=/dev/urandom bs=1k count=1 2/dev/null | openssl md5 | awk '{print $NF}'` } namegen_len() @@ -98,7 +98,7 @@ namegen_len() name= while :; do - namepart=`dd if=/dev/urandom bs=64 count=1 2/dev/null | openssl md5` + namepart=`dd if=/dev/urandom bs=64 count=1 2/dev/null | openssl md5 | awk '{print $NF}'` name=${name}${namepart} curlen=`printf %s ${name} | wc -c` [ ${curlen} -lt ${len} ] || 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: r248307 - head/contrib/tzdata
Author: edwin Date: Fri Mar 15 00:27:24 2013 New Revision: 248307 URL: http://svnweb.freebsd.org/changeset/base/248307 Log: MFV of 248305, tzdata2013b Lots of historical data added. Morocco: add DST rules for the coming years Cuba: Doing DST in 2013. Chili: Will do DST in 2013 as it seems. Modified: head/contrib/tzdata/africa head/contrib/tzdata/antarctica head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/europe head/contrib/tzdata/northamerica head/contrib/tzdata/southamerica head/contrib/tzdata/zone.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/africa == --- head/contrib/tzdata/africa Fri Mar 15 00:25:54 2013(r248306) +++ head/contrib/tzdata/africa Fri Mar 15 00:27:24 2013(r248307) @@ -6,7 +6,7 @@ # go ahead and edit the file (and please send any changes to # t...@iana.org for general use in the future). -# From Paul Eggert (2006-03-22): +# From Paul Eggert (2013-02-21): # # A good source for time zone historical data outside the U.S. is # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -25,6 +25,10 @@ # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which # I found in the UCLA library. # +# For data circa 1899, a common source is: +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 +# http://www.jstor.org/stable/1774359. +# # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # @@ -116,8 +120,12 @@ Zone Africa/Porto-Novo 0:10:28 - LMT 191 1:00- WAT # Botswana +# From Paul Eggert (2013-02-21): +# Milne says they were regulated by the Cape Town Signal in 1899; +# assume they switched to 2:00 when Cape Town did. # Zone NAMEGMTOFF RULES FORMAT [UNTIL] Zone Africa/Gaborone 1:43:40 - LMT 1885 + 1:30- SAST1903 Mar 2:00- CAT 1943 Sep 19 2:00 2:001:00CAST1944 Mar 19 2:00 2:00- CAT @@ -189,6 +197,11 @@ Zone Africa/Djibouti 2:52:36 - LMT 1911 # Egypt +# Milne says Cairo used 2:05:08.9, the local mean time of the Abbasizeh +# observatory; round to nearest. Milne also says that the official time for +# Egypt was mean noon at the Great Pyramid, 2:04:30.5, but apparently this +# did not apply to Cairo, Alexandria, or Port Said. + # Rule NAMEFROMTO TYPEIN ON AT SAVELETTER/S Rule Egypt 1940only- Jul 15 0:001:00S Rule Egypt 1940only- Oct 1 0:000 - @@ -329,7 +342,7 @@ RuleEgypt 2010only- Sep 10 0:001:00 Rule Egypt 2010only- Sep lastThu 23:00s 0 - # Zone NAMEGMTOFF RULES FORMAT [UNTIL] -Zone Africa/Cairo2:05:00 - LMT 1900 Oct +Zone Africa/Cairo2:05:09 - LMT 1900 Oct 2:00Egypt EE%sT # Equatorial Guinea @@ -833,6 +846,41 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # 3:00 am Friday, July 20, 2012 and will again be advanced by 60 minutes # August 20, 2012 from 2:00 am. +# From Paul Eggert (2013-03-06): +# Morocco's daylight-saving transitions due to Ramadan seem to be +# announced a bit in advance. On 2012-07-11 the Moroccan government +# announced that year's Ramadan daylight-saving transitions would be +# 2012-07-20 and 2012-08-20; see +# http://www.mmsp.gov.ma/fr/actualites.aspx?id=288. +# +# To estimate what the Moroccan government will do in future years, +# transition dates for 2013 through 2021 were determined by running +# the following program under GNU Emacs 24.3: +# +# (let ((islamic-year 1434)) +# (while ( islamic-year 1444) +# (let ((a +# (calendar-gregorian-from-absolute +#(calendar-islamic-to-absolute (list 9 1 islamic-year +# (b +# (calendar-gregorian-from-absolute +#(calendar-islamic-to-absolute (list 10 1 islamic-year) +# (insert +# (format +#(concat Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 3:00\t0\t-\n +#Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 2:00\t1:00\tS\n) +#(car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) +#(car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b) +# (setq islamic-year (+ 1 islamic-year +# +# with the results hand-edited for 2020-2022, when the normal spring-forward +# date falls during the estimated Ramadan. +# +# From 2023 through 2038 Ramadan is not predicted to overlap with +# daylight saving time. Starting in 2039 there will be overlap again, +# but 32-bit
svn commit: r248311 - head/sys/dev/ath
Author: adrian Date: Fri Mar 15 02:52:37 2013 New Revision: 248311 URL: http://svnweb.freebsd.org/changeset/base/248311 Log: Add locking around the new holdingbf code. Since this is being done during buffer free, it's a crap shoot whether the TX path lock is held or not. I tried putting the ath_freebuf() code inside the TX lock and I got all kinds of locking issues - it turns out that the buffer free path sometimes is called with the lock held and sometimes isn't. So I'll go and fix that soon. Hence for now the holdingbf buffers are protected by the TXBUF lock. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c == --- head/sys/dev/ath/if_ath.c Fri Mar 15 01:02:35 2013(r248310) +++ head/sys/dev/ath/if_ath.c Fri Mar 15 02:52:37 2013(r248311) @@ -4156,14 +4156,13 @@ ath_returnbuf_head(struct ath_softc *sc, static void ath_txq_freeholdingbuf(struct ath_softc *sc, struct ath_txq *txq) { + ATH_TXBUF_LOCK_ASSERT(sc); if (txq-axq_holdingbf == NULL) return; txq-axq_holdingbf-bf_flags = ~ATH_BUF_BUSY; - ATH_TXBUF_LOCK(sc); ath_returnbuf_tail(sc, txq-axq_holdingbf); - ATH_TXBUF_UNLOCK(sc); txq-axq_holdingbf = NULL; } @@ -4176,6 +4175,8 @@ ath_txq_addholdingbuf(struct ath_softc * { struct ath_txq *txq; + ATH_TXBUF_LOCK_ASSERT(sc); + /* XXX assert ATH_BUF_BUSY is set */ /* XXX assert the tx queue is under the max number */ @@ -4188,10 +4189,8 @@ ath_txq_addholdingbuf(struct ath_softc * ath_returnbuf_tail(sc, bf); return; } - txq = sc-sc_txq[bf-bf_state.bfs_tx_queue]; ath_txq_freeholdingbuf(sc, txq); - txq-axq_holdingbf = bf; } @@ -4219,7 +4218,9 @@ ath_freebuf(struct ath_softc *sc, struct * If this buffer is busy, push it onto the holding queue */ if (bf-bf_flags ATH_BUF_BUSY) { + ATH_TXBUF_LOCK(sc); ath_txq_addholdingbuf(sc, bf); + ATH_TXBUF_UNLOCK(sc); return; } @@ -4342,7 +4343,9 @@ ath_tx_draintxq(struct ath_softc *sc, st /* * Free the holding buffer if it exists */ + ATH_TXBUF_LOCK(sc); ath_txq_freeholdingbuf(sc, txq); + ATH_TXBUF_UNLOCK(sc); /* * Drain software queued frames which are on Modified: head/sys/dev/ath/if_athvar.h == --- head/sys/dev/ath/if_athvar.hFri Mar 15 01:02:35 2013 (r248310) +++ head/sys/dev/ath/if_athvar.hFri Mar 15 02:52:37 2013 (r248311) @@ -329,6 +329,15 @@ struct ath_txq { u_int axq_intrcnt;/* interrupt count */ u_int32_t *axq_link; /* link ptr in last TX desc */ TAILQ_HEAD(axq_q_s, ath_buf)axq_q; /* transmit queue */ + /* +* XXX the holdingbf field is protected by the TXBUF lock +* for now, NOT the TX lock. +* +* Architecturally, it would likely be better to move +* the holdingbf field to a separate array in ath_softc +* just to highlight that it's not protected by the normal +* TX path lock. +*/ struct ath_buf *axq_holdingbf; /* holding TX buffer */ charaxq_name[12]; /* e.g. ath0_txq4 */ ___ 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: r248312 - head/sys/dev/ath
Author: adrian Date: Fri Mar 15 04:43:27 2013 New Revision: 248312 URL: http://svnweb.freebsd.org/changeset/base/248312 Log: Remove a now incorrect comment. This comment dates back to my initial stab at TX aggregation completion, where I didn't even bother trying to do software retries. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c == --- head/sys/dev/ath/if_ath_tx.cFri Mar 15 02:52:37 2013 (r248311) +++ head/sys/dev/ath/if_ath_tx.cFri Mar 15 04:43:27 2013 (r248312) @@ -4176,8 +4176,6 @@ ath_tx_comp_cleanup_aggr(struct ath_soft /* * Handle completion of an set of aggregate frames. * - * XXX for now, simply complete each sub-frame. - * * Note: the completion handler is the last descriptor in the aggregate, * not the last descriptor in the first frame. */ ___ 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