linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Drop support for memory-hotplug and memory-hotremove on superH
@ 2024-05-18 11:58 Oscar Salvador
  2024-05-18 11:58 ` [PATCH 1/2] arch/sh: Remove code that handles memory-hotplug and memory-hotremove Oscar Salvador
  2024-05-18 11:58 ` [PATCH 2/2] arch/sh: Drop support for " Oscar Salvador
  0 siblings, 2 replies; 5+ messages in thread
From: Oscar Salvador @ 2024-05-18 11:58 UTC (permalink / raw)
  To: linux-sh
  Cc: linux-mm, David Hildenbrand, John Paul Adrian Glaubitz,
	Geert Uytterhoeven, Oscar Salvador

memory-hotplug dropped support for 32bit platforms a while back,
and given that superH can only operate on 32bit at this moment,
this cannot possibily work.

Remove all code and Kconfigs related to memory-hotplug and memory-hotremove.

Oscar Salvador (2):
  arch/sh: Remove code that handles memory-hotplug and memory-hotremove
  arch/sh: Drop support for memory-hotplug and memory-hotremove

 arch/sh/Kconfig                     |  2 --
 arch/sh/configs/apsh4ad0a_defconfig |  2 --
 arch/sh/configs/sdk7786_defconfig   |  2 --
 arch/sh/configs/shx3_defconfig      |  2 --
 arch/sh/mm/Kconfig                  |  4 ----
 arch/sh/mm/init.c                   | 28 ----------------------------
 6 files changed, 40 deletions(-)

-- 
2.45.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] arch/sh: Remove code that handles memory-hotplug and memory-hotremove
  2024-05-18 11:58 [PATCH 0/2] Drop support for memory-hotplug and memory-hotremove on superH Oscar Salvador
@ 2024-05-18 11:58 ` Oscar Salvador
  2024-07-11 10:20   ` John Paul Adrian Glaubitz
  2024-05-18 11:58 ` [PATCH 2/2] arch/sh: Drop support for " Oscar Salvador
  1 sibling, 1 reply; 5+ messages in thread
From: Oscar Salvador @ 2024-05-18 11:58 UTC (permalink / raw)
  To: linux-sh
  Cc: linux-mm, David Hildenbrand, John Paul Adrian Glaubitz,
	Geert Uytterhoeven, Oscar Salvador

Since commit 7ec58a2b941ed889("mm/memory_hotplug: restrict
CONFIG_MEMORY_HOTPLUG to 64 bit"), we only support memory-hotplug on
64bits platforms, but currently superH can only run on 32bit, so
remove the code that handles memory-hotplug and memory-hotremove as
that cannot work.

Signed-off-by: Oscar Salvador <osalvador@suse.de>
---
 arch/sh/mm/init.c | 28 ----------------------------
 1 file changed, 28 deletions(-)

diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index bf1b54055316..d1fe90b2f5ff 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -395,31 +395,3 @@ void __init mem_init(void)
 
 	mem_init_done = 1;
 }
-
-#ifdef CONFIG_MEMORY_HOTPLUG
-int arch_add_memory(int nid, u64 start, u64 size,
-		    struct mhp_params *params)
-{
-	unsigned long start_pfn = PFN_DOWN(start);
-	unsigned long nr_pages = size >> PAGE_SHIFT;
-	int ret;
-
-	if (WARN_ON_ONCE(params->pgprot.pgprot != PAGE_KERNEL.pgprot))
-		return -EINVAL;
-
-	/* We only have ZONE_NORMAL, so this is easy.. */
-	ret = __add_pages(nid, start_pfn, nr_pages, params);
-	if (unlikely(ret))
-		printk("%s: Failed, __add_pages() == %d\n", __func__, ret);
-
-	return ret;
-}
-
-void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
-{
-	unsigned long start_pfn = PFN_DOWN(start);
-	unsigned long nr_pages = size >> PAGE_SHIFT;
-
-	__remove_pages(start_pfn, nr_pages, altmap);
-}
-#endif /* CONFIG_MEMORY_HOTPLUG */
-- 
2.45.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] arch/sh: Drop support for memory-hotplug and memory-hotremove
  2024-05-18 11:58 [PATCH 0/2] Drop support for memory-hotplug and memory-hotremove on superH Oscar Salvador
  2024-05-18 11:58 ` [PATCH 1/2] arch/sh: Remove code that handles memory-hotplug and memory-hotremove Oscar Salvador
