mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luming Yu <luming.yu@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Subject: [RFC patch] delete improper hot pluggable code of memory affinity
Date: Thu, 16 Jul 2009 17:18:37 +0800	[thread overview]
Message-ID: <3877989d0907160218l4a28791v90ad22cc048c3440@mail.gmail.com> (raw)

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

Hello,

The current kernel code *wrongly* interprets Hot Pluggable bit of
Memory Affinity Structure (SRAT table in ACPI spec).
if Hot Pluggable bit is set and CONFIG_MEMORY_HOTPLUG_SPARSE is NOT
set, the memory Affinity will
be ignored. And a faked Node will be used...

An alternative is to enable CONFIG_MEMORY_HOTPLUG_SPARSE *always*
along with acpi_numa_memory_affinity_init.
Please decide which one is appropriate.

The downside of this patch is *some useful info* is lost and a follow
up patch is needed.

**The patch is enclosed in text attachment*
**Using web client to send the patch* *
**below is for review, please apply attached  patch*/

Thanks,
Luming


Signed-off-by: Yu Luming <luming.yu@intel.com>

 srat_64.c |   16 ----------------
 1 file changed, 16 deletions(-)


diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index 2dfcbf9..82423e5 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -172,11 +172,6 @@ acpi_numa_processor_affinity_init(struct
acpi_srat_cpu_affinity *pa)
 	       pxm, apic_id, node);
 }

-#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
-static inline int save_add_info(void) {return 1;}
-#else
-static inline int save_add_info(void) {return 0;}
-#endif
 /*
  * Update nodes_add[]
  * This code supports one contiguous hot add area per node
@@ -249,9 +244,6 @@ acpi_numa_memory_affinity_init(struct
acpi_srat_mem_affinity *ma)
 	}
 	if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
 		return;
-
-	if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && !save_add_info())
-		return;
 	start = ma->base_address;
 	end = start + ma->length;
 	pxm = ma->proximity_domain;
@@ -291,14 +283,6 @@ acpi_numa_memory_affinity_init(struct
acpi_srat_mem_affinity *ma)
 	e820_register_active_regions(node, start >> PAGE_SHIFT,
 				     end >> PAGE_SHIFT);

-	if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) {
-		update_nodes_add(node, start, end);
-		/* restore nodes[node] */
-		*nd = oldnode;
-		if ((nd->start | nd->end) == 0)
-			node_clear(node, nodes_parsed);
-	}
-
 	node_memblk_range[num_node_memblks].start = start;
 	node_memblk_range[num_node_memblks].end = end;
 	memblk_nodeid[num_node_memblks] = node;

[-- Attachment #2: 0.patch --]
[-- Type: application/octet-stream, Size: 1361 bytes --]

diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index 2dfcbf9..82423e5 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -172,11 +172,6 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 	       pxm, apic_id, node);
 }
 
-#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
-static inline int save_add_info(void) {return 1;}
-#else
-static inline int save_add_info(void) {return 0;}
-#endif
 /*
  * Update nodes_add[]
  * This code supports one contiguous hot add area per node
@@ -249,9 +244,6 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 	}
 	if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
 		return;
-
-	if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && !save_add_info())
-		return;
 	start = ma->base_address;
 	end = start + ma->length;
 	pxm = ma->proximity_domain;
@@ -291,14 +283,6 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 	e820_register_active_regions(node, start >> PAGE_SHIFT,
 				     end >> PAGE_SHIFT);
 
-	if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) {
-		update_nodes_add(node, start, end);
-		/* restore nodes[node] */
-		*nd = oldnode;
-		if ((nd->start | nd->end) == 0)
-			node_clear(node, nodes_parsed);
-	}
-
 	node_memblk_range[num_node_memblks].start = start;
 	node_memblk_range[num_node_memblks].end = end;
 	memblk_nodeid[num_node_memblks] = node;

             reply	other threads:[~2009-07-16  9:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-16  9:18 Luming Yu [this message]
2009-07-17  5:16 ` Yasunori Goto
2009-07-17  5:33   ` Luming Yu
2009-07-17  5:52     ` Yasunori Goto
2009-07-17  6:03       ` Luming Yu
2009-07-17  6:20         ` Yasunori Goto
2009-07-20  7:42 ` Andi Kleen

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=3877989d0907160218l4a28791v90ad22cc048c3440@mail.gmail.com \
    --to=luming.yu@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®