Skip to contentSkip to conversation

x86: drop obsolete ARCH_BOOTMEM support

PATCH In review Sam Ravnborg 3 participants 6 messages Apr 6, 2012 – Apr 14, 2012 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: drop obsolete ARCH_BOOTMEM support

Quoted 1 line

From ae6cdc767f973f39cb205af4b80ff13f35a1b66e Mon Sep 17 00:00:00 2001

From: Sam Ravnborg <[email protected]>
Date: Fri, 6 Apr 2012 13:37:08 +0200
Subject: [PATCH] x86: drop obsolete ARCH_BOOTMEM support

x86 unconditionally uses NO_BOOTMEM so there is no use of the HAVE_ARCH_BOOTMEM support as mm/bootmem.c is the only file referencing this symbol.

bootmem_arch_preferred_node() is the function referred in the mm/bootmem.c code and can thuis be dropped too.

x86 was the sole user of HAVE_ARCH_BOOTMEM - so there is an opportunity to clean up a little in mm/bootmem.c too if we do not expect other users to emerge.

---

I found this while browsing the bootmem code for other reasons. Build tested on x86-32

Sam

 arch/x86/Kconfig                 |    4 ----
 arch/x86/include/asm/mmzone_32.h |    6 ------
 2 files changed, 0 insertions(+), 10 deletions(-)
arch/x86/Kconfig +0 -4
index 1d14cc6..553f15e 100644
@@ -1239,10 +1239,6 @@ config NODES_SHIFT
 	  Specify the maximum number of NUMA Nodes available on the target
 	  system.  Increases memory reserved to accommodate various tables.
 
-config HAVE_ARCH_BOOTMEM
-	def_bool y
-	depends on X86_32 && NUMA
-
 config HAVE_ARCH_ALLOC_REMAP
 	def_bool y
 	depends on X86_32 && NUMA
arch/x86/include/asm/mmzone_32.h +0 -6
index 55728e1..eb05fb3 100644
@@ -61,10 +61,4 @@ static inline int pfn_valid(int pfn)
 
 #endif /* CONFIG_DISCONTIGMEM */
 
-#ifdef CONFIG_NEED_MULTIPLE_NODES
-/* always use node 0 for bootmem on this numa platform */
-#define bootmem_arch_preferred_node(__bdata, size, align, goal, limit)	\
-	(NODE_DATA(0)->bdata)
-#endif /* CONFIG_NEED_MULTIPLE_NODES */
-
 #endif /* _ASM_X86_MMZONE_32_H */
Signature · 1 line
1.6.0.6
#1 lore raw
Quoted 9 lines · Sam Ravnborg

From ae6cdc767f973f39cb205af4b80ff13f35a1b66e Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
Date: Fri, 6 Apr 2012 13:37:08 +0200
Subject: [PATCH] x86: drop obsolete ARCH_BOOTMEM support

x86 unconditionally uses NO_BOOTMEM so there is no use of the HAVE_ARCH_BOOTMEM support as mm/bootmem.c is the only file referencing this symbol.

Quoted 6 lines

bootmem_arch_preferred_node() is the function referred in the mm/bootmem.c code and can thuis be dropped too.

x86 was the sole user of HAVE_ARCH_BOOTMEM - so there is an opportunity to clean up a little in mm/bootmem.c too if we do not expect other users to emerge.

avr32 seems to have it too?

Signature · 1 line
tejun
#2 lore raw
Quoted 10 lines · Tejun Heo
Quoted 9 lines · Sam Ravnborg

From ae6cdc767f973f39cb205af4b80ff13f35a1b66e Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
Date: Fri, 6 Apr 2012 13:37:08 +0200
Subject: [PATCH] x86: drop obsolete ARCH_BOOTMEM support

x86 unconditionally uses NO_BOOTMEM so there is no use of the HAVE_ARCH_BOOTMEM support as mm/bootmem.c is the only file referencing this symbol.

Quoted 8 lines
Quoted 6 lines

bootmem_arch_preferred_node() is the function referred in the mm/bootmem.c code and can thuis be dropped too.

x86 was the sole user of HAVE_ARCH_BOOTMEM - so there is an opportunity to clean up a little in mm/bootmem.c too if we do not expect other users to emerge.

avr32 seems to have it too?

avr32 is:

config HAVE_ARCH_BOOTMEM
def_bool n

so that is not used with avr32

Yinghai

#3 lore raw
Quoted 18 lines · Yinghai Lu
Quoted 17 lines · Tejun Heo
Quoted 15 lines · Sam Ravnborg

