Skip to content

Commit

Permalink
s390/mm: remove fake numa support
Browse files Browse the repository at this point in the history
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: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
  • Loading branch information
Heiko Carstens authored and Vasily Gorbik committed Feb 27, 2020
1 parent 4a559cd commit 701dc81
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 1,231 deletions.
61 changes: 2 additions & 59 deletions arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -450,14 +450,6 @@ config NR_CPUS
config HOTPLUG_CPU
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
bool "NUMA support"
depends on SCHED_TOPOLOGY
Expand All @@ -467,58 +459,9 @@ config NUMA

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.

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
int
default "1"

config SCHED_SMT
def_bool n
Expand Down
13 changes: 1 addition & 12 deletions arch/s390/include/asm/numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,13 @@
#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_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) { }
static inline int numa_pfn_to_nid(unsigned long pfn)
{
return 0;
}

#endif /* CONFIG_NUMA */

#endif /* _ASM_S390_NUMA_H */
9 changes: 6 additions & 3 deletions arch/s390/include/asm/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ struct cpu_topology_s390 {
unsigned short socket_id;
unsigned short book_id;
unsigned short drawer_id;
unsigned short node_id;
unsigned short dedicated : 1;
cpumask_t thread_mask;
cpumask_t core_mask;
Expand Down Expand Up @@ -71,19 +70,23 @@ static inline void topology_expect_change(void) { }
#define cpu_to_node cpu_to_node
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'. */
#define cpumask_of_node cpumask_of_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 node_distance(a, b) __node_distance(a, b)
static inline int __node_distance(int a, int b)
{
return 0;
}

#else /* !CONFIG_NUMA */

Expand Down
1 change: 1 addition & 0 deletions arch/s390/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ static void __init memblock_add_mem_detect_info(void)
memblock_physmem_add(start, end - start);
}
memblock_set_bottom_up(false);
memblock_set_node(0, ULONG_MAX, &memblock.memory, 0);
memblock_dump_all();
}

Expand Down
2 changes: 0 additions & 2 deletions arch/s390/kernel/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <linux/nodemask.h>
#include <linux/node.h>
#include <asm/sysinfo.h>
#include <asm/numa.h>

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

void store_topology(struct sysinfo_15_1_x *info)
Expand Down
2 changes: 0 additions & 2 deletions arch/s390/numa/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# SPDX-License-Identifier: GPL-2.0
obj-y += numa.o
obj-y += toptree.o
obj-$(CONFIG_NUMA_EMU) += mode_emu.o
Loading

0 comments on commit 701dc81

Please sign in to comment.