From: noamca@mellanox.com (Noam Camus)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH v3 06/11] ARC: [NUMA] added CONFIG_NUMA for plat-eznps
Date: Thu, 15 Jun 2017 11:43:56 +0300 [thread overview]
Message-ID: <1497516241-16446-7-git-send-email-noamca@mellanox.com> (raw)
In-Reply-To: <1497516241-16446-1-git-send-email-noamca@mellanox.com>
From: Noam Camus <noamca@mellanox.com>
This is needed for NPS400 where high memory is assigned to node1
where the associated addresses are lower than node0.
This use case is not typical and just using discontigmem is not enough
since nodes assumed to have increasing address range.
i.e. address range of node0 assumed to be lower than node1.
Signed-off-by: Noam Camus <noamca at mellanox.com>
---
arch/arc/Kconfig | 9 +++++++++
arch/arc/include/asm/topology.h | 6 ++++++
arch/arc/kernel/setup.c | 3 +++
arch/arc/mm/init.c | 6 ++++++
4 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 982bd18..18c37de 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -378,6 +378,15 @@ config ARC_HUGEPAGE_16M
endchoice
+config NUMA
+ bool "NUMA Memory Allocation and Scheduler Support"
+ depends on SMP && DISCONTIGMEM
+ default y if ARC_PLAT_EZNPS
+ ---help---
+ NUMA memory allocation is required for NPS400 processors.
+ The reason is that node1 in NPS400 is assigned to lower
+ addresses than node0, which is not typical scenario.
+
config NODES_SHIFT
int "Maximum NUMA Nodes (as a power of 2)"
default "0" if !DISCONTIGMEM
diff --git a/arch/arc/include/asm/topology.h b/arch/arc/include/asm/topology.h
index a9be3f8..dfbc2ab 100644
--- a/arch/arc/include/asm/topology.h
+++ b/arch/arc/include/asm/topology.h
@@ -1,6 +1,12 @@
#ifndef _ASM_ARC_TOPOLOGY_H
#define _ASM_ARC_TOPOLOGY_H
+#ifdef CONFIG_NUMA
+#define cpu_to_node(cpu) ((void)(cpu), 0)
+#define parent_node(node) (node)
+#define cpumask_of_node(node) ((void)node, cpu_online_mask)
+#endif
+
#ifdef CONFIG_NPS_CPU_TOPOLOGY
#include <linux/cpumask.h>
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index 379ebda..3d1509b 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -577,6 +577,9 @@ static int __init topology_init(void)
{
int cpu;
+ for_each_online_node(cpu)
+ register_one_node(cpu);
+
for_each_present_cpu(cpu)
register_cpu(&per_cpu(cpu_topo_info, cpu), cpu);
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index 8c9415e..f9f80d9 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -113,6 +113,10 @@ void __init setup_arch_memory(void)
init_mm.end_data = (unsigned long)_edata;
init_mm.brk = (unsigned long)_end;
+ node_set_online(0);
+ node_set_state(0, N_MEMORY);
+ node_set_state(0, N_NORMAL_MEMORY);
+
/* first page of system - kernel .vector starts here */
min_low_pfn = ARCH_PFN_OFFSET;
@@ -182,6 +186,8 @@ void __init setup_arch_memory(void)
* populated with normal memory zone while node 1 only has highmem
*/
node_set_online(1);
+ node_set_state(1, N_MEMORY);
+ node_set_state(1, N_HIGH_MEMORY);
min_high_pfn = PFN_DOWN(high_mem_start);
max_high_pfn = PFN_DOWN(high_mem_start + high_mem_sz);
--
1.7.1
next prev parent reply other threads:[~2017-06-15 8:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-15 8:43 [PATCH v3 00/11] plat-eznps upstream cont. set 2 Noam Camus
2017-06-15 8:43 ` [PATCH v3 01/11] ARC: set level of log per CPU during boot to be info level Noam Camus
2017-06-15 8:43 ` [PATCH v3 02/11] ARC: send ipi to all cpus sharing task mm in case of page fault Noam Camus
2017-06-15 8:43 ` [PATCH v3 03/11] ARC: Allow irq threading Noam Camus
2017-08-25 20:45 ` Vineet Gupta
2017-08-25 20:59 ` Thomas Gleixner
2017-08-25 21:02 ` Thomas Gleixner
2017-06-15 8:43 ` [PATCH v3 04/11] ARC: Add CPU topology Noam Camus
2017-06-15 8:43 ` [PATCH v3 05/11] ARC: Support more than one PGDIR for KVADDR Noam Camus
2017-06-15 8:43 ` Noam Camus [this message]
2017-06-15 8:43 ` [PATCH v3 07/11] ARC: [plat-eznps] new command line argument for HW scheduler at MTM Noam Camus
2017-08-21 17:04 ` Vineet Gupta
2017-08-22 6:16 ` Noam Camus
2017-06-15 8:43 ` [PATCH v3 08/11] ARC: [plat-eznps] Update the init sequence of aux regs per cpu Noam Camus
2017-06-15 8:43 ` [PATCH v3 09/11] ARC: [plat-eznps] Save/Restore extra auxiliary registers Noam Camus
2017-06-15 8:44 ` [PATCH v3 10/11] ARC: [plat-eznps] handle dedicated AUX registers Noam Camus
2017-06-15 8:44 ` [PATCH v3 11/11] ARC: [plat-eznps] avoid toggling of DPC register Noam Camus
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=1497516241-16446-7-git-send-email-noamca@mellanox.com \
--to=noamca@mellanox.com \
--cc=linux-snps-arc@lists.infradead.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