From ae6cdc767f973f39cb205af4b80ff13f35a1b66e Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
Date: Fri, 6 Apr 2012 13:37:08 +0200
Subject: [PATCH] x86: drop obsolete ARCH_BOOTMEM support

x86 unconditionally uses NO_BOOTMEM so there is no use of the HAVE_ARCH_BOOTMEM support as mm/bootmem.c is the only file referencing this symbol.

bootmem_arch_preferred_node() is the function referred in the mm/bootmem.c code and can thuis be dropped too.

x86 was the sole user of HAVE_ARCH_BOOTMEM - so there is an opportunity to clean up a little in mm/bootmem.c too if we do not expect other users to emerge.

Quoted 8 lines
Quoted 1 line

avr32 seems to have it too?

avr32 is:

config HAVE_ARCH_BOOTMEM
def_bool n

so that is not used with avr32

Yeah, then better remove the reference from there too, right?

Thanks.

Signature · 1 line
tejun
#4 lore raw
Quoted 21 lines · Tejun Heo
Quoted 20 lines · Yinghai Lu
Quoted 18 lines · Tejun Heo
Quoted 9 lines · Sam Ravnborg

From ae6cdc767f973f39cb205af4b80ff13f35a1b66e Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
Date: Fri, 6 Apr 2012 13:37:08 +0200
Subject: [PATCH] x86: drop obsolete ARCH_BOOTMEM support

x86 unconditionally uses NO_BOOTMEM so there is no use of the HAVE_ARCH_BOOTMEM support as mm/bootmem.c is the only file referencing this symbol.

Quoted 6 lines

bootmem_arch_preferred_node() is the function referred in the mm/bootmem.c code and can thuis be dropped too.

x86 was the sole user of HAVE_ARCH_BOOTMEM - so there is an opportunity to clean up a little in mm/bootmem.c too if we do not expect other users to emerge.

avr32 seems to have it too?

Quoted 8 lines
Quoted 6 lines

avr32 is:

config HAVE_ARCH_BOOTMEM
def_bool n

so that is not used with avr32

Yeah, then better remove the reference from there too, right?

Yep - will do tomorrow.

Sam

#5 lore raw

[tip:x86/mm] x86: Drop obsolete ARCH_BOOTMEM support

In reply to Sam Ravnborg
Commit-ID:  302616911da8e868d3f1a00dce517ca30b0e065d
Gitweb:     http://git.kernel.org/tip/302616911da8e868d3f1a00dce517ca30b0e065d
Author:     Sam Ravnborg <[email protected]>
AuthorDate: Fri, 6 Apr 2012 14:47:35 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 14 Apr 2012 14:28:58 +0200

x86: Drop obsolete ARCH_BOOTMEM support

x86 unconditionally uses NO_BOOTMEM so there is no use of the HAVE_ARCH_BOOTMEM support as mm/bootmem.c is the only file referencing this symbol.

bootmem_arch_preferred_node() is the function referred in the mm/bootmem.c code and can thuis be dropped too.

x86 was the sole user of HAVE_ARCH_BOOTMEM - so there is an opportunity to clean up a little in mm/bootmem.c too if we do not expect other users to emerge.

---
 arch/x86/Kconfig                 |    4 ----
 arch/x86/include/asm/mmzone_32.h |    6 ------
 2 files changed, 0 insertions(+), 10 deletions(-)
arch/x86/Kconfig +0 -4
index 5bed94e..a105ee7 100644
@@ -1255,10 +1255,6 @@ config NODES_SHIFT
 	  Specify the maximum number of NUMA Nodes available on the target
 	  system.  Increases memory reserved to accommodate various tables.
 
-config HAVE_ARCH_BOOTMEM
-	def_bool y
-	depends on X86_32 && NUMA
-
 config HAVE_ARCH_ALLOC_REMAP
 	def_bool y
 	depends on X86_32 && NUMA
arch/x86/include/asm/mmzone_32.h +0 -6
index 55728e1..eb05fb3 100644
@@ -61,10 +61,4 @@ static inline int pfn_valid(int pfn)
 
 #endif /* CONFIG_DISCONTIGMEM */
 
-#ifdef CONFIG_NEED_MULTIPLE_NODES
-/* always use node 0 for bootmem on this numa platform */
-#define bootmem_arch_preferred_node(__bdata, size, align, goal, limit)	\
-	(NODE_DATA(0)->bdata)
-#endif /* CONFIG_NEED_MULTIPLE_NODES */
-
 #endif /* _ASM_X86_MMZONE_32_H */