From owner-cvs-all@FreeBSD.ORG Mon Dec 1 15:09:42 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4EBD216A4CF for ; Mon, 1 Dec 2003 15:09:42 -0800 (PST) Received: from mail8.speakeasy.net (mail8.speakeasy.net [216.254.0.208]) by mx1.FreeBSD.org (Postfix) with ESMTP id F39FC43FD7 for ; Mon, 1 Dec 2003 15:09:35 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 29454 invoked from network); 1 Dec 2003 23:09:35 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 1 Dec 2003 23:09:35 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.9/8.12.9) with ESMTP id hB1N9VFn097987; Mon, 1 Dec 2003 18:09:32 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20031201175237.S4201-100000@mail.chesapeake.net> Date: Mon, 01 Dec 2003 18:09:35 -0500 (EST) From: John Baldwin To: Jeff Roberson X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: cvs-src@FreeBSD.org cc: Jeff Roberson cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: RE: cvs commit: src/sys/alpha/alpha mp_machdep.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2003 23:09:42 -0000 On 01-Dec-2003 Jeff Roberson wrote: > > On Mon, 1 Dec 2003, John Baldwin wrote: > >> >> On 01-Dec-2003 Jeff Roberson wrote: >> > On Mon, 1 Dec 2003, John Baldwin wrote: >> > >> >> >> >> On 30-Nov-2003 Jeff Roberson wrote: >> >> > jeff 2003/11/30 14:08:24 PST >> >> > >> >> > FreeBSD src repository >> >> > >> >> > Modified files: >> >> > sys/alpha/alpha mp_machdep.c >> >> > Log: >> >> > - Set mp_maxid in a way that is consistent with every other arch. It is >> >> > one more than the last valid 'cpuid'. >> >> > >> >> > Approved by: re (rwatson) >> >> >> >> Eh? No it's not. All that needs to be true is that for every processor, >> >> PCPU_GET(cpuid) <= mp_maxid. >> >> >> >> It can be equal to the highest ID and should be so for most cases. >> > >> > From x86's mp_machdep: >> > mp_maxid = MAXCPU; >> >> That's a bug. >> >> > ia64 >> > mp_maxid = min(mp_ncpus, MAXCPU) - 1; >> >> This is correct. Note - 1. >> >> > sparc64 >> > cpus = 0; >> > root = OF_peer(0); >> > for (child = OF_child(root); child != 0; child = OF_peer(child)) { >> > if (OF_getprop(child, "device_type", buf, sizeof(buf)) > 0 >> > && >> > strcmp(buf, "cpu") == 0) >> > cpus++; >> > } >> > mp_maxid = cpus; >> >> This should be cpus - 1. >> >> > And I just changed amd64 and alpha to mean maxid + 1. Damn. it looks like >> > just sparc64 and x86 were wrong. Maybe I should change those to mean the >> > right thing, and backout the changes to uma. yack. >> >> Heh. I am already waiting for approval from re@ to fix x86. That was >> definitely my bug. > > Well, since ULE and UMA are the only two subsystems which make use of > mp_maxid, can I request that it be one over the maximum id so that I can > use it in loops like: > for (i = 0; i < mp_maxid; i++) { > > Otherwise I guess I can do <=. If you fix x86, can you fix alpha and > amd64, and uma and ule? :-) I'll fix all of them and work up a patch tomorrow, sure. :) -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/