Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2007 13:00:06 -0700
From:      Alfred Perlstein <alfred@freebsd.org>
To:        smp@freebsd.org
Cc:        jkoshy@freebsd.org
Subject:   hwpmc dealing with sparse cpu systems.
Message-ID:  <20071012200006.GK31826@elvis.mu.org>

next in thread | raw e-mail | index | archive | help
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.

-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



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