svn commit: r217877 - head/sys/dev/siis
Author: mav Date: Wed Jan 26 08:54:10 2011 New Revision: 217877 URL: http://svn.freebsd.org/changeset/base/217877 Log: Hardware supported by siis(4) allows software control over activity LEDs. Expose that functionality to led(4) OR-ing it with regular LED activity. Modified: head/sys/dev/siis/siis.c Modified: head/sys/dev/siis/siis.c == --- head/sys/dev/siis/siis.cWed Jan 26 08:39:34 2011(r217876) +++ head/sys/dev/siis/siis.cWed Jan 26 08:54:10 2011(r217877) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "siis.h" @@ -65,6 +66,7 @@ static int siis_ch_suspend(device_t dev) static int siis_ch_resume(device_t dev); static void siis_ch_intr_locked(void *data); static void siis_ch_intr(void *data); +static void siis_ch_led(void *priv, int onoff); static void siis_begin_transaction(device_t dev, union ccb *ccb); static void siis_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error); static void siis_execute_transaction(struct siis_slot *slot); @@ -516,6 +518,7 @@ siis_ch_attach(device_t dev) goto err3; } mtx_unlock(&ch->mtx); + ch->led = led_create(siis_ch_led, dev, device_get_nameunit(dev)); return (0); err3: @@ -536,6 +539,7 @@ siis_ch_detach(device_t dev) { struct siis_channel *ch = device_get_softc(dev); + led_destroy(ch->led); mtx_lock(&ch->mtx); xpt_async(AC_LOST_DEVICE, ch->path, NULL); xpt_free_path(ch->path); @@ -625,6 +629,21 @@ static driver_t siisch_driver = { }; DRIVER_MODULE(siisch, siis, siisch_driver, siis_devclass, 0, 0); +static void +siis_ch_led(void *priv, int onoff) +{ + device_t dev; + struct siis_channel *ch; + + dev = (device_t)priv; + ch = device_get_softc(dev); + + if (onoff == 0) + ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_LED_ON); + else + ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_LED_ON); +} + struct siis_dc_cb_args { bus_addr_t maddr; int error; ___ 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: r217830 - head/share/man/man9
On Tue, 25 Jan 2011, Matthew D Fleming wrote: .Dv SBUF_AUTOEXTEND . .Pp The +.Fn sbuf_new_for_sysctl +function will set up an sbuf with a drain function to use +.Fn SYSCTL_OUT +when the internal buffer fills. +The sysctl old buffer will be wired, which allows for doing an +.Fn sbuf_printf +while holding a mutex. +.Pp +The .Fn sbuf_delete function clears the .Fa sbuf Hmm. Is this description missing mention of how wiring failures are handled? (Also, it should probably mention that this call can sleep for potentially quite long periods of time, even if sbuf_printf (and friends) can't). Robert ___ 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: r217878 - head/sys/dev/ath/ath_hal
Author: adrian Date: Wed Jan 26 09:37:43 2011 New Revision: 217878 URL: http://svn.freebsd.org/changeset/base/217878 Log: * fix HAL_DEBUG_INTERRUPT to be a separate bit, it was overlapping with something else * add HAL_DEBUG_GPIO, for some GPIO related debugging I'm tinkering with at the moment. Modified: head/sys/dev/ath/ath_hal/ah_debug.h Modified: head/sys/dev/ath/ath_hal/ah_debug.h == --- head/sys/dev/ath/ath_hal/ah_debug.h Wed Jan 26 08:54:10 2011 (r217877) +++ head/sys/dev/ath/ath_hal/ah_debug.h Wed Jan 26 09:37:43 2011 (r217878) @@ -42,7 +42,8 @@ enum { HAL_DEBUG_EEPROM= 0x8000, HAL_DEBUG_BEACON= 0x0001, /* beacon setup work */ HAL_DEBUG_POWER = 0x0002, /* power management */ - HAL_DEBUG_INTERRUPT = 0x0080, /* interrupt handling */ + HAL_DEBUG_GPIO = 0x0004, /* GPIO debugging */ + HAL_DEBUG_INTERRUPT = 0x0008, /* interrupt handling */ HAL_DEBUG_ANY = 0x }; ___ 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: r217879 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Wed Jan 26 10:08:37 2011 New Revision: 217879 URL: http://svn.freebsd.org/changeset/base/217879 Log: Break out the chainmask init code into a new function - ar5416InitChainMasks() . ath9k does a few different things here during config - if it's an early AR5416 with two chains, it enables all three chains for calibration and then restores the chainmask to the original values after initial calibration has completed. The reason behind this commit is to begin breaking out the chainmask configuration for this specific reason; follow-up commits will add the chainmask restore in the ar5416Reset() routine. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h == --- head/sys/dev/ath/ath_hal/ar5416/ar5416.hWed Jan 26 09:37:43 2011 (r217878) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.hWed Jan 26 10:08:37 2011 (r217879) @@ -201,7 +201,7 @@ extern void ar5416GetTargetPowersLeg(str CAL_TARGET_POWER_LEG *powInfo, uint16_t numChannels, CAL_TARGET_POWER_LEG *pNewPower, uint16_t numRates, HAL_BOOL isExtTarget); - +extern void ar5416InitChainMasks(struct ath_hal *ah); extern HAL_BOOL ar5416StopTxDma(struct ath_hal *ah, u_int q); extern HAL_BOOL ar5416SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Jan 26 09:37:43 2011(r217878) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Jan 26 10:08:37 2011(r217879) @@ -209,13 +209,11 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO #endif } - if (AH5416(ah)->ah_rx_chainmask == 0x5 || - AH5416(ah)->ah_tx_chainmask == 0x5) - OS_REG_WRITE(ah, AR_PHY_ANALOG_SWAP, AR_PHY_SWAP_ALT_CHAIN); - /* Setup Chain Masks */ - OS_REG_WRITE(ah, AR_PHY_RX_CHAINMASK, AH5416(ah)->ah_rx_chainmask); - OS_REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, AH5416(ah)->ah_rx_chainmask); - OS_REG_WRITE(ah, AR_SELFGEN_MASK, AH5416(ah)->ah_tx_chainmask); + /* +* This routine swaps the analog chains - it should be done +* before any radio register twiddling is done. +*/ + ar5416InitChainMasks(ah); /* Setup the transmit power values. */ if (!ah->ah_setTxPower(ah, chan, rfXpdGain)) { @@ -1114,6 +1112,18 @@ ar5416SetReset(struct ath_hal *ah, int t return AH_TRUE; } +void +ar5416InitChainMasks(struct ath_hal *ah) +{ + if (AH5416(ah)->ah_rx_chainmask == 0x5 || + AH5416(ah)->ah_tx_chainmask == 0x5) + OS_REG_WRITE(ah, AR_PHY_ANALOG_SWAP, AR_PHY_SWAP_ALT_CHAIN); + /* Setup Chain Masks */ + OS_REG_WRITE(ah, AR_PHY_RX_CHAINMASK, AH5416(ah)->ah_rx_chainmask); + OS_REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, AH5416(ah)->ah_rx_chainmask); + OS_REG_WRITE(ah, AR_SELFGEN_MASK, AH5416(ah)->ah_tx_chainmask); +} + #ifndef IS_5GHZ_FAST_CLOCK_EN #defineIS_5GHZ_FAST_CLOCK_EN(ah, chan) AH_FALSE #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: r217880 - head/sys/geom/journal
Author: kib Date: Wed Jan 26 10:34:21 2011 New Revision: 217880 URL: http://svn.freebsd.org/changeset/base/217880 Log: Treat async buffer writes from the gjournal switcher thread the same as from syncer. We shall not sleep on running buffer space when suspending. Reproduced and tested by: pho PR: kern/154228 MFC after:1 week Modified: head/sys/geom/journal/g_journal.c Modified: head/sys/geom/journal/g_journal.c == --- head/sys/geom/journal/g_journal.c Wed Jan 26 10:08:37 2011 (r217879) +++ head/sys/geom/journal/g_journal.c Wed Jan 26 10:34:21 2011 (r217880) @@ -3033,6 +3033,7 @@ g_journal_switcher(void *arg) int error; mp = arg; + curthread->td_pflags |= TDP_NORUNNINGBUF; for (;;) { g_journal_switcher_wokenup = 0; error = tsleep(&g_journal_switcher_state, PRIBIO, "jsw:wait", ___ 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: r217881 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Wed Jan 26 10:36:43 2011 New Revision: 217881 URL: http://svn.freebsd.org/changeset/base/217881 Log: Add an AR5416 workaround - force a different bias based on 2.4ghz channel frequency. Obtained from:Linux ath9k Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c == --- head/sys/dev/ath/ath_hal/ar5416/ar2133.cWed Jan 26 10:34:21 2011 (r217880) +++ head/sys/dev/ath/ath_hal/ar5416/ar2133.cWed Jan 26 10:36:43 2011 (r217881) @@ -58,6 +58,65 @@ ar2133WriteRegs(struct ath_hal *ah, u_in } /* + * Fix on 2.4 GHz band for orientation sensitivity issue by increasing + * rf_pwd_icsyndiv. + * + * Theoretical Rules: + * if 2 GHz band + * if forceBiasAuto + * if synth_freq < 2412 + *bias = 0 + * else if 2412 <= synth_freq <= 2422 + *bias = 1 + * else // synth_freq > 2422 + *bias = 2 + * else if forceBias > 0 + * bias = forceBias & 7 + * else + * no change, use value from ini file + * else + * no change, invalid band + * + * 1st Mod: + *2422 also uses value of 2 + * + * + * 2nd Mod: + *Less than 2412 uses value of 0, 2412 and above uses value of 2 + */ +static void +ar2133ForceBias(struct ath_hal *ah, uint16_t synth_freq) +{ +uint32_t tmp_reg; +int reg_writes = 0; +uint32_t new_bias = 0; + struct ar2133State *priv = AR2133(ah); + + /* XXX this is a bit of a silly check for 2.4ghz channels -adrian */ +if (synth_freq >= 3000) +return; + +if (synth_freq < 2412) +new_bias = 0; +else if (synth_freq < 2422) +new_bias = 1; +else +new_bias = 2; + +/* pre-reverse this field */ +tmp_reg = ath_hal_reverseBits(new_bias, 3); + +HALDEBUG(ah, HAL_DEBUG_ANY, "%s: Force rf_pwd_icsyndiv to %1d on %4d\n", + __func__, new_bias, synth_freq); + +/* swizzle rf_pwd_icsyndiv */ +ar5416ModifyRfBuffer(priv->Bank6Data, tmp_reg, 3, 181, 3); + +/* write Bank 6 with new params */ +ath_hal_ini_bank_write(ah, &AH5416(ah)->ah_ini_bank6, priv->Bank6Data, reg_writes); +} + +/* * Take the MHz channel value and set the Channel value * * ASSUMES: Writes enabled to analog bus @@ -125,6 +184,10 @@ ar2133SetChannel(struct ath_hal *ah, con return AH_FALSE; } + /* Workaround for hw bug - AR5416 specific */ + if (AR_SREV_OWL(ah)) + ar2133ForceBias(ah, freq); + reg32 = (channelSel << 8) | (aModeRefSel << 2) | (bModeSynth << 1) | (1 << 5) | 0x1; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h == --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Wed Jan 26 10:34:21 2011 (r217880) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Wed Jan 26 10:36:43 2011 (r217881) @@ -588,6 +588,10 @@ #defineAR_XSREV_REVISION_KITE_11 1 /* Kite 1.1 */ #defineAR_XSREV_REVISION_KITE_12 2 /* Kite 1.2 */ +#defineAR_SREV_OWL(_ah) \ + ((AH_PRIVATE((_ah))->ah_macVersion == AR_XSREV_VERSION_OWL_PCI) || \ +(AH_PRIVATE((_ah))->ah_macVersion == AR_XSREV_VERSION_OWL_PCIE)) + #defineAR_SREV_OWL_20_OR_LATER(_ah) \ (AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_SOWL || \ AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_OWL_20) ___ 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: r217882 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Wed Jan 26 10:48:29 2011 New Revision: 217882 URL: http://svn.freebsd.org/changeset/base/217882 Log: Add ar5416RestoreChainMask() which will undo any AR5416 specific chainmask overriding after calibration. This will get set for other two chain radios, such as AR9280 and later on, AR9287. It should however be a nul operation. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h == --- head/sys/dev/ath/ath_hal/ar5416/ar5416.hWed Jan 26 10:36:43 2011 (r217881) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.hWed Jan 26 10:48:29 2011 (r217882) @@ -202,6 +202,7 @@ extern void ar5416GetTargetPowersLeg(str uint16_t numChannels, CAL_TARGET_POWER_LEG *pNewPower, uint16_t numRates, HAL_BOOL isExtTarget); extern void ar5416InitChainMasks(struct ath_hal *ah); +extern void ar5416RestoreChainMask(struct ath_hal *ah); extern HAL_BOOL ar5416StopTxDma(struct ath_hal *ah, u_int q); extern HAL_BOOL ar5416SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Jan 26 10:36:43 2011(r217881) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Jan 26 10:48:29 2011(r217882) @@ -329,6 +329,8 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO if (!ar5416InitCal(ah, chan)) FAIL(HAL_ESELFTEST); + ar5416RestoreChainMask(ah); + AH_PRIVATE(ah)->ah_opmode = opmode; /* record operating mode */ if (bChannelChange && !IEEE80211_IS_CHAN_DFS(chan)) @@ -1124,6 +1126,18 @@ ar5416InitChainMasks(struct ath_hal *ah) OS_REG_WRITE(ah, AR_SELFGEN_MASK, AH5416(ah)->ah_tx_chainmask); } +void +ar5416RestoreChainMask(struct ath_hal *ah) +{ + int rx_chainmask = AH5416(ah)->ah_rx_chainmask; + + if ((rx_chainmask == 0x5) || (rx_chainmask == 0x3)) { + OS_REG_WRITE(ah, AR_PHY_RX_CHAINMASK, rx_chainmask); + OS_REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, rx_chainmask); + } +} + + #ifndef IS_5GHZ_FAST_CLOCK_EN #defineIS_5GHZ_FAST_CLOCK_EN(ah, chan) AH_FALSE #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: r217883 - head/sys/dev/siis
Author: mav Date: Wed Jan 26 13:10:07 2011 New Revision: 217883 URL: http://svn.freebsd.org/changeset/base/217883 Log: Add missing part of r217877. Modified: head/sys/dev/siis/siis.h Modified: head/sys/dev/siis/siis.h == --- head/sys/dev/siis/siis.hWed Jan 26 10:48:29 2011(r217882) +++ head/sys/dev/siis/siis.hWed Jan 26 13:10:07 2011(r217883) @@ -371,6 +371,7 @@ struct siis_channel { struct ata_dma dma;/* DMA data */ struct cam_sim *sim; struct cam_path *path; + struct cdev *led; /* Activity led led(4) cdev. */ int quirks; int pm_level; /* power management level */ ___ 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: r217886 - in head/sys: amd64/amd64 i386/i386
Author: mdf Date: Wed Jan 26 17:06:13 2011 New Revision: 217886 URL: http://svn.freebsd.org/changeset/base/217886 Log: Set td_kstack_pages for thread0. This was already being done for most architectures, but i386 and amd64 were missing it. Submitted by: Mohd Fahadullah Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c == --- head/sys/amd64/amd64/machdep.c Wed Jan 26 16:59:07 2011 (r217885) +++ head/sys/amd64/amd64/machdep.c Wed Jan 26 17:06:13 2011 (r217886) @@ -1527,12 +1527,14 @@ hammer_time(u_int64_t modulep, u_int64_t struct nmi_pcpu *np; u_int64_t msr; char *env; + size_t kstack0_sz; thread0.td_kstack = physfree + KERNBASE; - bzero((void *)thread0.td_kstack, KSTACK_PAGES * PAGE_SIZE); - physfree += KSTACK_PAGES * PAGE_SIZE; - thread0.td_pcb = (struct pcb *) - (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; + thread0.td_kstack_pages = KSTACK_PAGES; + kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE; + bzero((void *)thread0.td_kstack, kstack0_sz); + physfree += kstack0_sz; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + kstack0_sz) - 1; /* * This may be done better later if it gets more high level @@ -1674,8 +1676,8 @@ hammer_time(u_int64_t modulep, u_int64_t initializecpucache(); /* make an initial tss so cpu can get interrupt stack on syscall! */ - common_tss[0].tss_rsp0 = thread0.td_kstack + \ - KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb); + common_tss[0].tss_rsp0 = thread0.td_kstack + + kstack0_sz - sizeof(struct pcb); /* Ensure the stack is aligned to 16 bytes */ common_tss[0].tss_rsp0 &= ~0xFul; PCPU_SET(rsp0, common_tss[0].tss_rsp0); Modified: head/sys/i386/i386/machdep.c == --- head/sys/i386/i386/machdep.cWed Jan 26 16:59:07 2011 (r217885) +++ head/sys/i386/i386/machdep.cWed Jan 26 17:06:13 2011 (r217886) @@ -2493,6 +2493,7 @@ init386(first) { unsigned long gdtmachpfn; int error, gsel_tss, metadata_missing, x, pa; + size_t kstack0_sz; struct pcpu *pc; struct callback_register event = { .type = CALLBACKTYPE_event, @@ -2504,8 +2505,9 @@ init386(first) }; thread0.td_kstack = proc0kstack; - thread0.td_pcb = (struct pcb *) - (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; + thread0.td_kstack_pages = KSTACK_PAGES; + kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + kstack0_sz) - 1; /* * This may be done better later if it gets more high level @@ -2656,7 +2658,7 @@ init386(first) /* make an initial tss so cpu can get interrupt stack on syscall! */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ PCPU_SET(common_tss.tss_esp0, thread0.td_kstack + - KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb) - 16); + kstack0_sz - sizeof(struct pcb) - 16); PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), @@ -2716,11 +2718,13 @@ init386(first) { struct gate_descriptor *gdp; int gsel_tss, metadata_missing, x, pa; + size_t kstack0_sz; struct pcpu *pc; thread0.td_kstack = proc0kstack; - thread0.td_pcb = (struct pcb *) - (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; + thread0.td_kstack_pages = KSTACK_PAGES; + kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + kstack0_sz) - 1; /* * This may be done better later if it gets more high level @@ -2912,7 +2916,7 @@ init386(first) /* make an initial tss so cpu can get interrupt stack on syscall! */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ PCPU_SET(common_tss.tss_esp0, thread0.td_kstack + - KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb) - 16); + kstack0_sz - sizeof(struct pcb) - 16); PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); PCPU_SET(tss_gdt, &gdt[GPROC0_SEL].sd); ___ 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: r217830 - head/share/man/man9
On Wed, Jan 26, 2011 at 1:37 AM, Robert Watson wrote: > On Tue, 25 Jan 2011, Matthew D Fleming wrote: > >> .Dv SBUF_AUTOEXTEND . >> .Pp >> The >> +.Fn sbuf_new_for_sysctl >> +function will set up an sbuf with a drain function to use >> +.Fn SYSCTL_OUT >> +when the internal buffer fills. >> +The sysctl old buffer will be wired, which allows for doing an >> +.Fn sbuf_printf >> +while holding a mutex. >> +.Pp >> +The >> .Fn sbuf_delete >> function clears the >> .Fa sbuf > > Hmm. Is this description missing mention of how wiring failures are > handled? (Also, it should probably mention that this call can sleep for > potentially quite long periods of time, even if sbuf_printf (and friends) > can't). I'm not sure how much to write, since some of the wiring failures are dealt with by the sysctl subsystem and are not documented. The current state of the actual code is that a failure in vslock(9) is ignored, unless it's ENOMEM in which case sysctl_wire_old_buffer sets the sysctl_req->validlen to 0, which would behave perhaps slightly unexpectedly for the user since no data will be copied out. Any non-ENOMEM failure from vslock() presumably would also have been a failure from SYSCTL_OUT and this does get squashed, perhaps incorrectly. I'll think about saving the error code so that sbuf_finish can report it if nothing else has gone wrong. Thanks, matthew ___ 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: r217888 - head/sys/netinet
Author: deischen Date: Wed Jan 26 17:31:03 2011 New Revision: 217888 URL: http://svn.freebsd.org/changeset/base/217888 Log: Prison check addresses set with multicast interface options. Reviewed by: bz MFC after:1 week Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c == --- head/sys/netinet/in_pcb.c Wed Jan 26 17:20:34 2011(r217887) +++ head/sys/netinet/in_pcb.c Wed Jan 26 17:31:03 2011(r217888) @@ -889,17 +889,20 @@ in_pcbconnect_setup(struct inpcb *inp, s if (imo->imo_multicast_ifp != NULL) { ifp = imo->imo_multicast_ifp; IN_IFADDR_RLOCK(); - TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) - if (ia->ia_ifp == ifp) + TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { + if ((ia->ia_ifp == ifp) && + (cred == NULL || + prison_check_ip4(cred, + &ia->ia_addr.sin_addr) == 0)) break; - if (ia == NULL) { - IN_IFADDR_RUNLOCK(); + } + if (ia == NULL) error = EADDRNOTAVAIL; - } else { + else { laddr = ia->ia_addr.sin_addr; - IN_IFADDR_RUNLOCK(); error = 0; } + IN_IFADDR_RUNLOCK(); } } if (error) ___ 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: r217830 - head/share/man/man9
On 26 Jan 2011, at 17:12, m...@freebsd.org wrote: >> Hmm. Is this description missing mention of how wiring failures are >> handled? (Also, it should probably mention that this call can sleep for >> potentially quite long periods of time, even if sbuf_printf (and friends) >> can't). > > I'm not sure how much to write, since some of the wiring failures are > dealt with by the sysctl subsystem and are not documented. > > The current state of the actual code is that a failure in vslock(9) is > ignored, unless it's ENOMEM in which case sysctl_wire_old_buffer sets > the sysctl_req->validlen to 0, which would behave perhaps slightly > unexpectedly for the user since no data will be copied out. > > Any non-ENOMEM failure from vslock() presumably would also have been a > failure from SYSCTL_OUT and this does get squashed, perhaps > incorrectly. > > I'll think about saving the error code so that sbuf_finish can report > it if nothing else has gone wrong. Yeah, no specific opinions on the right answer, except perhaps that sbuf_new_for_sysctl() failing due to ENOMEM is something worth making it easy to report to the user. I suppose an important question is now often we see this actually failing, and in what circumstances: if there's a moderate chance of it failing on low-memory machines under memory pressure, it suggests we've gone wrong somewhere... One nice thing about the non-wiring model is that it's pretty cheap in the common case, whereas the new code is pretty expensive in the common case. Maybe this doesn't matter too much. Robert___ 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: r217830 - head/share/man/man9
On Wed, Jan 26, 2011 at 9:55 AM, Robert N. M. Watson wrote: > > On 26 Jan 2011, at 17:12, m...@freebsd.org wrote: > >>> Hmm. Is this description missing mention of how wiring failures are >>> handled? (Also, it should probably mention that this call can sleep for >>> potentially quite long periods of time, even if sbuf_printf (and friends) >>> can't). >> >> I'm not sure how much to write, since some of the wiring failures are >> dealt with by the sysctl subsystem and are not documented. >> >> The current state of the actual code is that a failure in vslock(9) is >> ignored, unless it's ENOMEM in which case sysctl_wire_old_buffer sets >> the sysctl_req->validlen to 0, which would behave perhaps slightly >> unexpectedly for the user since no data will be copied out. >> >> Any non-ENOMEM failure from vslock() presumably would also have been a >> failure from SYSCTL_OUT and this does get squashed, perhaps >> incorrectly. >> >> I'll think about saving the error code so that sbuf_finish can report >> it if nothing else has gone wrong. > > Yeah, no specific opinions on the right answer, except perhaps that > sbuf_new_for_sysctl() > failing due to ENOMEM is something worth making it easy to report to the user. The ENOMEM is already managed and squashed inside sysctl_wire_old_buffer(), so there's no way for sbuf_new_for_sysctl() to report it. It may end up happening automagically since it sets the validlen to 0. > I suppose an important question is now often we see this actually failing I don't believe we've ever seen a memory failure relating to sysctls at Isilon and we've been using the equivalent of this code for a few years. Our machines aren't low memory but they are under memory pressure sometimes. Thanks, matthew ___ 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: r217890 - head/usr.bin/getopt
Author: uqs Date: Wed Jan 26 18:43:15 2011 New Revision: 217890 URL: http://svn.freebsd.org/changeset/base/217890 Log: Fix typo in example getopt(1) script: $i vs $1 [1] While here apply style hammer. PR: docs/154289 [1] Submitted by: Jamie Landeg Jones MFC after:1 week Modified: head/usr.bin/getopt/getopt.1 Modified: head/usr.bin/getopt/getopt.1 == --- head/usr.bin/getopt/getopt.1Wed Jan 26 18:03:03 2011 (r217889) +++ head/usr.bin/getopt/getopt.1Wed Jan 26 18:43:15 2011 (r217890) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd July 7, 2010 +.Dd January 26, 2011 .Dt GETOPT 1 .Os .Sh NAME @@ -54,8 +54,7 @@ which requires an argument. args=\`getopt abo: $*\` # you should not use \`getopt abo: "$@"\` since that would parse # the arguments differently from what the set command below does. -if [ $? -ne 0 ] -then +if [ $? -ne 0 ]; then echo 'Usage: ...' exit 2 fi @@ -63,22 +62,23 @@ set \-\- $args # You cannot use the set command with a backquoted getopt directly, # since the exit code from getopt would be shadowed by those of set, # which is zero by definition. -while true; -do - case "$1" - in - \-a|\-b) - echo flag $i set; sflags="${i#-}$sflags"; - shift;; - \-o) - echo oarg is "'"$2"'"; oarg="$2"; shift; - shift;; - \-\-) - shift; break;; +while true; do + case "$1" in + \-a|\-b) + echo "flag $1 set"; sflags="${1#-}$sflags" + shift + ;; + \-o) + echo "oarg is '$2'"; oarg="$2" + shift; shift + ;; + \-\-) + shift; break + ;; esac done -echo single-char flags: "'"$sflags"'" -echo oarg is "'"$oarg"'" +echo "single-char flags: '$sflags'" +echo "oarg is '$oarg'" .Ed .Pp This code will accept any of the following as equivalent: ___ 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: r217893 - in head/share/doc/papers: kernmalloc sysperf
Author: uqs Date: Wed Jan 26 19:39:31 2011 New Revision: 217893 URL: http://svn.freebsd.org/changeset/base/217893 Log: Unroll vgrind filter to no longer depend on vgrind(1) during buildworld. The source files haven't been touched in ages and this is unlikely to change in the future. Added: head/share/doc/papers/kernmalloc/appendix.ms (contents, props changed) head/share/doc/papers/sysperf/appendix.ms (contents, props changed) Modified: head/share/doc/papers/kernmalloc/Makefile head/share/doc/papers/sysperf/Makefile Modified: head/share/doc/papers/kernmalloc/Makefile == --- head/share/doc/papers/kernmalloc/Makefile Wed Jan 26 19:24:41 2011 (r217892) +++ head/share/doc/papers/kernmalloc/Makefile Wed Jan 26 19:39:31 2011 (r217893) @@ -10,9 +10,5 @@ USE_EQN= USE_PIC= USE_SOELIM= USE_TBL= -CLEANFILES=appendix.ms - -appendix.ms: appendix.t - ${GRIND} < ${.ALLSRC} > ${.TARGET} .include Added: head/share/doc/papers/kernmalloc/appendix.ms == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/doc/papers/kernmalloc/appendix.msWed Jan 26 19:39:31 2011(r217893) @@ -0,0 +1,275 @@ +.\" $FreeBSD$ +.am vS +.. +.am vE +.. +'ss 23 +'ds _ \d\(mi\u +'ps 9z +'vs 10p +'ds - \(mi +'ds / \\h'\\w' 'u-\\w'/'u'/ +'ds /* \\h'\\w' 'u-\\w'/'u'/* +'bd B 3 +'bd S B 3 +'nr cm 0 +'nf +'de vH +'ev 2 +'ft 1 +'sp .35i +'tl '\s14\f3\\*(=F\fP\s0'\\*(=H'\f3\s14\\*(=F\fP\s0' +'sp .25i +'ft 1 +\f2\s12\h'\\n(.lu-\w'\\*(=f'u'\\*(=f\fP\s0\h'|0u' +.sp .05i +'ev +'ds =G \\*(=F +.. +'de vF +'ev 2 +'sp .35i +'ie o 'tl '\f2\\*(=M''Page % of \\*(=G\fP' +'el 'tl '\f2Page % of \\*(=G''\\*(=M\fP' +'bp +'ev +'ft 1 +'if \\n(cm=1 'ft 2 +.. +'de () +'pn 1 +.. +'de +C +'nr cm 1 +'ft 2 +'ds +K +'ds -K +.. +'de -C +'nr cm 0 +'ft 1 +'ds +K \f3 +'ds -K \fP +.. +'+C +'-C +'am +C +'ne 3 +.. +'de FN +\f2\s14\h'\\n(.lu-\w'\\$1'u'\\$1\fP\s0\h'|0u'\c +.if r x .if \\nx .if d =F .tm \\$1 \\*(=F \\n% +'ds =f \&...\\$1 +.. +'de FC +.if r x .if \\nx .if d =F .tm \\$1 \\*(=F \\n% +'ds =f \&...\\$1 +.. +'de -F +'rm =f +.. +'ft 1 +'lg 0 +'-F +.\" Copyright (c) 1988 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\"must display the following acknowledgement: +.\"This product includes software developed by the University of +.\"California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\"may be used to endorse or promote products derived from this software +.\"without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\"@(#)appendix.t 5.1 (Berkeley) 4/16/91 +.\" +.bp +.H 1 "Appendix A - Implementation Details" +.LP +.nf +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Constants for setting the parameters of the kernel memory allocator\&. + \fI*\fP + \fI*\fP 2 \fI*\fP\fI*\fP MINBUCKET is the smallest unit of memory that will be + \fI*\fP allocated\&. It must be at least large enough to hold a pointer\&. + \fI*\fP + \fI*\fP Units of memory less or equal to MAXALLOCSAVE will permanently + \fI*\fP allocate physical memory; requests for these size pieces of memory + \fI*\fP are quite fast\&. Allocations greater than MAXALLOCSAVE must + \fI*\fP always allocate and free physical memory; requests for these size + \fI*\fP allocations should be done infrequently as they will be slow\&. + \fI*\fP Constraints: CLBYTES <= MAXALLOCSAVE <= 2 \fI*\
svn commit: r217894 - head/sys/netinet
Author: tuexen Date: Wed Jan 26 19:49:03 2011 New Revision: 217894 URL: http://svn.freebsd.org/changeset/base/217894 Log: Change infrastructure for SCTP_MAX_BURST to allow compliance with the latest socket API ID. Especially it can be disabled. Full compliance needs changing the structure used in the socket option. Since this breaks the API, it will be a seperate commit which will not be MFCed to stable/8. MFC after: 3 months. Modified: head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_cc_functions.c == --- head/sys/netinet/sctp_cc_functions.cWed Jan 26 19:39:31 2011 (r217893) +++ head/sys/netinet/sctp_cc_functions.cWed Jan 26 19:49:03 2011 (r217894) @@ -601,8 +601,11 @@ sctp_cwnd_update_after_packet_dropped(st * Take 1/4 of the space left or max burst up .. whichever * is less. */ - incr = min((bw_avail - *on_queue) >> 2, - stcb->asoc.max_burst * net->mtu); + incr = (bw_avail - *on_queue) >> 2; + if ((stcb->asoc.max_burst > 0) && + (stcb->asoc.max_burst * net->mtu < incr)) { + incr = stcb->asoc.max_burst * net->mtu; + } net->cwnd += incr; } if (net->cwnd > bw_avail) { Modified: head/sys/netinet/sctp_output.c == --- head/sys/netinet/sctp_output.c Wed Jan 26 19:39:31 2011 (r217893) +++ head/sys/netinet/sctp_output.c Wed Jan 26 19:49:03 2011 (r217894) @@ -9322,7 +9322,7 @@ sctp_chunk_output(struct sctp_inpcb *inp struct sctp_association *asoc; struct sctp_nets *net; int error = 0, num_out = 0, tot_out = 0, ret = 0, reason_code = 0, - burst_cnt = 0, burst_limit = 0; + burst_cnt = 0; struct timeval now; int now_filled = 0; int nagle_on = 0; @@ -9425,12 +9425,11 @@ sctp_chunk_output(struct sctp_inpcb *inp &now, &now_filled, frag_point, so_locked); return; } - if (tot_frs > asoc->max_burst) { + if ((asoc->max_burst > 0) && (tot_frs > asoc->max_burst)) { /* Hit FR burst limit */ return; } if ((num_out == 0) && (ret == 0)) { - /* No more retrans to send */ break; } @@ -9439,7 +9438,6 @@ sctp_chunk_output(struct sctp_inpcb *inp sctp_auditing(12, inp, stcb, NULL); #endif /* Check for bad destinations, if they exist move chunks around. */ - burst_limit = asoc->max_burst; TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) == SCTP_ADDR_NOT_REACHABLE) { @@ -9468,24 +9466,29 @@ sctp_chunk_output(struct sctp_inpcb *inp * { burst_limit = asoc->max_burst * * SCTP_SAT_NETWORK_BURST_INCR; } */ - if (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst)) { - if ((net->flight_size + (burst_limit * net->mtu)) < net->cwnd) { - /* -* JRS - Use the congestion control -* given in the congestion control -* module -*/ - asoc->cc_functions.sctp_cwnd_update_after_output(stcb, net, burst_limit); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_MAXBURST_ENABLE) { - sctp_log_maxburst(stcb, net, 0, burst_limit, SCTP_MAX_BURST_APPLIED); + if (asoc->max_burst > 0) { + if (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst)) { + if ((net->flight_size + (asoc->max_burst * net->mtu)) < net->cwnd) { + /* +* JRS - Use the congestion +* control given in the +* congestion control module +*/ + asoc->cc_functions.sctp_cwnd_update_after_output(stcb, net, asoc->max_burst); + if (SCTP_BASE_SYS
svn commit: r217895 - head/sys/netinet
Author: tuexen Date: Wed Jan 26 19:55:54 2011 New Revision: 217895 URL: http://svn.freebsd.org/changeset/base/217895 Log: Make SCTP_MAX_BURST compliant with the latest version of the socket API ID. This is not compatible with the API in stable/8. Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c == --- head/sys/netinet/sctp_usrreq.c Wed Jan 26 19:49:03 2011 (r217894) +++ head/sys/netinet/sctp_usrreq.c Wed Jan 26 19:55:54 2011 (r217895) @@ -1967,18 +1967,21 @@ flags_out: break; case SCTP_MAX_BURST: { - uint8_t *value; + struct sctp_assoc_value *av; - SCTP_CHECK_AND_CAST(value, optval, uint8_t, *optsize); + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); - SCTP_INP_RLOCK(inp); - if (inp->sctp_ep.max_burst < 256) { - *value = inp->sctp_ep.max_burst; + if (stcb) { + av->assoc_value = stcb->asoc.max_burst; + SCTP_TCB_UNLOCK(stcb); } else { - *value = 255; + SCTP_INP_RLOCK(inp); + av->assoc_value = inp->sctp_ep.max_burst; + SCTP_INP_RUNLOCK(inp); } - SCTP_INP_RUNLOCK(inp); - *optsize = sizeof(uint8_t); + *optsize = sizeof(struct sctp_assoc_value); + } break; case SCTP_MAXSEG: @@ -3590,13 +3593,19 @@ sctp_setopt(struct socket *so, int optna break; case SCTP_MAX_BURST: { - uint8_t *burst; + struct sctp_assoc_value *av; - SCTP_CHECK_AND_CAST(burst, optval, uint8_t, optsize); + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); - SCTP_INP_WLOCK(inp); - inp->sctp_ep.max_burst = *burst; - SCTP_INP_WUNLOCK(inp); + if (stcb) { + stcb->asoc.max_burst = av->assoc_value; + SCTP_TCB_UNLOCK(stcb); + } else { + SCTP_INP_WLOCK(inp); + inp->sctp_ep.max_burst = av->assoc_value; + SCTP_INP_WUNLOCK(inp); + } } break; case SCTP_MAXSEG: ___ 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: r217896 - in head/sys: amd64/amd64 amd64/linux32 compat/linprocfs fs/procfs i386/linux kern powerpc/aim powerpc/powerpc sys
Author: dchagin Date: Wed Jan 26 20:03:58 2011 New Revision: 217896 URL: http://svn.freebsd.org/changeset/base/217896 Log: Add macro to test the sv_flags of any process. Change some places to test the flags instead of explicit comparing with address of known sysentvec structures. MFC after:1 month Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/linux32/linux32_machdep.c head/sys/compat/linprocfs/linprocfs.c head/sys/fs/procfs/procfs_dbregs.c head/sys/fs/procfs/procfs_fpregs.c head/sys/fs/procfs/procfs_map.c head/sys/fs/procfs/procfs_regs.c head/sys/i386/linux/linux_machdep.c head/sys/kern/kern_jail.c head/sys/kern/sys_process.c head/sys/powerpc/aim/trap.c head/sys/powerpc/powerpc/exec_machdep.c head/sys/sys/sysent.h Modified: head/sys/amd64/amd64/vm_machdep.c == --- head/sys/amd64/amd64/vm_machdep.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/amd64/amd64/vm_machdep.c Wed Jan 26 20:03:58 2011 (r217896) @@ -445,7 +445,7 @@ cpu_set_upcall_kse(struct thread *td, vo cpu_thread_clean(td); #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { /* * Set the trap frame to point at the beginning of the uts * function. @@ -498,7 +498,7 @@ cpu_set_user_tls(struct thread *td, void pcb = td->td_pcb; #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { pcb->pcb_gsbase = (register_t)tls_base; return (0); } Modified: head/sys/amd64/linux32/linux32_machdep.c == --- head/sys/amd64/linux32/linux32_machdep.cWed Jan 26 19:55:54 2011 (r217895) +++ head/sys/amd64/linux32/linux32_machdep.cWed Jan 26 20:03:58 2011 (r217896) @@ -131,7 +131,7 @@ linux_execve(struct thread *td, struct l * linux_proc_init, this leads to a panic on KASSERT * because such process has p->p_emuldata == NULL. */ - if (td->td_proc->p_sysent == &elf_linux_sysvec) + if (SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX) error = linux_proc_init(td, 0, 0); return (error); } Modified: head/sys/compat/linprocfs/linprocfs.c == --- head/sys/compat/linprocfs/linprocfs.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/compat/linprocfs/linprocfs.c Wed Jan 26 20:03:58 2011 (r217896) @@ -928,7 +928,7 @@ do { \ #ifdef COMPAT_FREEBSD32 env_vector32 = NULL; - if ((p->p_sysent->sv_flags & SV_ILP32) != 0) { + if (SV_PROC_FLAG(p, SV_ILP32) != 0) { env_vector32 = malloc(sizeof(*env_vector32) * MAX_ARGV_STR, M_TEMP, M_WAITOK); elm_len = sizeof(int32_t); Modified: head/sys/fs/procfs/procfs_dbregs.c == --- head/sys/fs/procfs/procfs_dbregs.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/fs/procfs/procfs_dbregs.c Wed Jan 26 20:03:58 2011 (r217896) @@ -107,7 +107,7 @@ procfs_doprocdbregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) { PROC_UNLOCK(p); return (EINVAL); } Modified: head/sys/fs/procfs/procfs_fpregs.c == --- head/sys/fs/procfs/procfs_fpregs.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/fs/procfs/procfs_fpregs.c Wed Jan 26 20:03:58 2011 (r217896) @@ -106,7 +106,7 @@ procfs_doprocfpregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) { PROC_UNLOCK(p); return (EINVAL); } Modified: head/sys/fs/procfs/procfs_map.c == --- head/sys/fs/procfs/procfs_map.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/fs/procfs/procfs_map.c Wed Jan 26 20:03:58 2011 (r217896) @@ -100,8 +100,8 @@ procfs_doprocmap(PFS_FILL_ARGS) return (EOPNOTSUPP); #ifdef COMPAT_FREEBSD32 -if (c
svn commit: r217902 - in head/sys: dev/re pci
Author: yongari Date: Wed Jan 26 20:25:40 2011 New Revision: 217902 URL: http://svn.freebsd.org/changeset/base/217902 Log: Do not use interrupt taskqueue on controllers with MSI/MSI-X capability. One of reason using interrupt taskqueue in re(4) was to reduce number of TX/RX interrupts under load because re(4) controllers have no good TX/RX interrupt moderation mechanism. Basic TX interrupt moderation is done by hardware for most controllers but RX interrupt moderation through undocumented register showed poor RX performance so it was disabled in r215025. Using taskqueue to handle RX interrupt greatly reduced number of interrupts but re(4) consumed all available CPU cycles to run the taskqueue under high TX/RX network load. This can happen even with RTL810x fast ethernet controller and I believe this is not acceptable for most systems. To mitigate the issue, use one-shot timer register to moderate RX interrupts. The timer register provides programmable one-shot timer and can be used to suppress interrupt generation. The timer runs at 125MHZ on PCIe controllers so the minimum time allowed for the timer is 8ns. Data sheet says the register is 32 bits but experimentation shows only lower 13 bits are valid so maximum time that can be programmed is 65.528us. This yields theoretical maximum number of RX interrupts that could be generated per second is about 15260. Combined with TX completion interrupts re(4) shall generate less than 20k interrupts. This number is still slightly high compared to other intelligent ethernet controllers but system is very responsive even under high network load. Introduce sysctl variable dev.re.%d.int_rx_mod that controls amount of time to delay RX interrupt processing in units of us. Value 0 completely disables RX interrupt moderation. To provide old behavior for controllers that have MSI/MSI-X capability, introduce a new tunable hw.re.intr_filter. If the tunable is set to non-zero value, driver will use interrupt taskqueue. The default value of the tunable is 0. This tunable has no effect on controllers that has no MSI/MSI-X capability or if MSI/MSI-X is explicitly disabled by administrator. While I'm here cleanup interrupt setup/teardown since re(4) uses single MSI/MSI-X message at this moment. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c == --- head/sys/dev/re/if_re.c Wed Jan 26 20:18:56 2011(r217901) +++ head/sys/dev/re/if_re.c Wed Jan 26 20:25:40 2011(r217902) @@ -157,6 +157,8 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); #include "miibus_if.h" /* Tunables. */ +static int intr_filter = 0; +TUNABLE_INT("hw.re.intr_filter", &intr_filter); static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); static int msix_disable = 0; @@ -253,6 +255,7 @@ static int re_poll (struct ifnet *, enu static int re_poll_locked (struct ifnet *, enum poll_cmd, int); #endif static int re_intr (void *); +static void re_intr_msi(void *); static void re_tick(void *); static void re_int_task(void *, int); static void re_start (struct ifnet *); @@ -290,6 +293,8 @@ static int re_diag (struct rl_softc *); static void re_add_sysctls (struct rl_softc *); static int re_sysctl_stats (SYSCTL_HANDLER_ARGS); +static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); +static int sysctl_hw_re_int_mod(SYSCTL_HANDLER_ARGS); static device_method_t re_methods[] = { /* Device interface */ @@ -1574,19 +1579,19 @@ re_attach(device_t dev) } #endif +#ifdef RE_TX_MODERATION + intr_filter = 1; +#endif /* Hook interrupt last to avoid having to lock softc */ - if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0 && + intr_filter == 0) { + error = bus_setup_intr(dev, sc->rl_irq[0], + INTR_TYPE_NET | INTR_MPSAFE, NULL, re_intr_msi, sc, + &sc->rl_intrhand[0]); + } else { error = bus_setup_intr(dev, sc->rl_irq[0], INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, &sc->rl_intrhand[0]); - else { - for (i = 0; i < RL_MSI_MESSAGES; i++) { - error = bus_setup_intr(dev, sc->rl_irq[i], - INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, - &sc->rl_intrhand[i]); - if (error != 0) - break; - } } if (error) { device_printf(dev, "couldn't set up irq\n"); @@ -1657,31 +1662,22 @@ re_detach(device_t dev) * stopped here. */ - for (i = 0; i < RL_MSI
Re: svn commit: r217871 - head/sbin/mount
On 01/25/2011 23:55, Bruce Evans wrote: On Wed, 26 Jan 2011, Doug Barton wrote: Log: Clarify the availability of the noatime option on network file systems Modified: head/sbin/mount/mount.8 Modified: head/sbin/mount/mount.8 == --- head/sbin/mount/mount.8 Wed Jan 26 01:07:56 2011 (r217870) +++ head/sbin/mount/mount.8 Wed Jan 26 05:06:11 2011 (r217871) @@ -28,7 +28,7 @@ .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" $FreeBSD$ .\" -.Dd February 10, 2010 +.Dd January 25, 2011 .Dt MOUNT 8 .Os .Sh NAME @@ -208,7 +208,11 @@ This option is useful on file systems where there are large numbers of files and performance is more critical than updating the file access time (which is rarely ever important). -This option is currently only supported on local file systems. +This option is not supported on network file systems when the +server is FreeBSD. +Support in network files servers on other operating systems +with a FreeBSD client is possible, +but should be tested before it is relied on. Even atimes are not supported by at least the non-experimental FreeBSD client, so attempts to turn them off are nonsense and should have always failed at mount time. But such attempts bogusly always succeed and have no effect, even if atimes are otherwise supported, since: - for mount(2), the nonstandard option MOPT_NOATIME has always been bogusly in the standard options list MOPT_STDOPTS. Thus it is was never rejected by mount_nfs(8) or for other mount utilities than use mount(2), even for file systems for fies that don't even have atimes. - for nmount(2) in both the non-experimental and experimental cilent the unsupported option "noatime" is bogusly in the supported options list together with lots of other unsupported options like "suiddir", "nocluster[rw]", "multilabel" and "acls". All of these nonstandard options are also bogusly in MOPT_STDOPTS. - bogusly setting the MNT_ATIME flag in an attempt to turn off atime has no effect in any FreeBSD nfs client, since the MNT_ATIME flag is never referenced. And, at least in the non-experimental client, since even atimes are not supported, there is nothing useful that references to MNT_ATIME could do. Non-support of atimes by by at least the old FreeBSD client: Most reads are from the nfs cache (else most reads would be very slow). Since the client doesn't support atimes, it doesn't do the fancy caching of them that would be needed to make them sort of work without defeating the cache by telling the server about every read. So atimes just get updated on the server when the server is asked to fill the cache, and then only if the server supports atimes (not counting when an application on the client explicitly sets them using utimes(2). Full support for noatime/noatime on the client would involve negotating it with the server, so that the client's noatime flag has preference over the server flag on files read by that client... AFAIK there is no way to negotiate this. Client caching of atimes might also need delicate negotiation depending on how POSIXly you want atimes to work. I sometimes think that atimes should be handled mostly in vfs. The MNT_ATIME could then have an effect without any references to it in file systems that sort of support atimes, but ones that don't even have atimes should still make vfs reject attempts to use it. I think I understand most, if not all of what you wrote here, but I'm not nearly smart enough to translate it into something succinct for the man page. :) My concern was that the man page says that we don't support the option at all, but with a FreeBSD client and a solaris server it has a demonstrable effect. If someone wants to improve the wording then by all means, either make a suggestion or just do it. :) Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ ___ 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: r217910 - head/sys/dev/mii
Author: yongari Date: Wed Jan 26 21:07:44 2011 New Revision: 217910 URL: http://svn.freebsd.org/changeset/base/217910 Log: Add Realtek RTL8201E 10/100 PHY found in RTL8105E controller. The exact model name is not clear yet. All previous RTL8201 10/100 PHYs used 0x8201 in MII_PHYIDR2 which in turn makes model number 0x20 but this PHY used new model number 0x08. Modified: head/sys/dev/mii/miidevs head/sys/dev/mii/rlphy.c Modified: head/sys/dev/mii/miidevs == --- head/sys/dev/mii/miidevsWed Jan 26 20:36:20 2011(r217909) +++ head/sys/dev/mii/miidevsWed Jan 26 21:07:44 2011(r217910) @@ -220,6 +220,7 @@ model RDC R6040 0x0003 R6040 10/100 me /* RealTek Semiconductor PHYs */ model REALTEK RTL8201L 0x0020 RTL8201L 10/100 media interface model xxREALTEK RTL8305SC 0x0005 RTL8305SC 10/100 802.1q switch +model xxREALTEK RTL8201E 0x0008 RTL8201E 10/100 media interface model xxREALTEK RTL8169S 0x0011 RTL8169S/8110S/8211B media interface /* Seeq PHYs */ Modified: head/sys/dev/mii/rlphy.c == --- head/sys/dev/mii/rlphy.cWed Jan 26 20:36:20 2011(r217909) +++ head/sys/dev/mii/rlphy.cWed Jan 26 21:07:44 2011(r217910) @@ -98,6 +98,7 @@ static const struct mii_phydesc rlintphy static const struct mii_phydesc rlphys[] = { MII_PHY_DESC(REALTEK, RTL8201L), + MII_PHY_DESC(xxREALTEK, RTL8201E), MII_PHY_DESC(ICPLUS, IP101), MII_PHY_END }; ___ 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: r217830 - head/share/man/man9
On 26 Jan 2011, at 18:29, m...@freebsd.org wrote: >> I suppose an important question is now often we see this actually failing > > I don't believe we've ever seen a memory failure relating to sysctls > at Isilon and we've been using the equivalent of this code for a few > years. Our machines aren't low memory but they are under memory > pressure sometimes. The kinds of cases I worry about are things like the tcp connection monitoring sysctls. Most systems have a dozen, hundred, or a thousand connections. Some have half a million or a million. If we switched to requiring wiring every page needed to store that list, it would do terrible things to the system. So really what I have in mind is: either we handle cases like that well, or we put in a clear warning and have obvious failure modes to catch the cases where it didn't work out. In practice, I think we would not want to switch the tcpcb/inpcb sysctl for this reason, but as people say "ah, this is convenient" we need to make sure it's handled well, and easy to debug problems when they do arise. Robert___ 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: r217830 - head/share/man/man9
On Wed, Jan 26, 2011 at 1:10 PM, Robert N. M. Watson wrote: > > On 26 Jan 2011, at 18:29, m...@freebsd.org wrote: > >>> I suppose an important question is now often we see this actually failing >> >> I don't believe we've ever seen a memory failure relating to sysctls >> at Isilon and we've been using the equivalent of this code for a few >> years. Our machines aren't low memory but they are under memory >> pressure sometimes. > > The kinds of cases I worry about are things like the tcp connection > monitoring sysctls. Most systems have a dozen, hundred, or a thousand > connections. Some have half a million or a million. If we switched to > requiring wiring every page needed to store that list, it would do terrible > things to the system. So really what I have in mind is: either we handle > cases like that well, or we put in a clear warning and have obvious failure > modes to catch the cases where it didn't work out. In practice, I think we > would not want to switch the tcpcb/inpcb sysctl for this reason, but as > people say "ah, this is convenient" we need to make sure it's handled well, > and easy to debug problems when they do arise. > But I think that problem exists today using sysctl for output, since it's non-iterative. In fact, it's often worse today, because in addition to the user-space buffer that needs to be large enough to hold the output, the kernel needs to malloc(9) a buffer to hold it before doing the one SYSCTL_OUT at the end that most routines I've seen use. For situations like this where there is a lot of output but it doesn't need to be serialized by a lock held across the whole data fetch, then yes, using sbuf_new_for_sysctl() would wire more memory. Thanks, matthew ___ 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: r217911 - in head/sys: dev/re pci
Author: yongari Date: Wed Jan 26 21:14:20 2011 New Revision: 217911 URL: http://svn.freebsd.org/changeset/base/217911 Log: Add support for RTL8105E PCIe Fast Ethernet controller. It seems the controller has a kind of embedded controller/memory and vendor applies a large set of magic code via undocumented PHY registers in device initialization stage. I guess it's a firmware image for the embedded controller in RTL8105E since the code is too big compared to other DSP fixups. However I have no idea what that magic code does and what's purpose of the embedded controller. Fortunately driver seems to still work without loading the firmware. While I'm here change device description of RTL810xE controller. H/W donated by: Realtek Semiconductor Corp. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c == --- head/sys/dev/re/if_re.c Wed Jan 26 21:07:44 2011(r217910) +++ head/sys/dev/re/if_re.c Wed Jan 26 21:14:20 2011(r217911) @@ -177,7 +177,7 @@ static struct rl_type re_devs[] = { { RT_VENDORID, RT_DEVICEID_8139, 0, "RealTek 8139C+ 10/100BaseTX" }, { RT_VENDORID, RT_DEVICEID_8101E, 0, - "RealTek 8101E/8102E/8102EL/8103E PCIe 10/100baseTX" }, + "RealTek 810xE PCIe 10/100baseTX" }, { RT_VENDORID, RT_DEVICEID_8168, 0, "RealTek 8168/8111 B/C/CP/D/DP/E PCIe Gigabit Ethernet" }, { RT_VENDORID, RT_DEVICEID_8169, 0, @@ -217,6 +217,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8102EL, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, + { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168C, RL_8169, "8168C/8111C", RL_JUMBO_MTU_6K }, @@ -1376,6 +1377,11 @@ re_attach(device_t dev) RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; + case RL_HWREV_8105E: + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD; + break; case RL_HWREV_8168B_SPIN1: case RL_HWREV_8168B_SPIN2: sc->rl_flags |= RL_FLAG_WOLRXENB; Modified: head/sys/pci/if_rlreg.h == --- head/sys/pci/if_rlreg.h Wed Jan 26 21:07:44 2011(r217910) +++ head/sys/pci/if_rlreg.h Wed Jan 26 21:14:20 2011(r217911) @@ -176,6 +176,7 @@ #defineRL_HWREV_8168C 0x3C00 #defineRL_HWREV_8168C_SPIN20x3C40 #defineRL_HWREV_8168CP 0x3C80 +#defineRL_HWREV_8105E 0x4080 #defineRL_HWREV_8139 0x6000 #defineRL_HWREV_8139A 0x7000 #defineRL_HWREV_8139AG 0x7080 ___ 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: r217830 - head/share/man/man9
On 26 Jan 2011, at 21:14, m...@freebsd.org wrote: >> The kinds of cases I worry about are things like the tcp connection >> monitoring sysctls. Most systems have a dozen, hundred, or a thousand >> connections. Some have half a million or a million. If we switched to >> requiring wiring every page needed to store that list, it would do terrible >> things to the system. So really what I have in mind is: either we handle >> cases like that well, or we put in a clear warning and have obvious failure >> modes to catch the cases where it didn't work out. In practice, I think we >> would not want to switch the tcpcb/inpcb sysctl for this reason, but as >> people say "ah, this is convenient" we need to make sure it's handled well, >> and easy to debug problems when they do arise. > > But I think that problem exists today using sysctl for output, since > it's non-iterative. In fact, it's often worse today, because in > addition to the user-space buffer that needs to be large enough to > hold the output, the kernel needs to malloc(9) a buffer to hold it > before doing the one SYSCTL_OUT at the end that most routines I've > seen use. > > For situations like this where there is a lot of output but it doesn't > need to be serialized by a lock held across the whole data fetch, then > yes, using sbuf_new_for_sysctl() would wire more memory. Right -- hence my concern about (a) appropriate documentation and (b) proper error handling. The sbuf routine looks convenient, easy to use, and exactly the semantic that I want in most cases. However, sometimes, it may silently break based on something rather abstract getting "too big". We need users of the KPI to be aware of that limitation and hence not use it when that could occur, and when it does occur, generate a clear notice of some sort so that it can be tracked down. Robert___ 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: r217913 - head/sys/netinet
Author: tuexen Date: Wed Jan 26 21:38:17 2011 New Revision: 217913 URL: http://svn.freebsd.org/changeset/base/217913 Log: * Use 300 ms as the default for RTO_MIN. * Disable burst mitigation by default. * Remove unused constant. Discussed with rrs. MFC after: 3 months. Modified: head/sys/netinet/sctp_constants.h Modified: head/sys/netinet/sctp_constants.h == --- head/sys/netinet/sctp_constants.h Wed Jan 26 21:22:06 2011 (r217912) +++ head/sys/netinet/sctp_constants.h Wed Jan 26 21:38:17 2011 (r217913) @@ -343,8 +343,8 @@ __FBSDID("$FreeBSD$"); */ #define SCTP_NO_FR_UNLESS_SEGMENT_SMALLER 1 -/* default max I can burst out after a fast retransmit */ -#define SCTP_DEF_MAX_BURST 4 +/* default max I can burst out after a fast retransmit, 0 disables it */ +#define SCTP_DEF_MAX_BURST 0 /* IP hdr (20/40) + 12+2+2 (enet) + sctp common 12 */ #define SCTP_FIRST_MBUF_RESV 68 /* Packet transmit states in the sent field */ @@ -642,8 +642,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_DEFAULT_SECRET_LIFE_SEC 3600 #define SCTP_RTO_UPPER_BOUND (6) /* 60 sec in ms */ -#define SCTP_RTO_UPPER_BOUND_SEC 60/* for the init timer */ -#define SCTP_RTO_LOWER_BOUND (1000) /* 1 sec in ms */ +#define SCTP_RTO_LOWER_BOUND (300) /* 0.3 sec is ms */ #define SCTP_RTO_INITIAL (3000) /* 3 sec in ms */ ___ 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: r217914 - head/share/man/man4
Author: yongari Date: Wed Jan 26 21:59:59 2011 New Revision: 217914 URL: http://svn.freebsd.org/changeset/base/217914 Log: Document newly added tunables. hw.re.intr_filter hw.re.msix_disable dev.re.%d.int_rx_mod Modified: head/share/man/man4/re.4 Modified: head/share/man/man4/re.4 == --- head/share/man/man4/re.4Wed Jan 26 21:38:17 2011(r217913) +++ head/share/man/man4/re.4Wed Jan 26 21:59:59 2011(r217914) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2011 +.Dd January 26, 2011 .Dt RE 4 .Os .Sh NAME @@ -175,15 +175,39 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width "xx" +.It Va hw.re.intr_filter +This tunable makes driver use interrupt filter handler on +controllers that support MSI/MSI-X capability. +If MSI/MSI-X is disabled by administrator this tunable has no +effect and driver will use interrupt filter handler. +The default value is 0 to use interrupt thread handler. .It Va hw.re.msi_disable This tunable disables MSI support on the Ethernet hardware. The default value is 0. +.It Va hw.re.msix_disable +This tunable disables MSI-X support on the Ethernet hardware. +The default value is 0. .It Va hw.re.prefer_iomap This tunable controls which register mapping should be used on the specified device. A non-zero value enables I/O space register mapping. The default value is 0 to use memory space register mapping. .El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xx" +.It Va dev.re.%d.int_rx_mod +Maximum amount of time to delay receive interrupt processing in +units of 1us. +The accepted range is 0 to 65, the default is 65(65us). +Value 0 completely disables the interrupt moderation. +The interface need to be brought down and up again before a change +takes effect. +.El .Sh DIAGNOSTICS .Bl -diag .It "re%d: couldn't map memory" ___ 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: r217830 - head/share/man/man9
On Wednesday, January 26, 2011 4:14:15 pm m...@freebsd.org wrote: > On Wed, Jan 26, 2011 at 1:10 PM, Robert N. M. Watson > wrote: > > > > On 26 Jan 2011, at 18:29, m...@freebsd.org wrote: > > > >>> I suppose an important question is now often we see this actually failing > >> > >> I don't believe we've ever seen a memory failure relating to sysctls > >> at Isilon and we've been using the equivalent of this code for a few > >> years. Our machines aren't low memory but they are under memory > >> pressure sometimes. > > > > The kinds of cases I worry about are things like the tcp connection monitoring sysctls. Most systems have a dozen, hundred, or a thousand connections. Some have half a million or a million. If we switched to requiring wiring every page needed to store that list, it would do terrible things to the system. So really what I have in mind is: either we handle cases like that well, or we put in a clear warning and have obvious failure modes to catch the cases where it didn't work out. In practice, I think we would not want to switch the tcpcb/inpcb sysctl for this reason, but as people say "ah, this is convenient" we need to make sure it's handled well, and easy to debug problems when they do arise. > > > > But I think that problem exists today using sysctl for output, since > it's non-iterative. In fact, it's often worse today, because in > addition to the user-space buffer that needs to be large enough to > hold the output, the kernel needs to malloc(9) a buffer to hold it > before doing the one SYSCTL_OUT at the end that most routines I've > seen use. Not always. I think in the case of the inpcb's what happens is that we hold enough references on objects that we can drop the locks while calling SYSCTL_OUT() without requiring us to 1) allocate a full duplicate of the buffer in KVM, or 2) wire the entire userland buffer. -- 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: r217871 - head/sbin/mount
On Wed, Jan 26, 2011 at 12:30 PM, Doug Barton wrote: > On 01/25/2011 23:55, Bruce Evans wrote: >> >> On Wed, 26 Jan 2011, Doug Barton wrote: >> >>> Log: >>> Clarify the availability of the noatime option on network file systems >>> >>> Modified: >>> head/sbin/mount/mount.8 >>> >>> Modified: head/sbin/mount/mount.8 >>> >>> == >>> >>> --- head/sbin/mount/mount.8 Wed Jan 26 01:07:56 2011 (r217870) >>> +++ head/sbin/mount/mount.8 Wed Jan 26 05:06:11 2011 (r217871) >>> @@ -28,7 +28,7 @@ >>> .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 >>> .\" $FreeBSD$ >>> .\" >>> -.Dd February 10, 2010 >>> +.Dd January 25, 2011 >>> .Dt MOUNT 8 >>> .Os >>> .Sh NAME >>> @@ -208,7 +208,11 @@ This option >>> is useful on file systems where there are large numbers of files and >>> performance is more critical than updating the file access time (which is >>> rarely ever important). >>> -This option is currently only supported on local file systems. >>> +This option is not supported on network file systems when the >>> +server is FreeBSD. >>> +Support in network files servers on other operating systems >>> +with a FreeBSD client is possible, >>> +but should be tested before it is relied on. >> >> Even atimes are not supported by at least the non-experimental FreeBSD >> client, so attempts to turn them off are nonsense and should have >> always failed at mount time. But such attempts bogusly always succeed >> and have no effect, even if atimes are otherwise supported, since: >> - for mount(2), the nonstandard option MOPT_NOATIME has always been >> bogusly in the standard options list MOPT_STDOPTS. Thus it is was >> never rejected by mount_nfs(8) or for other mount utilities than >> use mount(2), even for file systems for fies that don't even have atimes. >> - for nmount(2) in both the non-experimental and experimental cilent >> the unsupported option "noatime" is bogusly in the supported options >> list together with lots of other unsupported options like "suiddir", >> "nocluster[rw]", "multilabel" and "acls". All of these nonstandard >> options are also bogusly in MOPT_STDOPTS. >> - bogusly setting the MNT_ATIME flag in an attempt to turn off atime has >> no effect in any FreeBSD nfs client, since the MNT_ATIME flag is never >> referenced. And, at least in the non-experimental client, since even >> atimes are not supported, there is nothing useful that references to >> MNT_ATIME could do. >> >> Non-support of atimes by by at least the old FreeBSD client: Most >> reads are from the nfs cache (else most reads would be very slow). >> Since the client doesn't support atimes, it doesn't do the fancy caching >> of them that would be needed to make them sort of work without defeating >> the cache by telling the server about every read. So atimes just get >> updated on the server when the server is asked to fill the cache, and >> then only if the server supports atimes (not counting when an application >> on the client explicitly sets them using utimes(2). Full support for >> noatime/noatime on the client would involve negotating it with the >> server, so that the client's noatime flag has preference over the >> server flag on files read by that client... AFAIK there is no way to >> negotiate this. Client caching of atimes might also need delicate >> negotiation depending on how POSIXly you want atimes to work. >> >> I sometimes think that atimes should be handled mostly in vfs. The >> MNT_ATIME could then have an effect without any references to it in >> file systems that sort of support atimes, but ones that don't even >> have atimes should still make vfs reject attempts to use it. > > I think I understand most, if not all of what you wrote here, but I'm not > nearly smart enough to translate it into something succinct for the man > page. :) > > My concern was that the man page says that we don't support the option at > all, but with a FreeBSD client and a solaris server it has a demonstrable > effect. If someone wants to improve the wording then by all means, either > make a suggestion or just do it. :) Maybe something should just be added to the BUGS section for this item? Thanks, -Garrett ___ 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: r217915 - in head/sys: geom kern sys
Author: mdf Date: Wed Jan 26 22:48:09 2011 New Revision: 217915 URL: http://svn.freebsd.org/changeset/base/217915 Log: Remove the CTLFLAG_NOLOCK as it seems to be both unused and unfunctional. Wiring the user buffer has only been done explicitly since r101422. Mark the kern.disks sysctl as MPSAFE since it is and it seems to have been mis-using the NOLOCK flag. Partially break the KPI (but not the KBI) for the sysctl_req 'lock' field since this member should be private and the "REQ_LOCKED" state seems meaningless now. Modified: head/sys/geom/geom_disk.c head/sys/kern/kern_sysctl.c head/sys/sys/sysctl.h Modified: head/sys/geom/geom_disk.c == --- head/sys/geom/geom_disk.c Wed Jan 26 21:59:59 2011(r217914) +++ head/sys/geom/geom_disk.c Wed Jan 26 22:48:09 2011(r217915) @@ -527,6 +527,7 @@ sysctl_disks(SYSCTL_HANDLER_ARGS) return error; } -SYSCTL_PROC(_kern, OID_AUTO, disks, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NOLOCK, 0, 0, +SYSCTL_PROC(_kern, OID_AUTO, disks, +CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_disks, "A", "names of available disks"); Modified: head/sys/kern/kern_sysctl.c == --- head/sys/kern/kern_sysctl.c Wed Jan 26 21:59:59 2011(r217914) +++ head/sys/kern/kern_sysctl.c Wed Jan 26 22:48:09 2011(r217915) @@ -1206,7 +1206,7 @@ kernel_sysctl(struct thread *td, int *na req.oldfunc = sysctl_old_kernel; req.newfunc = sysctl_new_kernel; - req.lock = REQ_LOCKED; + req.lock = REQ_UNWIRED; SYSCTL_XLOCK(); error = sysctl_root(0, name, namelen, &req); @@ -1314,7 +1314,7 @@ sysctl_wire_old_buffer(struct sysctl_req wiredlen = (len > 0 && len < req->oldlen) ? len : req->oldlen; ret = 0; - if (req->lock == REQ_LOCKED && req->oldptr && + if (req->lock != REQ_WIRED && req->oldptr && req->oldfunc == sysctl_old_user) { if (wiredlen != 0) { ret = vslock(req->oldptr, wiredlen); @@ -1350,8 +1350,6 @@ sysctl_find_oid(int *name, u_int namelen return (ENOENT); indx++; - if (oid->oid_kind & CTLFLAG_NOLOCK) - req->lock = REQ_UNLOCKED; if ((oid->oid_kind & CTLTYPE) == CTLTYPE_NODE) { if (oid->oid_handler != NULL || indx == namelen) { *noid = oid; @@ -1548,7 +1546,7 @@ userland_sysctl(struct thread *td, int * req.oldfunc = sysctl_old_user; req.newfunc = sysctl_new_user; - req.lock = REQ_LOCKED; + req.lock = REQ_UNWIRED; #ifdef KTRACE if (KTRPOINT(curthread, KTR_SYSCTL)) Modified: head/sys/sys/sysctl.h == --- head/sys/sys/sysctl.h Wed Jan 26 21:59:59 2011(r217914) +++ head/sys/sys/sysctl.h Wed Jan 26 22:48:09 2011(r217915) @@ -77,7 +77,6 @@ struct ctlname { #define CTLFLAG_RD 0x8000 /* Allow reads of variable */ #define CTLFLAG_WR 0x4000 /* Allow writes to the variable */ #define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR) -#define CTLFLAG_NOLOCK 0x2000 /* XXX Don't Lock */ #define CTLFLAG_ANYBODY0x1000 /* All users can set this var */ #define CTLFLAG_SECURE 0x0800 /* Permit set only if securelevel<=0 */ #define CTLFLAG_PRISON 0x0400 /* Prisoned roots can fiddle */ @@ -122,9 +121,8 @@ struct ctlname { struct sysctl_req *req /* definitions for sysctl_req 'lock' member */ -#define REQ_UNLOCKED 0 /* not locked and not wired */ -#define REQ_LOCKED 1 /* locked and not wired */ -#define REQ_WIRED 2 /* locked and wired */ +#defineREQ_UNWIRED 1 +#defineREQ_WIRED 2 /* definitions for sysctl_req 'flags' member */ #if defined(__amd64__) || defined(__ia64__) || defined(__powerpc64__) @@ -137,7 +135,7 @@ struct ctlname { */ struct sysctl_req { struct thread *td;/* used for access checking */ - int lock; /* locking/wiring state */ + int lock; /* wiring state */ void*oldptr; size_t oldlen; size_t oldidx; ___ 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: r217830 - head/share/man/man9
On Wed, Jan 26, 2011 at 1:19 PM, Robert N. M. Watson wrote: > > On 26 Jan 2011, at 21:14, m...@freebsd.org wrote: > >>> The kinds of cases I worry about are things like the tcp connection >>> monitoring sysctls. Most systems have a dozen, hundred, or a thousand >>> connections. Some have half a million or a million. If we switched to >>> requiring wiring every page needed to store that list, it would do terrible >>> things to the system. So really what I have in mind is: either we handle >>> cases like that well, or we put in a clear warning and have obvious failure >>> modes to catch the cases where it didn't work out. In practice, I think we >>> would not want to switch the tcpcb/inpcb sysctl for this reason, but as >>> people say "ah, this is convenient" we need to make sure it's handled well, >>> and easy to debug problems when they do arise. >> >> But I think that problem exists today using sysctl for output, since >> it's non-iterative. In fact, it's often worse today, because in >> addition to the user-space buffer that needs to be large enough to >> hold the output, the kernel needs to malloc(9) a buffer to hold it >> before doing the one SYSCTL_OUT at the end that most routines I've >> seen use. >> >> For situations like this where there is a lot of output but it doesn't >> need to be serialized by a lock held across the whole data fetch, then >> yes, using sbuf_new_for_sysctl() would wire more memory. > > Right -- hence my concern about (a) appropriate documentation and (b) proper > error handling. The sbuf routine looks convenient, easy to use, and exactly > the semantic that I want in most cases. However, sometimes, it may silently > break based on something rather abstract getting "too big". We need users of > the KPI to be aware of that limitation and hence not use it when that could > occur, and when it does occur, generate a clear notice of some sort so that > it can be tracked down. > Upon further consideration, I don't think sbuf_new_for_sysctl() should be doing the wire. Whether the buffer needs to be wired or not is up to the implementation of the individual sysctl; *most* of them will be holding a lock when doing sbuf_print, but there's no guarantee. It's simpler to just leave this in the hands of the implementor, and it also enables better error reporting. Thanks, matthew ___ 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: r217916 - in head: share/man/man9 sys/dev/cxgb sys/kern sys/vm
Author: mdf Date: Thu Jan 27 00:34:12 2011 New Revision: 217916 URL: http://svn.freebsd.org/changeset/base/217916 Log: Explicitly wire the user buffer rather than doing it implicitly in sbuf_new_for_sysctl(9). This allows using an sbuf with a SYSCTL_OUT drain for extremely large amounts of data where the caller knows that appropriate references are held, and sleeping is not an issue. Inspired by: rwatson Modified: head/share/man/man9/sbuf.9 head/sys/dev/cxgb/cxgb_sge.c head/sys/kern/kern_malloc.c head/sys/kern/kern_sysctl.c head/sys/kern/subr_lock.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_witness.c head/sys/vm/uma_core.c head/sys/vm/vm_phys.c head/sys/vm/vm_reserv.c Modified: head/share/man/man9/sbuf.9 == --- head/share/man/man9/sbuf.9 Wed Jan 26 22:48:09 2011(r217915) +++ head/share/man/man9/sbuf.9 Thu Jan 27 00:34:12 2011(r217916) @@ -177,9 +177,9 @@ The function will set up an sbuf with a drain function to use .Fn SYSCTL_OUT when the internal buffer fills. -The sysctl old buffer will be wired, which allows for doing an -.Fn sbuf_printf -while holding a mutex. +Note that if the various functions which append to an sbuf are used while +a non-sleepable lock is held, the user buffer should be wired using +.Fn sysctl_wire_old_buffer . .Pp The .Fn sbuf_delete Modified: head/sys/dev/cxgb/cxgb_sge.c == --- head/sys/dev/cxgb/cxgb_sge.cWed Jan 26 22:48:09 2011 (r217915) +++ head/sys/dev/cxgb/cxgb_sge.cThu Jan 27 00:34:12 2011 (r217916) @@ -3251,7 +3251,9 @@ t3_dump_rspq(SYSCTL_HANDLER_ARGS) err = t3_sge_read_rspq(qs->port->adapter, rspq->cntxt_id, data); if (err) return (err); - + err = sysctl_wire_old_buffer(req, 0); + if (err) + return (err); sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req); sbuf_printf(sb, " \n index=%u size=%u MSI-X/RspQ=%u intr enable=%u intr armed=%u\n", @@ -3316,7 +3318,9 @@ t3_dump_txq_eth(SYSCTL_HANDLER_ARGS) err = t3_sge_read_ecntxt(qs->port->adapter, qs->rspq.cntxt_id, data); if (err) return (err); - + err = sysctl_wire_old_buffer(req, 0); + if (err) + return (err); sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req); sbuf_printf(sb, " \n credits=%u GTS=%u index=%u size=%u rspq#=%u cmdq#=%u\n", @@ -3381,6 +3385,9 @@ t3_dump_txq_ctrl(SYSCTL_HANDLER_ARGS) return (EINVAL); } + err = sysctl_wire_old_buffer(req, 0); + if (err != 0) + return (err); sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req); sbuf_printf(sb, " qid=%d start=%d -> end=%d\n", qs->idx, txq->txq_dump_start, Modified: head/sys/kern/kern_malloc.c == --- head/sys/kern/kern_malloc.c Wed Jan 26 22:48:09 2011(r217915) +++ head/sys/kern/kern_malloc.c Thu Jan 27 00:34:12 2011(r217916) @@ -862,6 +862,9 @@ sysctl_kern_malloc_stats(SYSCTL_HANDLER_ int error, i; struct sbuf sbuf; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sbuf_new_for_sysctl(&sbuf, NULL, 128, req); mtx_lock(&malloc_mtx); @@ -1019,6 +1022,9 @@ sysctl_kern_mprof(SYSCTL_HANDLER_ARGS) waste = 0; mem = 0; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sbuf_new_for_sysctl(&sbuf, NULL, 128, req); sbuf_printf(&sbuf, "\n SizeRequests Real Size\n"); Modified: head/sys/kern/kern_sysctl.c == --- head/sys/kern/kern_sysctl.c Wed Jan 26 22:48:09 2011(r217915) +++ head/sys/kern/kern_sysctl.c Thu Jan 27 00:34:12 2011(r217916) @@ -1591,7 +1591,8 @@ userland_sysctl(struct thread *td, int * } /* - * Drain into a sysctl struct. The user buffer must be wired. + * Drain into a sysctl struct. The user buffer should be wired if a page + * fault would cause issue. */ static int sbuf_sysctl_drain(void *arg, const char *data, int len) @@ -1609,9 +1610,6 @@ sbuf_new_for_sysctl(struct sbuf *s, char struct sysctl_req *req) { - /* Wire the user buffer, so we can write without blocking. */ - sysctl_wire_old_buffer(req, 0); - s = sbuf_new(s, buf, length, SBUF_FIXEDLEN); sbuf_set_drain(s, sbuf_sysctl_drain, req); return (s); Modified: head/sys/kern/subr_lock.c == --- head/sys/kern/subr_lock.c Wed Jan 26 22:48:09 2011(r217915) +++ head/sys/kern/subr_
Re: svn commit: r217358 - head/usr.sbin/usbdump
On Thu, Jan 13, 2011 at 04:37:12PM +, Weongyo Jeong wrote: > Author: weongyo > Date: Thu Jan 13 16:37:12 2011 > New Revision: 217358 > URL: http://svn.freebsd.org/changeset/base/217358 > > Log: > Documents OUTPUT formats. While I'm here cleans up styles and words. > > Reviewed by:brueffer@ Some corrections that cleaning styles and words were done by brueffer@. regards, Weongyo Jeong ___ 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: r217921 - head/sys/dev/ath/ath_hal
Author: adrian Date: Thu Jan 27 02:56:03 2011 New Revision: 217921 URL: http://svn.freebsd.org/changeset/base/217921 Log: Writing to the analog registers on the AR9220 (Merlin PCI) seems to require a delay. This, along with an initval change which will appear in a subsequent commit, fixes bus panics that I have been seing with the AR9220 on a Routerstation Pro (AR7161 MIPS board.) Obtained from: Linux ath9k PR: kern/154220 Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c == --- head/sys/dev/ath/ath_hal/ah.c Thu Jan 27 02:27:17 2011 (r217920) +++ head/sys/dev/ath/ath_hal/ah.c Thu Jan 27 02:56:03 2011 (r217921) @@ -858,6 +858,11 @@ ath_hal_ini_write(struct ath_hal *ah, co for (r = 0; r < ia->rows; r++) { OS_REG_WRITE(ah, HAL_INI_VAL(ia, r, 0), HAL_INI_VAL(ia, r, col)); + + /* Analog shift register delay seems needed for Merlin - PR kern/154220 */ + if (HAL_INI_VAL(ia, r, 0) >= 0x7800 && HAL_INI_VAL(ia, r, 0) < 0x78a0) + OS_DELAY(100); + DMA_YIELD(regWr); } return regWr; @@ -881,6 +886,10 @@ ath_hal_ini_bank_write(struct ath_hal *a for (r = 0; r < ia->rows; r++) { OS_REG_WRITE(ah, HAL_INI_VAL(ia, r, 0), data[r]); + + /* Analog shift register delay seems needed for Merlin - PR kern/154220 */ + if (HAL_INI_VAL(ia, r, 0) >= 0x7800 && HAL_INI_VAL(ia, r, 0) < 0x78a0) + OS_DELAY(100); DMA_YIELD(regWr); } return regWr; ___ 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: r217922 - head/sys/fs/nfs
Author: gnn Date: Thu Jan 27 03:32:16 2011 New Revision: 217922 URL: http://svn.freebsd.org/changeset/base/217922 Log: Quick fix to a comment. Modified: head/sys/fs/nfs/nfsport.h Modified: head/sys/fs/nfs/nfsport.h == --- head/sys/fs/nfs/nfsport.h Thu Jan 27 02:56:03 2011(r217921) +++ head/sys/fs/nfs/nfsport.h Thu Jan 27 03:32:16 2011(r217922) @@ -639,9 +639,9 @@ int nfsmsleep(void *, void *, int, const #defineTAILQ_END(head) NULL /* - * This must be defined to be a global variable the increments once + * This must be defined to be a global variable that increments once * per second, but never stops or goes backwards, even when a "date" - * command changes the tod clock. It is used for delta times for + * command changes the TOD clock. It is used for delta times for * leases, etc. */ #defineNFSD_MONOSECtime_uptime ___ 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: r217871 - head/sbin/mount
On Wed, 26 Jan 2011, Doug Barton wrote: On 01/25/2011 23:55, Bruce Evans wrote: ... Even atimes are not supported by at least the non-experimental FreeBSD client, so attempts to turn them off are nonsense and should have always failed at mount time. But such attempts bogusly always succeed ... I think I understand most, if not all of what you wrote here, but I'm not nearly smart enough to translate it into something succinct for the man page. :) "The noatime option has no effect for nfs... BUGS: the noatime option should cause .Nm to fail, but it is turned into a no-op for bug for bug compatibility with historical behaviour." ? My concern was that the man page says that we don't support the option at all, but with a FreeBSD client and a solaris server it has a demonstrable effect. If someone wants to improve the wording then by all means, either make a suggestion or just do it. :) What is the effect? I can't see any in the source code. But I found a place where vfs examines the flag. I even wrote half of the original version of this (*). It is for marking atimes on exec and mmap. VOP_MARKATIME() is called if the vnode has a mount point and the flags for the mount point don't indicate noatime or readonly. But VOP_MARKATIME() is only implemented for ffs (even recent changes to reduce bitrot of ext2fs relative to ffs don't have it), and marking atimes on exec and mmap would be especially large foot-shooting for nfs, so this too has no effect for nfs (it just causes a null or bad vop to be called, and the result to be ignored. It is hard to see the exact default behaviour since even vfs_defaults.c doesn't have an explicit entry for vop_markatime). (*) The original version of this checked MNT_NOATIME and MNT_RDONLY in vfs only as an optimization. The rather heavyweight vop VOP_SETATTR() with was (ab)used,. Now there is a separate vop for this, and only 1 file system supports this, checking the MNT_* flags should be left to the file system. In practice, MNT_NOATIME and MNT_RDONLY are rarely set for file systems that support atimes, and MNT_NOATIME should never be set for a file system that doesn't support atimes, so checking them at the vfs level isn't even an optimization. We could use a mount flag that indicates that the file system doesn't support atimes at all, but this amounts to subverting the vop system -- non-support is properly indicated by the vop being null or bad. Or you can consider the flag as making the vop depend on the mount options (the file system instance) instead of only depending on the file system (the file system source code). That might be useful, but use of it should start with more interesting vops than VOP_MARKATIME(). Say VOP_WRITE() on readonly file system instances. Even that is a bit complicated, and vfs_mark_atime()'s check of MNT_RDONLY may have races, since the file system may and does in the case of ffs have a internal readonly flag that doesn't quite track MNT_RDONLY. As it happens, ffs has special, hackish handling of atimes on readonly file systems -- it marks them for update unconditionally, then cancels the marks at update time iff the file system instance is readonly at update time (maybe it now cancels them more correctly when the readonly flag(s) change). Thus it doesn't care about the MNT_RDONLY check that vfs_mark_atimes() does. But this doesn't work for VOP_WRITE(). 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: r217923 - head/sys/dev/ath/ath_hal
Author: adrian Date: Thu Jan 27 07:33:17 2011 New Revision: 217923 URL: http://svn.freebsd.org/changeset/base/217923 Log: Make a note to re-check whether that particular check is needed. Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c == --- head/sys/dev/ath/ath_hal/ah.c Thu Jan 27 03:32:16 2011 (r217922) +++ head/sys/dev/ath/ath_hal/ah.c Thu Jan 27 07:33:17 2011 (r217923) @@ -888,6 +888,8 @@ ath_hal_ini_bank_write(struct ath_hal *a OS_REG_WRITE(ah, HAL_INI_VAL(ia, r, 0), data[r]); /* Analog shift register delay seems needed for Merlin - PR kern/154220 */ + /* XXX verify whether any analog radio bank writes will hit up this */ + /* XXX since this is a merlin work-around; and merlin doesn't use radio banks */ if (HAL_INI_VAL(ia, r, 0) >= 0x7800 && HAL_INI_VAL(ia, r, 0) < 0x78a0) OS_DELAY(100); DMA_YIELD(regWr); ___ 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"