Skip to content

Commit fdb7d9b

Browse files
rppttorvalds
authored andcommitted
alpha: remove DISCONTIGMEM and NUMA
Patch series "Remove DISCONTIGMEM memory model", v3. SPARSEMEM memory model was supposed to entirely replace DISCONTIGMEM a (long) while ago. The last architectures that used DISCONTIGMEM were updated to use other memory models in v5.11 and it is about the time to entirely remove DISCONTIGMEM from the kernel. This set removes DISCONTIGMEM from alpha, arc and m68k, simplifies memory model selection in mm/Kconfig and replaces usage of redundant CONFIG_NEED_MULTIPLE_NODES and CONFIG_FLAT_NODE_MEM_MAP with CONFIG_NUMA and CONFIG_FLATMEM respectively. I've also removed NUMA support on alpha that was BROKEN for more than 15 years. There were also minor updates all over arch/ to remove mentions of DISCONTIGMEM in comments and #ifdefs. This patch (of 9): NUMA is marked broken on alpha for more than 15 years and DISCONTIGMEM was replaced with SPARSEMEM in v5.11. Remove both NUMA and DISCONTIGMEM support from alpha. Link: https://lkml.kernel.org/r/20210608091316.3622-1-rppt@kernel.org Link: https://lkml.kernel.org/r/20210608091316.3622-2-rppt@kernel.org Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: David Hildenbrand <david@redhat.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Matt Turner <mattst88@gmail.com> Cc: Richard Henderson <rth@twiddle.net> Cc: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 21d02f8 commit fdb7d9b

15 files changed

Lines changed: 4 additions & 540 deletions

File tree

arch/alpha/Kconfig

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -549,29 +549,12 @@ config NR_CPUS
549549
MARVEL support can handle a maximum of 32 CPUs, all the others
550550
with working support have a maximum of 4 CPUs.
551551

552-
config ARCH_DISCONTIGMEM_ENABLE
553-
bool "Discontiguous Memory Support"
554-
depends on BROKEN
555-
help
556-
Say Y to support efficient handling of discontiguous physical memory,
557-
for architectures which are either NUMA (Non-Uniform Memory Access)
558-
or have huge holes in the physical address space for other reasons.
559-
See <file:Documentation/vm/numa.rst> for more.
560-
561552
config ARCH_SPARSEMEM_ENABLE
562553
bool "Sparse Memory Support"
563554
help
564555
Say Y to support efficient handling of discontiguous physical memory,
565556
for systems that have huge holes in the physical address space.
566557

567-
config NUMA
568-
bool "NUMA Support (EXPERIMENTAL)"
569-
depends on DISCONTIGMEM && BROKEN
570-
help
571-
Say Y to compile the kernel to support NUMA (Non-Uniform Memory
572-
Access). This option is for configuring high-end multiprocessor
573-
server machines. If in doubt, say N.
574-
575558
config ALPHA_WTINT
576559
bool "Use WTINT" if ALPHA_SRM || ALPHA_GENERIC
577560
default y if ALPHA_QEMU
@@ -596,11 +579,6 @@ config ALPHA_WTINT
596579

597580
If unsure, say N.
598581

599-
config NODES_SHIFT
600-
int
601-
default "7"
602-
depends on NEED_MULTIPLE_NODES
603-
604582
# LARGE_VMALLOC is racy, if you *really* need it then fix it first
605583
config ALPHA_LARGE_VMALLOC
606584
bool

arch/alpha/include/asm/machvec.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ struct alpha_machine_vector
9999

100100
const char *vector_name;
101101

