Commit 3a368f74 authored by Philipp Hachtmann's avatar Philipp Hachtmann Committed by Martin Schwidefsky
Browse files

s390/numa: add core infrastructure



Enable core NUMA support for s390 and add one simple default mode "plain"
that creates one single NUMA node.

This patch contains several changes from Michael Holzheu.

Signed-off-by: default avatarPhilipp Hachtmann <phacht@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 199071f1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6,3 +6,4 @@ obj-$(CONFIG_S390_HYPFS_FS) += hypfs/
obj-$(CONFIG_APPLDATA_BASE)	+= appldata/
obj-y				+= net/
obj-$(CONFIG_PCI)		+= pci/
obj-$(CONFIG_NUMA)		+= numa/
+37 −0
Original line number Diff line number Diff line
@@ -153,6 +153,10 @@ config S390
	select TTY
	select VIRT_CPU_ACCOUNTING
	select VIRT_TO_BUS
	select ARCH_SUPPORTS_NUMA_BALANCING
	select ARCH_WANTS_PROT_NUMA_PROT_NONE
	select HAVE_ARCH_EARLY_PFN_TO_NID


config SCHED_OMIT_FRAME_POINTER
	def_bool y
@@ -386,6 +390,39 @@ config HOTPLUG_CPU
config SCHED_SMT
	def_bool n

# Some NUMA nodes have memory ranges that span
# other nodes.	Even though a pfn is valid and
# between a node's start and end pfns, it may not
# reside on that node.	See memmap_init_zone()
# for details. <- They meant memory holes!
config NODES_SPAN_OTHER_NODES
	def_bool NUMA

config NUMA
	bool "NUMA support"
	depends on SMP && 64BIT && SCHED_TOPOLOGY
	default n
	help
	  Enable NUMA support

	  This option adds NUMA support to the kernel.

	  An operation mode can be selected by appending
	  numa=<method> to the kernel command line.

	  The default behaviour is identical to appending numa=plain to
	  the command line. This will create just one node with all
	  available memory and all CPUs in it.

config NODES_SHIFT
	int "Maximum NUMA nodes (as a power of 2)"
	range 1 10
	depends on NUMA
	default "4"
	help
	  Specify the maximum number of NUMA nodes available on the target
	  system. Increases memory reserved to accommodate various tables.

config SCHED_MC
	def_bool n

+16 −0
Original line number Diff line number Diff line
/*
 * NUMA support for s390
 *
 * Copyright IBM Corp. 2015
 */

#ifndef _ASM_S390_MMZONE_H
#define _ASM_S390_MMZONE_H

#ifdef CONFIG_NUMA

extern struct pglist_data *node_data[];
#define NODE_DATA(nid) (node_data[nid])

#endif /* CONFIG_NUMA */
#endif /* _ASM_S390_MMZONE_H */
+31 −0
Original line number Diff line number Diff line
/*
 * NUMA support for s390
 *
 * Declare the NUMA core code structures and functions.
 *
 * Copyright IBM Corp. 2015
 */

#ifndef _ASM_S390_NUMA_H
#define _ASM_S390_NUMA_H

#ifdef CONFIG_NUMA

#include <linux/numa.h>
#include <linux/cpumask.h>

void numa_setup(void);
int numa_pfn_to_nid(unsigned long pfn);
int __node_distance(int a, int b);
void numa_update_cpu_topology(void);

extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
extern int numa_debug_enabled;

#else

static inline void numa_setup(void) { }
static inline void numa_update_cpu_topology(void) { }

#endif /* CONFIG_NUMA */
#endif /* _ASM_S390_NUMA_H */
+16 −0
Original line number Diff line number Diff line
@@ -192,4 +192,20 @@ void zpci_debug_init_device(struct zpci_dev *);
void zpci_debug_exit_device(struct zpci_dev *);
void zpci_debug_info(struct zpci_dev *, struct seq_file *);

#ifdef CONFIG_NUMA

/* Returns the node based on PCI bus */
static inline int __pcibus_to_node(const struct pci_bus *bus)
{
	return NUMA_NO_NODE;
}

static inline const struct cpumask *
cpumask_of_pcibus(const struct pci_bus *bus)
{
	return cpu_online_mask;
}

#endif /* CONFIG_NUMA */

#endif
Loading