Re: svn commit: r247116 - in head/sys: fs/nfs fs/nfsclient kern nfsclient sys tools
On Tue, 26 Feb 2013 01:49:42 -0600 Alan Cox wrote: > On 02/26/2013 01:27, Andrew Turner wrote: > > On Mon, 25 Feb 2013 15:00:41 -0600 > > Alan Cox wrote: > > > >> On Feb 25, 2013, at 4:36 AM, Andrew Turner wrote: > >> > >>> On Mon, 25 Feb 2013 10:50:19 +0200 > >>> Konstantin Belousov wrote: > >>> > On Mon, Feb 25, 2013 at 08:13:13PM +1300, Andrew Turner wrote: > > On Thu, 21 Feb 2013 19:02:50 + (UTC) > > John Baldwin wrote: > > > >> Author: jhb > >> Date: Thu Feb 21 19:02:50 2013 > >> New Revision: 247116 > >> URL: http://svnweb.freebsd.org/changeset/base/247116 > >> > >> Log: > >> Further refine the handling of stop signals in the NFS client. > >> The changes in r246417 were incomplete as they did not add > >> explicit calls to sigdeferstop() around all the places that > >> previously passed SBDRY to _sleep(). In addition, > >> nfs_getcacheblk() could trigger a write RPC from getblk() > >> resulting in sigdeferstop() recursing. Rather than manually > >> deferring stop signals in specific places, change the VFS_*() > >> and VOP_*() methods to defer stop signals for filesystems which > >> request this behavior via a new VFCF_SBDRY flag. Note that this > >> has to be a VFC flag rather than a MNTK flag so that it works > >> properly with VFS_MOUNT() when the mount is not yet fully > >> constructed. For now, only the NFS clients are set this new > >> flag in VFS_SET(). A few other related changes: > >> - Add an assertion to ensure that TDF_SBDRY doesn't leak to > >> userland. > >> - When a lookup request uses VOP_READLINK() to follow a > >> symlink, mark the request as being on behalf of the thread > >> performing the lookup (cnp_thread) rather than using a NULL > >> thread pointer. This causes NFS to properly handle signals > >> during this VOP on an interruptible mount. > >> > >> PR: kern/176179 > >> Reported by: Russell Cattelan (sigdeferstop() > >> recursion) Reviewed by:kib > >> MFC after:1 month > > This change is causing init to crash for me on armv6. I'm > > netbooting a PandaBoard and it appears init is receiving a > > SIGABRT before it gets into main(). > > > > Do you have any idea where I could look to track down why it is > > doing this? > It is weird. SIGABRT sent by the kernel usually means that > execve(2) already destroyed the previous address space of the > process, but the new image cannot be activated, most likely due > to image format error discovered too late, or resource shortage. > > Could it be that some NFS RPC fails after the patch, but I cannot > imagine why. You would need to track this. Also, verify that the > init binary is correct. > > I tried amd64 netboot, and it worked fine. > >>> It looks like this change is not the issue, it just changed the > >>> symptom enough for me to not realise I was seeing an issue where > >>> it would crash the kernel before. I reinstated this change but > >>> only allowed the kernel to access half the memory and it booted > >>> correctly. > >>> > >>> The real issue appears to be related to something in the vm layer > >>> not working on ARM boards with too much memory (somewhere between > >>> 512MiB and 1GiB). > >> > >> The recently introduced auto-sizing and cap may be too optimistic. > >> In fact, they are greater than what we allow on 32-bit x86 and > >> 32-bit MIPS. Try the following. > >> > >> Index: arm/include/vmparam.h > >> === > >> --- arm/include/vmparam.h (revision 247249) > >> +++ arm/include/vmparam.h (working copy) > >> @@ -142,15 +142,15 @@ > >> #define VM_KMEM_SIZE (12*1024*1024) > >> #endif > >> #ifndef VM_KMEM_SIZE_SCALE > >> -#define VM_KMEM_SIZE_SCALE(2) > >> +#define VM_KMEM_SIZE_SCALE(3) > >> #endif > >> > >> /* > >> - * Ceiling on the size of the kmem submap: 60% of the kernel map. > >> + * Ceiling on the size of the kmem submap: 40% of the kernel map. > >> */ > >> #ifndef VM_KMEM_SIZE_MAX > >> #define VM_KMEM_SIZE_MAX((vm_max_kernel_address - \ > >> -VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) > >> +VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) > >> #endif > >> > >> #define MAXTSIZ (16*1024*1024) > >> > > This patch fixes the boot for me. Is it likely we will see similar > > issues with boards with more memory with this? I know of ARM boards > > with 2GiB of ram, and I would expect to see some with more soon. > > > > The kmem submap should be fine, but other things might become a > problem. > > What do "sysctl -x vm.min_kernel_address" and "sysctl -x > vm.max_kernel_address" report on your machine? I get the following. # sysctl -x vm.min_kernel_address vm.min_kernel_address: 0xc000 # sysctl -x vm.max_kernel_address vm.max_kernel_address: 0xdf00 Andrew _
svn commit: r247314 - head/sys/arm/include
Author: alc Date: Tue Feb 26 08:17:34 2013 New Revision: 247314 URL: http://svnweb.freebsd.org/changeset/base/247314 Log: Be more conservative in auto-sizing and capping the kmem submap. In fact, use the same values here that we use on 32-bit x86 and MIPS. Some machines were reported to have problems with the more aggressive values. Reported and tested by: andrew Modified: head/sys/arm/include/vmparam.h Modified: head/sys/arm/include/vmparam.h == --- head/sys/arm/include/vmparam.h Tue Feb 26 07:41:34 2013 (r247313) +++ head/sys/arm/include/vmparam.h Tue Feb 26 08:17:34 2013 (r247314) @@ -142,15 +142,15 @@ #define VM_KMEM_SIZE (12*1024*1024) #endif #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (2) +#define VM_KMEM_SIZE_SCALE (3) #endif /* - * Ceiling on the size of the kmem submap: 60% of the kernel map. + * Ceiling on the size of the kmem submap: 40% of the kernel map. */ #ifndef VM_KMEM_SIZE_MAX #defineVM_KMEM_SIZE_MAX((vm_max_kernel_address - \ -VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) +VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) #endif #define MAXTSIZ(16*1024*1024) ___ 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: r247317 - head/sys/dev/ath/ath_rate/sample
Author: adrian Date: Tue Feb 26 10:24:49 2013 New Revision: 247317 URL: http://svnweb.freebsd.org/changeset/base/247317 Log: Update the EWMA statistics for each intermediary rate as well as the final rate. This fixes two things: * The intermediary rates now also have their EWMA values changed; * The existing code was using the wrong value for longtries - so the EWMA stats were only adjusted for the first rate and not subsequent rates in a MRR setup. TODO: * Merge the EWMA updates into update_stats() now.. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c == --- head/sys/dev/ath/ath_rate/sample/sample.c Tue Feb 26 08:53:33 2013 (r247316) +++ head/sys/dev/ath/ath_rate/sample/sample.c Tue Feb 26 10:24:49 2013 (r247317) @@ -1008,6 +1008,15 @@ ath_rate_tx_complete(struct ath_softc *s short_tries, long_tries, long_tries > rc[0].tries, nframes, nbad); + update_ewma_stats(sc, an, frame_size, +rc[0].rix, rc[0].tries, +rc[1].rix, rc[1].tries, +rc[2].rix, rc[2].tries, +rc[3].rix, rc[3].tries, +short_tries, long_tries, +long_tries > rc[0].tries, +nframes, nbad); + long_tries -= rc[0].tries; } @@ -1020,6 +1029,14 @@ ath_rate_tx_complete(struct ath_softc *s short_tries, long_tries, status, nframes, nbad); + update_ewma_stats(sc, an, frame_size, +rc[1].rix, rc[1].tries, +rc[2].rix, rc[2].tries, +rc[3].rix, rc[3].tries, +0, 0, +short_tries, long_tries, +status, +nframes, nbad); long_tries -= rc[1].tries; } @@ -1032,6 +1049,14 @@ ath_rate_tx_complete(struct ath_softc *s short_tries, long_tries, status, nframes, nbad); + update_ewma_stats(sc, an, frame_size, +rc[2].rix, rc[2].tries, +rc[3].rix, rc[3].tries, +0, 0, +0, 0, +short_tries, long_tries, +status, +nframes, nbad); long_tries -= rc[2].tries; } @@ -1044,17 +1069,15 @@ ath_rate_tx_complete(struct ath_softc *s short_tries, long_tries, status, nframes, nbad); + update_ewma_stats(sc, an, frame_size, +rc[3].rix, rc[3].tries, +0, 0, +0, 0, +0, 0, +short_tries, long_tries, +status, +nframes, nbad); } - - update_ewma_stats(sc, an, frame_size, -rc[0].rix, rc[0].tries, -rc[1].rix, rc[1].tries, -rc[2].rix, rc[2].tries, -rc[3].rix, rc[3].tries, -short_tries, long_tries, -long_tries > rc[0].tries, -nframes, nbad); - } } ___ 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: r247318 - head/sys/dev/hwpmc
Author: mav Date: Tue Feb 26 13:59:39 2013 New Revision: 247318 URL: http://svnweb.freebsd.org/changeset/base/247318 Log: Change the way how software PMC updates counters. This at least fixes -n option of pmcstat. Reviewed by: fabient Modified: head/sys/dev/hwpmc/hwpmc_soft.c Modified: head/sys/dev/hwpmc/hwpmc_soft.c == --- head/sys/dev/hwpmc/hwpmc_soft.c Tue Feb 26 10:24:49 2013 (r247317) +++ head/sys/dev/hwpmc/hwpmc_soft.c Tue Feb 26 13:59:39 2013 (r247318) @@ -408,8 +408,11 @@ pmc_soft_intr(struct pmckern_soft *ks) } processed = 1; - pc->soft_values[ri]++; if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) { + if ((pc->soft_values[ri]--) <= 0) + pc->soft_values[ri] += pm->pm_sc.pm_reloadcount; + else + continue; user_mode = TRAPF_USERMODE(ks->pm_tf); error = pmc_process_interrupt(ks->pm_cpu, PMC_SR, pm, ks->pm_tf, user_mode); @@ -424,7 +427,8 @@ pmc_soft_intr(struct pmckern_soft *ks) */ curthread->td_flags |= TDF_ASTPENDING; } - } + } else + pc->soft_values[ri]++; } atomic_add_int(processed ? &pmc_stats.pm_intr_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"
Re: svn commit: r247300 - in head: sys/sys usr.bin/truss
On Monday, February 25, 2013 9:13:02 pm Xin LI wrote: > Author: delphij > Date: Tue Feb 26 02:13:02 2013 > New Revision: 247300 > URL: http://svnweb.freebsd.org/changeset/base/247300 > > Log: > Expose timespec and timeval macros when __BSD_VISIBLE is defined. This > allows userland application to use the following macros: > > timespecclear, timespecisset, timespeccmp, timespecadd, > timespecsub; > > timevalclear, timevalisset, timevalcmp. Why not fix truss to use the stock functions instead of keeping private "unusual" versions? -- John Baldwin ___ 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: r247300 - in head: sys/sys usr.bin/truss
On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin wrote: > On Monday, February 25, 2013 9:13:02 pm Xin LI wrote: >> Author: delphij >> Date: Tue Feb 26 02:13:02 2013 >> New Revision: 247300 >> URL: http://svnweb.freebsd.org/changeset/base/247300 >> >> Log: >> Expose timespec and timeval macros when __BSD_VISIBLE is defined. This >> allows userland application to use the following macros: >> >> timespecclear, timespecisset, timespeccmp, timespecadd, >> timespecsub; >> >> timevalclear, timevalisset, timevalcmp. > > Why not fix truss to use the stock functions instead of keeping private > "unusual" versions? > > -- > John Baldwin time.h is already a mess in terms of namespace pollution, and this exposure might not help thing. Other details here: http://permalink.gmane.org/gmane.os.freebsd.architechture/15518 -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare ___ 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: r247323 - head/sys/vm
Author: attilio Date: Tue Feb 26 17:22:08 2013 New Revision: 247323 URL: http://svnweb.freebsd.org/changeset/base/247323 Log: Wrap the sleeps synchronized by the vm_object lock into the specific macro VM_OBJECT_SLEEP(). This hides some implementation details like the usage of the msleep() primitive and the necessity to access to the lock address directly. For this reason VM_OBJECT_MTX() macro is now retired. Sponsored by: EMC / Isilon storage division Reviewed by: alc Tested by:pho Modified: head/sys/vm/swap_pager.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c head/sys/vm/vnode_pager.c Modified: head/sys/vm/swap_pager.c == --- head/sys/vm/swap_pager.cTue Feb 26 16:55:59 2013(r247322) +++ head/sys/vm/swap_pager.cTue Feb 26 17:22:08 2013(r247323) @@ -1213,7 +1213,7 @@ swap_pager_getpages(vm_object_t object, while ((mreq->oflags & VPO_SWAPINPROG) != 0) { mreq->oflags |= VPO_WANTED; PCPU_INC(cnt.v_intrans); - if (msleep(mreq, VM_OBJECT_MTX(object), PSWP, "swread", hz*20)) { + if (VM_OBJECT_SLEEP(object, mreq, PSWP, "swread", hz * 20)) { printf( "swap_pager: indefinite wait buffer: bufobj: %p, blkno: %jd, size: %ld\n", bp->b_bufobj, (intmax_t)bp->b_blkno, bp->b_bcount); Modified: head/sys/vm/vm_object.c == --- head/sys/vm/vm_object.c Tue Feb 26 16:55:59 2013(r247322) +++ head/sys/vm/vm_object.c Tue Feb 26 17:22:08 2013(r247323) @@ -387,7 +387,7 @@ vm_object_pip_wait(vm_object_t object, c VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); while (object->paging_in_progress) { object->flags |= OBJ_PIPWNT; - msleep(object, VM_OBJECT_MTX(object), PVM, waitid, 0); + VM_OBJECT_SLEEP(object, object, PVM, waitid, 0); } } @@ -579,8 +579,7 @@ retry: } else if (object->paging_in_progress) { VM_OBJECT_UNLOCK(robject); object->flags |= OBJ_PIPWNT; - msleep(object, - VM_OBJECT_MTX(object), + VM_OBJECT_SLEEP(object, object, PDROP | PVM, "objde2", 0); VM_OBJECT_LOCK(robject); temp = robject->backing_object; @@ -1139,8 +1138,7 @@ shadowlookup: if (object != tobject) VM_OBJECT_UNLOCK(object); m->oflags |= VPO_WANTED; - msleep(m, VM_OBJECT_MTX(tobject), PDROP | PVM, "madvpo", - 0); + VM_OBJECT_SLEEP(tobject, m, PDROP | PVM, "madvpo" , 0); VM_OBJECT_LOCK(object); goto relookup; } @@ -1338,7 +1336,7 @@ retry: if ((m->oflags & VPO_BUSY) || m->busy) { VM_OBJECT_UNLOCK(new_object); m->oflags |= VPO_WANTED; - msleep(m, VM_OBJECT_MTX(orig_object), PVM, "spltwt", 0); + VM_OBJECT_SLEEP(orig_object, m, PVM, "spltwt" , 0); VM_OBJECT_LOCK(new_object); goto retry; } @@ -1496,7 +1494,7 @@ vm_object_backing_scan(vm_object_t objec if ((p->oflags & VPO_BUSY) || p->busy) { VM_OBJECT_UNLOCK(object); p->oflags |= VPO_WANTED; - msleep(p, VM_OBJECT_MTX(backing_object), + VM_OBJECT_SLEEP(backing_object, p, PDROP | PVM, "vmocol", 0); VM_OBJECT_LOCK(object); VM_OBJECT_LOCK(backing_object); Modified: head/sys/vm/vm_object.h == --- head/sys/vm/vm_object.h Tue Feb 26 16:55:59 2013(r247322) +++ head/sys/vm/vm_object.h Tue Feb 26 17:22:08 2013(r247323) @@ -210,7 +210,9 @@ extern struct vm_object kmem_object_stor mtx_init(&(object)->mtx, "vm object", \ (type), MTX_DEF | MTX_DUPOK) #defineVM_OBJECT_LOCKED(object)mtx_owned(&(object)->mtx) -#defineVM_OBJECT_MTX(object) (&(object)->mtx) +#defineVM_OBJ
svn commit: r247329 - in head: lib/libpmc sys/dev/hwpmc sys/kern
Author: mav Date: Tue Feb 26 18:13:42 2013 New Revision: 247329 URL: http://svnweb.freebsd.org/changeset/base/247329 Log: Add support for good old 8192Hz profiling clock to software PMC. Reviewed by: fabient Modified: head/lib/libpmc/pmc.soft.3 head/sys/dev/hwpmc/hwpmc_soft.c head/sys/kern/kern_clock.c head/sys/kern/kern_clocksource.c Modified: head/lib/libpmc/pmc.soft.3 == --- head/lib/libpmc/pmc.soft.3 Tue Feb 26 18:11:43 2013(r247328) +++ head/lib/libpmc/pmc.soft.3 Tue Feb 26 18:13:42 2013(r247329) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2012 +.Dd February 26, 2013 .Dt PMC.SOFT 3 .Os .Sh NAME @@ -61,6 +61,8 @@ The event specifiers supported by softwa Hard clock ticks. .It Li CLOCK.STAT Stat clock ticks. +.It Li CLOCK.PROF +Profiling clock ticks. .It Li LOCK.FAILED Lock acquisition failed. .It Li PAGE_FAULT.ALL Modified: head/sys/dev/hwpmc/hwpmc_soft.c == --- head/sys/dev/hwpmc/hwpmc_soft.c Tue Feb 26 18:11:43 2013 (r247328) +++ head/sys/dev/hwpmc/hwpmc_soft.c Tue Feb 26 18:13:42 2013 (r247329) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #defineSOFT_CAPS (PMC_CAP_READ | PMC_CAP_WRITE | PMC_CAP_INTERRUPT | \ PMC_CAP_USER | PMC_CAP_SYSTEM) +PMC_SOFT_DECLARE( , , clock, prof); + struct soft_descr { struct pmc_descr pm_descr; /* "base class" */ }; @@ -125,6 +127,8 @@ soft_allocate_pmc(int cpu, int ri, struc return (EINVAL); pmc_soft_ev_release(ps); + if (ev == pmc___clock_prof.ps_ev.pm_ev_code) + cpu_startprofclock(); return (0); } @@ -324,9 +328,8 @@ soft_release_pmc(int cpu, int ri, struct KASSERT(phw->phw_pmc == NULL, ("[soft,%d] PHW pmc %p non-NULL", __LINE__, phw->phw_pmc)); - /* -* Nothing to do. -*/ + if (pmc->pm_event == pmc___clock_prof.ps_ev.pm_ev_code) + cpu_stopprofclock(); return (0); } Modified: head/sys/kern/kern_clock.c == --- head/sys/kern/kern_clock.c Tue Feb 26 18:11:43 2013(r247328) +++ head/sys/kern/kern_clock.c Tue Feb 26 18:13:42 2013(r247329) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include PMC_SOFT_DEFINE( , , clock, hard); PMC_SOFT_DEFINE( , , clock, stat); +PMC_SOFT_DEFINE( , , clock, prof); #endif #ifdef DEVICE_POLLING @@ -817,6 +818,10 @@ profclock_cnt(int cnt, int usermode, uin } } #endif +#ifdef HWPMC_HOOKS + if (td->td_intr_frame != NULL) + PMC_SOFT_CALL_TF( , , clock, prof, td->td_intr_frame); +#endif } /* Modified: head/sys/kern/kern_clocksource.c == --- head/sys/kern/kern_clocksource.cTue Feb 26 18:11:43 2013 (r247328) +++ head/sys/kern/kern_clocksource.cTue Feb 26 18:13:42 2013 (r247329) @@ -732,12 +732,15 @@ cpu_startprofclock(void) { ET_LOCK(); - if (periodic) { - configtimer(0); - profiling = 1; - configtimer(1); + if (profiling == 0) { + if (periodic) { + configtimer(0); + profiling = 1; + configtimer(1); + } else + profiling = 1; } else - profiling = 1; + profiling++; ET_UNLOCK(); } @@ -749,12 +752,15 @@ cpu_stopprofclock(void) { ET_LOCK(); - if (periodic) { - configtimer(0); + if (profiling == 1) { + if (periodic) { + configtimer(0); + profiling = 0; + configtimer(1); + } else profiling = 0; - configtimer(1); } else - profiling = 0; + profiling--; ET_UNLOCK(); } ___ 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: r247332 - head/sys/dev/cpufreq
Author: jhb Date: Tue Feb 26 18:30:47 2013 New Revision: 247332 URL: http://svnweb.freebsd.org/changeset/base/247332 Log: Add a quirk to disable this driver for certain older laptops with an ICH2 southbridge and an Intel 82815_MC host bridge where the host bridge's revision is less than 5. Tested by:mi MFC after:1 week Modified: head/sys/dev/cpufreq/ichss.c Modified: head/sys/dev/cpufreq/ichss.c == --- head/sys/dev/cpufreq/ichss.cTue Feb 26 18:19:51 2013 (r247331) +++ head/sys/dev/cpufreq/ichss.cTue Feb 26 18:30:47 2013 (r247332) @@ -67,7 +67,7 @@ struct ichss_softc { #define PCI_DEV_82801BA0x244c /* ICH2M */ #define PCI_DEV_82801CA0x248c /* ICH3M */ #define PCI_DEV_82801DB0x24cc /* ICH4M */ -#define PCI_DEV_82815BA0x1130 /* Unsupported/buggy part */ +#define PCI_DEV_82815_MC 0x1130 /* Unsupported/buggy part */ /* PCI config registers for finding PMBASE and enabling SpeedStep. */ #define ICHSS_PMBASE_OFFSET0x40 @@ -155,9 +155,6 @@ ichss_identify(driver_t *driver, device_ * E.g. see Section 6.1 "PCI Devices and Functions" and table 6.1 of * Intel(r) 82801BA I/O Controller Hub 2 (ICH2) and Intel(r) 82801BAM * I/O Controller Hub 2 Mobile (ICH2-M). -* -* TODO: add a quirk to disable if we see the 82815_MC along -* with the 82801BA and revision < 5. */ ich_device = pci_find_bsf(0, 0x1f, 0); if (ich_device == NULL || @@ -167,6 +164,22 @@ ichss_identify(driver_t *driver, device_ pci_get_device(ich_device) != PCI_DEV_82801DB)) return; + /* +* Certain systems with ICH2 and an Intel 82815_MC host bridge +* where the host bridge's revision is < 5 lockup if SpeedStep +* is used. +*/ + if (pci_get_device(ich_device) == PCI_DEV_82801BA) { + device_t hostb; + + hostb = pci_find_bsf(0, 0, 0); + if (hostb != NULL && + pci_get_vendor(hostb) == PCI_VENDOR_INTEL && + pci_get_device(hostb) == PCI_DEV_82815_MC && + pci_get_revid(hostb) < 5) + return; + } + /* Find the PMBASE register from our PCI config header. */ pmbase = pci_read_config(ich_device, ICHSS_PMBASE_OFFSET, sizeof(pmbase)); ___ 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: r247334 - head/sys/dev/random
Author: delphij Date: Tue Feb 26 18:33:23 2013 New Revision: 247334 URL: http://svnweb.freebsd.org/changeset/base/247334 Log: Correct a typo introduced in r153575, which gives inverted logic when handling blocking semantics when seeding. PR: kern/143298 Submitted by: James Juran Reviewed by: markm MFC after:3 days Modified: head/sys/dev/random/randomdev_soft.c Modified: head/sys/dev/random/randomdev_soft.c == --- head/sys/dev/random/randomdev_soft.cTue Feb 26 18:31:03 2013 (r247333) +++ head/sys/dev/random/randomdev_soft.cTue Feb 26 18:33:23 2013 (r247334) @@ -391,7 +391,7 @@ random_yarrow_block(int flag) mtx_lock(&random_reseed_mtx); /* Blocking logic */ - while (random_systat.seeded && !error) { + while (!random_systat.seeded && !error) { if (flag & O_NONBLOCK) error = EWOULDBLOCK; else { ___ 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: r247300 - in head: sys/sys usr.bin/truss
On Tuesday, February 26, 2013 12:09:42 pm Davide Italiano wrote: > On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin wrote: > > On Monday, February 25, 2013 9:13:02 pm Xin LI wrote: > >> Author: delphij > >> Date: Tue Feb 26 02:13:02 2013 > >> New Revision: 247300 > >> URL: http://svnweb.freebsd.org/changeset/base/247300 > >> > >> Log: > >> Expose timespec and timeval macros when __BSD_VISIBLE is defined. This > >> allows userland application to use the following macros: > >> > >> timespecclear, timespecisset, timespeccmp, timespecadd, > >> timespecsub; > >> > >> timevalclear, timevalisset, timevalcmp. > > > > Why not fix truss to use the stock functions instead of keeping private > > "unusual" versions? > > > > -- > > John Baldwin > > time.h is already a mess in terms of namespace pollution, and this > exposure might not help thing. > Other details here: > http://permalink.gmane.org/gmane.os.freebsd.architechture/15518 I think that is orthogonal. Even if this is reverted I think truss should be changed to use the "normal" timespecsubt() macro rather than using a custom one with a different argument order. -- John Baldwin ___ 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: r247300 - in head: sys/sys usr.bin/truss
On Tue, Feb 26, 2013 at 7:35 PM, John Baldwin wrote: > On Tuesday, February 26, 2013 12:09:42 pm Davide Italiano wrote: >> On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin wrote: >> > On Monday, February 25, 2013 9:13:02 pm Xin LI wrote: >> >> Author: delphij >> >> Date: Tue Feb 26 02:13:02 2013 >> >> New Revision: 247300 >> >> URL: http://svnweb.freebsd.org/changeset/base/247300 >> >> >> >> Log: >> >> Expose timespec and timeval macros when __BSD_VISIBLE is defined. This >> >> allows userland application to use the following macros: >> >> >> >> timespecclear, timespecisset, timespeccmp, timespecadd, >> >> timespecsub; >> >> >> >> timevalclear, timevalisset, timevalcmp. >> > >> > Why not fix truss to use the stock functions instead of keeping private >> > "unusual" versions? >> > >> > -- >> > John Baldwin >> >> time.h is already a mess in terms of namespace pollution, and this >> exposure might not help thing. >> Other details here: >> http://permalink.gmane.org/gmane.os.freebsd.architechture/15518 > > I think that is orthogonal. Even if this is reverted I think truss should > be changed to use the "normal" timespecsubt() macro rather than using a custom > one with a different argument order. > > -- > John Baldwin When I talked about "exposure" I referred about timeval/timespec macros(). I wasn't arguing about your proposed change. Sorry if it wasn't clear. -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare ___ 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: r247300 - in head: sys/sys usr.bin/truss
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 02/26/13 09:09, Davide Italiano wrote: > On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin > wrote: >> On Monday, February 25, 2013 9:13:02 pm Xin LI wrote: >>> Author: delphij Date: Tue Feb 26 02:13:02 2013 New Revision: >>> 247300 URL: http://svnweb.freebsd.org/changeset/base/247300 >>> >>> Log: Expose timespec and timeval macros when __BSD_VISIBLE is >>> defined. This allows userland application to use the following >>> macros: >>> >>> timespecclear, timespecisset, timespeccmp, timespecadd, >>> timespecsub; >>> >>> timevalclear, timevalisset, timevalcmp. >> >> Why not fix truss to use the stock functions instead of keeping >> private "unusual" versions? >> >> -- John Baldwin > > time.h is already a mess in terms of namespace pollution, and this > exposure might not help thing. Other details here: > http://permalink.gmane.org/gmane.os.freebsd.architechture/15518 What would be the preferred way of doing these operations on a timespec structure then? Should the caller duplicate these macros? Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -BEGIN PGP SIGNATURE- iQEcBAEBCgAGBQJRLQceAAoJEG80Jeu8UPuzYQIIAIf9vJ6TS2Lmk+vkC0O9oXFi 1W+msaOn/Onhi9TSbpdPlhfQI2VB8bkdDCA63ll3LC64jjDaRObobSYxYn7mKhz9 +o0sdRXl8AvDkHNofSmrtO0h3JormzJjGIxNLi0DsTgrUDuOiVT34WtzTY6uvvnG Y4zpxoY/KI9ftaAabxhfTG8RcMkWbAHrQXmah/UujuMID57665I0NwxBap5lyyng lMygEBfAZ8bZqbh2IcUZi9qKBsIkFJugxYZc95WkU73A4rCGBJSJXpYWAghJxthy nDHNA6I5DxoeXpf3hEscG4WjHgLubZen8HwEs/3uA4mRkmAkI7pwT56wo7kVnwU= =JZjk -END PGP SIGNATURE- ___ 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: r247300 - in head: sys/sys usr.bin/truss
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 02/26/13 10:35, John Baldwin wrote: > On Tuesday, February 26, 2013 12:09:42 pm Davide Italiano wrote: >> On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin >> wrote: >>> On Monday, February 25, 2013 9:13:02 pm Xin LI wrote: Author: delphij Date: Tue Feb 26 02:13:02 2013 New Revision: 247300 URL: http://svnweb.freebsd.org/changeset/base/247300 Log: Expose timespec and timeval macros when __BSD_VISIBLE is defined. This allows userland application to use the following macros: timespecclear, timespecisset, timespeccmp, timespecadd, timespecsub; timevalclear, timevalisset, timevalcmp. >>> >>> Why not fix truss to use the stock functions instead of keeping >>> private "unusual" versions? >>> >>> -- John Baldwin >> >> time.h is already a mess in terms of namespace pollution, and >> this exposure might not help thing. Other details here: >> http://permalink.gmane.org/gmane.os.freebsd.architechture/15518 > > I think that is orthogonal. Even if this is reverted I think truss > should be changed to use the "normal" timespecsubt() macro rather > than using a custom one with a different argument order. I'll find a way to solve this and post a patch for review, thanks for your comments. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -BEGIN PGP SIGNATURE- iQEcBAEBCgAGBQJRLQdWAAoJEG80Jeu8UPuzpQ0H/1wxy58rK+p/jx2sZtFIhxCA j6H/xQ0nNqthVBW2rw0gwiaUgU1AfcAtdfz7/lFopsvbGFoxzQFYUyC4U67JhSk6 IOgElmtjfFMfvj0ksQnEtIGPMYFbc5G4AHfmmwu4f9cjEPBQz3rPssybGqFvJjO+ tUs7I6tYsq5Lnu9ltjDXgBcNHblgjFqz0jMZ/Rysdu4+51Mga5akyV2D6OFbcbNG oYzC5OOJFvnw6lV+bCVh/ZQNjvEE/Z+YUhfT66MlmU9CBDM9TlYCl7F+5/snZiZ4 0xVFDUIglQqHXkaA1DtP7+HGfVtYhDvO3BgOUe+fHieFxkQFsiEATO4YUImZTKE= =KUVT -END PGP SIGNATURE- ___ 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: r247337 - head/lib/libkiconv
Author: jmg Date: Tue Feb 26 19:46:02 2013 New Revision: 247337 URL: http://svnweb.freebsd.org/changeset/base/247337 Log: no one bothered to write the iconv.9 man page... If it appears we can readd the xref... MFC: 1 week Modified: head/lib/libkiconv/kiconv.3 Modified: head/lib/libkiconv/kiconv.3 == --- head/lib/libkiconv/kiconv.3 Tue Feb 26 19:14:29 2013(r247336) +++ head/lib/libkiconv/kiconv.3 Tue Feb 26 19:46:02 2013(r247337) @@ -126,5 +126,4 @@ not using .Sh SEE ALSO .Xr iconv 3 , .Xr tolower 3 , -.Xr toupper 3 , -.Xr iconv 9 +.Xr toupper 3 ___ 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: r247338 - in head: sys/sys usr.bin/truss
Author: delphij Date: Tue Feb 26 19:46:59 2013 New Revision: 247338 URL: http://svnweb.freebsd.org/changeset/base/247338 Log: Revert r247300 for now. I'll post a new changeset for review. Modified: head/sys/sys/time.h head/usr.bin/truss/main.c head/usr.bin/truss/syscalls.c head/usr.bin/truss/truss.h Modified: head/sys/sys/time.h == --- head/sys/sys/time.h Tue Feb 26 19:46:02 2013(r247337) +++ head/sys/sys/time.h Tue Feb 26 19:46:59 2013(r247338) @@ -156,6 +156,9 @@ timeval2bintime(const struct timeval *tv /* 18446744073709 = int(2^64 / 100) */ bt->frac = tv->tv_usec * (uint64_t)18446744073709LL; } +#endif /* __BSD_VISIBLE */ + +#ifdef _KERNEL /* Operations on timespecs */ #definetimespecclear(tvp) ((tvp)->tv_sec = (tvp)->tv_nsec = 0) @@ -194,7 +197,7 @@ timeval2bintime(const struct timeval *tv /* timevaladd and timevalsub are not inlined */ -#endif /* __BSD_VISIBLE */ +#endif /* _KERNEL */ #ifndef _KERNEL/* NetBSD/OpenBSD compatible interfaces */ Modified: head/usr.bin/truss/main.c == --- head/usr.bin/truss/main.c Tue Feb 26 19:46:02 2013(r247337) +++ head/usr.bin/truss/main.c Tue Feb 26 19:46:59 2013(r247338) @@ -323,14 +323,14 @@ START_TRACE: fprintf(trussinfo->outfile, "%5d: ", trussinfo->pid); if (trussinfo->flags & ABSOLUTETIMESTAMPS) { - timespecsubt_to(&trussinfo->curthread->after, + timespecsubt(&trussinfo->curthread->after, &trussinfo->start_time, &timediff); fprintf(trussinfo->outfile, "%ld.%09ld ", (long)timediff.tv_sec, timediff.tv_nsec); } if (trussinfo->flags & RELATIVETIMESTAMPS) { - timespecsubt_to(&trussinfo->curthread->after, + timespecsubt(&trussinfo->curthread->after, &trussinfo->curthread->before, &timediff); fprintf(trussinfo->outfile, "%ld.%09ld ", (long)timediff.tv_sec, @@ -349,14 +349,14 @@ START_TRACE: fprintf(trussinfo->outfile, "%5d: ", trussinfo->pid); if (trussinfo->flags & ABSOLUTETIMESTAMPS) { - timespecsubt_to(&trussinfo->curthread->after, + timespecsubt(&trussinfo->curthread->after, &trussinfo->start_time, &timediff); fprintf(trussinfo->outfile, "%ld.%09ld ", (long)timediff.tv_sec, timediff.tv_nsec); } if (trussinfo->flags & RELATIVETIMESTAMPS) { - timespecsubt_to(&trussinfo->curthread->after, + timespecsubt(&trussinfo->curthread->after, &trussinfo->curthread->before, &timediff); fprintf(trussinfo->outfile, "%ld.%09ld ", (long)timediff.tv_sec, timediff.tv_nsec); Modified: head/usr.bin/truss/syscalls.c == --- head/usr.bin/truss/syscalls.c Tue Feb 26 19:46:02 2013 (r247337) +++ head/usr.bin/truss/syscalls.c Tue Feb 26 19:46:59 2013 (r247338) @@ -1126,14 +1126,14 @@ print_syscall(struct trussinfo *trussinf } if (trussinfo->flags & ABSOLUTETIMESTAMPS) { - timespecsubt_to(&trussinfo->curthread->after, + timespecsubt(&trussinfo->curthread->after, &trussinfo->start_time, &timediff); len += fprintf(trussinfo->outfile, "%ld.%09ld ", (long)timediff.tv_sec, timediff.tv_nsec); } if (trussinfo->flags & RELATIVETIMESTAMPS) { - timespecsubt_to(&trussinfo->curthread->after, + timespecsubt(&trussinfo->curthread->after, &trussinfo->curthread->before, &timediff); len += fprintf(trussinfo->outfile, "%ld.%09ld ", (long)timediff.tv_sec, timediff.tv_nsec); @@ -1165,9 +1165,9 @@ print_syscall_ret(struct trussinfo *trus if (!sc) return; clock_gettime(CLOCK_REALTIME, &trussinfo->curthread->after); - timespecsubt_to(&trussinfo->curthread->after, + timespe
svn commit: r247339 - head/sys/arm/arm
Author: cognet Date: Tue Feb 26 19:58:49 2013 New Revision: 247339 URL: http://svnweb.freebsd.org/changeset/base/247339 Log: Don't forget to init the VFP stuff for all cores. Modified: head/sys/arm/arm/mp_machdep.c Modified: head/sys/arm/arm/mp_machdep.c == --- head/sys/arm/arm/mp_machdep.c Tue Feb 26 19:46:59 2013 (r247338) +++ head/sys/arm/arm/mp_machdep.c Tue Feb 26 19:58:49 2013 (r247339) @@ -49,6 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef ARM_VFP_SUPPORT +#include +#endif #include "opt_smp.h" @@ -181,6 +184,11 @@ init_secondary(int cpu) KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread")); pc->pc_curthread = pc->pc_idlethread; pc->pc_curpcb = pc->pc_idlethread->td_pcb; +#ifdef ARM_VFP_SUPPORT + pc->pc_cpu = cpu; + + vfp_init(); +#endif mtx_lock_spin(&ap_boot_mtx); ___ 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: r247340 - head/sys/arm/arm
Author: cognet Date: Tue Feb 26 19:59:52 2013 New Revision: 247340 URL: http://svnweb.freebsd.org/changeset/base/247340 Log: Fix SMP build. Modified: head/sys/arm/arm/vfp.c Modified: head/sys/arm/arm/vfp.c == --- head/sys/arm/arm/vfp.c Tue Feb 26 19:58:49 2013(r247339) +++ head/sys/arm/arm/vfp.c Tue Feb 26 19:59:52 2013(r247340) @@ -43,7 +43,6 @@ unsigned int get_coprocessorACR(void); intvfp_bounce(u_int, u_int, struct trapframe *, int); void vfp_discard(void); void vfp_enable(void); -void vfp_init(void); void vfp_restore(struct vfp_state *); void vfp_store(struct vfp_state *); void set_coprocessorACR(u_int); @@ -74,8 +73,8 @@ void set_coprocessorACR(u_int val) { __asm __volatile("mcr p15, 0, %0, c1, c0, 2\n\t" -"isb\n\t" : : "r" (val) : "cc"); + isb(); } @@ -140,7 +139,7 @@ vfp_bounce(u_int addr, u_int insn, struc #ifdef SMP /* don't save if newer registers are on another processor */ if (vfptd /* && (vfptd == curthread) */ && - (vfptd->td_pcb->pcb_vfpcpu == PCPU_GET(vfpcpu)) + (vfptd->td_pcb->pcb_vfpcpu == PCPU_GET(cpu))) #else /* someone did not save their registers, */ if (vfptd /* && (vfptd == curthread) */) @@ -168,7 +167,7 @@ vfp_bounce(u_int addr, u_int insn, struc */ vfp_restore(&curpcb->pcb_vfpstate); #ifdef SMP - curpcb->pcb_cpu = PCPU_GET(cpu); + curpcb->pcb_vfpcpu = PCPU_GET(cpu); #endif PCPU_SET(vfpcthread, PCPU_GET(curthread)); return 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: r247341 - head/sys/arm/include
Author: cognet Date: Tue Feb 26 20:01:05 2013 New Revision: 247341 URL: http://svnweb.freebsd.org/changeset/base/247341 Log: Export vfp_init() prototype, for use in the MP code. Modified: head/sys/arm/include/vfp.h Modified: head/sys/arm/include/vfp.h == --- head/sys/arm/include/vfp.h Tue Feb 26 19:59:52 2013(r247340) +++ head/sys/arm/include/vfp.h Tue Feb 26 20:01:05 2013(r247341) @@ -124,5 +124,6 @@ #define COPROC10 (0x3 << 20) #define COPROC11 (0x3 << 22) +voidvfp_init(void); #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: r247342 - head/usr.sbin/bhyve
Author: neel Date: Tue Feb 26 20:02:17 2013 New Revision: 247342 URL: http://svnweb.freebsd.org/changeset/base/247342 Log: Ignore the BARRIER flag in the virtio block header. This capability is not advertised by the host so ignore it even if the guest insists on setting the flag. Reviewed by: grehan Obtained from:NetApp Modified: head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/pci_virtio_block.c == --- head/usr.sbin/bhyve/pci_virtio_block.c Tue Feb 26 20:01:05 2013 (r247341) +++ head/usr.sbin/bhyve/pci_virtio_block.c Tue Feb 26 20:02:17 2013 (r247342) @@ -110,8 +110,9 @@ CTASSERT(sizeof(struct vtblk_config) == * Fixed-size block header */ struct virtio_blk_hdr { -#define VBH_OP_READ0 -#define VBH_OP_WRITE 1 +#defineVBH_OP_READ 0 +#defineVBH_OP_WRITE1 +#defineVBH_FLAG_BARRIER0x8000 /* OR'ed into vbh_type */ uint32_tvbh_type; uint32_tvbh_ioprio; uint64_tvbh_sector; @@ -198,7 +199,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *s int iolen; int nsegs; int uidx, aidx, didx; - int writeop; + int writeop, type; off_t offset; uidx = *hq->hq_used_idx; @@ -232,7 +233,13 @@ pci_vtblk_proc(struct pci_vtblk_softc *s assert(vid[0].vd_flags & VRING_DESC_F_NEXT); assert((vid[0].vd_flags & VRING_DESC_F_WRITE) == 0); - writeop = (vbh->vbh_type == VBH_OP_WRITE); + /* +* XXX +* The guest should not be setting the BARRIER flag because +* we don't advertise the capability. +*/ + type = vbh->vbh_type & ~VBH_FLAG_BARRIER; + writeop = (type == VBH_OP_WRITE); offset = vbh->vbh_sector * DEV_BSIZE; ___ 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: r247300 - in head: sys/sys usr.bin/truss
On Tue, Feb 26, 2013 at 8:03 PM, Xin Li wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > On 02/26/13 09:09, Davide Italiano wrote: >> On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin >> wrote: >>> On Monday, February 25, 2013 9:13:02 pm Xin LI wrote: Author: delphij Date: Tue Feb 26 02:13:02 2013 New Revision: 247300 URL: http://svnweb.freebsd.org/changeset/base/247300 Log: Expose timespec and timeval macros when __BSD_VISIBLE is defined. This allows userland application to use the following macros: timespecclear, timespecisset, timespeccmp, timespecadd, timespecsub; timevalclear, timevalisset, timevalcmp. >>> >>> Why not fix truss to use the stock functions instead of keeping >>> private "unusual" versions? >>> >>> -- John Baldwin >> >> time.h is already a mess in terms of namespace pollution, and this >> exposure might not help thing. Other details here: >> http://permalink.gmane.org/gmane.os.freebsd.architechture/15518 > > What would be the preferred way of doing these operations on a > timespec structure then? Should the caller duplicate these macros? > > Cheers, > - -- > Xin LI https://www.delphij.net/ > FreeBSD - The Power to Serve! Live free or die > -BEGIN PGP SIGNATURE- > > iQEcBAEBCgAGBQJRLQceAAoJEG80Jeu8UPuzYQIIAIf9vJ6TS2Lmk+vkC0O9oXFi > 1W+msaOn/Onhi9TSbpdPlhfQI2VB8bkdDCA63ll3LC64jjDaRObobSYxYn7mKhz9 > +o0sdRXl8AvDkHNofSmrtO0h3JormzJjGIxNLi0DsTgrUDuOiVT34WtzTY6uvvnG > Y4zpxoY/KI9ftaAabxhfTG8RcMkWbAHrQXmah/UujuMID57665I0NwxBap5lyyng > lMygEBfAZ8bZqbh2IcUZi9qKBsIkFJugxYZc95WkU73A4rCGBJSJXpYWAghJxthy > nDHNA6I5DxoeXpf3hEscG4WjHgLubZen8HwEs/3uA4mRkmAkI7pwT56wo7kVnwU= > =JZjk > -END PGP SIGNATURE- Well, it may be. And maybe this might be a topic for a larger discussion. What's your use-case? -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare ___ 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: r247345 - head/sbin/hastctl
Author: trociny Date: Tue Feb 26 20:19:45 2013 New Revision: 247345 URL: http://svnweb.freebsd.org/changeset/base/247345 Log: Fix casting. MFC after:3 days Modified: head/sbin/hastctl/hastctl.c Modified: head/sbin/hastctl/hastctl.c == --- head/sbin/hastctl/hastctl.c Tue Feb 26 20:19:19 2013(r247344) +++ head/sbin/hastctl/hastctl.c Tue Feb 26 20:19:45 2013(r247345) @@ -342,15 +342,15 @@ control_status(struct nv *nv) (intmax_t)nv_get_uint64(nv, "dirty%u", ii)); printf(" statistics:\n"); printf("reads: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_read%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_read%u", ii)); printf("writes: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_write%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_write%u", ii)); printf("deletes: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_delete%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_delete%u", ii)); printf("flushes: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_flush%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_flush%u", ii)); printf("activemap updates: %ju\n", - (uint64_t)nv_get_uint64(nv, "stat_activemap_update%u", ii)); + (uintmax_t)nv_get_uint64(nv, "stat_activemap_update%u", ii)); printf("local errors: " "read: %ju, write: %ju, delete: %ju, flush: %ju\n", (uintmax_t)nv_get_uint64(nv, "stat_read_error%u", ii), ___ 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: r247346 - head/sys/vm
Author: attilio Date: Tue Feb 26 20:35:40 2013 New Revision: 247346 URL: http://svnweb.freebsd.org/changeset/base/247346 Log: Remove white spaces. Sponsored by: EMC / Isilon storage division Modified: head/sys/vm/vm_object.c head/sys/vm/vnode_pager.c Modified: head/sys/vm/vm_object.c == --- head/sys/vm/vm_object.c Tue Feb 26 20:19:45 2013(r247345) +++ head/sys/vm/vm_object.c Tue Feb 26 20:35:40 2013(r247346) @@ -1138,7 +1138,7 @@ shadowlookup: if (object != tobject) VM_OBJECT_UNLOCK(object); m->oflags |= VPO_WANTED; - VM_OBJECT_SLEEP(tobject, m, PDROP | PVM, "madvpo" , 0); + VM_OBJECT_SLEEP(tobject, m, PDROP | PVM, "madvpo", 0); VM_OBJECT_LOCK(object); goto relookup; } @@ -1336,7 +1336,7 @@ retry: if ((m->oflags & VPO_BUSY) || m->busy) { VM_OBJECT_UNLOCK(new_object); m->oflags |= VPO_WANTED; - VM_OBJECT_SLEEP(orig_object, m, PVM, "spltwt" , 0); + VM_OBJECT_SLEEP(orig_object, m, PVM, "spltwt", 0); VM_OBJECT_LOCK(new_object); goto retry; } Modified: head/sys/vm/vnode_pager.c == --- head/sys/vm/vnode_pager.c Tue Feb 26 20:19:45 2013(r247345) +++ head/sys/vm/vnode_pager.c Tue Feb 26 20:35:40 2013(r247346) @@ -116,7 +116,7 @@ vnode_create_vobject(struct vnode *vp, o } VOP_UNLOCK(vp, 0); vm_object_set_flag(object, OBJ_DISCONNECTWNT); - VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vodead" , 0); + VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vodead", 0); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); } @@ -210,7 +210,7 @@ retry: if ((object->flags & OBJ_DEAD) == 0) break; vm_object_set_flag(object, OBJ_DISCONNECTWNT); - VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vadead" , 0); + VM_OBJECT_SLEEP(object, object, PDROP | PVM, "vadead", 0); } if (vp->v_usecount == 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: r247347 - in head: share/man/man4 sys/dev/cxgbe sys/dev/cxgbe/common
Author: np Date: Tue Feb 26 20:35:54 2013 New Revision: 247347 URL: http://svnweb.freebsd.org/changeset/base/247347 Log: cxgbe(4): Consider all the API versions of the interfaces exported by the firmware (instead of just the main firmware version) when evaluating firmware compatibility. Document the new "hw.cxgbe.fw_install" knob being introduced here. This should fix kern/173584 too. Setting hw.cxgbe.fw_install=2 will mostly do what was requested in the PR but it's a bit more intelligent in that it won't reinstall the same firmware repeatedly if the knob is left set. PR: kern/173584 MFC after:5 days Modified: head/share/man/man4/cxgbe.4 head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/t4_main.c Modified: head/share/man/man4/cxgbe.4 == --- head/share/man/man4/cxgbe.4 Tue Feb 26 20:35:40 2013(r247346) +++ head/share/man/man4/cxgbe.4 Tue Feb 26 20:35:54 2013(r247347) @@ -178,6 +178,15 @@ Bit 0 represents INTx (line interrupts), The default is 7 (all allowed). The driver will select the best possible type out of the allowed types by itself. +.It Va hw.cxgbe.fw_install +0 prohibits the driver from installing a firmware on the card. +1 allows the driver to install a new firmware if internal driver +heuristics indicate that the new firmware is preferable to the one +already on the card. +2 instructs the driver to always install the new firmware on the card as +long as it is compatible with the driver and is a different version than +the one already on the card. +The default is 1. .It Va hw.cxgbe.config_file Select a pre-packaged device configuration file. A configuration file contains a recipe for partitioning and configuring the Modified: head/sys/dev/cxgbe/common/common.h == --- head/sys/dev/cxgbe/common/common.h Tue Feb 26 20:35:40 2013 (r247346) +++ head/sys/dev/cxgbe/common/common.h Tue Feb 26 20:35:54 2013 (r247347) @@ -68,6 +68,11 @@ enum { #define FW_VERSION_MICRO 4 #define FW_VERSION_BUILD 0 +#define FW_VERSION (V_FW_HDR_FW_VER_MAJOR(FW_VERSION_MAJOR) | \ +V_FW_HDR_FW_VER_MINOR(FW_VERSION_MINOR) | \ +V_FW_HDR_FW_VER_MICRO(FW_VERSION_MICRO) | \ +V_FW_HDR_FW_VER_BUILD(FW_VERSION_BUILD)) + struct port_stats { u64 tx_octets;/* total # of octets in good frames */ u64 tx_frames;/* all good frames */ Modified: head/sys/dev/cxgbe/t4_main.c == --- head/sys/dev/cxgbe/t4_main.cTue Feb 26 20:35:40 2013 (r247346) +++ head/sys/dev/cxgbe/t4_main.cTue Feb 26 20:35:54 2013 (r247347) @@ -213,6 +213,13 @@ static char t4_cfg_file[32] = "default"; TUNABLE_STR("hw.cxgbe.config_file", t4_cfg_file, sizeof(t4_cfg_file)); /* + * Firmware auto-install by driver during attach (0, 1, 2 = prohibited, allowed, + * encouraged respectively). + */ +static unsigned int t4_fw_install = 1; +TUNABLE_INT("hw.cxgbe.fw_install", &t4_fw_install); + +/* * ASIC features that will be used. Disable the ones you don't want so that the * chip resources aren't wasted on features that will not be used. */ @@ -1503,6 +1510,33 @@ allocate: } /* + * Is the given firmware compatible with the one the driver was compiled with? + */ +static int +fw_compatible(const struct fw_hdr *hdr) +{ + + if (hdr->fw_ver == htonl(FW_VERSION)) + return (1); + + /* +* XXX: Is this too conservative? Perhaps I should limit this to the +* features that are supported in the driver. +*/ + if (hdr->intfver_nic == FW_HDR_INTFVER_NIC && + hdr->intfver_vnic == FW_HDR_INTFVER_VNIC && + hdr->intfver_ofld == FW_HDR_INTFVER_OFLD && + hdr->intfver_ri == FW_HDR_INTFVER_RI && + hdr->intfver_iscsipdu == FW_HDR_INTFVER_ISCSIPDU && + hdr->intfver_iscsi == FW_HDR_INTFVER_ISCSI && + hdr->intfver_fcoepdu == FW_HDR_INTFVER_FCOEPDU && + hdr->intfver_fcoe == FW_HDR_INTFVER_FCOEPDU) + return (1); + + return (0); +} + +/* * Install a compatible firmware (if required), establish contact with it (by * saying hello), and reset the device. If we end up as the master driver, * partition adapter resources by providing a configuration file to the @@ -1512,84 +1546,99 @@ static int prep_firmware(struct adapter *sc) { const struct firmware *fw = NULL, *cfg = NULL, *default_cfg; - int rc; + int rc, card_fw_usable, kld_fw_usable; enum dev_state state; + struct fw_hdr *card_fw; + const struct fw_hdr *kld_fw; default_cfg = firmware_get(T4_CFGNAME); - /* Check firmware version and install a different one if necessary */ - rc = t4_check_fw_version(sc); - snprintf(sc->fw_
svn commit: r247348 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mm Date: Tue Feb 26 20:41:27 2013 New Revision: 247348 URL: http://svnweb.freebsd.org/changeset/base/247348 Log: Be more verbose on ZFS deadman I/O panic Patch suggested upstream. Suggested by: Olivier Cinquin MFC after:12 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Feb 26 20:35:54 2013(r247347) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Feb 26 20:41:27 2013(r247348) @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright 2013 Martin Matuska . All rights reserved. */ #include @@ -3205,7 +3206,10 @@ vdev_deadman(vdev_t *vd) fio->io_timestamp, delta, vq->vq_io_complete_ts); fm_panic("I/O to pool '%s' appears to be " - "hung.", spa_name(spa)); + "hung on vdev guid %llu at '%s'.", + spa_name(spa), + (long long unsigned int) vd->vdev_guid, + vd->vdev_path); } } mutex_exit(&vq->vq_lock); ___ 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: r247355 - head/sys/dev/cxgbe/common
Author: np Date: Tue Feb 26 21:25:17 2013 New Revision: 247355 URL: http://svnweb.freebsd.org/changeset/base/247355 Log: cxgbe(4): Report unusual out of band errors from the firmware. Obtained from:Chelsio MFC after:5 days Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c == --- head/sys/dev/cxgbe/common/t4_hw.c Tue Feb 26 21:17:38 2013 (r247354) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue Feb 26 21:25:17 2013 (r247355) @@ -154,6 +154,36 @@ u32 t4_hw_pci_read_cfg4(adapter_t *adap, } /* + * t4_report_fw_error - report firmware error + * @adap: the adapter + * + * The adapter firmware can indicate error conditions to the host. + * This routine prints out the reason for the firmware error (as + * reported by the firmware). + */ +static void t4_report_fw_error(struct adapter *adap) +{ + static const char *reason[] = { + "Crash",/* PCIE_FW_EVAL_CRASH */ + "During Device Preparation",/* PCIE_FW_EVAL_PREP */ + "During Device Configuration", /* PCIE_FW_EVAL_CONF */ + "During Device Initialization", /* PCIE_FW_EVAL_INIT */ + "Unexpected Event", /* PCIE_FW_EVAL_UNEXPECTEDEVENT */ + "Insufficient Airflow", /* PCIE_FW_EVAL_OVERHEAT */ + "Device Shutdown", /* PCIE_FW_EVAL_DEVICESHUTDOWN */ + "Reserved", /* reserved */ + }; + u32 pcie_fw; + + pcie_fw = t4_read_reg(adap, A_PCIE_FW); + if (!(pcie_fw & F_PCIE_FW_ERR)) + CH_ERR(adap, "Firmware error report called with no error\n"); + else + CH_ERR(adap, "Firmware reports adapter error: %s\n", + reason[G_PCIE_FW_EVAL(pcie_fw)]); +} + +/* * Get the reply to a mailbox command and store it in @rpl in big-endian order. */ static void get_mbox_rpl(struct adapter *adap, __be64 *rpl, int nflit, @@ -267,8 +297,15 @@ int t4_wr_mbox_meat(struct adapter *adap } } + /* +* We timed out waiting for a reply to our mailbox command. Report +* the error and also check to see if the firmware reported any +* errors ... +*/ CH_ERR(adap, "command %#x in mailbox %d timed out\n", *(const u8 *)cmd, mbox); + if (t4_read_reg(adap, A_PCIE_FW) & F_PCIE_FW_ERR) + t4_report_fw_error(adap); return -ETIMEDOUT; } @@ -2033,9 +2070,11 @@ static void cim_intr_handler(struct adap { F_TIMEOUTMAINT , "CIM PIF MA timeout", -1, 1 }, { 0 } }; - int fat; + if (t4_read_reg(adapter, A_PCIE_FW) & F_PCIE_FW_ERR) + t4_report_fw_error(adapter); + fat = t4_handle_intr_status(adapter, A_CIM_HOST_INT_CAUSE, cim_intr_info) + t4_handle_intr_status(adapter, A_CIM_HOST_UPACC_INT_CAUSE, @@ -4103,12 +4142,16 @@ retry: /* * Issue the HELLO command to the firmware. If it's not successful * but indicates that we got a "busy" or "timeout" condition, retry -* the HELLO until we exhaust our retry limit. +* the HELLO until we exhaust our retry limit. If we do exceed our +* retry limit, check to see if the firmware left us any error +* information and report that if so ... */ ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); if (ret != FW_SUCCESS) { if ((ret == -EBUSY || ret == -ETIMEDOUT) && retries-- > 0) goto retry; + if (t4_read_reg(adap, A_PCIE_FW) & F_PCIE_FW_ERR) + t4_report_fw_error(adap); return ret; } ___ 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: r247356 - head/sys/dev/isp
Author: mjacob Date: Tue Feb 26 21:37:12 2013 New Revision: 247356 URL: http://svnweb.freebsd.org/changeset/base/247356 Log: Remove redundant xpt_alloc_ccb in isp_target_thread that was causing leakage. Pointed out by: Sascha Wildner of DragonFly BSD MFC after:1 week Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c == --- head/sys/dev/isp/isp_freebsd.c Tue Feb 26 21:25:17 2013 (r247355) +++ head/sys/dev/isp/isp_freebsd.c Tue Feb 26 21:37:12 2013 (r247356) @@ -4140,8 +4140,6 @@ isp_target_thread(ispsoftc_t *isp, int c return; } - ccb = xpt_alloc_ccb(); - ISP_LOCK(isp); status = cam_periph_alloc(isptargctor, NULL, isptargdtor, isptargstart, "isptarg", CAM_PERIPH_BIO, wpath, NULL, 0, softc); if (status != CAM_REQ_CMP) { ___ 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: r247359 - head/sbin/reboot
Author: n_hibma Date: Tue Feb 26 23:18:35 2013 New Revision: 247359 URL: http://svnweb.freebsd.org/changeset/base/247359 Log: Clarify that overriding the -h/-D flags through flags in device.hints only works for sio(4) but not for uart(4) which no longer has this flag. Modified: head/sbin/reboot/boot_i386.8 Modified: head/sbin/reboot/boot_i386.8 == --- head/sbin/reboot/boot_i386.8Tue Feb 26 22:08:10 2013 (r247358) +++ head/sbin/reboot/boot_i386.8Tue Feb 26 23:18:35 2013 (r247359) @@ -220,15 +220,14 @@ you can use the option to force the kernel to use the serial port as its console device. The serial port driver -.Xr uart 4 +.Xr sio 4 +(but not +.Xr uart 4 ) has a flag (0x20) to override this option. If that flag is set, the serial port will always be used as the console, regardless of the .Fl h option described here. -See the man page for -.Xr uart 4 -for more details. .It Fl m mute the console to suppress all console input and output during the boot. ___ 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: r247360 - in head/sys: arm/arm powerpc/booke vm
Author: attilio Date: Tue Feb 26 23:35:27 2013 New Revision: 247360 URL: http://svnweb.freebsd.org/changeset/base/247360 Log: Merge from vmc-playground branch: Replace the sub-optimal uma_zone_set_obj() primitive with more modern uma_zone_reserve_kva(). The new primitive reserves before hand the necessary KVA space to cater the zone allocations and allocates pages with ALLOC_NOOBJ. More specifically: - uma_zone_reserve_kva() does not need an object to cater the backend allocator. - uma_zone_reserve_kva() can cater M_WAITOK requests, in order to serve zones which need to do uma_prealloc() too. - When possible, uma_zone_reserve_kva() uses directly the direct-mapping by uma_small_alloc() rather than relying on the KVA / offset combination. The removal of the object attribute allows 2 further changes: 1) _vm_object_allocate() becomes static within vm_object.c 2) VM_OBJECT_LOCK_INIT() is removed. This function is replaced by direct calls to mtx_init() as there is no need to export it anymore and the calls aren't either homogeneous anymore: there are now small differences between arguments passed to mtx_init(). Sponsored by: EMC / Isilon storage division Reviewed by: alc (which also offered almost all the comments) Tested by:pho, jhb, davide Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c head/sys/powerpc/booke/pmap.c head/sys/vm/swap_pager.c head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h head/sys/vm/vm_map.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/arm/arm/pmap-v6.c == --- head/sys/arm/arm/pmap-v6.c Tue Feb 26 23:18:35 2013(r247359) +++ head/sys/arm/arm/pmap-v6.c Tue Feb 26 23:35:27 2013(r247360) @@ -392,7 +392,6 @@ static uma_zone_t l2table_zone; static vm_offset_t pmap_kernel_l2dtable_kva; static vm_offset_t pmap_kernel_l2ptp_kva; static vm_paddr_t pmap_kernel_l2ptp_phys; -static struct vm_object pvzone_obj; static int pv_entry_count=0, pv_entry_max=0, pv_entry_high_water=0; static struct rwlock pvh_global_lock; @@ -1164,7 +1163,7 @@ pmap_init(void) NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; - uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max); + uma_zone_reserve_kva(pvzone, pv_entry_max); pv_entry_high_water = 9 * (pv_entry_max / 10); /* Modified: head/sys/arm/arm/pmap.c == --- head/sys/arm/arm/pmap.c Tue Feb 26 23:18:35 2013(r247359) +++ head/sys/arm/arm/pmap.c Tue Feb 26 23:35:27 2013(r247360) @@ -397,7 +397,6 @@ static uma_zone_t l2table_zone; static vm_offset_t pmap_kernel_l2dtable_kva; static vm_offset_t pmap_kernel_l2ptp_kva; static vm_paddr_t pmap_kernel_l2ptp_phys; -static struct vm_object pvzone_obj; static int pv_entry_count=0, pv_entry_max=0, pv_entry_high_water=0; static struct rwlock pvh_global_lock; @@ -1828,7 +1827,7 @@ pmap_init(void) NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; - uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max); + uma_zone_reserve_kva(pvzone, pv_entry_max); pv_entry_high_water = 9 * (pv_entry_max / 10); /* Modified: head/sys/powerpc/booke/pmap.c == --- head/sys/powerpc/booke/pmap.c Tue Feb 26 23:18:35 2013 (r247359) +++ head/sys/powerpc/booke/pmap.c Tue Feb 26 23:35:27 2013 (r247360) @@ -217,7 +217,6 @@ static struct rwlock_padalign pvh_global /* Data for the pv entry allocation mechanism */ static uma_zone_t pvzone; -static struct vm_object pvzone_obj; static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0; #define PV_ENTRY_ZONE_MIN 2048/* min pv entries in uma zone */ @@ -1343,7 +1342,7 @@ mmu_booke_init(mmu_t mmu) TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); pv_entry_high_water = 9 * (pv_entry_max / 10); - uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max); + uma_zone_reserve_kva(pvzone, pv_entry_max); /* Pre-fill pvzone with initial number of pv entries. */ uma_prealloc(pvzone, PV_ENTRY_ZONE_MIN); Modified: head/sys/vm/swap_pager.c == --- head/sys/vm/swap_pager.cTue Feb 26 23:18:35 2013(r247359) +++ head/sys/vm/swap_pager.cTue Feb 26 23:35:27 2013(r247360) @@ -343,7 +343,6 @@ SYSCTL_INT(_vm, OID_AUTO, swap_async_max static struct mtx sw_alloc_mtx;
Re: svn commit: r247274 - in head: bin/test tools/regression/bin/test
On Tuesday, 26 February 2013 at 1:02:27 +0100, Jilles Tjoelker wrote: > On Mon, Feb 25, 2013 at 07:05:41PM +, Peter Jeremy wrote: >> Author: peterj >> Date: Mon Feb 25 19:05:40 2013 >> New Revision: 247274 >> URL: http://svnweb.freebsd.org/changeset/base/247274 > >> Log: >> Enhance test(1) by adding provision to compare any combination of the >> access, birth, change and modify times of two files, instead of only >> being able to compare modify times. The builtin test in sh(1) will >> automagically acquire the same expansion. > >> Approved by: grog >> MFC after: 2 weeks > > What do you need this for? Lots of things. For example, I need it to compare photos I have created and then set the timestamp to the time of exposure. The only way I can establish that the image is newer is via the creation timestamp. In the past I've wished I had the functionality for other reasons I now forget. Peter has other reasons again. I expect other users to also find this useful. Arguably comparing different kinds of timestamps is not very useful, but then, that's "arguably". Others might find a use for it. > If it is not needed very often, this test can > be done more portably (older FreeBSD and GNU) as > [ -n "$(find -L FILE1 -prune -newerXY FILE2 2>/dev/null)" ] That's really ugly. It's also difficult for the casual reader to understand. > I have generally been rather reluctant in adding things to sh(1) and > even more so if they are completely new. Someone proposed something > rather similar (except that it added a time string parser -- even more > code) in PR bin/57054 and I rejected it in 2009. That was a much larger chunk of code. And times change. In December 1998 I added an -S option to ls(1), and jkh (my mentor) refused it on the basis of bloat. In June 2005, keramida submitted similar functionality, and it was committed as revision 146924. It's also functionality that I use frequently. Re bloat. Here's before and after: textdata bss dec hex filename 2564511524720 315177b1d /bin/ls 2671811684840 327267fd6 /bin/ls A little over a kilobyte. Peter even went to the trouble of keeping the size of the operator table entries the same. I think the additional size is justifiable. Greg -- Sent from my desktop computer. Finger g...@freebsd.org for PGP public key. See complete headers for address and phone numbers. This message is digitally signed. If your Microsoft MUA reports problems, please read http://tinyurl.com/broken-mua pgpuI80jfqqjE.pgp Description: PGP signature
svn commit: r247366 - in head/sys/dev/ath: . ath_hal
Author: adrian Date: Wed Feb 27 00:25:44 2013 New Revision: 247366 URL: http://svnweb.freebsd.org/changeset/base/247366 Log: Add in the STBC TX/RX capability support into the HAL and driver. The HAL already included the STBC fields; it just needed to be exposed to the driver and net80211 stack. This should allow single-stream STBC TX and RX to be negotiated; however the driver and rate control code currently don't do anything with it. Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.c == --- head/sys/dev/ath/ath_hal/ah.c Wed Feb 27 00:14:12 2013 (r247365) +++ head/sys/dev/ath/ath_hal/ah.c Wed Feb 27 00:25:44 2013 (r247366) @@ -692,6 +692,10 @@ ath_hal_getcapability(struct ath_hal *ah return pCap->hal4AddrAggrSupport ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_EXT_CHAN_DFS: return pCap->halExtChanDfsSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_RX_STBC: + return pCap->halRxStbcSupport ? HAL_OK : HAL_ENOTSUPP; + case HAL_CAP_TX_STBC: + return pCap->halTxStbcSupport ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_COMBINED_RADAR_RSSI: return pCap->halUseCombinedRadarRssi ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_AUTO_SLEEP: Modified: head/sys/dev/ath/ath_hal/ah.h == --- head/sys/dev/ath/ath_hal/ah.h Wed Feb 27 00:14:12 2013 (r247365) +++ head/sys/dev/ath/ath_hal/ah.h Wed Feb 27 00:25:44 2013 (r247366) @@ -137,6 +137,9 @@ typedef enum { HAL_CAP_RIFS_RX_ENABLED = 53, HAL_CAP_BB_DFS_HANG = 54, + HAL_CAP_RX_STBC = 58, + HAL_CAP_TX_STBC = 59, + HAL_CAP_BT_COEX = 60, /* hardware is capable of bluetooth coexistence */ HAL_CAP_DYNAMIC_SMPS= 61, /* Dynamic MIMO Power Save hardware support */ Modified: head/sys/dev/ath/if_ath.c == --- head/sys/dev/ath/if_ath.c Wed Feb 27 00:14:12 2013(r247365) +++ head/sys/dev/ath/if_ath.c Wed Feb 27 00:25:44 2013(r247366) @@ -781,6 +781,28 @@ ath_attach(u_int16_t devid, struct ath_s ic->ic_txstream = txs; ic->ic_rxstream = rxs; + /* +* Setup TX and RX STBC based on what the HAL allows and +* the currently configured chainmask set. +* Ie - don't enable STBC TX if only one chain is enabled. +* STBC RX is fine on a single RX chain; it just won't +* provide any real benefit. +*/ + if (ath_hal_getcapability(ah, HAL_CAP_RX_STBC, 0, + NULL) == HAL_OK) { + sc->sc_rx_stbc = 1; + device_printf(sc->sc_dev, + "[HT] 1 stream STBC receive enabled\n"); + ic->ic_htcaps |= IEEE80211_HTCAP_RXSTBC_1STREAM; + } + if (txs > 1 && ath_hal_getcapability(ah, HAL_CAP_TX_STBC, 0, + NULL) == HAL_OK) { + sc->sc_tx_stbc = 1; + device_printf(sc->sc_dev, + "[HT] 1 stream STBC transmit enabled\n"); + ic->ic_htcaps |= IEEE80211_HTCAP_TXSTBC; + } + (void) ath_hal_getcapability(ah, HAL_CAP_RTS_AGGR_LIMIT, 1, &sc->sc_rts_aggr_limit); if (sc->sc_rts_aggr_limit != (64 * 1024)) Modified: head/sys/dev/ath/if_athvar.h == --- head/sys/dev/ath/if_athvar.hWed Feb 27 00:14:12 2013 (r247365) +++ head/sys/dev/ath/if_athvar.hWed Feb 27 00:25:44 2013 (r247366) @@ -567,7 +567,9 @@ struct ath_softc { /* * Second set of flags. */ - u_int32_t sc_use_ent : 1; + u_int32_t sc_use_ent : 1, + sc_rx_stbc : 1, + sc_tx_stbc : 1; /* * Enterprise mode configuration for AR9380 and later chipsets. ___ 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: r247367 - head/sys/dev/mfi
Author: smh Date: Wed Feb 27 00:35:40 2013 New Revision: 247367 URL: http://svnweb.freebsd.org/changeset/base/247367 Log: Fixes mfi panic on recused on non-recusive mutex MFI I/O lock Removes a mtx_unlock call for mfi_io_lock which is never aquired While I'm here fix a braceing style issue. Reviewed by: Doug Ambrisko Approved by: pjd (mentor) MFC after:1 month Modified: head/sys/dev/mfi/mfi.c head/sys/dev/mfi/mfi_tbolt.c Modified: head/sys/dev/mfi/mfi.c == --- head/sys/dev/mfi/mfi.c Wed Feb 27 00:25:44 2013(r247366) +++ head/sys/dev/mfi/mfi.c Wed Feb 27 00:35:40 2013(r247367) @@ -723,10 +723,8 @@ mfi_attach(struct mfi_softc *sc) "hook\n"); return (EINVAL); } - if ((error = mfi_aen_setup(sc, 0), 0) != 0) { - mtx_unlock(&sc->mfi_io_lock); + if ((error = mfi_aen_setup(sc, 0), 0) != 0) return (error); - } /* * Register a shutdown handler. Modified: head/sys/dev/mfi/mfi_tbolt.c == --- head/sys/dev/mfi/mfi_tbolt.cWed Feb 27 00:25:44 2013 (r247366) +++ head/sys/dev/mfi/mfi_tbolt.cWed Feb 27 00:35:40 2013 (r247367) @@ -1194,6 +1194,7 @@ mfi_process_fw_state_chg_isr(void *arg) sc->hw_crit_error= 1; return ; } + mtx_unlock(&sc->mfi_io_lock); if ((error = mfi_tbolt_init_MFI_queue(sc)) != 0) return; @@ -1225,7 +1226,9 @@ mfi_process_fw_state_chg_isr(void *arg) /* * Initiate AEN (Asynchronous Event Notification) */ + mtx_unlock(&sc->mfi_io_lock); mfi_aen_setup(sc, sc->last_seq_num); + mtx_lock(&sc->mfi_io_lock); sc->issuepend_done = 1; device_printf(sc->mfi_dev, "second stage of reset " "complete, FW is ready now.\n"); @@ -1237,7 +1240,6 @@ mfi_process_fw_state_chg_isr(void *arg) device_printf(sc->mfi_dev, "mfi_process_fw_state_chg_isr " "called with unhandled value:%d\n", sc->adpreset); } - mtx_unlock(&sc->mfi_io_lock); } /* ___ 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: r247368 - head/sys/dev/ath
Author: adrian Date: Wed Feb 27 00:49:32 2013 New Revision: 247368 URL: http://svnweb.freebsd.org/changeset/base/247368 Log: Enable STBC for the given rate series if it's negotiated: * If both ends have negotiated (at least) one stream; * Only if it's a single stream rate (MCS0-7); * Only if there's more than one TX chain enabled. Tested: * AR9280 STA mode -> Atheros AP; tested both MCS2 (STBC) and MCS12 (no STBC.) Verified using athalq to inspect the TX descriptors. TODO: * Test AR5416 - no STBC should be enabled; * Test AR9280 with one TX chain enabled - no STBC should be enabled. Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c == --- head/sys/dev/ath/if_ath_tx_ht.c Wed Feb 27 00:35:40 2013 (r247367) +++ head/sys/dev/ath/if_ath_tx_ht.c Wed Feb 27 00:49:32 2013 (r247368) @@ -536,17 +536,30 @@ ath_rateseries_setup(struct ath_softc *s series[i].RateFlags |= HAL_RATESERIES_HALFGI; /* -* XXX TODO: STBC if it's possible +* Setup rate and TX power cap for this series. */ + series[i].Rate = rt->info[rc[i].rix].rateCode; + series[i].RateIndex = rc[i].rix; + series[i].tx_power_cap = 0x3f; /* XXX for now */ + + + /* +* If we have STBC TX enabled and the receiver +* can receive (at least) 1 stream STBC, AND it's +* MCS 0-7, AND we have at least two chains enabled, +* enable STBC. +*/ + if (ic->ic_htcaps & IEEE80211_HTCAP_TXSTBC && + ni->ni_htcap & IEEE80211_HTCAP_RXSTBC_1STREAM && + (sc->sc_cur_txchainmask > 1) && + HT_RC_2_STREAMS(series[i].Rate) == 1) { + series[i].RateFlags |= HAL_RATESERIES_STBC; + } /* * XXX TODO: LDPC if it's possible */ - series[i].Rate = rt->info[rc[i].rix].rateCode; - series[i].RateIndex = rc[i].rix; - series[i].tx_power_cap = 0x3f; /* XXX for now */ - /* * PktDuration doesn't include slot, ACK, RTS, etc timing - * it's just the packet duration ___ 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: r247369 - head/sys/dev/mfi
Author: smh Date: Wed Feb 27 02:21:10 2013 New Revision: 247369 URL: http://svnweb.freebsd.org/changeset/base/247369 Log: Fixes queuing issues where mfi_release_command blindly sets the cm_flags = 0 without first removing the command from the relavent queue. This was causing panics in the queue functions which check to ensure a command is not on another queue. Fixed some cases where the error from mfi_mapcmd was lost and where the command was never released / dequeued in error cases. Ensure that all failures to mfi_mapcmd are logged. Fixed possible null pointer exception in mfi_aen_setup if mfi_get_log_state failed. Fixed mfi_parse_entries & mfi_aen_setup not returning possible errors. Corrected MFI_DUMP_CMDS calls with invalid vars SC vs sc. Commands which have timed out now set cm_error to ETIMEDOUT and call mfi_complete which prevents them getting stuck in the busy queue forever. Fixed possible use of NULL pointer in mfi_tbolt_get_cmd. Changed output formats to be more easily recognisable when debugging. Optimised mfi_cmd_pool_tbolt cleanup. Made information about driver limiting commands always display as for modern cards this can be severe. Fixed mfi_tbolt_alloc_cmd out of memory case which previously didnt return an error. Added malloc checks for request_desc_pool including free when subsiquent errors are detected. Fixed overflow error in SIMD reply descriptor check. Fixed tbolt_cmd leak in mfi_build_and_issue_cmd if there's an error during IO build. Elimintated double checks on sc->mfi_aen_cm & sc->mfi_map_sync_cm in mfi_shutdown. Move local hdr calculation after error check in mfi_aen_complete. Fixed wakeup on NULL in mfi_aen_complete. Fixed mfi_aen_cm cleanup in mfi_process_fw_state_chg_isr not checking if it was NULL. Changed mfi_alloc_commands to error if bus_dmamap_create fails. Previously we would try to continue with the number of allocated commands but lots of places in the driver assume sc->mfi_max_fw_cmds is whats available so its unsafe to do this without lots of changes. Removed mfi_total_cmds as its no longer used due the above change. Corrected mfi_tbolt_alloc_cmd to return ENOMEM where appropriate. Fixed timeouts actually firing at double what they should. Setting hw.mfi.max_cmds=-1 now configures to use the controller max. A few style (9) fixes e.g. braced single line conditions and double blank lines Cleaned up queuing macros Removed invalid queuing tests for multiple queues Trap and deal with errors when doing sends in mfi_data_cb Refactored frame sending into one method with error checking of the return code so we can ensure commands aren't left on the queue after error. This ensures that mfi_mapcmd & mfi_data_cb leave the queue in a valid state. Refactored how commands are cleaned up, mfi_release_command now ensures that all queues and command state is maintained in a consistent state. Prevent NULL pointer use in mfi_tbolt_complete_cmd Fixed use of NULL sc->mfi_map_sync_cm in wakeup Added defines to help with output of mfi_cmd and header flags. Fixed mfi_tbolt_init_MFI_queue invalidating cm_index of the acquired mfi_cmd. Reset now reinitialises sync map as well as AEN. Fixed possible use of NULL pointer in mfi_build_and_issue_cmd Fixed mfi_tbolt_init_MFI_queue call to mfi_process_fw_state_chg_isr causing panic on failure. Ensure that tbolt cards always initialise next_host_reply_index and free_host_reply_index (based off mfi_max_fw_cmds) on both startup and reset as per the linux driver. Fixed mfi_tbolt_complete_cmd not acknowledging unknown commands so it didn't clear the controller. Prevent locks from being dropped and re-acquired in the following functions which was allowing multiple threads to enter critical methods such as mfi_tbolt_complete_cmd & mfi_process_fw_state_chg_isr:- * mfi_tbolt_init_MFI_queue * mfi_aen_complete / mfi_aen_register * mfi_tbolt_sync_map_info * mfi_get_log_state * mfi_parse_entries The locking for these functions was promoting to higher level methods. This also fixed MFI_LINUX_SET_AEN_2 which was already acquiring the lock, so would have paniced for recursive lock. This also required changing malloc of ld_sync in mfi_tbolt_sync_map_info to M_NOWAIT which can hence now fail but this was already expected as its return was being tested. Removed the assignment of cm_index in mfi_tbolt_init_MFI_queue which breaks the world if the cmd returned by mfi_dequeue_free isn't the first cmd. Fixed locking in mfi_data_cb, this is an async callback from bus_dmamap_load which could hence be called after the caller has dropped the lock. If we don't have the lock we aquire it and ensure we unlock before returning. Fixed locking mfi_comms_init when mfi_dequeue_free fails.
svn commit: r247370 - head/sbin/geom/class/part
Author: benno Date: Wed Feb 27 03:43:16 2013 New Revision: 247370 URL: http://svnweb.freebsd.org/changeset/base/247370 Log: Fix typo in EFI GPT GUID. Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 == --- head/sbin/geom/class/part/gpart.8 Wed Feb 27 02:21:10 2013 (r247369) +++ head/sbin/geom/class/part/gpart.8 Wed Feb 27 03:43:16 2013 (r247370) @@ -583,7 +583,7 @@ The system partition for computers that Interface (EFI). In such cases, the GPT partitioning scheme is used and the actual partition type for the system partition can also be specified as -.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab" . +.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" . .It Cm freebsd A .Fx ___ 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: r247372 - head/sys/dev/ath/ath_rate/sample
Author: adrian Date: Wed Feb 27 04:33:06 2013 New Revision: 247372 URL: http://svnweb.freebsd.org/changeset/base/247372 Log: I give up - just throw the EWMA update into the normal update_stats() routine. There were still corner cases where the EWMA update stats are being called on a rix which didn't have an intermediary stats update; thus no packets were counted against it. Sigh. This should fix the crashes I've been seeing on recent -HEAD. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c == --- head/sys/dev/ath/ath_rate/sample/sample.c Wed Feb 27 04:19:12 2013 (r247371) +++ head/sys/dev/ath/ath_rate/sample/sample.c Wed Feb 27 04:33:06 2013 (r247372) @@ -708,71 +708,6 @@ ath_rate_setupxtxdesc(struct ath_softc * s3code, sched->t3); /* series 3 */ } -/* - * Update the EWMA percentage. - * - * This is a simple hack to track an EWMA based on the current - * rate scenario. For the rate codes which failed, this will - * record a 0% against it. For the rate code which succeeded, - * EWMA will record the nbad*100/nframes percentage against it. - */ -static void -update_ewma_stats(struct ath_softc *sc, struct ath_node *an, -int frame_size, -int rix0, int tries0, -int rix1, int tries1, -int rix2, int tries2, -int rix3, int tries3, -int short_tries, int tries, int status, -int nframes, int nbad) -{ - struct sample_node *sn = ATH_NODE_SAMPLE(an); - struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc); - const int size_bin = size_to_bin(frame_size); - int tries_so_far; - int pct; - int rix = rix0; - - /* Calculate percentage based on current rate */ - if (nframes == 0) - nframes = nbad = 1; - pct = ((nframes - nbad) * 1000) / nframes; - - /* Figure out which rate index succeeded */ - tries_so_far = tries0; - - if (tries1 && tries_so_far < tries) { - tries_so_far += tries1; - rix = rix1; - /* XXX bump ewma pct */ - } - - if (tries2 && tries_so_far < tries) { - tries_so_far += tries2; - rix = rix2; - /* XXX bump ewma pct */ - } - - if (tries3 && tries_so_far < tries) { - rix = rix3; - /* XXX bump ewma pct */ - } - - /* rix is the successful rate, update EWMA for final rix */ - if (sn->stats[size_bin][rix].total_packets < - ssc->smoothing_minpackets) { - /* just average the first few packets */ - int a_pct = (sn->stats[size_bin][rix].packets_acked * 1000) / - (sn->stats[size_bin][rix].total_packets); - sn->stats[size_bin][rix].ewma_pct = a_pct; - } else { - /* use a ewma */ - sn->stats[size_bin][rix].ewma_pct = - ((sn->stats[size_bin][rix].ewma_pct * ssc->smoothing_rate) + -(pct * (100 - ssc->smoothing_rate))) / 100; - } -} - static void update_stats(struct ath_softc *sc, struct ath_node *an, int frame_size, @@ -792,6 +727,7 @@ update_stats(struct ath_softc *sc, struc const int size = bin_to_size(size_bin); int tt, tries_so_far; int is_ht40 = (an->an_node.ni_chw == 40); + int pct; if (!IS_RATE_DEFINED(sn, rix0)) return; @@ -865,6 +801,27 @@ update_stats(struct ath_softc *sc, struc sn->stats[size_bin][rix0].last_tx = ticks; sn->stats[size_bin][rix0].total_packets += nframes; + /* update EWMA for this rix */ + + /* Calculate percentage based on current rate */ + if (nframes == 0) + nframes = nbad = 1; + pct = ((nframes - nbad) * 1000) / nframes; + + if (sn->stats[size_bin][rix0].total_packets < + ssc->smoothing_minpackets) { + /* just average the first few packets */ + int a_pct = (sn->stats[size_bin][rix0].packets_acked * 1000) / + (sn->stats[size_bin][rix0].total_packets); + sn->stats[size_bin][rix0].ewma_pct = a_pct; + } else { + /* use a ewma */ + sn->stats[size_bin][rix0].ewma_pct = + ((sn->stats[size_bin][rix0].ewma_pct * ssc->smoothing_rate) + +(pct * (100 - ssc->smoothing_rate))) / 100; + } + + if (rix0 == sn->current_sample_rix[size_bin]) { IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, @@ -907,6 +864,11 @@ ath_rate_tx_complete(struct ath_softc *s short_tries = ts->ts_shortretry; long_tries = ts->ts_longretry + 1; + if (nframes == 0) { + device_printf(sc->sc_dev, "%s: nframes=0?\n", __func__); + retur
Re: svn commit: r247300 - in head: sys/sys usr.bin/truss
On Tue, 26 Feb 2013, Davide Italiano wrote: On Tue, Feb 26, 2013 at 7:35 PM, John Baldwin wrote: On Tuesday, February 26, 2013 12:09:42 pm Davide Italiano wrote: On Tue, Feb 26, 2013 at 3:41 PM, John Baldwin wrote: On Monday, February 25, 2013 9:13:02 pm Xin LI wrote: Author: delphij Date: Tue Feb 26 02:13:02 2013 New Revision: 247300 URL: http://svnweb.freebsd.org/changeset/base/247300 Log: Expose timespec and timeval macros when __BSD_VISIBLE is defined. This allows userland application to use the following macros: timespecclear, timespecisset, timespeccmp, timespecadd, timespecsub; timevalclear, timevalisset, timevalcmp. These were intentionally left out. Unfortunately the API/namespace police were not vigilant when the even worse APIs timerclear(), etc., were imported from NetBSD/OpenBSD. Apart from namespace pollution, bugs in these APIs start with them being unsafe macros spelled as safe ones. This bug is unimportant for relatively limited use in the kernel, but is unsuitable for a public API. Not leaving the above out gives a reasonable but nonstandard set of APIs for timespecs (the 5 listed above), but a weird sesqui-duplicated set for timevals (the 3 listed above, plus the 5 misnamed timer*() from NetBSD/ OpenBSD). Not leaving out the 3 duplicates the 3 least useful ones. Why not fix truss to use the stock functions instead of keeping private "unusual" versions? They are 3-operand variants of the 2-operand kernel ones that escaped. 3 operands would be better (more general, and at no cost except in calling complexity if the target operand is one of the source operands), but the order of the 3 operands is as badly designed as possible: kernel API: operands (v, u); result v op= u; truss API: operands (t, u, v); result should be t = u op v result isv = t op u (just reversed; t is not the target...) The timeval APIs are not actually sesqui-duplicated like I said above. The NetBSD/OpenBSD ones follow the truss order, with t not being the target (it just means generic timespec/timeval, while u and v mean the second and third ones, and now it is the kernel API that is confusing since there is no t and the order of the others is reversed in the operands), while the 3 recently exposed kernel ones aren't of the form target = source1 op source2. truss's timespecadd() also has or had an off by 1 error in its tv_nsec wrap check. time.h is already a mess in terms of namespace pollution, and this exposure might not help thing. Other details here: http://permalink.gmane.org/gmane.os.freebsd.architechture/15518 The bintime macros add further designed and implementation errors. And now there are sbintimes... I think that is orthogonal. Even if this is reverted I think truss should be changed to use the "normal" timespecsubt() macro rather than using a custom one with a different argument order. When I talked about "exposure" I referred about timeval/timespec macros(). I wasn't arguing about your proposed change. Sorry if it wasn't clear. In fact, conversion would further unimprove truss, since it wants a different target in all cases, so the 3-operand variants are ideal for it. Converting to the 2-operand variants would require a temporary variable in all callers or in the macros. The macros could be based on the standard ones, but would hardly be improved by that since the operations are so simple that no one would get them wrong with off by 1 errors etc. Bruce ___ 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: r247382 - head/sys/dev/msk
Author: yongari Date: Wed Feb 27 05:03:35 2013 New Revision: 247382 URL: http://svnweb.freebsd.org/changeset/base/247382 Log: RX checksum offloading on old Yukon controllers seem to cause more problems. Disable RX checksum offloading on controllers that don't use new descriptor format but give chance to enable it with ifconfig(8). Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c == --- head/sys/dev/msk/if_msk.c Wed Feb 27 05:02:40 2013(r247381) +++ head/sys/dev/msk/if_msk.c Wed Feb 27 05:03:35 2013(r247382) @@ -1695,6 +1695,12 @@ msk_attach(device_t dev) ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; } ifp->if_capenable = ifp->if_capabilities; + /* +* Disable RX checksum offloading on controllers that don't use +* new descriptor format but give chance to enable it. +*/ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0) + ifp->if_capenable &= ~IFCAP_RXCSUM; /* * Tell the upper layer(s) we support long frames. ___ 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: r247386 - head/contrib/binutils/gas/config
Author: andrew Date: Wed Feb 27 06:53:15 2013 New Revision: 247386 URL: http://svnweb.freebsd.org/changeset/base/247386 Log: Clear the memory allocated to build the unwind tables. This fixes C++ exceptions on ARM EABI with static binaries. Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c == --- head/contrib/binutils/gas/config/tc-arm.c Wed Feb 27 06:12:50 2013 (r247385) +++ head/contrib/binutils/gas/config/tc-arm.c Wed Feb 27 06:53:15 2013 (r247386) @@ -3079,6 +3079,7 @@ s_arm_unwind_fnend (int ignored ATTRIBUT record_alignment (now_seg, 2); ptr = frag_more (8); + memset(ptr, 0, 8); where = frag_now_fix () - 8; /* Self relative offset of the function start. */ @@ -17350,6 +17351,7 @@ create_unwind_entry (int have_data) /* Allocate the table entry. */ ptr = frag_more ((size << 2) + 4); + memset(ptr, 0, (size << 2) + 4); where = frag_now_fix () - ((size << 2) + 4); switch (unwind.personality_index) ___ 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: r247387 - head/sys/ufs/ffs
Author: kib Date: Wed Feb 27 07:31:23 2013 New Revision: 247387 URL: http://svnweb.freebsd.org/changeset/base/247387 Log: An inode block must not be blockingly read while cg block is owned. The order is inode buffer lock -> snaplk -> cg buffer lock, reversing the order causes deadlocks. Inode block must not be written while cg block buffer is owned. The FFS copy on write needs to allocate a block to copy the content of the inode block, and the cylinder group selected for the allocation might be the same as the owned cg block. The reserved block detection code in the ffs_copyonwrite() and ffs_bp_snapblk() is unable to detect the situation, because the locked cg buffer is not exposed to it. In order to maintain the dependency between initialized inode block and the cg_initediblk pointer, look up the inode buffer in non-blocking mode. If succeeded, brelse cg block, initialize the inode block and write it. After the write is finished, reread cg block and update the cg_initediblk. If inode block is already locked by another thread, let the another thread initialize it. If another thread raced with us after we started writing inode block, the situation is detected by an update of cg_initediblk. Note that double-initialization of the inode block is harmless, the block cannot be used until cg_initediblk is incremented. Sponsored by: The FreeBSD Foundation In collaboration with:pho Reviewed by: mckusick MFC after:1 month X-MFC-note: after r246877 Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c == --- head/sys/ufs/ffs/ffs_alloc.cWed Feb 27 06:53:15 2013 (r247386) +++ head/sys/ufs/ffs/ffs_alloc.cWed Feb 27 07:31:23 2013 (r247387) @@ -1790,6 +1790,17 @@ fail: return (0); } +static inline struct buf * +getinobuf(struct inode *ip, u_int cg, u_int32_t cginoblk, int gbflags) +{ + struct fs *fs; + + fs = ip->i_fs; + return (getblk(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, + cg * fs->fs_ipg + cginoblk)), (int)fs->fs_bsize, 0, 0, + gbflags)); +} + /* * Determine whether an inode can be allocated. * @@ -1814,9 +1825,11 @@ ffs_nodealloccg(ip, cg, ipref, mode, unu u_int8_t *inosused, *loc; struct ufs2_dinode *dp2; int error, start, len, i; + u_int32_t old_initediblk; fs = ip->i_fs; ump = ip->i_ump; +check_nifree: if (fs->fs_cs(fs, cg).cs_nifree == 0) return (0); UFS_UNLOCK(ump); @@ -1828,13 +1841,13 @@ ffs_nodealloccg(ip, cg, ipref, mode, unu return (0); } cgp = (struct cg *)bp->b_data; +restart: if (!cg_chkmagic(cgp) || cgp->cg_cs.cs_nifree == 0) { brelse(bp); UFS_LOCK(ump); return (0); } bp->b_xflags |= BX_BKGRDWRITE; - cgp->cg_old_time = cgp->cg_time = time_second; inosused = cg_inosused(cgp); if (ipref) { ipref %= fs->fs_ipg; @@ -1856,7 +1869,6 @@ ffs_nodealloccg(ip, cg, ipref, mode, unu } } ipref = (loc - inosused) * NBBY + ffs(~*loc) - 1; - cgp->cg_irotor = ipref; gotit: /* * Check to see if we need to initialize more inodes. @@ -1864,9 +1876,37 @@ gotit: if (fs->fs_magic == FS_UFS2_MAGIC && ipref + INOPB(fs) > cgp->cg_initediblk && cgp->cg_initediblk < cgp->cg_niblk) { - ibp = getblk(ip->i_devvp, fsbtodb(fs, - ino_to_fsba(fs, cg * fs->fs_ipg + cgp->cg_initediblk)), - (int)fs->fs_bsize, 0, 0, 0); + old_initediblk = cgp->cg_initediblk; + + /* +* Free the cylinder group lock before writing the +* initialized inode block. Entering the +* babarrierwrite() with the cylinder group lock +* causes lock order violation between the lock and +* snaplk. +* +* Another thread can decide to initialize the same +* inode block, but whichever thread first gets the +* cylinder group lock after writing the newly +* allocated inode block will update it and the other +* will realize that it has lost and leave the +* cylinder group unchanged. +*/ + ibp = getinobuf(ip, cg, old_initediblk, GB_LOCK_NOWAIT); + brelse(bp); + if (ibp == NULL) { + /* +* The inode block buffer is already owned by +* another thread, which must initialize it. +* Wait on the buffer to allow another thread +* to finish the updates, with dropped cg +
svn commit: r247388 - in head/sys: sys ufs/ffs ufs/ufs
Author: kib Date: Wed Feb 27 07:32:39 2013 New Revision: 247388 URL: http://svnweb.freebsd.org/changeset/base/247388 Log: The softdep freeblks workitem might hold a reference on the dquot. Current dqflush() panics when a dquot with with non-zero refcount is encountered. The situation is possible, because quotas are turned off before softdep workitem queue if flushed, due to the quota file writes might create softdep workitems. Make the encountering an active dquot in dqflush() not fatal, return the error from quotaoff() instead. Ignore the quotaoff() failures when ffs_flushfiles() is called in the course of softdep_flushfiles() loop, until the last iteration. At the last loop, the quotas must be closed, and because SU workitems should be already flushed, the references to dquot are gone. Sponsored by: The FreeBSD Foundation Reported and tested by: pho Reviewed by: mckusick MFC after:2 weeks Modified: head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/ufs_quota.c Modified: head/sys/sys/vnode.h == --- head/sys/sys/vnode.hWed Feb 27 07:31:23 2013(r247387) +++ head/sys/sys/vnode.hWed Feb 27 07:32:39 2013(r247388) @@ -385,6 +385,7 @@ extern int vttoif_tab[]; #defineSKIPSYSTEM 0x0001 /* vflush: skip vnodes marked VSYSTEM */ #defineFORCECLOSE 0x0002 /* vflush: force file closure */ #defineWRITECLOSE 0x0004 /* vflush: only close writable files */ +#defineEARLYFLUSH 0x0008 /* vflush: early call for ffs_flushfiles */ #defineV_SAVE 0x0001 /* vinvalbuf: sync file first */ #defineV_ALT 0x0002 /* vinvalbuf: invalidate only alternate bufs */ #defineV_NORMAL0x0004 /* vinvalbuf: invalidate only regular bufs */ Modified: head/sys/ufs/ffs/ffs_softdep.c == --- head/sys/ufs/ffs/ffs_softdep.c Wed Feb 27 07:31:23 2013 (r247387) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Feb 27 07:32:39 2013 (r247388) @@ -1908,7 +1908,12 @@ softdep_flushfiles(oldmnt, flags, td) int flags; struct thread *td; { - int error, depcount, loopcnt, retry_flush_count, retry; +#ifdef QUOTA + struct ufsmount *ump; + int i; +#endif + int error, early, depcount, loopcnt, retry_flush_count, retry; + int morework; loopcnt = 10; retry_flush_count = 3; @@ -1926,7 +1931,9 @@ retry_flush: * Do another flush in case any vnodes were brought in * as part of the cleanup operations. */ - if ((error = ffs_flushfiles(oldmnt, flags, td)) != 0) + early = retry_flush_count == 1 || (oldmnt->mnt_kern_flag & + MNTK_UNMOUNT) == 0 ? 0 : EARLYFLUSH; + if ((error = ffs_flushfiles(oldmnt, flags | early, td)) != 0) break; if ((error = softdep_flushworklist(oldmnt, &depcount, td)) != 0 || depcount == 0) @@ -1950,7 +1957,17 @@ retry_flush: MNT_ILOCK(oldmnt); KASSERT((oldmnt->mnt_kern_flag & MNTK_NOINSMNTQ) != 0, ("softdep_flushfiles: !MNTK_NOINSMNTQ")); - if (oldmnt->mnt_nvnodelistsize > 0) { + morework = oldmnt->mnt_nvnodelistsize > 0; +#ifdef QUOTA + ump = VFSTOUFS(oldmnt); + UFS_LOCK(ump); + for (i = 0; i < MAXQUOTAS; i++) { + if (ump->um_quotas[i] != NULLVP) + morework = 1; + } + UFS_UNLOCK(ump); +#endif + if (morework) { if (--retry_flush_count > 0) { retry = 1; loopcnt = 3; Modified: head/sys/ufs/ffs/ffs_vfsops.c == --- head/sys/ufs/ffs/ffs_vfsops.c Wed Feb 27 07:31:23 2013 (r247387) +++ head/sys/ufs/ffs/ffs_vfsops.c Wed Feb 27 07:32:39 2013 (r247388) @@ -1351,9 +1351,10 @@ ffs_flushfiles(mp, flags, td) struct thread *td; { struct ufsmount *ump; - int error; + int qerror, error; ump = VFSTOUFS(mp); + qerror = 0; #ifdef QUOTA if (mp->mnt_flag & MNT_QUOTA) { int i; @@ -1361,11 +1362,19 @@ ffs_flushfiles(mp, flags, td) if (error) return (error); for (i = 0; i < MAXQUOTAS; i++) { - quotaoff(td, mp, i); + error = quotaoff(t
svn commit: r247389 - head/sys/kern
Author: kib Date: Wed Feb 27 07:34:09 2013 New Revision: 247389 URL: http://svnweb.freebsd.org/changeset/base/247389 Log: Make recursive getblk() slightly more useful. Keep the buffer state intact if getblk() is done on the already owned buffer. Exit from brelse() early when the lock recursion is detected, otherwise brelse() might prematurely destroy the buffer under some circumstances. Sponsored by: The FreeBSD Foundation Noted by: mckusick 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 Wed Feb 27 07:32:39 2013(r247388) +++ head/sys/kern/vfs_bio.c Wed Feb 27 07:34:09 2013(r247389) @@ -1268,6 +1268,15 @@ brelse(struct buf *bp) KASSERT(!(bp->b_flags & (B_CLUSTER|B_PAGING)), ("brelse: inappropriate B_PAGING or B_CLUSTER bp %p", bp)); + if (BUF_LOCKRECURSED(bp)) { + /* +* Do not process, in particular, do not handle the +* B_INVAL/B_RELBUF and do not release to free list. +*/ + BUF_UNLOCK(bp); + return; + } + if (bp->b_flags & B_MANAGED) { bqrelse(bp); return; @@ -1444,12 +1453,6 @@ brelse(struct buf *bp) brelvp(bp); } - if (BUF_LOCKRECURSED(bp)) { - /* do not release to free list */ - BUF_UNLOCK(bp); - return; - } - /* enqueue */ mtx_lock(&bqlock); /* Handle delayed bremfree() processing. */ @@ -2681,6 +2684,9 @@ loop: /* We timed out or were interrupted. */ else if (error) return (NULL); + /* If recursed, assume caller knows the rules. */ + else if (BUF_LOCKRECURSED(bp)) + goto end; /* * The buffer is locked. B_CACHE is cleared if the buffer is @@ -2864,6 +2870,7 @@ loop: } CTR4(KTR_BUF, "getblk(%p, %ld, %d) = %p", vp, (long)blkno, size, bp); BUF_ASSERT_HELD(bp); +end: KASSERT(bp->b_bufobj == bo, ("bp %p wrong b_bufobj %p should be %p", bp, bp->b_bufobj, bo)); return (bp); ___ 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"