102-
/* NUMA information */
103-
int (*pa_to_nid)(unsigned long);
104-
int (*cpuid_to_nid)(int);
105-
unsigned long (*node_mem_start)(int);
106-
unsigned long (*node_mem_size)(int);
107-
108102
/* System specific parameters. */
109103
union {
110104
struct {

arch/alpha/include/asm/mmzone.h

Lines changed: 0 additions & 100 deletions
This file was deleted.

arch/alpha/include/asm/pgtable.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ extern unsigned long __zero_page(void);
206206
#define page_to_pa(page) (page_to_pfn(page) << PAGE_SHIFT)
207207
#define pte_pfn(pte) (pte_val(pte) >> 32)
208208

209-
#ifndef CONFIG_DISCONTIGMEM
210209
#define pte_page(pte) pfn_to_page(pte_pfn(pte))
211210
#define mk_pte(page, pgprot) \
212211
({ \
@@ -215,7 +214,6 @@ extern unsigned long __zero_page(void);
215214
pte_val(pte) = (page_to_pfn(page) << 32) | pgprot_val(pgprot); \
216215
pte; \
217216
})
218-
#endif
219217

220218
extern inline pte_t pfn_pte(unsigned long physpfn, pgprot_t pgprot)
221219
{ pte_t pte; pte_val(pte) = (PHYS_TWIDDLE(physpfn) << 32) | pgprot_val(pgprot); return pte; }
@@ -330,9 +328,7 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
330328
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
331329
#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
332330

333-
#ifndef CONFIG_DISCONTIGMEM
334331
#define kern_addr_valid(addr) (1)
335-
#endif
336332

337333
#define pte_ERROR(e) \
338334
printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))

arch/alpha/include/asm/topology.h

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,6 @@
77
#include <linux/numa.h>
88
#include <asm/machvec.h>
99

10-
#ifdef CONFIG_NUMA
11-
static inline int cpu_to_node(int cpu)
12-
{
13-
int node;
14-
15-
if (!alpha_mv.cpuid_to_nid)
16-
return 0;
17-
18-
node = alpha_mv.cpuid_to_nid(cpu);
19-
20-
#ifdef DEBUG_NUMA
21-
BUG_ON(node < 0);
22-
#endif
23-
24-
return node;
25-
}
26-
27-
extern struct cpumask node_to_cpumask_map[];
28-
/* FIXME: This is dumb, recalculating every time. But simple. */
29-
static const struct cpumask *cpumask_of_node(int node)
30-
{
31-
int cpu;
32-
33-
if (node == NUMA_NO_NODE)
34-
return cpu_all_mask;
35-
36-
cpumask_clear(&node_to_cpumask_map[node]);
37-
38-
for_each_online_cpu(cpu) {
39-
if (cpu_to_node(cpu) == node)
40-
cpumask_set_cpu(cpu, node_to_cpumask_map[node]);
41-
}
42-
43-
return &node_to_cpumask_map[node];
44-
}
45-
46-
#define cpumask_of_pcibus(bus) (cpu_online_mask)
47-
48-
#endif /* !CONFIG_NUMA */
4910
# include <asm-generic/topology.h>
5011

5112
#endif /* _ASM_ALPHA_TOPOLOGY_H */

arch/alpha/kernel/core_marvel.c

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,7 @@ io7_init_hose(struct io7 *io7, int port)
287287
/*
288288
* Set up window 0 for scatter-gather 8MB at 8MB.
289289
*/
290-
hose->sg_isa = iommu_arena_new_node(marvel_cpuid_to_nid(io7->pe),
291-
hose, 0x00800000, 0x00800000, 0);
290+
hose->sg_isa = iommu_arena_new_node(0, hose, 0x00800000, 0x00800000, 0);
292291
hose->sg_isa->align_entry = 8; /* cache line boundary */
293292
csrs->POx_WBASE[0].csr =
294293
hose->sg_isa->dma_base | wbase_m_ena | wbase_m_sg;
@@ -305,8 +304,7 @@ io7_init_hose(struct io7 *io7, int port)
305304
/*
306305
* Set up window 2 for scatter-gather (up-to) 1GB at 3GB.
307306
*/
308-
hose->sg_pci = iommu_arena_new_node(marvel_cpuid_to_nid(io7->pe),
309-
hose, 0xc0000000, 0x40000000, 0);
307+
hose->sg_pci = iommu_arena_new_node(0, hose, 0xc0000000, 0x40000000, 0);
310308
hose->sg_pci->align_entry = 8; /* cache line boundary */
311309
csrs->POx_WBASE[2].csr =
312310
hose->sg_pci->dma_base | wbase_m_ena | wbase_m_sg;
@@ -843,53 +841,8 @@ EXPORT_SYMBOL(marvel_ioportmap);
843841
EXPORT_SYMBOL(marvel_ioread8);
844842
EXPORT_SYMBOL(marvel_iowrite8);
845843
#endif
846-
847-
/*
848-
* NUMA Support
849-
*/
850-
/**********
851-
* FIXME - for now each cpu is a node by itself
852-
* -- no real support for striped mode
853-
**********
854-
*/
855-
int
856-
marvel_pa_to_nid(unsigned long pa)
857-
{
858-
int cpuid;
859844

860-
if ((pa >> 43) & 1) /* I/O */
861-
cpuid = (~(pa >> 35) & 0xff);
862-
else /* mem */
863-
cpuid = ((pa >> 34) & 0x3) | ((pa >> (37 - 2)) & (0x1f << 2));
864-
865-
return marvel_cpuid_to_nid(cpuid);
866-
}
867-
868-
int
869-
marvel_cpuid_to_nid(int cpuid)
870-
{
871-
return cpuid;
872-
}
873-
874-
unsigned long
875-
marvel_node_mem_start(int nid)
876-
{
877-
unsigned long pa;
878-
879-
pa = (nid & 0x3) | ((nid & (0x1f << 2)) << 1);
880-
pa <<= 34;
881-
882-
return pa;
883-
}
884-
885-
unsigned long
886-
marvel_node_mem_size(int nid)
887-
{
888-
return 16UL * 1024 * 1024 * 1024; /* 16GB */
889-
}
890-
891-
892-
/*
845+
/*
893846
* AGP GART Support.
894847
*/
895848
#include <linux/agp_backend.h>

