PERFORCE change 96020 for review

John Birrell jb at FreeBSD.org
Mon Apr 24 22:17:10 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=96020

Change 96020 by jb at jb_freebsd2 on 2006/04/24 22:16:20

	Check if the cpu is present to avoid allocating a buffer when it
	isn't required.
	
	Fix the upper bound on the cpu number.
	
	I don't have any multi-cpu machines to test this on.

Affected files ...

.. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_buffer.c#5 edit

Differences ...

==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_buffer.c#5 (text+ko) ====

@@ -148,9 +148,12 @@
 	int i;
 
 	ASSERT(MUTEX_HELD(&dtrace_lock));
-	for (i = 0; i < mp_maxid; i++) {
+	for (i = 0; i <= mp_maxid; i++) {
 		buf = &bufs[i];
 
+		if (CPU_ABSENT(i))
+			continue;
+
 		/*
 		 * If there is already a buffer allocated for this CPU, it
 		 * is only possible that this is a DR event.  In this case,


More information about the p4-projects mailing list