PERFORCE change 96007 for review

John Baldwin jhb at freebsd.org
Mon Apr 24 20:38:00 UTC 2006


On Monday 24 April 2006 15:13, John Birrell wrote:
> http://perforce.freebsd.org/chv.cgi?CH=96007
> 
> Change 96007 by jb at jb_freebsd2 on 2006/04/24 19:13:05
> 
> 	Use mp_maxid instead of mp_ncpus. cpus are sparse, so this code
> 	needs to be changed to use the cpu list, only allocating buffers
> 	for the cpus that exist.
> 
> Affected files ...
> 
> .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_buffer.c#4 edit
> 
> Differences ...
> 
> ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_buffer.c#4 (text+ko) ====
> 
> @@ -148,7 +148,7 @@
>  	int i;
>  
>  	ASSERT(MUTEX_HELD(&dtrace_lock));
> -	for (i = 0; i < mp_ncpus; i++) {
> +	for (i = 0; i < mp_maxid; i++) {

Use <= with mp_maxid.  The range is 0 .. mp_maxid (inclusive).

>  		buf = &bufs[i];
>  
>  		/*
> @@ -158,7 +158,6 @@
>  		 */
>  		if (buf->dtb_tomax != NULL) {
>  			ASSERT(buf->dtb_size == size);
> -printf("buf->dtb_size %ld size %ld\n",(long) buf->dtb_size,(long) size);
>  			continue;
>  		}
>  
> 

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the p4-projects mailing list