Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Apr 2006 22:17:06 GMT
From:      John Birrell <jb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 96020 for review
Message-ID:  <200604242217.k3OMH63t065162@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96020

Change 96020 by jb@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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604242217.k3OMH63t065162>