Commit 701dc81e authored by Heiko Carstens's avatar Heiko Carstens Committed by Vasily Gorbik
Browse files

s390/mm: remove fake numa support



It turned out that fake numa support is rather useless on s390, since
there are no scenarios where there is any performance or other benefit
when used.

However it does provide maintenance cost and breaks from time to time.
Therefore remove it.

CONFIG_NUMA is still supported with a very small backend and only one
node. This way userspace applications which require NUMA interfaces
continue to work.

Note that NODES_SHIFT is set to 1 (= 2 nodes) instead of 0 (= 1 node),
since there is quite a bit of kernel code which assumes that more than
one node is possible if CONFIG_NUMA is enabled.

Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 4a559cd1
Loading
Loading
Loading
Loading
+2 −59
Original line number Original line Diff line number Diff line
@@ -450,14 +450,6 @@ config NR_CPUS
config HOTPLUG_CPU
config HOTPLUG_CPU
	def_bool y
	def_bool y


# 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
config NUMA
	bool "NUMA support"
	bool "NUMA support"
	depends on SCHED_TOPOLOGY
	depends on SCHED_TOPOLOGY
@@ -467,58 +459,9 @@ config NUMA


	  This option adds NUMA support to the kernel.
	  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
config NODES_SHIFT
	int "Maximum NUMA nodes (as a power of 2)"
	int
	range 1 10
	default "1"
	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.

menu "Select NUMA modes"
	depends on NUMA

config NUMA_EMU
	bool "NUMA emulation"
	default y
	help
	  Numa emulation mode will split the available system memory into
	  equal chunks which then are distributed over the configured number
	  of nodes in a round-robin manner.

	  The number of fake nodes is limited by the number of available memory
	  chunks (i.e. memory size / fake size) and the number of supported
	  nodes in the kernel.

	  The CPUs are assigned to the nodes in a way that partially respects
	  the original machine topology (if supported by the machine).
	  Fair distribution of the CPUs is not guaranteed.

config EMU_SIZE
	hex "NUMA emulation memory chunk size"
	default 0x10000000
	range 0x400000 0x100000000
	depends on NUMA_EMU
	help
	  Select the default size by which the memory is chopped and then
	  assigned to emulated NUMA nodes.

	  This can be overridden by specifying

	  emu_size=<n>

	  on the kernel command line where also suffixes K, M, G, and T are
	  supported.

endmenu


config SCHED_SMT
config SCHED_SMT
	def_bool n
	def_bool n
+1 −12
Original line number Original line Diff line number Diff line
@@ -13,24 +13,13 @@
#ifdef CONFIG_NUMA
#ifdef CONFIG_NUMA


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


void numa_setup(void);
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_t node_to_cpumask_map[MAX_NUMNODES];
extern int numa_debug_enabled;


#else
#else


static inline void numa_setup(void) { }
static inline void numa_setup(void) { }
static inline void numa_update_cpu_topology(void) { }
static inline int numa_pfn_to_nid(unsigned long pfn)
{
	return 0;
}


#endif /* CONFIG_NUMA */
#endif /* CONFIG_NUMA */

#endif /* _ASM_S390_NUMA_H */
#endif /* _ASM_S390_NUMA_H */
+6 −3
Original line number Original line Diff line number Diff line
@@ -16,7 +16,6 @@ struct cpu_topology_s390 {
	unsigned short socket_id;
	unsigned short socket_id;
	unsigned short book_id;
	unsigned short book_id;
	unsigned short drawer_id;
	unsigned short drawer_id;
	unsigned short node_id;
	unsigned short dedicated : 1;
	unsigned short dedicated : 1;
	cpumask_t thread_mask;
	cpumask_t thread_mask;
	cpumask_t core_mask;
	cpumask_t core_mask;
@@ -71,19 +70,23 @@ static inline void topology_expect_change(void) { }
#define cpu_to_node cpu_to_node
#define cpu_to_node cpu_to_node
static inline int cpu_to_node(int cpu)
static inline int cpu_to_node(int cpu)
{
{
	return cpu_topology[cpu].node_id;
	return 0;
}
}


/* Returns a pointer to the cpumask of CPUs on node 'node'. */
/* Returns a pointer to the cpumask of CPUs on node 'node'. */
#define cpumask_of_node cpumask_of_node
#define cpumask_of_node cpumask_of_node
static inline const struct cpumask *cpumask_of_node(int node)
static inline const struct cpumask *cpumask_of_node(int node)
{
{
	return &node_to_cpumask_map[node];
	return cpu_possible_mask;
}
}


#define pcibus_to_node(bus) __pcibus_to_node(bus)
#define pcibus_to_node(bus) __pcibus_to_node(bus)


#define node_distance(a, b) __node_distance(a, b)
#define node_distance(a, b) __node_distance(a, b)
static inline int __node_distance(int a, int b)
{
	return 0;
}


#else /* !CONFIG_NUMA */
#else /* !CONFIG_NUMA */


+1 −0
Original line number Original line Diff line number Diff line
@@ -790,6 +790,7 @@ static void __init memblock_add_mem_detect_info(void)
		memblock_physmem_add(start, end - start);
		memblock_physmem_add(start, end - start);
	}
	}
	memblock_set_bottom_up(false);
	memblock_set_bottom_up(false);
	memblock_set_node(0, ULONG_MAX, &memblock.memory, 0);
	memblock_dump_all();
	memblock_dump_all();
}
}


+0 −2
Original line number Original line Diff line number Diff line
@@ -26,7 +26,6 @@
#include <linux/nodemask.h>
#include <linux/nodemask.h>
#include <linux/node.h>
#include <linux/node.h>
#include <asm/sysinfo.h>
#include <asm/sysinfo.h>
#include <asm/numa.h>


#define PTF_HORIZONTAL	(0UL)
#define PTF_HORIZONTAL	(0UL)
#define PTF_VERTICAL	(1UL)
#define PTF_VERTICAL	(1UL)
@@ -267,7 +266,6 @@ static void update_cpu_masks(void)
				cpumask_set_cpu(cpu, &cpus_with_topology);
				cpumask_set_cpu(cpu, &cpus_with_topology);
		}
		}
	}
	}
	numa_update_cpu_topology();
}
}


void store_topology(struct sysinfo_15_1_x *info)
void store_topology(struct sysinfo_15_1_x *info)
Loading