From owner-freebsd-smp@FreeBSD.ORG Sat Oct 13 06:12:02 2007 Return-Path: Delivered-To: smp@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0475616A41B for ; Sat, 13 Oct 2007 06:12:02 +0000 (UTC) (envelope-from jkoshy.freebsd@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.179]) by mx1.freebsd.org (Postfix) with ESMTP id DF4FC13C465 for ; Sat, 13 Oct 2007 06:12:01 +0000 (UTC) (envelope-from jkoshy.freebsd@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so1273139waf for ; Fri, 12 Oct 2007 23:12:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:message-id:to:cc:subject:in-reply-to:references:user-agent:mime-version:content-type:from:sender; bh=Qc4E7/Nv698jbF2iA+sf1YPyFDoBvJgB1Ekcc4bVGb4=; b=SesNgOqBpd0Pf53qzcyLCgzvQAy1nuMjuOJgneahxSpaWy3P6tpgcpsnnurKr5uUUOmOWE5KpQFA/JsI30oGsY4Ai+yRr8bXfHpSOIoeGEidFN55O7Jh8ie28webxXBGO3YGo72EVtgZSKz3+T+oRTBCux7dJZY/OAbE6CF+N7U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:message-id:to:cc:subject:in-reply-to:references:user-agent:mime-version:content-type:from:sender; b=gaWbZIwhcUL+jON/Yaz3WaP0YZ1In7cLcAlmFllgBnAhb9OCgMY0aorSSf2D7bTiqzAPyWHmMo/DJ0m0obrroBeYMeV+/QBQLuS5O/nTF3xLFmml64zrYtwnEuh5zQmgAED3haCMf+5VLkfQGNJl+qc8qf4wRtyoSWrhnIZJCkk= Received: by 10.114.53.1 with SMTP id b1mr4382388waa.1192254242763; Fri, 12 Oct 2007 22:44:02 -0700 (PDT) Received: from moria.unixconsulting.co.in ( [59.88.120.188]) by mx.google.com with ESMTPS id k21sm1979720waf.2007.10.12.22.43.54 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 12 Oct 2007 22:44:02 -0700 (PDT) Date: Sat, 13 Oct 2007 09:37:15 +0530 Message-ID: <86k5prac98.wl%koshy@unixconsulting.co.in> To: Alfred Perlstein In-Reply-To: <20071012200006.GK31826@elvis.mu.org> References: <20071012200006.GK31826@elvis.mu.org> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/21.3 (amd64--freebsd) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII From: Joseph Koshy Sender: Joseph Koshy Cc: jkoshy@freebsd.org, smp@freebsd.org Subject: Re: hwpmc dealing with sparse cpu systems. X-BeenThere: freebsd-smp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD SMP implementation group List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Oct 2007 06:12:02 -0000 > One of the engineers here seems to have found a bug in the > hwpmc_mod.c module. The problem we have is that cpuids can be > greater than mp_ncpus due to sparseness. > Does the fix here make sense? (replace mp_ncpus with MAXCPU) No, a simple global substitution would probably be incorrect because it would allow userland to get hwpmc to attempt operations on non-existent CPUs. I will look into this. Regards, Koshy