From owner-p4-projects@FreeBSD.ORG Mon Apr 24 22:17:10 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F2D8E16A415; Mon, 24 Apr 2006 22:17:09 +0000 (UTC) X-Original-To: perforce@freebsd.org 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 C923516A413 for ; Mon, 24 Apr 2006 22:17:09 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 463C043D6B for ; Mon, 24 Apr 2006 22:17:06 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k3OMH6dI065165 for ; Mon, 24 Apr 2006 22:17:06 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k3OMH63t065162 for perforce@freebsd.org; Mon, 24 Apr 2006 22:17:06 GMT (envelope-from jb@freebsd.org) Date: Mon, 24 Apr 2006 22:17:06 GMT Message-Id: <200604242217.k3OMH63t065162@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 96020 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Apr 2006 22:17:10 -0000 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,