Date: Fri, 12 Oct 2007 16:23:38 -0400 From: John Baldwin <jhb@freebsd.org> To: Alfred Perlstein <alfred@freebsd.org> Cc: jkoshy@freebsd.org, smp@freebsd.org Subject: Re: hwpmc dealing with sparse cpu systems. Message-ID: <200710121623.38782.jhb@freebsd.org> In-Reply-To: <20071012200006.GK31826@elvis.mu.org>
index | next in thread | previous in thread | raw e-mail
On Friday 12 October 2007 04:00:06 pm Alfred Perlstein wrote: > 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) > > I would like to commit it. Actually, mp_maxid is what you should use. It is guaranteed that all CPU IDs are <= mp_maxid. > -Alfred > > ----- Forwarded message from Alfred Perlstein <perlstein@juniper.net> ----- > > From: "Sunil Mudunuri" > Subject: Re: hwpmc on mpsdk. > Date: Thu, 11 Oct 2007 18:11:27 -0700 > Message-ID: <470EC9BF.5070607@juniper.net> > User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) > > Looking at the code in hwpmc_mod.c, I feel that > the mp_ncpus (global) is wrongly used in this module. > > While mp_ncpus is the count of active cpus in the system, > this is being used to range check a cpu id(active/inactive) which can be > greater than mp_ncpus. > > The code works fine in systems which has all the cpu's active eg. > SPU(australia), but is causing crashes > in mpsdk where we have the active cpus interleaved with idle cpu's. > > I replaced mp_ncpus with MAXCPU in almost all the places and it works fine. > > So this should be fixed in the FreeBSD proper, I guess. > > Alfred/Girish, can you push this to be fixed in FreeBSD > > Thanks, > Sunil > > > > ----- End forwarded message ----- > > -- > - Alfred Perlstein > -- John Baldwinhelp
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710121623.38782.jhb>