arch/alpha/kernel/core_wildfire.c

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -434,39 +434,12 @@ wildfire_write_config(struct pci_bus *bus, unsigned int devfn, int where,
434434
return PCIBIOS_SUCCESSFUL;
435435
}
436436

437-
struct pci_ops wildfire_pci_ops =
437+
struct pci_ops wildfire_pci_ops =
438438
{
439439
.read = wildfire_read_config,
440440
.write = wildfire_write_config,
441441
};
442442

443-
444-
/*
445-
* NUMA Support
446-
*/
447-
int wildfire_pa_to_nid(unsigned long pa)
448-
{
449-
return pa >> 36;
450-
}
451-
452-
int wildfire_cpuid_to_nid(int cpuid)
453-
{
454-
/* assume 4 CPUs per node */
455-
return cpuid >> 2;
456-
}
457-
458-
unsigned long wildfire_node_mem_start(int nid)
459-
{
460-
/* 64GB per node */
461-
return (unsigned long)nid * (64UL * 1024 * 1024 * 1024);
462-
}
463-
464-
unsigned long wildfire_node_mem_size(int nid)
465-
{
466-
/* 64GB per node */
467-
return 64UL * 1024 * 1024 * 1024;
468-
}
469-
470443
#if DEBUG_DUMP_REGS
471444

472445
static void __init

arch/alpha/kernel/pci_iommu.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -71,33 +71,6 @@ iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base,
7171
if (align < mem_size)
7272
align = mem_size;
7373

74-
75-
#ifdef CONFIG_DISCONTIGMEM
76-
77-
arena = memblock_alloc_node(sizeof(*arena), align, nid);
78-
if (!NODE_DATA(nid) || !arena) {
79-
printk("%s: couldn't allocate arena from node %d\n"
80-
" falling back to system-wide allocation\n",
81-
__func__, nid);
82-
arena = memblock_alloc(sizeof(*arena), SMP_CACHE_BYTES);
83-
if (!arena)
84-
panic("%s: Failed to allocate %zu bytes\n", __func__,
85-
sizeof(*arena));
86-
}
87-
88-
arena->ptes = memblock_alloc_node(sizeof(*arena), align, nid);
89-
if (!NODE_DATA(nid) || !arena->ptes) {
90-
printk("%s: couldn't allocate arena ptes from node %d\n"
91-
" falling back to system-wide allocation\n",
92-
__func__, nid);
93-
arena->ptes = memblock_alloc(mem_size, align);
94-
if (!arena->ptes)
95-
panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
96-
__func__, mem_size, align);
97-
}
98-
99-
#else /* CONFIG_DISCONTIGMEM */
100-
10174
arena = memblock_alloc(sizeof(*arena), SMP_CACHE_BYTES);
10275
if (!arena)
10376
panic("%s: Failed to allocate %zu bytes\n", __func__,
@@ -107,8 +80,6 @@ iommu_arena_new_node(int nid, struct pci_controller *hose, dma_addr_t base,
10780
panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
10881
__func__, mem_size, align);
10982

110-
#endif /* CONFIG_DISCONTIGMEM */
111-
11283
spin_lock_init(&arena->lock);
11384
arena->hose = hose;
11485
arena->dma_base = base;

0 commit comments

Comments
 (0)