From owner-p4-projects@FreeBSD.ORG Sat Aug 7 02:34:01 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8207D16A4D0; Sat, 7 Aug 2004 02:34:01 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5BA4816A4CE for ; Sat, 7 Aug 2004 02:34:01 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E7A343D31 for ; Sat, 7 Aug 2004 02:34:01 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i772Y1cu039298 for ; Sat, 7 Aug 2004 02:34:01 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i772Y0dM039295 for perforce@freebsd.org; Sat, 7 Aug 2004 02:34:00 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 7 Aug 2004 02:34:00 GMT Message-Id: <200408070234.i772Y0dM039295@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Subject: PERFORCE change 59044 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2004 02:34:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=59044 Change 59044 by rwatson@rwatson_paprika on 2004/08/07 02:33:01 Integrate netperf_socket from FreeBSD CVS: ath driver grabs Giant before entering 802.11? Loop back i386 system call tracing with KTR. Loop back fcntl() Giant pushdown. Loop back uidinfo lock narrowing in chgsbsize(). Loop back thread_exit() KTR trace enhancement. Loop back additional VFS Giant assertions, Giant narrowing in fdesc ops on vnodes. Loop back KTR_UMA, KTR_CALLOUT definitions. Loop back KTR UMA tracing. Loop back KTR callout/timeout tracing. Affected files ... .. //depot/projects/netperf_socket/sys/arm/arm/pmap.c#8 integrate .. //depot/projects/netperf_socket/sys/dev/ata/ata-lowlevel.c#13 integrate .. //depot/projects/netperf_socket/sys/dev/ath/if_ath.c#8 integrate .. //depot/projects/netperf_socket/sys/dev/fb/splash_pcx.c#3 integrate .. //depot/projects/netperf_socket/sys/i386/i386/trap.c#6 integrate .. //depot/projects/netperf_socket/sys/kern/kern_descrip.c#14 integrate .. //depot/projects/netperf_socket/sys/kern/kern_resource.c#11 integrate .. //depot/projects/netperf_socket/sys/kern/kern_thread.c#21 integrate .. //depot/projects/netperf_socket/sys/kern/kern_timeout.c#7 integrate .. //depot/projects/netperf_socket/sys/kern/vfs_vnops.c#9 integrate .. //depot/projects/netperf_socket/sys/net/if_sl.c#10 integrate .. //depot/projects/netperf_socket/sys/powerpc/include/cpufunc.h#3 integrate .. //depot/projects/netperf_socket/sys/sys/ktr.h#2 integrate .. //depot/projects/netperf_socket/sys/vm/uma_core.c#13 integrate Differences ... ==== //depot/projects/netperf_socket/sys/arm/arm/pmap.c#8 (text+ko) ==== @@ -144,7 +144,7 @@ */ /* Include header files */ #include -__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.10 2004/08/04 22:03:15 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.11 2004/08/06 22:32:53 cognet Exp $"); #include #include #include @@ -1103,8 +1103,8 @@ * Pool cache constructors for L2 descriptor tables, metadata and pmap * structures. */ -static void -pmap_l2ptp_ctor(void *mem, int size, void *arg) +static int +pmap_l2ptp_ctor(void *mem, int size, void *arg, int flags) { #ifndef PMAP_INCLUDE_PTE_SYNC struct l2_bucket *l2b; @@ -1136,6 +1136,7 @@ memset(mem, 0, L2_TABLE_SIZE_REAL); PTE_SYNC_RANGE(mem, L2_TABLE_SIZE_REAL / sizeof(pt_entry_t)); + return (0); } /* ==== //depot/projects/netperf_socket/sys/dev/ata/ata-lowlevel.c#13 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.41 2004/08/05 21:13:41 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-lowlevel.c,v 1.42 2004/08/06 22:23:53 njl Exp $"); #include "opt_ata.h" #include @@ -295,7 +295,7 @@ } /* request finish here */ - if (ch->dma->flags & ATA_DMA_LOADED) + if (request->flags & ATA_R_DMA && ch->dma->flags & ATA_DMA_LOADED) ch->dma->unload(ch); return ATA_OP_FINISHED; } ==== //depot/projects/netperf_socket/sys/dev/ath/if_ath.c#8 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.55 2004/08/01 23:58:04 mlaier Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.56 2004/08/07 00:45:05 sam Exp $"); /* * Driver for the Atheros Wireless LAN controller. @@ -532,7 +532,9 @@ * machine will drop us into scanning after timing * out waiting for a probe response. */ + NET_LOCK_GIANT(); ieee80211_new_state(ic, IEEE80211_S_ASSOC, -1); + NET_UNLOCK_GIANT(); } } @@ -1662,6 +1664,8 @@ u_int phyerr; HAL_STATUS status; + NET_LOCK_GIANT(); /* XXX */ + DPRINTF(ATH_DEBUG_RX_PROC, ("%s: pending %u\n", __func__, npending)); do { bf = TAILQ_FIRST(&sc->sc_rxbuf); @@ -1815,6 +1819,8 @@ ath_hal_rxmonitor(ah); /* rx signal state monitoring */ ath_hal_rxena(ah); /* in case of RXEOL */ + + NET_UNLOCK_GIANT(); /* XXX */ #undef PA2DESC } ==== //depot/projects/netperf_socket/sys/dev/fb/splash_pcx.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/fb/splash_pcx.c,v 1.7 2004/08/06 20:37:08 des Exp $ + * $FreeBSD: src/sys/dev/fb/splash_pcx.c,v 1.8 2004/08/06 21:35:51 des Exp $ */ #include @@ -40,224 +40,232 @@ #include #include -#define FADE_TIMEOUT 300 /* sec */ - static int splash_mode = -1; static int splash_on = FALSE; static int pcx_start(video_adapter_t *adp); static int pcx_end(video_adapter_t *adp); static int pcx_splash(video_adapter_t *adp, int on); -static int pcx_init(char *data, int sdepth); +static int pcx_init(void *data, int sdepth); static int pcx_draw(video_adapter_t *adp); static splash_decoder_t pcx_decoder = { - "splash_pcx", pcx_start, pcx_end, pcx_splash, SPLASH_IMAGE, + .name = "splash_pcx", + .init = pcx_start, + .term = pcx_end, + .splash = pcx_splash, + .data_type = SPLASH_IMAGE, }; SPLASH_DECODER(splash_pcx, pcx_decoder); -static struct -{ - int width, height, bpsl; - int bpp, planes, zlen; - const u_char *zdata; - u_char *palette; +static struct { + int width; + int height; + int bpsl; + int bpp; + int planes; + int zlen; + const uint8_t *zdata; + uint8_t *palette; } pcx_info; -static int +static int pcx_start(video_adapter_t *adp) { - static int modes[] = { - M_VGA_CG320, - M_VESA_CG640x480, - M_VESA_CG800x600, - M_VESA_CG1024x768, - -1, - }; - video_info_t info; - int i; + static int modes[] = { + M_VGA_CG320, + M_VESA_CG640x480, + M_VESA_CG800x600, + M_VESA_CG1024x768, + -1, + }; + video_info_t info; + int i; + + if (pcx_decoder.data == NULL || + pcx_decoder.data_size <= 0 || + pcx_init(pcx_decoder.data, pcx_decoder.data_size)) + return (ENODEV); + + if (bootverbose) + printf("splash_pcx: image good:\n" + " width = %d\n" + " height = %d\n" + " depth = %d\n" + " planes = %d\n", + pcx_info.width, pcx_info.height, + pcx_info.bpp, pcx_info.planes); - if (pcx_decoder.data == NULL - || pcx_decoder.data_size <= 0 - || pcx_init((u_char *)pcx_decoder.data, pcx_decoder.data_size)) - return ENODEV; + for (i = 0; modes[i] >= 0; ++i) { + if (get_mode_info(adp, modes[i], &info) != 0) + continue; + if (bootverbose) + printf("splash_pcx: considering mode %d:\n" + " vi_width = %d\n" + " vi_height = %d\n" + " vi_depth = %d\n" + " vi_planes = %d\n", + modes[i], + info.vi_width, info.vi_height, + info.vi_depth, info.vi_planes); + if (info.vi_width >= pcx_info.width + && info.vi_height >= pcx_info.height + && info.vi_depth == pcx_info.bpp + && info.vi_planes == pcx_info.planes) + break; + } - if (bootverbose) - printf("splash_pcx: image good:\n" - " width = %d\n" - " height = %d\n" - " depth = %d\n" - " planes = %d\n", - pcx_info.width, pcx_info.height, - pcx_info.bpp, pcx_info.planes); - - for (i = 0; modes[i] >= 0; ++i) { - if (get_mode_info(adp, modes[i], &info) != 0) - continue; + splash_mode = modes[i]; + if (splash_mode == -1) + return (ENODEV); if (bootverbose) - printf("splash_pcx: considering mode %d:\n" - " vi_width = %d\n" - " vi_height = %d\n" - " vi_depth = %d\n" - " vi_planes = %d\n", - modes[i], - info.vi_width, info.vi_height, - info.vi_depth, info.vi_planes); - if (info.vi_width >= pcx_info.width - && info.vi_height >= pcx_info.height - && info.vi_depth == pcx_info.bpp - && info.vi_planes == pcx_info.planes) - break; - } - - splash_mode = modes[i]; - if (splash_mode == -1) - return ENODEV; - if (bootverbose) - printf("pcx_splash: selecting mode %d\n", splash_mode); - return 0; + printf("splash_pcx: selecting mode %d\n", splash_mode); + return (0); } static int pcx_end(video_adapter_t *adp) { - /* nothing to do */ - return 0; + /* nothing to do */ + return (0); } static int pcx_splash(video_adapter_t *adp, int on) { - if (on) { - if (!splash_on) { - if (set_video_mode(adp, splash_mode) || pcx_draw(adp)) - return 1; - splash_on = TRUE; + if (on) { + if (!splash_on) { + if (set_video_mode(adp, splash_mode) || pcx_draw(adp)) + return 1; + splash_on = TRUE; + } + return (0); + } else { + splash_on = FALSE; + return (0); } - return 0; - } else { - splash_on = FALSE; - return 0; - } } -struct pcxheader { - u_char manufactor; - u_char version; - u_char encoding; - u_char bpp; - u_short xmin, ymin, xmax, ymax; - u_short hres, vres; - u_char colormap[48]; - u_char rsvd; - u_char nplanes; - u_short bpsl; - u_short palinfo; - u_short hsize, vsize; +struct pcx_header { + uint8_t manufactor; + uint8_t version; + uint8_t encoding; + uint8_t bpp; + uint16_t xmin; + uint16_t ymin; + uint16_t xmax; + uint16_t ymax; + uint16_t hres; + uint16_t vres; + uint8_t colormap[48]; + uint8_t rsvd; + uint8_t nplanes; + uint16_t bpsl; + uint16_t palinfo; + uint16_t hsize; + uint16_t vsize; }; #define MAXSCANLINE 1024 static int -pcx_init(char *data, int size) +pcx_init(void *data, int size) { - const struct pcxheader *hdr; + const struct pcx_header *hdr = data; - hdr = (const struct pcxheader *)data; - - if (size < 128 + 1 + 1 + 768 - || hdr->manufactor != 10 - || hdr->version != 5 - || hdr->encoding != 1 - || hdr->nplanes != 1 - || hdr->bpp != 8 - || hdr->bpsl > MAXSCANLINE - || data[size-769] != 12) { - printf("splash_pcx: invalid PCX image\n"); - return 1; - } - pcx_info.width = hdr->xmax - hdr->xmin + 1; - pcx_info.height = hdr->ymax - hdr->ymin + 1; - pcx_info.bpsl = hdr->bpsl; - pcx_info.bpp = hdr->bpp; - pcx_info.planes = hdr->nplanes; - pcx_info.zlen = size - (128 + 1 + 768); - pcx_info.zdata = data + 128; - pcx_info.palette = data + size - 768; - return 0; + if (size < 128 + 1 + 1 + 768 || + hdr->manufactor != 10 || + hdr->version != 5 || + hdr->encoding != 1 || + hdr->nplanes != 1 || + hdr->bpp != 8 || + hdr->bpsl > MAXSCANLINE || + ((uint8_t *)data)[size - 769] != 12) { + printf("splash_pcx: invalid PCX image\n"); + return (1); + } + pcx_info.width = hdr->xmax - hdr->xmin + 1; + pcx_info.height = hdr->ymax - hdr->ymin + 1; + pcx_info.bpsl = hdr->bpsl; + pcx_info.bpp = hdr->bpp; + pcx_info.planes = hdr->nplanes; + pcx_info.zlen = size - (128 + 1 + 768); + pcx_info.zdata = (uint8_t *)data + 128; + pcx_info.palette = (uint8_t *)data + size - 768; + return (0); } static int pcx_draw(video_adapter_t *adp) { - u_char *vidmem; - int swidth, sheight, sbpsl, sdepth, splanes; - int banksize, origin; - int c, i, j, pos, scan, x, y; - u_char line[MAXSCANLINE]; - - if (pcx_info.zlen < 1) - return 1; + uint8_t *vidmem; + int swidth, sheight, sbpsl, sdepth, splanes; + int banksize, origin; + int c, i, j, pos, scan, x, y; + uint8_t line[MAXSCANLINE]; + + if (pcx_info.zlen < 1) + return (1); + + load_palette(adp, pcx_info.palette); + + vidmem = (uint8_t *)adp->va_window; + swidth = adp->va_info.vi_width; + sheight = adp->va_info.vi_height; + sbpsl = adp->va_line_width; + sdepth = adp->va_info.vi_depth; + splanes = adp->va_info.vi_planes; + banksize = adp->va_window_size; - load_palette(adp, pcx_info.palette); - - vidmem = (u_char *)adp->va_window; - swidth = adp->va_info.vi_width; - sheight = adp->va_info.vi_height; - sbpsl = adp->va_line_width; - sdepth = adp->va_info.vi_depth; - splanes = adp->va_info.vi_planes; - banksize = adp->va_window_size; - - for (origin = 0; origin < sheight*sbpsl; origin += banksize) { - set_origin(adp, origin); - bzero(vidmem, banksize); - } - - x = (swidth - pcx_info.width) / 2; - y = (sheight - pcx_info.height) / 2; - origin = 0; - pos = y * sbpsl + x; - while (pos > banksize) { - pos -= banksize; - origin += banksize; - } - set_origin(adp, origin); - - for (scan = i = 0; scan < pcx_info.height; ++scan, ++y, pos += sbpsl) { - for (j = 0; j < pcx_info.bpsl && i < pcx_info.zlen; ++i) { - if ((pcx_info.zdata[i] & 0xc0) == 0xc0) { - c = pcx_info.zdata[i++] & 0x3f; - if (i >= pcx_info.zlen) - return 1; - } else { - c = 1; - } - if (j + c > pcx_info.bpsl) - return 1; - while (c--) - line[j++] = pcx_info.zdata[i]; + for (origin = 0; origin < sheight*sbpsl; origin += banksize) { + set_origin(adp, origin); + bzero(vidmem, banksize); } - if (pos > banksize) { - origin += banksize; - pos -= banksize; - set_origin(adp, origin); + x = (swidth - pcx_info.width) / 2; + y = (sheight - pcx_info.height) / 2; + origin = 0; + pos = y * sbpsl + x; + while (pos > banksize) { + pos -= banksize; + origin += banksize; } + set_origin(adp, origin); + + for (scan = i = 0; scan < pcx_info.height; ++scan, ++y, pos += sbpsl) { + for (j = 0; j < pcx_info.bpsl && i < pcx_info.zlen; ++i) { + if ((pcx_info.zdata[i] & 0xc0) == 0xc0) { + c = pcx_info.zdata[i++] & 0x3f; + if (i >= pcx_info.zlen) + return (1); + } else { + c = 1; + } + if (j + c > pcx_info.bpsl) + return (1); + while (c--) + line[j++] = pcx_info.zdata[i]; + } - if (pos + pcx_info.width > banksize) { - /* scanline crosses bank boundary */ - j = banksize - pos; - bcopy(line, vidmem + pos, j); - origin += banksize; - pos -= banksize; - set_origin(adp, origin); - bcopy(line + j, vidmem, pcx_info.width - j); - } else { - bcopy(line, vidmem + pos, pcx_info.width); + if (pos > banksize) { + origin += banksize; + pos -= banksize; + set_origin(adp, origin); + } + + if (pos + pcx_info.width > banksize) { + /* scanline crosses bank boundary */ + j = banksize - pos; + bcopy(line, vidmem + pos, j); + origin += banksize; + pos -= banksize; + set_origin(adp, origin); + bcopy(line + j, vidmem, pcx_info.width - j); + } else { + bcopy(line, vidmem + pos, pcx_info.width); + } } - } - return 0; + return (0); } ==== //depot/projects/netperf_socket/sys/i386/i386/trap.c#6 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/i386/i386/trap.c,v 1.266 2004/07/10 22:11:14 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/trap.c,v 1.267 2004/08/06 21:56:26 rwatson Exp $"); /* * 386 Trap and System call handling @@ -983,6 +983,9 @@ ktrsyscall(code, narg, args); #endif + CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td, + td->td_proc->p_pid, td->td_proc->p_comm, code); + /* * Try to run the syscall without Giant if the syscall * is MP safe. @@ -1050,6 +1053,9 @@ */ userret(td, &frame, sticks); + CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td, + td->td_proc->p_pid, td->td_proc->p_comm, code); + #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) ktrsysret(code, error, td->td_retval[0]); ==== //depot/projects/netperf_socket/sys/kern/kern_descrip.c#14 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_descrip.c,v 1.239 2004/08/04 18:35:33 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_descrip.c,v 1.240 2004/08/06 22:00:55 rwatson Exp $"); #include "opt_compat.h" @@ -333,12 +333,29 @@ struct vnode *vp; u_int newmin; int error, flg, tmp; + int giant_locked; + + /* + * XXXRW: Some fcntl() calls require Giant -- others don't. Try to + * avoid grabbing Giant for calls we know don't need it. + */ + switch (cmd) { + case F_DUPFD: + case F_GETFD: + case F_SETFD: + case F_GETFL: + giant_locked = 0; + break; + default: + giant_locked = 1; + mtx_lock(&Giant); + } + error = 0; flg = F_POSIX; p = td->td_proc; fdp = p->p_fd; - mtx_lock(&Giant); FILEDESC_LOCK(fdp); if ((unsigned)fd >= fdp->fd_nfiles || (fp = fdp->fd_ofiles[fd]) == NULL) { @@ -350,6 +367,7 @@ switch (cmd) { case F_DUPFD: + mtx_assert(&Giant, MA_NOTOWNED); FILEDESC_UNLOCK(fdp); newmin = arg; PROC_LOCK(p); @@ -364,17 +382,21 @@ break; case F_GETFD: + mtx_assert(&Giant, MA_NOTOWNED); td->td_retval[0] = (*pop & UF_EXCLOSE) ? FD_CLOEXEC : 0; FILEDESC_UNLOCK(fdp); break; case F_SETFD: + mtx_assert(&Giant, MA_NOTOWNED); *pop = (*pop &~ UF_EXCLOSE) | (arg & FD_CLOEXEC ? UF_EXCLOSE : 0); FILEDESC_UNLOCK(fdp); break; case F_GETFL: + /* MPSAFE */ + mtx_assert(&Giant, MA_NOTOWNED); FILE_LOCK(fp); FILEDESC_UNLOCK(fdp); td->td_retval[0] = OFLAGS(fp->f_flag); @@ -382,6 +404,7 @@ break; case F_SETFL: + mtx_assert(&Giant, MA_OWNED); FILE_LOCK(fp); FILEDESC_UNLOCK(fdp); fhold_locked(fp); @@ -409,6 +432,7 @@ break; case F_GETOWN: + mtx_assert(&Giant, MA_OWNED); fhold(fp); FILEDESC_UNLOCK(fdp); error = fo_ioctl(fp, FIOGETOWN, &tmp, td->td_ucred, td); @@ -418,6 +442,7 @@ break; case F_SETOWN: + mtx_assert(&Giant, MA_OWNED); fhold(fp); FILEDESC_UNLOCK(fdp); tmp = arg; @@ -426,10 +451,12 @@ break; case F_SETLKW: + mtx_assert(&Giant, MA_OWNED); flg |= F_WAIT; /* FALLTHROUGH F_SETLK */ case F_SETLK: + mtx_assert(&Giant, MA_OWNED); if (fp->f_type != DTYPE_VNODE) { FILEDESC_UNLOCK(fdp); error = EBADF; @@ -503,6 +530,7 @@ break; case F_GETLK: + mtx_assert(&Giant, MA_OWNED); if (fp->f_type != DTYPE_VNODE) { FILEDESC_UNLOCK(fdp); error = EBADF; @@ -542,7 +570,8 @@ break; } done2: - mtx_unlock(&Giant); + if (giant_locked) + mtx_unlock(&Giant); return (error); } ==== //depot/projects/netperf_socket/sys/kern/kern_resource.c#11 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_resource.c,v 1.142 2004/08/04 18:19:09 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_resource.c,v 1.143 2004/08/06 22:04:33 rwatson Exp $"); #include "opt_compat.h" @@ -1142,9 +1142,9 @@ return (0); } uip->ui_sbsize = new; + UIDINFO_UNLOCK(uip); *hiwat = to; - if (uip->ui_sbsize < 0) + if (new < 0) printf("negative sbsize for uid = %d\n", uip->ui_uid); - UIDINFO_UNLOCK(uip); return (1); } ==== //depot/projects/netperf_socket/sys/kern/kern_thread.c#21 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_thread.c,v 1.190 2004/08/02 00:18:35 green Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_thread.c,v 1.191 2004/08/06 22:06:14 rwatson Exp $"); #include #include @@ -613,7 +613,8 @@ KASSERT(ke != NULL, ("thread exiting without a kse")); KASSERT(kg != NULL, ("thread exiting without a kse group")); PROC_LOCK_ASSERT(p, MA_OWNED); - CTR1(KTR_PROC, "thread_exit: thread %p", td); + CTR3(KTR_PROC, "thread_exit: thread %p (pid %ld, %s)", td, + (long)p->p_pid, p->p_comm); mtx_assert(&Giant, MA_NOTOWNED); if (td->td_standin != NULL) { ==== //depot/projects/netperf_socket/sys/kern/kern_timeout.c#7 (text+ko) ==== @@ -35,13 +35,14 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_timeout.c,v 1.90 2004/08/06 02:44:58 cperciva Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_timeout.c,v 1.91 2004/08/06 21:49:00 rwatson Exp $"); #include #include #include #include #include +#include #include #include #include @@ -245,8 +246,11 @@ if (!(c_flags & CALLOUT_MPSAFE)) { mtx_lock(&Giant); gcalls++; + CTR1(KTR_CALLOUT, "callout %p", c_func); } else { mpcalls++; + CTR1(KTR_CALLOUT, "callout mpsafe %p", + c_func); } #ifdef DIAGNOSTIC binuptime(&bt1); ==== //depot/projects/netperf_socket/sys/kern/vfs_vnops.c#9 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/vfs_vnops.c,v 1.205 2004/07/22 20:40:23 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/vfs_vnops.c,v 1.206 2004/08/06 22:25:35 rwatson Exp $"); #include "opt_mac.h" @@ -117,6 +117,8 @@ exclusive = 0; #endif + GIANT_REQUIRED; + restart: fmode = *flagp; if (fmode & O_CREAT) { @@ -315,6 +317,8 @@ { int error; + GIANT_REQUIRED; + if (flags & FWRITE) vp->v_writecount--; error = VOP_CLOSE(vp, flags, file_cred, td); @@ -387,6 +391,8 @@ struct ucred *cred; int error; + GIANT_REQUIRED; + if ((ioflg & IO_NODELOCKED) == 0) { mp = NULL; if (rw == UIO_WRITE) { @@ -474,6 +480,8 @@ int error = 0; int iaresid; + GIANT_REQUIRED; + do { int chunk; @@ -518,7 +526,6 @@ struct vnode *vp; int error, ioflag; - mtx_lock(&Giant); KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); vp = fp->f_vnode; @@ -527,6 +534,7 @@ ioflag |= IO_NDELAY; if (fp->f_flag & O_DIRECT) ioflag |= IO_DIRECT; + mtx_lock(&Giant); VOP_LEASE(vp, td, fp->f_cred, LEASE_READ); /* * According to McKusick the vn lock is protecting f_offset here. @@ -568,10 +576,10 @@ struct mount *mp; int error, ioflag; - mtx_lock(&Giant); KASSERT(uio->uio_td == td, ("uio_td %p is not td %p", uio->uio_td, td)); vp = fp->f_vnode; + mtx_lock(&Giant); if (vp->v_type == VREG) bwillwrite(); ioflag = IO_UNIT; @@ -647,6 +655,8 @@ int error; u_short mode; + GIANT_REQUIRED; + #ifdef MAC error = mac_check_vnode_stat(active_cred, file_cred, vp); if (error) @@ -769,6 +779,8 @@ struct vattr vattr; int error; + GIANT_REQUIRED; + switch (vp->v_type) { case VREG: @@ -846,6 +858,8 @@ int error; #endif + GIANT_REQUIRED; + vp = fp->f_vnode; #ifdef MAC vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); @@ -1000,6 +1014,8 @@ { int error; + GIANT_REQUIRED; + if (vp != NULL) { if ((error = VOP_GETWRITEMOUNT(vp, &mp)) != 0) { if (error != EOPNOTSUPP) @@ -1054,6 +1070,8 @@ struct thread *td = curthread; int error; + GIANT_REQUIRED; + if (mp->mnt_kern_flag & MNTK_SUSPEND) return (0); mp->mnt_kern_flag |= MNTK_SUSPEND; @@ -1075,6 +1093,8 @@ struct mount *mp; { + GIANT_REQUIRED; + if ((mp->mnt_kern_flag & MNTK_SUSPEND) == 0) return; mp->mnt_kern_flag &= ~(MNTK_SUSPEND | MNTK_SUSPENDED); @@ -1089,6 +1109,8 @@ vn_kqfilter(struct file *fp, struct knote *kn) { + GIANT_REQUIRED; + return (VOP_KQFILTER(fp->f_vnode, kn)); } ==== //depot/projects/netperf_socket/sys/net/if_sl.c#10 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)if_sl.c 8.6 (Berkeley) 2/1/94 - * $FreeBSD: src/sys/net/if_sl.c,v 1.121 2004/07/15 08:26:06 phk Exp $ + * $FreeBSD: src/sys/net/if_sl.c,v 1.122 2004/08/06 22:41:13 rwatson Exp $ */ /* @@ -309,7 +309,7 @@ #ifdef SLIP_IFF_OPTS SLIP_IFF_OPTS; #else - IFF_POINTOPOINT | SC_AUTOCOMP | IFF_MULTICAST; + IFF_POINTOPOINT | SC_AUTOCOMP | IFF_MULTICAST | IFF_NEEDSGIANT; #endif sc->sc_if.if_type = IFT_SLIP; sc->sc_if.if_ioctl = slioctl; @@ -610,6 +610,8 @@ int s; register int len = 0; + GIANT_REQUIRED; /* tty */ + for (;;) { /* * Call output process whether or not there is more in the ==== //depot/projects/netperf_socket/sys/powerpc/include/cpufunc.h#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/powerpc/include/cpufunc.h,v 1.20 2004/07/12 22:16:04 grehan Exp $ + * $FreeBSD: src/sys/powerpc/include/cpufunc.h,v 1.21 2004/08/07 00:20:00 grehan Exp $ */ #ifndef _MACHINE_CPUFUNC_H_ @@ -65,7 +65,7 @@ mtmsr(register_t value) { - __asm __volatile ("mtmsr %0" :: "r"(value)); + __asm __volatile ("mtmsr %0; isync" :: "r"(value)); } static __inline register_t ==== //depot/projects/netperf_socket/sys/sys/ktr.h#2 (text+ko) ==== @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * from BSDI $Id: ktr.h,v 1.10.2.7 2000/03/16 21:44:42 cp Exp $ - * $FreeBSD: src/sys/sys/ktr.h,v 1.21 2003/03/11 20:07:22 jhb Exp $ + * $FreeBSD: src/sys/sys/ktr.h,v 1.22 2004/08/06 21:46:51 rwatson Exp $ */ /* @@ -72,7 +72,9 @@ #define KTR_WITNESS 0x00200000 #define KTR_RUNQ 0x00400000 /* Run queue */ #define KTR_CONTENTION 0x00800000 /* Lock contention */ -#define KTR_ALL 0x00ffffff +#define KTR_UMA 0x01000000 /* UMA slab allocator */ +#define KTR_CALLOUT 0x02000000 /* Callouts and timeouts */ +#define KTR_ALL 0x02ffffff /* * Trace classes which can be assigned to particular use at compile time ==== //depot/projects/netperf_socket/sys/vm/uma_core.c#13 (text+ko) ==== @@ -46,7 +46,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/vm/uma_core.c,v 1.104 2004/08/02 00:18:35 green Exp $"); +__FBSDID("$FreeBSD: src/sys/vm/uma_core.c,v 1.105 2004/08/06 21:52:38 rwatson Exp $"); /* I should really use ktr.. */ /* >>> TRUNCATED FOR MAIL (1000 lines) <<<