From: Matthew Dobson <colpatch@us.ibm.com>
To: Matt Mackall <mpm@selenic.com>
Cc: Trivial Patch Monkey <trivial@rustcorp.com.au>,
"Martin J. Bligh" <mbligh@aracnet.com>,
linux-kernel@vger.kernel.org
Subject: Re: [patch] use valid value when unmapping cpus
Date: Mon, 09 Jun 2003 09:59:52 -0700 [thread overview]
Message-ID: <3EE4BD08.6040601@us.ibm.com> (raw)
In-Reply-To: 20030609052008.GB31216@waste.org
Matt Mackall wrote:
> On Wed, Jun 04, 2003 at 02:26:22PM -0700, Matthew Dobson wrote:
>
>>For some unknown reason, we stick a -1 in cpu_2_node when we unmap a cpu
>>on i386. We're better off sticking a 0 in there, because at least 0 is
>>a valid value if something references it. -1 is only going to cause
>>problems at some point down the line.
>
>
> Problems down the line help you find the bogus dereference. Even
> better to stick a poison value in there.
Well, it's not really a dereference issue. The function, cpu_to_node()
just returns an integer which is the node that particular CPU is on.
This should always return a valid value. This is used in many places,
often as a direct index into an array, and we shouldn't have to check
its return value everywhere. The default behavior is to just return 0,
because 0 is a valid node, even for UP/SMP. The array of CPU -> node
mappings is initialized to 0's on i386 already, so unmapping a CPU
should return this mapping to its uninitialized state.
Cheers!
-Matt
prev parent reply other threads:[~2003-06-09 16:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-04 21:26 [patch] use valid value when unmapping cpus Matthew Dobson
2003-06-09 5:20 ` Matt Mackall
2003-06-09 16:59 ` Matthew Dobson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3EE4BD08.6040601@us.ibm.com \
--to=colpatch@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@aracnet.com \
--cc=mpm@selenic.com \
--cc=trivial@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.