Date: Fri, 20 Jul 2007 19:00:18 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 123819 for review Message-ID: <200707201900.l6KJ0Ijm012946@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=123819 Change 123819 by peter@peter_daintree on 2007/07/20 18:59:32 IFC @123810 Affected files ... .. //depot/projects/hammer/release/doc/en_US.ISO8859-1/relnotes/article.sgml#12 integrate .. //depot/projects/hammer/sys/fs/coda/coda_vfsops.c#2 integrate .. //depot/projects/hammer/sys/fs/coda/coda_vnops.c#2 integrate .. //depot/projects/hammer/sys/fs/msdosfs/msdosfs_fat.c#8 integrate .. //depot/projects/hammer/sys/fs/msdosfs/msdosfs_vnops.c#29 integrate .. //depot/projects/hammer/sys/i386/linux/linux_machdep.c#27 integrate .. //depot/projects/hammer/sys/kern/kern_rwlock.c#11 integrate .. //depot/projects/hammer/sys/kern/tty.c#55 integrate .. //depot/projects/hammer/sys/net80211/ieee80211_scan_sta.c#4 integrate .. //depot/projects/hammer/sys/sys/rwlock.h#9 integrate Differences ... ==== //depot/projects/hammer/release/doc/en_US.ISO8859-1/relnotes/article.sgml#12 (text+ko) ==== @@ -30,7 +30,7 @@ <corpauthor>The &os; Project</corpauthor> - <pubdate>$FreeBSD: src/release/doc/en_US.ISO8859-1/relnotes/article.sgml,v 1.1051 2007/07/15 01:59:35 delphij Exp $</pubdate> + <pubdate>$FreeBSD: src/release/doc/en_US.ISO8859-1/relnotes/article.sgml,v 1.1052 2007/07/20 15:48:02 bmah Exp $</pubdate> <copyright> <year>2000</year> @@ -416,9 +416,14 @@ performance improvements.</para> <para>The ULE process scheduler has been revised to improve its - behavior, in particular interactivity under load. This - implementation can commonly be referred to as <quote>ULE - 2.0</quote>.</para> + behavior, in particular interactivity under load, for both + uniprocessor and multiprocessor machines. This + implementation has commonly been referred to as <quote>ULE + 3.0</quote>. (ULE 3.0 was formerly known as SCHED_SMP, + which in turn was based on version 2.0 of the ULE scheduler. + ULE 2.0 was never a part of any &os; release, however it + was the subject of many development, testing, and + benchmarking efforts.)</para> <para>The <literal>SIGCHLD</literal> signal queuing has been added. For each child process whose status has been changed, @@ -836,6 +841,9 @@ <filename role="package">net/iwi-firmware</filename> port/package. &merged;</para> + <para>The ixgbe driver, which supports the Intel 10G PCI-Express + adapter (82598), has been added.</para> + <para>The &man.le.4; driver, which supports AMD Am7900 LANCE and Am79C9xx PCnet NICs, has been added. While the &man.lnc.4; driver also supports these @@ -938,6 +946,14 @@ cards, as well as quarter- and half-channel support for 802.11a. &merged;</para> + <para>ISDN4BSD, &man.ng.h4.4;, and netatm have been temporarily + disconnected from the build. These modules all require + the Giant kernel lock for their operation; disconnecting + them allows the removal of the NET_NEEDS_GIANT compatability + shim and allows the &os; network stack to run completely + without the Giant kernel lock. It is planned to convert + these modules to fine-grained kernel locking and re-connect + them for &os; 7.1-RELEASE.</para> </sect4> </sect3> ==== //depot/projects/hammer/sys/fs/coda/coda_vfsops.c#2 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/fs/coda/coda_vfsops.c,v 1.66 2007/07/12 21:04:57 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/fs/coda/coda_vfsops.c,v 1.67 2007/07/20 11:14:51 rwatson Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -227,6 +227,7 @@ printf("coda_unmount: ROOT: vp %p, cp %p\n", mi->mi_rootvp, VTOC(mi->mi_rootvp)); #endif vrele(mi->mi_rootvp); + vrele(coda_ctlvp); active = coda_kill(vfsp, NOT_DOWNCALL); ASSERT_VOP_LOCKED(mi->mi_rootvp, "coda_unmount"); mi->mi_rootvp->v_vflag &= ~VV_ROOT; ==== //depot/projects/hammer/sys/fs/coda/coda_vnops.c#2 (text+ko) ==== @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/fs/coda/coda_vnops.c,v 1.75 2007/07/12 21:04:57 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/fs/coda/coda_vnops.c,v 1.76 2007/07/20 11:14:51 rwatson Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -745,11 +745,6 @@ /* We don't need to send inactive to venus - DCS */ MARK_ENTRY(CODA_INACTIVE_STATS); - if (IS_CTL_VP(vp)) { - MARK_INT_SAT(CODA_INACTIVE_STATS); - return 0; - } - CODADEBUG(CODA_INACTIVE, myprintf(("in inactive, %s, vfsp %p\n", coda_f2s(&cp->c_fid), vp->v_mount));) ==== //depot/projects/hammer/sys/fs/msdosfs/msdosfs_fat.c#8 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/fs/msdosfs/msdosfs_fat.c,v 1.41 2007/07/12 16:09:07 bde Exp $ */ +/* $FreeBSD: src/sys/fs/msdosfs/msdosfs_fat.c,v 1.42 2007/07/20 16:21:47 bde Exp $ */ /* $NetBSD: msdosfs_fat.c,v 1.28 1997/11/17 15:36:49 ws Exp $ */ /*- @@ -1105,7 +1105,7 @@ else bp->b_blkno = blkno; } - clrbuf(bp); + vfs_bio_clrbuf(bp); if (bpp) { *bpp = bp; bpp = NULL; ==== //depot/projects/hammer/sys/fs/msdosfs/msdosfs_vnops.c#29 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/fs/msdosfs/msdosfs_vnops.c,v 1.170 2007/06/12 00:11:58 rwatson Exp $ */ +/* $FreeBSD: src/sys/fs/msdosfs/msdosfs_vnops.c,v 1.172 2007/07/20 17:06:57 bde Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ /*- @@ -579,6 +579,9 @@ if (uio->uio_offset >= dep->de_FileSize) break; lbn = de_cluster(pmp, uio->uio_offset); + rablock = lbn + 1; + blsize = pmp->pm_bpcluster; + on = uio->uio_offset & pmp->pm_crbomask; /* * If we are operating on a directory file then be sure to * do i/o with the vnode for the filesystem instead of the @@ -593,23 +596,22 @@ } else if (error) break; error = bread(pmp->pm_devvp, lbn, blsize, NOCRED, &bp); + } else if (de_cn2off(pmp, rablock) >= dep->de_FileSize) { + error = bread(vp, lbn, blsize, NOCRED, &bp); + } else if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { + error = cluster_read(vp, dep->de_FileSize, lbn, blsize, + NOCRED, on + uio->uio_resid, seqcount, &bp); + } else if (seqcount > 1) { + rasize = blsize; + error = breadn(vp, lbn, + blsize, &rablock, &rasize, 1, NOCRED, &bp); } else { - blsize = pmp->pm_bpcluster; - rablock = lbn + 1; - if (seqcount > 1 && - de_cn2off(pmp, rablock) < dep->de_FileSize) { - rasize = pmp->pm_bpcluster; - error = breadn(vp, lbn, blsize, - &rablock, &rasize, 1, NOCRED, &bp); - } else { - error = bread(vp, lbn, blsize, NOCRED, &bp); - } + error = bread(vp, lbn, blsize, NOCRED, &bp); } if (error) { brelse(bp); break; } - on = uio->uio_offset & pmp->pm_crbomask; diff = pmp->pm_bpcluster - on; n = diff > uio->uio_resid ? uio->uio_resid : diff; diff = dep->de_FileSize - uio->uio_offset; @@ -645,6 +647,7 @@ u_long osize; int error = 0; u_long count; + int seqcount; daddr_t bn, lastcn; struct buf *bp; int ioflag = ap->a_ioflag; @@ -730,6 +733,7 @@ } else lastcn = de_clcount(pmp, osize) - 1; + seqcount = ioflag >> IO_SEQSHIFT; do { if (de_cluster(pmp, uio->uio_offset) > lastcn) { error = ENOSPC; @@ -755,7 +759,7 @@ * then no need to read data from disk. */ bp = getblk(thisvp, bn, pmp->pm_bpcluster, 0, 0, 0); - clrbuf(bp); + vfs_bio_clrbuf(bp); /* * Do the bmap now, since pcbmap needs buffers * for the fat table. (see msdosfs_strategy) @@ -798,18 +802,31 @@ break; } + /* Prepare for clustered writes in some else clauses. */ + if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) + bp->b_flags |= B_CLUSTEROK; + /* - * If they want this synchronous then write it and wait for - * it. Otherwise, if on a cluster boundary write it - * asynchronously so we can move on to the next block - * without delay. Otherwise do a delayed write because we - * may want to write somemore into the block later. + * If IO_SYNC, then each buffer is written synchronously. + * Otherwise, if we have a severe page deficiency then + * write the buffer asynchronously. Otherwise, if on a + * cluster boundary then write the buffer asynchronously, + * combining it with contiguous clusters if permitted and + * possible, since we don't expect more writes into this + * buffer soon. Otherwise, do a delayed write because we + * expect more writes into this buffer soon. */ if (ioflag & IO_SYNC) - (void) bwrite(bp); - else if (n + croffset == pmp->pm_bpcluster) + (void)bwrite(bp); + else if (vm_page_count_severe() || buf_dirty_count_severe()) bawrite(bp); - else + else if (n + croffset == pmp->pm_bpcluster) { + if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) + cluster_write(vp, bp, dep->de_FileSize, + seqcount); + else + bawrite(bp); + } else bdwrite(bp); dep->de_flag |= DE_UPDATE; } while (error == 0 && uio->uio_resid > 0); @@ -1755,12 +1772,16 @@ return (error); } -/* - * vp - address of vnode file the file - * bn - which cluster we are interested in mapping to a filesystem block number. - * vpp - returns the vnode for the block special file holding the filesystem - * containing the file of interest - * bnp - address of where to return the filesystem relative block number +/*- + * a_vp - pointer to the file's vnode + * a_bn - logical block number within the file (cluster number for us) + * a_bop - where to return the bufobj of the special file containing the fs + * a_bnp - where to return the "physical" block number corresponding to a_bn + * (relative to the special file; units are blocks of size DEV_BSIZE) + * a_runp - where to return the "run past" a_bn. This is the count of logical + * blocks whose physical blocks (together with a_bn's physical block) + * are contiguous. + * a_runb - where to return the "run before" a_bn. */ static int msdosfs_bmap(ap) @@ -1773,26 +1794,54 @@ int *a_runb; } */ *ap; { - struct denode *dep = VTODE(ap->a_vp); - daddr_t blkno; - int error; + struct denode *dep; + struct mount *mp; + struct msdosfsmount *pmp; + struct vnode *vp; + daddr_t runbn; + u_long cn; + int bnpercn, error, maxio, maxrun, run; + vp = ap->a_vp; + dep = VTODE(vp); + pmp = dep->de_pmp; if (ap->a_bop != NULL) - *ap->a_bop = &dep->de_pmp->pm_devvp->v_bufobj; + *ap->a_bop = &pmp->pm_devvp->v_bufobj; if (ap->a_bnp == NULL) return (0); - if (ap->a_runp) { - /* - * Sequential clusters should be counted here. - */ + if (ap->a_runp != NULL) *ap->a_runp = 0; + if (ap->a_runb != NULL) + *ap->a_runb = 0; + cn = ap->a_bn; + if (cn != ap->a_bn) + return (EFBIG); + error = pcbmap(dep, cn, ap->a_bnp, NULL, NULL); + if (error != 0 || (ap->a_runp == NULL && ap->a_runb == NULL)) + return (error); + + mp = vp->v_mount; + maxio = mp->mnt_iosize_max / mp->mnt_stat.f_iosize; + bnpercn = de_cn2bn(pmp, 1); + if (ap->a_runp != NULL) { + maxrun = ulmin(maxio - 1, pmp->pm_maxcluster - cn); + for (run = 1; run <= maxrun; run++) { + if (pcbmap(dep, cn + run, &runbn, NULL, NULL) != 0 || + runbn != *ap->a_bnp + run * bnpercn) + break; + } + *ap->a_runp = run - 1; } - if (ap->a_runb) { - *ap->a_runb = 0; + if (ap->a_runb != NULL) { + maxrun = ulmin(maxio - 1, cn); + for (run = 1; run < maxrun; run++) { + if (pcbmap(dep, cn - run, &runbn, NULL, NULL) != 0 || + runbn != *ap->a_bnp - run * bnpercn) + break; + } + *ap->a_runb = run - 1; } - error = pcbmap(dep, ap->a_bn, &blkno, 0, 0); - *ap->a_bnp = blkno; - return (error); + return (0); } static int ==== //depot/projects/hammer/sys/i386/linux/linux_machdep.c#27 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/i386/linux/linux_machdep.c,v 1.77 2007/07/04 23:06:43 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/linux/linux_machdep.c,v 1.78 2007/07/20 08:35:18 attilio Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -846,9 +846,7 @@ iia.start = args->start; iia.length = args->length; iia.enable = args->enable; - mtx_lock(&Giant); error = i386_set_ioperm(td, &iia); - mtx_unlock(&Giant); return (error); } @@ -884,10 +882,8 @@ ldt.start = 0; ldt.descs = uap->ptr; ldt.num = uap->bytecount / sizeof(union descriptor); - mtx_lock(&Giant); error = i386_get_ldt(td, &ldt); td->td_retval[0] *= sizeof(union descriptor); - mtx_unlock(&Giant); break; case 0x01: /* write_ldt */ case 0x11: /* write_ldt */ @@ -912,9 +908,7 @@ desc.sd.sd_xx = 0; desc.sd.sd_def32 = ld.seg_32bit; desc.sd.sd_gran = ld.limit_in_pages; - mtx_lock(&Giant); error = i386_set_ldt(td, &ldt, &desc); - mtx_unlock(&Giant); break; default: error = EINVAL; ==== //depot/projects/hammer/sys/kern/kern_rwlock.c#11 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_rwlock.c,v 1.27 2007/06/26 21:31:56 attilio Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_rwlock.c,v 1.28 2007/07/20 08:43:41 attilio Exp $"); #include "opt_ddb.h" #include "opt_no_adaptive_rwlocks.h" @@ -45,7 +45,7 @@ #include <sys/rwlock.h> #include <sys/systm.h> #include <sys/turnstile.h> -#include <sys/lock_profile.h> + #include <machine/cpu.h> CTASSERT((RW_RECURSE & LO_CLASSFLAGS) == RW_RECURSE); @@ -221,8 +221,10 @@ #ifdef ADAPTIVE_RWLOCKS volatile struct thread *owner; #endif +#ifdef LOCK_PROFILING_SHARED uint64_t waittime = 0; int contested = 0; +#endif uintptr_t x; KASSERT(rw->rw_lock != RW_DESTROYED, @@ -265,22 +267,22 @@ MPASS((x & RW_LOCK_READ_WAITERS) == 0); if (atomic_cmpset_acq_ptr(&rw->rw_lock, x, x + RW_ONE_READER)) { +#ifdef LOCK_PROFILING_SHARED + if (RW_READERS(x) == 0) + lock_profile_obtain_lock_success( + &rw->lock_object, contested, + waittime, file, line); +#endif if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR4(KTR_LOCK, "%s: %p succeed %p -> %p", __func__, rw, (void *)x, (void *)(x + RW_ONE_READER)); - if (RW_READERS(x) == 0) - lock_profile_obtain_lock_success( - &rw->lock_object, contested, waittime, - file, line); break; } cpu_spinwait(); continue; } - lock_profile_obtain_lock_failed(&rw->lock_object, &contested, - &waittime); /* * Okay, now it's the hard case. Some other thread already @@ -331,6 +333,10 @@ if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR3(KTR_LOCK, "%s: spinning on %p held by %p", __func__, rw, owner); +#ifdef LOCK_PROFILING_SHARED + lock_profile_obtain_lock_failed(&rw->lock_object, + &contested, &waittime); +#endif while ((struct thread*)RW_OWNER(rw->rw_lock)== owner && TD_IS_RUNNING(owner)) cpu_spinwait(); @@ -345,6 +351,10 @@ if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p blocking on turnstile", __func__, rw); +#ifdef LOCK_PROFILING_SHARED + lock_profile_obtain_lock_failed(&rw->lock_object, &contested, + &waittime); +#endif turnstile_wait(ts, rw_owner(rw), TS_SHARED_QUEUE); if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p resuming from turnstile", @@ -403,6 +413,9 @@ */ KASSERT(!(x & RW_LOCK_READ_WAITERS), ("%s: waiting readers", __func__)); +#ifdef LOCK_PROFILING_SHARED + lock_profile_release_lock(&rw->lock_object); +#endif /* * If there aren't any waiters for a write lock, then try @@ -479,7 +492,6 @@ turnstile_chain_unlock(&rw->lock_object); break; } - lock_profile_release_lock(&rw->lock_object); } /* @@ -494,7 +506,9 @@ #ifdef ADAPTIVE_RWLOCKS volatile struct thread *owner; #endif + uint64_t waittime = 0; uintptr_t v; + int contested = 0; if (rw_wlocked(rw)) { KASSERT(rw->lock_object.lo_flags & RW_RECURSE, @@ -578,6 +592,8 @@ if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR3(KTR_LOCK, "%s: spinning on %p held by %p", __func__, rw, owner); + lock_profile_obtain_lock_failed(&rw->lock_object, + &contested, &waittime); while ((struct thread*)RW_OWNER(rw->rw_lock)== owner && TD_IS_RUNNING(owner)) cpu_spinwait(); @@ -592,11 +608,15 @@ if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p blocking on turnstile", __func__, rw); + lock_profile_obtain_lock_failed(&rw->lock_object, &contested, + &waittime); turnstile_wait(ts, rw_owner(rw), TS_EXCLUSIVE_QUEUE); if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p resuming from turnstile", __func__, rw); } + lock_profile_obtain_lock_success(&rw->lock_object, contested, waittime, + file, line); } /* ==== //depot/projects/hammer/sys/kern/tty.c#55 (text+ko) ==== @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/tty.c,v 1.272 2007/07/01 00:17:59 jeff Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/tty.c,v 1.273 2007/07/20 09:41:54 kib Exp $"); #include "opt_compat.h" #include "opt_tty.h" ==== //depot/projects/hammer/sys/net80211/ieee80211_scan_sta.c#4 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_scan_sta.c,v 1.3 2007/07/12 17:22:43 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_scan_sta.c,v 1.4 2007/07/20 11:38:12 sephe Exp $"); /* * IEEE 802.11 station scanning support. @@ -376,17 +376,23 @@ break; c = ieee80211_find_channel(ic, freq[i], modeflags); - if (c == NULL || isexcluded(ic, c)) + if (c != NULL && isexcluded(ic, c)) continue; if (mode == IEEE80211_MODE_AUTO) { /* * XXX special-case 11b/g channels so we select - * the g channel if both are present. + * the g channel if both are present or there + * are only g channels. */ - if (IEEE80211_IS_CHAN_B(c) && - (cg = find11gchannel(ic, i, c->ic_freq)) != NULL) - c = cg; + if (c == NULL || IEEE80211_IS_CHAN_B(c)) { + cg = find11gchannel(ic, i, freq[i]); + if (cg != NULL) + c = cg; + } } + if (c == NULL) + continue; + ss->ss_chans[ss->ss_last++] = c; } #undef N ==== //depot/projects/hammer/sys/sys/rwlock.h#9 (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/sys/rwlock.h,v 1.13 2007/06/26 21:31:56 attilio Exp $ + * $FreeBSD: src/sys/sys/rwlock.h,v 1.14 2007/07/20 08:43:42 attilio Exp $ */ #ifndef _SYS_RWLOCK_H_ @@ -34,6 +34,7 @@ #include <sys/_lock.h> #include <sys/_rwlock.h> +#include <sys/lock_profile.h> #ifdef _KERNEL #include <sys/pcpu.h> @@ -98,18 +99,14 @@ */ /* Acquire a write lock. */ -#define __rw_wlock(rw, tid, file, line) do { \ +#define __rw_wlock(rw, tid, file, line) do { \ uintptr_t _tid = (uintptr_t)(tid); \ - int contested = 0; \ - uint64_t waitstart = 0; \ \ - if (!_rw_write_lock((rw), _tid)) { \ - lock_profile_obtain_lock_failed(&(rw)->lock_object, \ - &contested, &waitstart); \ + if (!_rw_write_lock((rw), _tid)) \ _rw_wlock_hard((rw), _tid, (file), (line)); \ - } \ - lock_profile_obtain_lock_success(&(rw)->lock_object, contested, \ - waitstart, (file), (line)); \ + else \ + lock_profile_obtain_lock_success(&(rw)->lock_object, 0, \ + 0, (file), (line)); \ } while (0) /* Release a write lock. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707201900.l6KJ0Ijm012946>