@ 2024-05-18 11:58 ` Oscar Salvador
  2024-07-11 10:20   ` John Paul Adrian Glaubitz
  1 sibling, 1 reply; 5+ messages in thread
From: Oscar Salvador @ 2024-05-18 11:58 UTC (permalink / raw)
  To: linux-sh
  Cc: linux-mm, David Hildenbrand, John Paul Adrian Glaubitz,
	Geert Uytterhoeven, Oscar Salvador

Remove all CONFIG options related to memory-hotplug and memory-hotremove.

Signed-off-by: Oscar Salvador <osalvador@suse.de>
---
 arch/sh/Kconfig                     | 2 --
 arch/sh/configs/apsh4ad0a_defconfig | 2 --
 arch/sh/configs/sdk7786_defconfig   | 2 --
 arch/sh/configs/shx3_defconfig      | 2 --
 arch/sh/mm/Kconfig                  | 4 ----
 5 files changed, 12 deletions(-)

diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 6bc60f964f96..c5c093c73aa1 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -3,8 +3,6 @@ config SUPERH
 	def_bool y
 	select ARCH_32BIT_OFF_T
 	select ARCH_HAS_CPU_CACHE_ALIASING
-	select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM && MMU
-	select ARCH_ENABLE_MEMORY_HOTREMOVE if SPARSEMEM && MMU
 	select ARCH_HAVE_NMI_SAFE_CMPXCHG if (GUSA_RB || CPU_SH4A)
 	select ARCH_HAS_BINFMT_FLAT if !MMU
 	select ARCH_HAS_CPU_FINALIZE_INIT
diff --git a/arch/sh/configs/apsh4ad0a_defconfig b/arch/sh/configs/apsh4ad0a_defconfig
index 64558bf60e10..19ed0601a36f 100644
--- a/arch/sh/configs/apsh4ad0a_defconfig
+++ b/arch/sh/configs/apsh4ad0a_defconfig
@@ -24,8 +24,6 @@ CONFIG_BFQ_GROUP_IOSCHED=y
 CONFIG_CPU_SUBTYPE_SH7786=y
 CONFIG_MEMORY_SIZE=0x10000000
 CONFIG_HUGETLB_PAGE_SIZE_1MB=y
-CONFIG_MEMORY_HOTPLUG=y
-CONFIG_MEMORY_HOTREMOVE=y
 CONFIG_KSM=y
 CONFIG_SH_STORE_QUEUES=y
 CONFIG_SH_APSH4AD0A=y
diff --git a/arch/sh/configs/sdk7786_defconfig b/arch/sh/configs/sdk7786_defconfig
index 7b427c17fbfe..07894f13441e 100644
--- a/arch/sh/configs/sdk7786_defconfig
+++ b/arch/sh/configs/sdk7786_defconfig
@@ -43,8 +43,6 @@ CONFIG_MEMORY_SIZE=0x20000000
 CONFIG_PMB=y
 CONFIG_NUMA=y
 CONFIG_HUGETLB_PAGE_SIZE_64MB=y
-CONFIG_MEMORY_HOTPLUG=y
-CONFIG_MEMORY_HOTREMOVE=y
 CONFIG_KSM=y
 CONFIG_SH_STORE_QUEUES=y
 CONFIG_SPECULATIVE_EXECUTION=y
diff --git a/arch/sh/configs/shx3_defconfig b/arch/sh/configs/shx3_defconfig
index aa353dff7f19..9a0df5ea3866 100644
--- a/arch/sh/configs/shx3_defconfig
+++ b/arch/sh/configs/shx3_defconfig
@@ -31,8 +31,6 @@ CONFIG_CPU_SUBTYPE_SHX3=y
 CONFIG_MEMORY_START=0x0c000000
 CONFIG_NUMA=y
 CONFIG_PAGE_SIZE_64KB=y
-CONFIG_MEMORY_HOTPLUG=y
-CONFIG_MEMORY_HOTREMOVE=y
 CONFIG_SH_STORE_QUEUES=y
 CONFIG_SH_X3PROTO=y
 CONFIG_NO_HZ=y
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
index f32a1963ff0c..1862411665ab 100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
@@ -144,10 +144,6 @@ config ARCH_SPARSEMEM_DEFAULT
 config ARCH_SELECT_MEMORY_MODEL
 	def_bool y
 
-config ARCH_MEMORY_PROBE
-	def_bool y
-	depends on MEMORY_HOTPLUG
-
 config IOREMAP_FIXED
        def_bool y
        depends on X2TLB
-- 
2.45.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] arch/sh: Remove code that handles memory-hotplug and memory-hotremove
  2024-05-18 11:58 ` [PATCH 1/2] arch/sh: Remove code that handles memory-hotplug and memory-hotremove Oscar Salvador
@ 2024-07-11 10:20   ` John Paul Adrian Glaubitz
  0 siblings, 0 replies; 5+ messages in thread
From: John Paul Adrian Glaubitz @ 2024-07-11 10:20 UTC (permalink / raw)
  To: Oscar Salvador, linux-sh; +Cc: linux-mm, David Hildenbrand, Geert Uytterhoeven

On Sat, 2024-05-18 at 13:58 +0200, Oscar Salvador wrote:
> Since commit 7ec58a2b941ed889("mm/memory_hotplug: restrict
> CONFIG_MEMORY_HOTPLUG to 64 bit"), we only support memory-hotplug on
> 64bits platforms, but currently superH can only run on 32bit, so
> remove the code that handles memory-hotplug and memory-hotremove as
> that cannot work.
> 
> Signed-off-by: Oscar Salvador <osalvador@suse.de>
> ---
>  arch/sh/mm/init.c | 28 ----------------------------
>  1 file changed, 28 deletions(-)
> 
> diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
> index bf1b54055316..d1fe90b2f5ff 100644
> --- a/arch/sh/mm/init.c
> +++ b/arch/sh/mm/init.c
> @@ -395,31 +395,3 @@ void __init mem_init(void)
>  
>  	mem_init_done = 1;
>  }
> -
> -#ifdef CONFIG_MEMORY_HOTPLUG
> -int arch_add_memory(int nid, u64 start, u64 size,
> -		    struct mhp_params *params)
> -{
> -	unsigned long start_pfn = PFN_DOWN(start);
> -	unsigned long nr_pages = size >> PAGE_SHIFT;
> -	int ret;
> -
> -	if (WARN_ON_ONCE(params->pgprot.pgprot != PAGE_KERNEL.pgprot))
> -		return -EINVAL;
> -
> -	/* We only have ZONE_NORMAL, so this is easy.. */
> -	ret = __add_pages(nid, start_pfn, nr_pages, params);
> -	if (unlikely(ret))
> -		printk("%s: Failed, __add_pages() == %d\n", __func__, ret);
> -
> -	return ret;
> -}
> -
> -void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
> -{
> -	unsigned long start_pfn = PFN_DOWN(start);
> -	unsigned long nr_pages = size >> PAGE_SHIFT;
> -
> -	__remove_pages(start_pfn, nr_pages, altmap);
> -}
> -#endif /* CONFIG_MEMORY_HOTPLUG */

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

Will pick this up later today.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] arch/sh: Drop support for memory-hotplug and memory-hotremove
  2024-05-18 11:58 ` [PATCH 2/2] arch/sh: Drop support for " Oscar Salvador
@ 2024-07-11 10:20   ` John Paul Adrian Glaubitz
  0 siblings, 0 replies; 5+ messages in thread
From: John Paul Adrian Glaubitz @ 2024-07-11 10:20 UTC (permalink / raw)
  To: Oscar Salvador, linux-sh; +Cc: linux-mm, David Hildenbrand, Geert Uytterhoeven

On Sat, 2024-05-18 at 13:58 +0200, Oscar Salvador wrote:
> Remove all CONFIG options related to memory-hotplug and memory-hotremove.
> 
> Signed-off-by: Oscar Salvador <osalvador@suse.de>
> ---
>  arch/sh/Kconfig                     | 2 --
>  arch/sh/configs/apsh4ad0a_defconfig | 2 --
>  arch/sh/configs/sdk7786_defconfig   | 2 --
>  arch/sh/configs/shx3_defconfig      | 2 --
>  arch/sh/mm/Kconfig                  | 4 ----
>  5 files changed, 12 deletions(-)
> 
> diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> index 6bc60f964f96..c5c093c73aa1 100644
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -3,8 +3,6 @@ config SUPERH
>  	def_bool y
>  	select ARCH_32BIT_OFF_T
>  	select ARCH_HAS_CPU_CACHE_ALIASING
> -	select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM && MMU
> -	select ARCH_ENABLE_MEMORY_HOTREMOVE if SPARSEMEM && MMU
>  	select ARCH_HAVE_NMI_SAFE_CMPXCHG if (GUSA_RB || CPU_SH4A)
>  	select ARCH_HAS_BINFMT_FLAT if !MMU
>  	select ARCH_HAS_CPU_FINALIZE_INIT
> diff --git a/arch/sh/configs/apsh4ad0a_defconfig b/arch/sh/configs/apsh4ad0a_defconfig
> index 64558bf60e10..19ed0601a36f 100644
> --- a/arch/sh/configs/apsh4ad0a_defconfig
> +++ b/arch/sh/configs/apsh4ad0a_defconfig
> @@ -24,8 +24,6 @@ CONFIG_BFQ_GROUP_IOSCHED=y
>  CONFIG_CPU_SUBTYPE_SH7786=y
>  CONFIG_MEMORY_SIZE=0x10000000
>  CONFIG_HUGETLB_PAGE_SIZE_1MB=y
> -CONFIG_MEMORY_HOTPLUG=y
> -CONFIG_MEMORY_HOTREMOVE=y
>  CONFIG_KSM=y
>  CONFIG_SH_STORE_QUEUES=y
>  CONFIG_SH_APSH4AD0A=y
> diff --git a/arch/sh/configs/sdk7786_defconfig b/arch/sh/configs/sdk7786_defconfig
> index 7b427c17fbfe..07894f13441e 100644
> --- a/arch/sh/configs/sdk7786_defconfig
> +++ b/arch/sh/configs/sdk7786_defconfig
> @@ -43,8 +43,6 @@ CONFIG_MEMORY_SIZE=0x20000000
>  CONFIG_PMB=y
>  CONFIG_NUMA=y
>  CONFIG_HUGETLB_PAGE_SIZE_64MB=y
> -CONFIG_MEMORY_HOTPLUG=y
> -CONFIG_MEMORY_HOTREMOVE=y
>  CONFIG_KSM=y
>  CONFIG_SH_STORE_QUEUES=y
>  CONFIG_SPECULATIVE_EXECUTION=y
> diff --git a/arch/sh/configs/shx3_defconfig b/arch/sh/configs/shx3_defconfig
> index aa353dff7f19..9a0df5ea3866 100644
> --- a/arch/sh/configs/shx3_defconfig
> +++ b/arch/sh/configs/shx3_defconfig
> @@ -31,8 +31,6 @@ CONFIG_CPU_SUBTYPE_SHX3=y
>  CONFIG_MEMORY_START=0x0c000000
>  CONFIG_NUMA=y
>  CONFIG_PAGE_SIZE_64KB=y
> -CONFIG_MEMORY_HOTPLUG=y
> -CONFIG_MEMORY_HOTREMOVE=y
>  CONFIG_SH_STORE_QUEUES=y
>  CONFIG_SH_X3PROTO=y
>  CONFIG_NO_HZ=y
> diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
> index f32a1963ff0c..1862411665ab 100644
> --- a/arch/sh/mm/Kconfig
> +++ b/arch/sh/mm/Kconfig
> @@ -144,10 +144,6 @@ config ARCH_SPARSEMEM_DEFAULT
>  config ARCH_SELECT_MEMORY_MODEL
>  	def_bool y
>  
> -config ARCH_MEMORY_PROBE
> -	def_bool y
> -	depends on MEMORY_HOTPLUG
> -
>  config IOREMAP_FIXED
>         def_bool y
>         depends on X2TLB

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

Will pick this up later today.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-07-11 10:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-18 11:58 [PATCH 0/2] Drop support for memory-hotplug and memory-hotremove on superH Oscar Salvador
2024-05-18 11:58 ` [PATCH 1/2] arch/sh: Remove code that handles memory-hotplug and memory-hotremove Oscar Salvador
2024-07-11 10:20   ` John Paul Adrian Glaubitz
2024-05-18 11:58 ` [PATCH 2/2] arch/sh: Drop support for " Oscar Salvador
2024-07-11 10:20   ` John Paul Adrian Glaubitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox