Skip to content

Commit 4317326

Browse files
rpptsuryasaimadhu
authored andcommitted
x86/mm: Drop deprecated DISCONTIGMEM support for 32-bit
The DISCONTIGMEM support was marked as deprecated in v5.2 and since there were no complaints about it for almost 5 releases it can be completely removed. Signed-off-by: Mike Rapoport <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Acked-by: Dave Hansen <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent e027a2b commit 4317326

File tree

4 files changed

+1
-84
lines changed

4 files changed

+1
-84
lines changed

arch/x86/Kconfig

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,19 +1610,10 @@ config NODES_SHIFT
16101610
Specify the maximum number of NUMA Nodes available on the target
16111611
system. Increases memory reserved to accommodate various tables.
16121612

1613-
config ARCH_HAVE_MEMORY_PRESENT
1614-
def_bool y
1615-
depends on X86_32 && DISCONTIGMEM
1616-
16171613
config ARCH_FLATMEM_ENABLE
16181614
def_bool y
16191615
depends on X86_32 && !NUMA
16201616

1621-
config ARCH_DISCONTIGMEM_ENABLE
1622-
def_bool n
1623-
depends on NUMA && X86_32
1624-
depends on BROKEN
1625-
16261617
config ARCH_SPARSEMEM_ENABLE
16271618
def_bool y
16281619
depends on X86_64 || NUMA || X86_32 || X86_32_NON_STANDARD

arch/x86/include/asm/mmzone_32.h

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,4 @@ extern struct pglist_data *node_data[];
1414
#define NODE_DATA(nid) (node_data[nid])
1515
#endif /* CONFIG_NUMA */
1616

17-
#ifdef CONFIG_DISCONTIGMEM
18-
19-
/*
20-
* generic node memory support, the following assumptions apply:
21-
*
22-
* 1) memory comes in 64Mb contiguous chunks which are either present or not
23-
* 2) we will not have more than 64Gb in total
24-
*
25-
* for now assume that 64Gb is max amount of RAM for whole system
26-
* 64Gb / 4096bytes/page = 16777216 pages
27-
*/
28-
#define MAX_NR_PAGES 16777216
29-
#define MAX_SECTIONS 1024
30-
#define PAGES_PER_SECTION (MAX_NR_PAGES/MAX_SECTIONS)
31-
32-
extern s8 physnode_map[];
33-
34-
static inline int pfn_to_nid(unsigned long pfn)
35-
{
36-
#ifdef CONFIG_NUMA
37-
return((int) physnode_map[(pfn) / PAGES_PER_SECTION]);
38-
#else
39-
return 0;
40-
#endif
41-
}
42-
43-
static inline int pfn_valid(int pfn)
44-
{
45-
int nid = pfn_to_nid(pfn);
46-
47-
if (nid >= 0)
48-
return (pfn < node_end_pfn(nid));
49-
return 0;
50-
}
51-
52-
#define early_pfn_valid(pfn) pfn_valid((pfn))
53-
54-
#endif /* CONFIG_DISCONTIGMEM */
55-
5617
#endif /* _ASM_X86_MMZONE_32_H */

arch/x86/include/asm/pgtable_32.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ do { \
6666
#endif /* !__ASSEMBLY__ */
6767

6868
/*
69-
* kern_addr_valid() is (1) for FLATMEM and (0) for
70-
* SPARSEMEM and DISCONTIGMEM
69+
* kern_addr_valid() is (1) for FLATMEM and (0) for SPARSEMEM
7170
*/
7271
#ifdef CONFIG_FLATMEM
7372
#define kern_addr_valid(addr) (1)

arch/x86/mm/numa_32.c

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,40 +27,6 @@
2727

2828
#include "numa_internal.h"
2929

30-
#ifdef CONFIG_DISCONTIGMEM
31-
/*
32-
* 4) physnode_map - the mapping between a pfn and owning node
33-
* physnode_map keeps track of the physical memory layout of a generic
34-
* numa node on a 64Mb break (each element of the array will
35-
* represent 64Mb of memory and will be marked by the node id. so,
36-
* if the first gig is on node 0, and the second gig is on node 1
37-
* physnode_map will contain:
38-
*
39-
* physnode_map[0-15] = 0;
40-
* physnode_map[16-31] = 1;
41-
* physnode_map[32- ] = -1;
42-
*/
43-
s8 physnode_map[MAX_SECTIONS] __read_mostly = { [0 ... (MAX_SECTIONS - 1)] = -1};
44-
EXPORT_SYMBOL(physnode_map);
45-
46-
void memory_present(int nid, unsigned long start, unsigned long end)
47-
{
48-
unsigned long pfn;
49-
50-
printk(KERN_INFO "Node: %d, start_pfn: %lx, end_pfn: %lx\n",
51-
nid, start, end);
52-
printk(KERN_DEBUG " Setting physnode_map array to node %d for pfns:\n", nid);
53-
printk(KERN_DEBUG " ");
54-
start = round_down(start, PAGES_PER_SECTION);
55-
end = round_up(end, PAGES_PER_SECTION);
56-
for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) {
57-
physnode_map[pfn / PAGES_PER_SECTION] = nid;
58-
printk(KERN_CONT "%lx ", pfn);
59-
}
60-
printk(KERN_CONT "\n");
61-
}
62-
#endif
63-
6430
extern unsigned long highend_pfn, highstart_pfn;
6531

6632
void __init initmem_init(void)

0 commit comments

Comments
 (0)