Date: Tue, 8 May 2007 16:48:55 GMT From: Rui Paulo <rpaulo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 119487 for review Message-ID: <200705081648.l48GmtLi001694@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=119487 Change 119487 by rpaulo@rpaulo_epsilon on 2007/05/08 16:48:09 IFC Affected files ... .. //depot/projects/soc2007/rpaulo-macbook/amd64/amd64/intr_machdep.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/amd64/include/vmparam.h#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/arm/include/vmparam.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/boot/common/loader.8#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/conf/files#7 integrate .. //depot/projects/soc2007/rpaulo-macbook/conf/options#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/dbuf.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/dnode.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/zio.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/acpica/acpi.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/ata/ata-disk.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/bce/if_bce.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/bce/if_bcefw.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/bce/if_bcereg.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_80003es2lan.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_80003es2lan.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82540.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82541.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82541.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82542.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82543.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82543.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82571.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82571.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82575.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_82575.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_api.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_api.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_defines.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_hw.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_ich8lan.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_ich8lan.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_mac.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_mac.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_manage.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_manage.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_nvm.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_nvm.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_osdep.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_phy.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_phy.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/e1000_regs.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/if_em.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/em/if_em.h#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/gem/if_gem.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/gem/if_gem_pci.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/gem/if_gemvar.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/isp/isp.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/isp/isp_freebsd.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/isp/isp_freebsd.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/isp/isp_pci.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/isp/isp_sbus.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/isp/isp_tpublic.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/mpt/mpt.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/mpt/mpt.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/mpt/mpt_cam.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/mpt/mpt_cam.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/mpt/mpt_pci.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/mpt/mpt_raid.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/mxge/eth_z8e.dat.gz.uu#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/mxge/ethp_z8e.dat.gz.uu#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/mxge/if_mxge.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/mxge/mxge_mcp.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/nve/if_nve.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/pci/pci.c#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/sound/pci/hda/hdac.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/sound/pci/hda/hdac_private.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/sound/pci/ich.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/sound/pcm/buffer.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/sound/pcm/sound.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/usb/if_rum.c#1 branch .. //depot/projects/soc2007/rpaulo-macbook/dev/usb/if_rumreg.h#1 branch .. //depot/projects/soc2007/rpaulo-macbook/dev/usb/if_rumvar.h#1 branch .. //depot/projects/soc2007/rpaulo-macbook/dev/usb/rt2573_ucode.h#1 branch .. //depot/projects/soc2007/rpaulo-macbook/dev/usb/usb_subr.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/dev/usb/usbdevs#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/geom/eli/g_eli_ctl.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/geom/geom.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/geom/geom_dev.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/geom/geom_disk.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/geom/geom_disk.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/geom/geom_io.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/geom/geom_slice.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/geom/geom_subr.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/i386/conf/GENERIC#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/i386/conf/PAE#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/i386/i386/intr_machdep.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/i386/include/vmparam.h#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/ia64/ia64/machdep.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/ia64/include/vmparam.h#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/kern/kern_descrip.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/kern/kern_intr.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/kern/uipc_socket.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/kern/uipc_usrreq.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/kern/vfs_syscalls.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/modules/Makefile#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/modules/em/Makefile#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/modules/rum/Makefile#1 branch .. //depot/projects/soc2007/rpaulo-macbook/net/ieee8023ad_lacp.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/net/ieee8023ad_lacp.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/net/if_lagg.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/net/if_lagg.h#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/net80211/ieee80211_amrr.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/netgraph/ng_mppc.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp.h#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_asconf.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_auth.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_constants.h#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_indata.c#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_indata.h#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_input.c#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_input.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_os_bsd.h#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_output.c#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_output.h#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_pcb.c#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_pcb.h#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_structs.h#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_sysctl.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_timer.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_uio.h#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_usrreq.c#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctp_var.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctputil.c#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/sctputil.h#4 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_debug.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_input.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_output.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_subr.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_syncache.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_timer.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_usrreq.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/tcp_var.h#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet/udp_usrreq.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet6/nd6.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet6/nd6_nbr.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/netinet6/sctp6_usrreq.c#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/powerpc/include/vmparam.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/sparc64/include/vmparam.h#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/sun4v/include/vmparam.h#3 integrate .. //depot/projects/soc2007/rpaulo-macbook/sys/disk.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/sys/filedesc.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/sys/interrupt.h#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/vm/vm_page.c#2 integrate .. //depot/projects/soc2007/rpaulo-macbook/vm/vm_page.h#2 integrate Differences ... ==== //depot/projects/soc2007/rpaulo-macbook/amd64/amd64/intr_machdep.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.30 2007/03/06 17:16:46 jhb Exp $ + * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.31 2007/05/06 17:02:49 piso Exp $ */ /* @@ -74,6 +74,12 @@ static struct mtx intr_table_lock; static STAILQ_HEAD(, pic) pics; +#ifdef INTR_FILTER +static void intr_eoi_src(void *arg); +static void intr_disab_eoi_src(void *arg); +static void intr_event_stray(void *cookie); +#endif + #ifdef SMP static int assign_cpu; @@ -134,8 +140,14 @@ vector = isrc->is_pic->pic_vector(isrc); if (interrupt_sources[vector] != NULL) return (EEXIST); +#ifdef INTR_FILTER + error = intr_event_create(&isrc->is_event, isrc, 0, + (mask_fn)isrc->is_pic->pic_enable_source, + intr_eoi_src, intr_disab_eoi_src, "irq%d:", vector); +#else error = intr_event_create(&isrc->is_event, isrc, 0, (mask_fn)isrc->is_pic->pic_enable_source, "irq%d:", vector); +#endif if (error) return (error); mtx_lock_spin(&intr_table_lock); @@ -212,6 +224,77 @@ return (isrc->is_pic->pic_config_intr(isrc, trig, pol)); } +#ifdef INTR_FILTER +void +intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) +{ + struct thread *td; + struct intr_event *ie; + int vector; + + td = curthread; + + /* + * We count software interrupts when we process them. The + * code here follows previous practice, but there's an + * argument for counting hardware interrupts when they're + * processed too. + */ + (*isrc->is_count)++; + PCPU_LAZY_INC(cnt.v_intr); + + ie = isrc->is_event; + + /* + * XXX: We assume that IRQ 0 is only used for the ISA timer + * device (clk). + */ + vector = isrc->is_pic->pic_vector(isrc); + if (vector == 0) + clkintr_pending = 1; + + if (intr_event_handle(ie, frame) != 0) + intr_event_stray(isrc); +} + +static void +intr_event_stray(void *cookie) +{ + struct intsrc *isrc; + + isrc = cookie; + /* + * For stray interrupts, mask and EOI the source, bump the + * stray count, and log the condition. + */ + isrc->is_pic->pic_disable_source(isrc, PIC_EOI); + (*isrc->is_straycount)++; + if (*isrc->is_straycount < MAX_STRAY_LOG) + log(LOG_ERR, "stray irq%d\n", isrc->is_pic->pic_vector(isrc)); + else if (*isrc->is_straycount == MAX_STRAY_LOG) + log(LOG_CRIT, + "too many stray irq %d's: not logging anymore\n", + isrc->is_pic->pic_vector(isrc)); +} + +static void +intr_eoi_src(void *arg) +{ + struct intsrc *isrc; + + isrc = arg; + isrc->is_pic->pic_eoi_source(isrc); +} + +static void +intr_disab_eoi_src(void *arg) +{ + struct intsrc *isrc; + + isrc = arg; + isrc->is_pic->pic_disable_source(isrc, PIC_EOI); +} +#else void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) { @@ -298,6 +381,7 @@ } td->td_intr_nesting_level--; } +#endif void intr_resume(void) ==== //depot/projects/soc2007/rpaulo-macbook/amd64/include/vmparam.h#3 (text+ko) ==== @@ -38,7 +38,7 @@ * SUCH DAMAGE. * * from: @(#)vmparam.h 5.9 (Berkeley) 5/12/91 - * $FreeBSD: src/sys/amd64/include/vmparam.h,v 1.46 2007/04/21 01:14:47 sepotvin Exp $ + * $FreeBSD: src/sys/amd64/include/vmparam.h,v 1.47 2007/05/05 19:50:26 alc Exp $ */ @@ -88,6 +88,11 @@ #define UMA_MD_SMALL_ALLOC /* + * The physical address space is densely populated. + */ +#define VM_PHYSSEG_DENSE + +/* * Virtual addresses of things. Derived from the page directory and * page table indexes from pmap.h for precision. * Because of the page that is both a PD and PT, it looks a little ==== //depot/projects/soc2007/rpaulo-macbook/arm/include/vmparam.h#2 (text+ko) ==== @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/arm/include/vmparam.h,v 1.7 2006/08/25 23:51:10 alc Exp $ + * $FreeBSD: src/sys/arm/include/vmparam.h,v 1.8 2007/05/05 19:50:26 alc Exp $ */ #ifndef _MACHINE_VMPARAM_H_ @@ -73,6 +73,11 @@ #define VM_PHYSSEG_NOADD /* + * The physical address space is densely populated. + */ +#define VM_PHYSSEG_DENSE + +/* * we support 2 free lists: * * - DEFAULT for all systems ==== //depot/projects/soc2007/rpaulo-macbook/boot/common/loader.8#2 (text+ko) ==== @@ -22,9 +22,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.91 2007/02/04 06:35:10 imp Exp $ +.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.92 2007/05/05 17:36:42 jmg Exp $ .\" -.Dd November 29, 2006 +.Dd May 5, 2007 .Dt LOADER 8 .Os .Sh NAME @@ -574,20 +574,19 @@ meta information, which directly governs the maximum amount of swap the system can support. This value is specified in bytes of KVA space -and defaults to around 70MBytes. +and defaults to 32MBytes on i386 and amd64. Care should be taken to not reduce this value such that the actual amount of configured swap exceeds 1/2 the kernel-supported swap. -The default 70MB allows -the kernel to support a maximum of (approximately) -14GB of configured swap. -Only mess around with +The default of 32MB allows +the kernel to support a maximum of ~7GB of swap. +Only change this parameter if you need to greatly extend the KVM reservation for other resources such as the buffer cache or .Va kern.ipc.nmbclusters . -Modifies +Modifies kernel option .Dv VM_SWZONE_SIZE_MAX . .It Va kern.maxbcache Limits the amount of KVM reserved for use by the ==== //depot/projects/soc2007/rpaulo-macbook/conf/files#7 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1201 2007/05/04 13:29:45 rwatson Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1202 2007/05/06 10:07:20 kevlo Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1071,6 +1071,7 @@ dev/usb/if_kue.c optional kue dev/usb/if_ural.c optional ural dev/usb/if_rue.c optional rue +dev/usb/if_rum.c optional rum dev/usb/if_udav.c optional udav dev/usb/ohci.c optional ohci dev/usb/ohci_pci.c optional ohci pci ==== //depot/projects/soc2007/rpaulo-macbook/conf/options#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.586 2007/04/14 20:16:03 kmacy Exp $ +# $FreeBSD: src/sys/conf/options,v 1.587 2007/05/06 17:04:34 piso Exp $ # # On the handling of kernel options # @@ -764,3 +764,6 @@ # snd_emu10kx sound driver options SND_EMU10KX_MULTICHANNEL opt_emu10kx.h + +# Interrupt filtering +INTR_FILTER opt_global.h ==== //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/dbuf.c#2 (text+ko) ==== @@ -1178,7 +1178,8 @@ } else { ASSERT(db->db_buf != NULL); ASSERT(list_head(&dr->dt.di.dr_children) == NULL); - /* XXX - mutex and list destroy? */ + list_destroy(&dr->dt.di.dr_children); + mutex_destroy(&dr->dt.di.dr_mtx); } kmem_free(dr, sizeof (dbuf_dirty_record_t)); @@ -1925,6 +1926,10 @@ drp = &(*drp)->dr_next; ASSERT((*drp)->dr_next == NULL); *drp = NULL; + if (dr->dr_dbuf->db_level != 0) { + list_destroy(&dr->dt.di.dr_children); + mutex_destroy(&dr->dt.di.dr_mtx); + } kmem_free(dr, sizeof (dbuf_dirty_record_t)); ASSERT(db->db_dirtycnt > 0); db->db_dirtycnt -= 1; @@ -2225,6 +2230,8 @@ >> (db->db_level * epbs), >=, db->db_blkid); arc_set_callback(db->db_buf, dbuf_do_evict, db); } + list_destroy(&dr->dt.di.dr_children); + mutex_destroy(&dr->dt.di.dr_mtx); } kmem_free(dr, sizeof (dbuf_dirty_record_t)); ==== //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/dnode.c#2 (text+ko) ==== @@ -260,7 +260,6 @@ uint64_t object) { dnode_t *dn = kmem_cache_alloc(dnode_cache, KM_SLEEP); - (void) dnode_cons(dn, NULL, 0); /* XXX */ dn->dn_objset = os; dn->dn_object = object; ==== //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c#2 (text+ko) ==== @@ -445,6 +445,8 @@ } else { mutex_exit(&db->db_mtx); dnode_undirty_dbufs(&dr->dt.di.dr_children); + list_destroy(&dr->dt.di.dr_children); + mutex_destroy(&dr->dt.di.dr_mtx); } kmem_free(dr, sizeof (dbuf_dirty_record_t)); dbuf_rele(db, (void *)(uintptr_t)txg); ==== //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c#2 (text+ko) ==== @@ -129,6 +129,7 @@ txg_list_destroy(&dp->dp_dirty_datasets); txg_list_destroy(&dp->dp_dirty_dirs); + txg_list_destroy(&dp->dp_sync_tasks); list_destroy(&dp->dp_synced_objsets); arc_flush(); ==== //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c#3 (text+ko) ==== @@ -27,11 +27,13 @@ #include <sys/param.h> #include <sys/kernel.h> #include <sys/bio.h> +#include <sys/disk.h> #include <sys/spa.h> #include <sys/vdev_impl.h> #include <sys/fs/zfs.h> #include <sys/zio.h> #include <geom/geom.h> +#include <geom/geom_int.h> /* * Virtual device vector for GEOM. @@ -83,7 +85,8 @@ error = cp->provider->error; ZFS_LOG(1, "Closing access to %s.", cp->provider->name); - g_access(cp, -cp->acr, -cp->acw, -cp->ace); + if (cp->acr + cp->acw + cp->ace > 0) + g_access(cp, -cp->acr, -cp->acw, -cp->ace); ZFS_LOG(1, "Destroyed consumer to %s.", cp->provider->name); g_detach(cp); g_destroy_consumer(cp); @@ -113,8 +116,11 @@ ZFS_LOG(1, "Attaching to %s.", pp->name); /* Do we have geom already? No? Create one. */ LIST_FOREACH(gp, &zfs_vdev_class.geom, geom) { - if (!(gp->flags & G_GEOM_WITHER)) - break; + if (gp->flags & G_GEOM_WITHER) + continue; + if (strcmp(gp->name, "zfs::vdev") != 0) + continue; + break; } if (gp == NULL) { gp = g_new_geomf(&zfs_vdev_class, "zfs::vdev"); @@ -227,12 +233,125 @@ } } +static char * +vdev_geom_get_id(struct g_consumer *cp) +{ + char *id; + int len; + + g_topology_assert_not(); + len = DISK_IDENT_SIZE; + id = kmem_zalloc(len, KM_SLEEP); + if (g_io_getattr("GEOM::ident", cp, &len, id) != 0) { + kmem_free(id, DISK_IDENT_SIZE); + return (NULL); + } + return (id); +} + +static void +vdev_geom_free_id(char *id) +{ + + if (id != NULL) + kmem_free(id, DISK_IDENT_SIZE); +} + +struct vdev_geom_find { + const char *id; + int write; + struct g_consumer *cp; +}; + +static void +vdev_geom_taste_orphan(struct g_consumer *cp) +{ + + KASSERT(1 == 0, ("%s called while tasting %s.", __func__, + cp->provider->name)); +} + +static void +vdev_geom_attach_by_id_event(void *arg, int flags __unused) +{ + struct vdev_geom_find *ap; + struct g_class *mp; + struct g_geom *gp, *zgp; + struct g_provider *pp; + struct g_consumer *zcp; + char *id; + + g_topology_assert(); + + ap = arg; + + zgp = g_new_geomf(&zfs_vdev_class, "zfs::vdev::taste"); + /* This orphan function should be never called. */ + zgp->orphan = vdev_geom_taste_orphan; + zcp = g_new_consumer(zgp); + + LIST_FOREACH(mp, &g_classes, class) { + if (mp == &zfs_vdev_class) + continue; + LIST_FOREACH(gp, &mp->geom, geom) { + if (gp->flags & G_GEOM_WITHER) + continue; + LIST_FOREACH(pp, &gp->provider, provider) { + if (pp->flags & G_PF_WITHER) + continue; + g_attach(zcp, pp); + if (g_access(zcp, 1, 0, 0) != 0) { + g_detach(zcp); + continue; + } + g_topology_unlock(); + id = vdev_geom_get_id(zcp); + g_topology_lock(); + g_access(zcp, -1, 0, 0); + g_detach(zcp); + if (id == NULL || strcmp(id, ap->id) != 0) { + vdev_geom_free_id(id); + continue; + } + vdev_geom_free_id(id); + ap->cp = vdev_geom_attach(pp, ap->write); + if (ap->cp == NULL) { + printf("ZFS WARNING: Cannot open %s " + "for writting.\n", pp->name); + continue; + } + goto end; + } + } + } + ap->cp = NULL; +end: + g_destroy_consumer(zcp); + g_destroy_geom(zgp); +} + +static struct g_consumer * +vdev_geom_attach_by_id(const char *id, int write) +{ + struct vdev_geom_find *ap; + struct g_consumer *cp; + + ap = kmem_zalloc(sizeof(*ap), KM_SLEEP); + ap->id = id; + ap->write = write; + g_waitfor_event(vdev_geom_attach_by_id_event, ap, M_WAITOK, NULL); + cp = ap->cp; + kmem_free(ap, sizeof(*ap)); + return (cp); +} + static int vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift) { vdev_geom_ctx_t *ctx; struct g_provider *pp; struct g_consumer *cp; + char *id = NULL; int owned; /* @@ -245,23 +364,55 @@ if ((owned = mtx_owned(&Giant))) mtx_unlock(&Giant); + cp = NULL; g_topology_lock(); pp = g_provider_by_name(vd->vdev_path + sizeof("/dev/") - 1); - if (pp == NULL) { - g_topology_unlock(); - if (owned) - mtx_lock(&Giant); - vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL; - return (EINVAL); + if (pp != NULL) { + ZFS_LOG(1, "Found provider by name %s.", vd->vdev_path); + cp = vdev_geom_attach(pp, !!(spa_mode & FWRITE)); + if (cp != NULL && vd->vdev_devid != NULL) { + g_topology_unlock(); + id = vdev_geom_get_id(cp); + g_topology_lock(); + if (id == NULL || strcmp(id, vd->vdev_devid) != 0) { + vdev_geom_detach(cp, 0); + cp = NULL; + ZFS_LOG(1, "ID mismatch for provider %s: " + "[%s]!=[%s].", vd->vdev_path, + vd->vdev_devid, id); + goto next; + } + ZFS_LOG(1, "ID match for provider %s.", vd->vdev_path); + } } - cp = vdev_geom_attach(pp, !!(spa_mode & FWRITE)); +next: g_topology_unlock(); + vdev_geom_free_id(id); + if (cp == NULL && vd->vdev_devid != NULL) { + ZFS_LOG(0, "Searching by ID [%s].", vd->vdev_devid); + cp = vdev_geom_attach_by_id(vd->vdev_devid, + !!(spa_mode & FWRITE)); + if (cp != NULL) { + size_t len = strlen(cp->provider->name) + 6; /* 6 == strlen("/dev/") + 1 */ + char *buf = kmem_alloc(len, KM_SLEEP); + + snprintf(buf, len, "/dev/%s", cp->provider->name); + spa_strfree(vd->vdev_path); + vd->vdev_path = buf; + + ZFS_LOG(1, "Attach by ID [%s] succeeded, provider %s.", + vd->vdev_devid, vd->vdev_path); + } + } if (owned) mtx_lock(&Giant); if (cp == NULL) { + ZFS_LOG(1, "Provider %s (id=[%s]) not found.", vd->vdev_path, + vd->vdev_devid); vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; return (EACCES); } + pp = cp->provider; /* * Determine the actual size of the device. ==== //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#4 (text+ko) ==== @@ -770,11 +770,12 @@ * Perhaps we should use SPA_MAXBLOCKSIZE chunks? */ nbytes = MIN(n, max_blksz - P2PHASE(woff, max_blksz)); - rw_enter(&zp->z_map_lock, RW_READER); if (woff + nbytes > zp->z_phys->zp_size) vnode_pager_setsize(vp, woff + nbytes); + rw_enter(&zp->z_map_lock, RW_READER); + tx_bytes = uio->uio_resid; if (vn_has_cached_data(vp)) { rw_exit(&zp->z_map_lock); ==== //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c#4 (text+ko) ==== @@ -695,9 +695,6 @@ ZFS_OBJ_HOLD_EXIT(zfsvfs, z_id); } -/* - * FreeBSD: Should be called from ->vop_reclaim(). - */ void zfs_znode_free(znode_t *zp) { @@ -991,6 +988,7 @@ error = zap_add(os, moid, ZFS_ROOT_OBJ, 8, 1, &roid, tx); ASSERT(error == 0); + mutex_destroy(&zfsvfs.z_znodes_lock); kmem_cache_free(znode_cache, rootzp); } #endif /* _KERNEL */ ==== //depot/projects/soc2007/rpaulo-macbook/contrib/opensolaris/uts/common/fs/zfs/zio.c#3 (text+ko) ==== @@ -977,6 +977,8 @@ cv_broadcast(&zio->io_cv); mutex_exit(&zio->io_lock); } else { + cv_destroy(&zio->io_cv); + mutex_destroy(&zio->io_lock); kmem_cache_free(zio_cache, zio); } } ==== //depot/projects/soc2007/rpaulo-macbook/dev/acpica/acpi.c#3 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.235 2007/04/25 16:22:18 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.236 2007/05/08 14:31:49 marks Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -331,14 +331,14 @@ if (device_find_child(parent, "acpi", 0) != NULL) return_VOID; + snprintf(acpi_ca_version, sizeof(acpi_ca_version), "%x", ACPI_CA_VERSION); + /* Initialize root tables. */ if (ACPI_FAILURE(acpi_Startup())) { printf("ACPI: Try disabling either ACPI or apic support.\n"); return_VOID; } - snprintf(acpi_ca_version, sizeof(acpi_ca_version), "%x", ACPI_CA_VERSION); - /* Attach the actual ACPI device. */ if ((child = BUS_ADD_CHILD(parent, 10, "acpi", 0)) == NULL) { device_printf(parent, "device_identify failed\n"); ==== //depot/projects/soc2007/rpaulo-macbook/dev/ata/ata-disk.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.202 2007/04/26 12:59:20 roberto Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.203 2007/05/06 01:20:06 pjd Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -161,6 +161,8 @@ adp->disk->d_unit = device_get_unit(dev); if (atadev->param.support.command2 & ATA_SUPPORT_FLUSHCACHE) adp->disk->d_flags = DISKFLAG_CANFLUSHCACHE; + snprintf(adp->disk->d_ident, sizeof(adp->disk->d_ident), "ad:%s", + atadev->param.serial); disk_create(adp->disk, DISK_VERSION); device_add_child(dev, "subdisk", device_get_unit(dev)); ad_firmware_geom_adjust(dev, adp->disk); ==== //depot/projects/soc2007/rpaulo-macbook/dev/bce/if_bce.c#2 (text) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006 Broadcom Corporation + * Copyright (c) 2006-2007 Broadcom Corporation * David Christensen <davidch@broadcom.com>. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,20 +29,18 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.29 2007/03/04 03:38:06 csjp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.30 2007/05/04 23:14:19 davidch Exp $"); /* * The following controllers are supported by this driver: * BCM5706C A2, A3 - * BCM5708C B1 + * BCM5708C B1, B2 * * The following controllers are not supported by this driver: - * (These are not "Production" versions of the controller.) - * * BCM5706C A0, A1 * BCM5706S A0, A1, A2, A3 * BCM5708C A0, B0 - * BCM5708S A0, B0, B1 + * BCM5708S A0, B0, B1, B2 */ #include "opt_bce.h" @@ -51,12 +49,6 @@ #include <dev/bce/if_bcefw.h> /****************************************************************************/ -/* BCE Driver Version */ -/****************************************************************************/ -char bce_driver_version[] = "v0.9.6"; - - -/****************************************************************************/ /* BCE Debug Options */ /****************************************************************************/ #ifdef BCE_DEBUG @@ -416,11 +408,10 @@ return(ENOMEM); /* Print out the device identity. */ - snprintf(descbuf, BCE_DEVDESC_MAX, "%s (%c%d), %s", + snprintf(descbuf, BCE_DEVDESC_MAX, "%s (%c%d)", t->bce_name, (((pci_read_config(dev, PCIR_REVID, 4) & 0xf0) >> 4) + 'A'), - (pci_read_config(dev, PCIR_REVID, 4) & 0xf), - bce_driver_version); + (pci_read_config(dev, PCIR_REVID, 4) & 0xf)); device_set_desc_copy(dev, descbuf); free(descbuf, M_TEMP); @@ -473,7 +464,7 @@ RF_ACTIVE | PCI_RF_DENSE); /* flags */ if (sc->bce_res == NULL) { - BCE_PRINTF(sc, "%s(%d): PCI memory allocation failed\n", + BCE_PRINTF("%s(%d): PCI memory allocation failed\n", __FILE__, __LINE__); rc = ENXIO; goto bce_attach_fail; @@ -495,7 +486,7 @@ RF_SHAREABLE | RF_ACTIVE); if (sc->bce_irq == NULL) { - BCE_PRINTF(sc, "%s(%d): PCI map interrupt failed\n", + BCE_PRINTF("%s(%d): PCI map interrupt failed\n", __FILE__, __LINE__); rc = ENXIO; goto bce_attach_fail; @@ -523,7 +514,7 @@ case BCE_CHIP_ID_5706_A1: case BCE_CHIP_ID_5708_A0: case BCE_CHIP_ID_5708_B0: - BCE_PRINTF(sc, "%s(%d): Unsupported controller revision (%c%d)!\n", + BCE_PRINTF("%s(%d): Unsupported controller revision (%c%d)!\n", __FILE__, __LINE__, (((pci_read_config(dev, PCIR_REVID, 4) & 0xf0) >> 4) + 'A'), (pci_read_config(dev, PCIR_REVID, 4) & 0xf)); @@ -603,7 +594,7 @@ if (val & BCE_PCICFG_MISC_STATUS_32BIT_DET) sc->bce_flags |= BCE_PCI_32BIT_FLAG; - BCE_PRINTF(sc, "ASIC ID 0x%08X; Revision (%c%d); PCI%s %s %dMHz\n", + BCE_PRINTF("ASIC ID 0x%08X; Revision (%c%d); PCI%s %s %dMHz\n", sc->bce_chipid, ((BCE_CHIP_ID(sc) & 0xf000) >> 12) + 'A', ((BCE_CHIP_ID(sc) & 0x0ff0) >> 4), @@ -619,7 +610,7 @@ /* Initialize the controller. */ if (bce_chipinit(sc)) { - BCE_PRINTF(sc, "%s(%d): Controller initialization failed!\n", + BCE_PRINTF("%s(%d): Controller initialization failed!\n", __FILE__, __LINE__); rc = ENXIO; goto bce_attach_fail; @@ -627,7 +618,7 @@ /* Perform NVRAM test. */ if (bce_nvram_test(sc)) { - BCE_PRINTF(sc, "%s(%d): NVRAM test failed!\n", + BCE_PRINTF("%s(%d): NVRAM test failed!\n", __FILE__, __LINE__); rc = ENXIO; goto bce_attach_fail; @@ -693,7 +684,7 @@ /* Allocate DMA memory resources. */ if (bce_dma_alloc(dev)) { - BCE_PRINTF(sc, "%s(%d): DMA resource allocation failed!\n", + BCE_PRINTF("%s(%d): DMA resource allocation failed!\n", __FILE__, __LINE__); rc = ENXIO; goto bce_attach_fail; @@ -702,7 +693,7 @@ /* Allocate an ifnet structure. */ ifp = sc->bce_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - BCE_PRINTF(sc, "%s(%d): Interface allocation failed!\n", + BCE_PRINTF("%s(%d): Interface allocation failed!\n", __FILE__, __LINE__); rc = ENXIO; goto bce_attach_fail; @@ -738,7 +729,7 @@ /* Look for our PHY. */ if (mii_phy_probe(dev, &sc->bce_miibus, bce_ifmedia_upd, bce_ifmedia_sts)) { - BCE_PRINTF(sc, "%s(%d): PHY probe failed!\n", + BCE_PRINTF("%s(%d): PHY probe failed!\n", __FILE__, __LINE__); rc = ENXIO; goto bce_attach_fail; @@ -758,7 +749,7 @@ bce_intr, sc, &sc->bce_intrhand); if (rc) { - BCE_PRINTF(sc, "%s(%d): Failed to setup IRQ!\n", + BCE_PRINTF("%s(%d): Failed to setup IRQ!\n", __FILE__, __LINE__); bce_detach(dev); goto bce_attach_exit; @@ -771,9 +762,9 @@ bce_add_sysctls(sc); /* Get the firmware running so IPMI still works */ - BCE_LOCK(sc); + BCE_LOCK(sc); bce_mgmt_init_locked(sc); - BCE_UNLOCK(sc); + BCE_UNLOCK(sc); goto bce_attach_exit; @@ -984,7 +975,7 @@ } if (val & BCE_EMAC_MDIO_COMM_START_BUSY) { - BCE_PRINTF(sc, "%s(%d): Error: PHY read timeout! phy = %d, reg = 0x%04X\n", + BCE_PRINTF("%s(%d): Error: PHY read timeout! phy = %d, reg = 0x%04X\n", __FILE__, __LINE__, phy, reg); val = 0x0; } else { @@ -1061,7 +1052,7 @@ } if (val1 & BCE_EMAC_MDIO_COMM_START_BUSY) - BCE_PRINTF(sc, "%s(%d): PHY write timeout!\n", + BCE_PRINTF("%s(%d): PHY write timeout!\n", __FILE__, __LINE__); if (sc->bce_phy_flags & BCE_PHY_INT_MODE_AUTO_POLLING_FLAG) { @@ -1415,7 +1406,7 @@ /* Check for errors. */ if (i >= NVRAM_TIMEOUT_COUNT) { - BCE_PRINTF(sc, "%s(%d): Timeout error reading NVRAM at offset 0x%08X!\n", + BCE_PRINTF("%s(%d): Timeout error reading NVRAM at offset 0x%08X!\n", __FILE__, __LINE__, offset); rc = EBUSY; } @@ -1471,7 +1462,7 @@ break; } if (j >= NVRAM_TIMEOUT_COUNT) { - BCE_PRINTF(sc, "%s(%d): Timeout error writing NVRAM at offset 0x%08X\n", + BCE_PRINTF("%s(%d): Timeout error writing NVRAM at offset 0x%08X\n", __FILE__, __LINE__, offset); >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705081648.l48GmtLi001694>