public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Dobson <colpatch@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: mbligh@aracnet.com, Andrew Morton <akpm@osdl.org>,
	Trivial Patch Monkey <trivial@rustcorp.com.au>
Subject: [TRIVIAL PATCH] Use valid node number when unmapping CPUs
Date: Mon, 22 Dec 2003 11:37:37 -0800	[thread overview]
Message-ID: <3FE74801.2010401@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 487 bytes --]

The cpu_2_node array for i386 is initialized to 0 for each CPU, 
effectively mapping all CPUs to node 0 unless changed.  When we unmap 
CPUs, however, we stick a -1 in the array, mapping the CPU to an invalid 
node.  This really isn't helpful.  We should map the CPU to node 0, to 
make sure that callers of cpu_to_node() and friends aren't returned a 
bogus node number.  This trivial patch changes the unmapping code to 
place a 0 in the node mapping for removed CPUs.

Cheers!

-Matt

[-- Attachment #2: use_node0_on_unmap.patch --]
[-- Type: text/plain, Size: 572 bytes --]

diff -Nurp --exclude-from=/home/mcd/.dontdiff linux-2.6.0-vanilla/arch/i386/kernel/smpboot.c linux-2.6.0-patched/arch/i386/kernel/smpboot.c
--- linux-2.6.0-vanilla/arch/i386/kernel/smpboot.c	Wed Dec 17 18:58:49 2003
+++ linux-2.6.0-patched/arch/i386/kernel/smpboot.c	Thu Dec 18 14:36:06 2003
@@ -520,7 +520,7 @@ static inline void unmap_cpu_to_node(int
 	printk("Unmapping cpu %d from all nodes\n", cpu);
 	for (node = 0; node < MAX_NUMNODES; node ++)
 		cpu_clear(cpu, node_2_cpu_mask[node]);
-	cpu_2_node[cpu] = -1;
+	cpu_2_node[cpu] = 0;
 }
 #else /* !CONFIG_NUMA */
 

             reply	other threads:[~2003-12-22 19:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-22 19:37 Matthew Dobson [this message]
2003-12-23  0:41 ` [TRIVIAL PATCH] Use valid node number when unmapping CPUs Nick Piggin
2004-01-05 22:52   ` Matthew Dobson
2004-01-06  0:39     ` Nick Piggin
2004-03-29 15:46     ` Nick Piggin
2004-03-29 15:45   ` Matthew Dobson

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=3FE74801.2010401@us.ibm.com \
    --to=colpatch@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox