Date: Mon, 24 Apr 2006 08:29:33 -0400 From: John Baldwin <jhb@freebsd.org> To: John Birrell <jb@freebsd.org> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 95987 for review Message-ID: <200604240829.34562.jhb@freebsd.org> In-Reply-To: <200604240353.k3O3rQ9E010703@repoman.freebsd.org> References: <200604240353.k3O3rQ9E010703@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 23 April 2006 11:53 pm, John Birrell wrote: > http://perforce.freebsd.org/chv.cgi?CH=3D95987 > > Change 95987 by jb@jb_freebsd2 on 2006/04/24 03:52:59 > > Just allocate buffer memory for the maximum number of cpus. > > Affected files ... > > .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_buffer.c#3 edit > > Differences ... > > =3D=3D=3D=3D //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_buffe= r.c#3 > (text+ko) =3D=3D=3D=3D > > @@ -69,8 +69,7 @@ > dtrace_buffer_alloc(dtrace_buffer_t *bufs, size_t size, int flags, > processorid_t cpu) > { > -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); > -#ifdef DOODAD > +#if defined(sun) > cpu_t *cp; > dtrace_buffer_t *buf; > > @@ -142,9 +141,51 @@ > buf->dtb_xamot =3D NULL; > buf->dtb_size =3D 0; > } while ((cp =3D cp->cpu_next) !=3D cpu_list); > -#endif > > return (ENOMEM); > +#else > + dtrace_buffer_t *buf; > + int i; > + > + ASSERT(MUTEX_HELD(&dtrace_lock)); > + for (i =3D 0; i < mp_ncpus; i++) { Use mp_maxid rather than mp_ncpus. CPU ID's in FreeBSD are allowed to be sparse, but will be in the range 0 .. mp_maxid. =2D-=20 John Baldwin <jhb@FreeBSD.org> =A0<>< =A0http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" =A0=3D =A0http://www.FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604240829.34562.jhb>