public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Martin J. Bligh" <mbligh@aracnet.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] 2/6 Make CONFIG_NUMA work on non-numa machines.
Date: Fri, 07 Mar 2003 15:36:12 -0800	[thread overview]
Message-ID: <52120000.1047080172@flay> (raw)

>From Andy Whitcroft

A few very simple changes in order to make CONFIG_NUMA work everywhere, so 
the distros can build one common binary kernel for distributions.

diff -urpN -X /home/fletch/.diff.exclude 012-pfn_valid/arch/i386/Kconfig 013-numa_x86_pc/arch/i386/Kconfig
--- 012-pfn_valid/arch/i386/Kconfig	Wed Mar  5 07:36:57 2003
+++ 013-numa_x86_pc/arch/i386/Kconfig	Wed Mar  5 07:41:54 2003
@@ -488,7 +488,7 @@ config NR_CPUS
 # Common NUMA Features
 config NUMA
 	bool "Numa Memory Allocation Support"
-	depends on (HIGHMEM64G && (X86_NUMAQ || (X86_SUMMIT && ACPI && !ACPI_HT_ONLY)))
+	depends on (HIGHMEM64G && (X86_NUMAQ || (X86_SUMMIT && ACPI && !ACPI_HT_ONLY))) || X86_PC
 
 config DISCONTIGMEM
 	bool
diff -urpN -X /home/fletch/.diff.exclude 012-pfn_valid/arch/i386/kernel/smpboot.c 013-numa_x86_pc/arch/i386/kernel/smpboot.c
--- 012-pfn_valid/arch/i386/kernel/smpboot.c	Wed Mar  5 07:36:57 2003
+++ 013-numa_x86_pc/arch/i386/kernel/smpboot.c	Wed Mar  5 07:41:54 2003
@@ -966,6 +966,7 @@ static void __init smp_boot_cpus(unsigne
 		if (APIC_init_uniprocessor())
 			printk(KERN_NOTICE "Local APIC not detected."
 					   " Using dummy APIC emulation.\n");
+		map_cpu_to_logical_apicid();
 		return;
 	}
 
diff -urpN -X /home/fletch/.diff.exclude 012-pfn_valid/arch/i386/mm/discontig.c 013-numa_x86_pc/arch/i386/mm/discontig.c
--- 012-pfn_valid/arch/i386/mm/discontig.c	Wed Mar  5 07:41:52 2003
+++ 013-numa_x86_pc/arch/i386/mm/discontig.c	Wed Mar  5 07:41:54 2003
@@ -82,6 +82,36 @@ void *node_remap_start_vaddr[MAX_NUMNODE
 void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags);
 
 /*
+ * FLAT - support for basic PC memory model with discontig enabled, essentially
+ *        a single node with all available processors in it with a flat
+ *        memory map.
+ */
+void __init get_memcfg_numa_flat(void)
+{
+	int pfn;
+
+	printk("NUMA - single node, flat memory mode\n");
+
+	/* Run the memory configuration and find the top of memory. */
+	find_max_pfn();
+	node_start_pfn[0]  = 0;
+	node_end_pfn[0]	  = max_pfn;
+
+	/* Fill in the physnode_map with our simplistic memory model,
+	* all memory is in node 0.
+	*/
+	for (pfn = node_start_pfn[0]; pfn <= node_end_pfn[0];
+	       pfn += PAGES_PER_ELEMENT)
+	{
+		physnode_map[pfn / PAGES_PER_ELEMENT] = 0;
+	}
+
+         /* Indicate there is one node available. */
+	node_set_online(0);
+	numnodes = 1;
+}
+
+/*
  * Find the highest page frame number we have available for the node
  */
 static void __init find_max_pfn_node(int nid)
diff -urpN -X /home/fletch/.diff.exclude 012-pfn_valid/include/asm-i386/mmzone.h 013-numa_x86_pc/include/asm-i386/mmzone.h
--- 012-pfn_valid/include/asm-i386/mmzone.h	Wed Mar  5 07:41:53 2003
+++ 013-numa_x86_pc/include/asm-i386/mmzone.h	Wed Mar  5 07:41:54 2003
@@ -123,6 +123,9 @@ static inline struct pglist_data *pfn_to
 #include <asm/numaq.h>
 #elif CONFIG_X86_SUMMIT
 #include <asm/srat.h>
+#elif CONFIG_X86_PC
+#define get_memcfg_numa get_memcfg_numa_flat
+#define get_zholes_size(n) (0)
 #else
 #define pfn_to_nid(pfn)		(0)
 #endif /* CONFIG_X86_NUMAQ */


             reply	other threads:[~2003-03-07 23:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-07 23:36 Martin J. Bligh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-03-05 17:23 [PATCH] 1/6 Share common physnode_map code between NUMA-Q and Summit Martin J. Bligh
2003-03-05 17:24 ` [PATCH] 2/6 Make CONFIG_NUMA work on non-numa machines Martin J. Bligh
2003-03-05 17:14 [PATCH] 1/6 Share common physnode_map code between NUMA-Q and Summit Martin J. Bligh
2003-03-05 17:15 ` [PATCH] 2/6 Make CONFIG_NUMA work on non-numa machines Martin J. Bligh

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=52120000.1047080172@flay \
    --to=mbligh@aracnet.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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