* [PATCH 2/2] Register bootmem pages at boot on powerpc
[not found] <52050ACE.4090001@linux.vnet.ibm.com>
@ 2013-08-09 15:32 ` Nathan Fontenot
2013-08-12 0:19 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 6+ messages in thread
From: Nathan Fontenot @ 2013-08-09 15:32 UTC (permalink / raw)
To: linuxppc-dev, linux-mm
Register bootmem pages at boot time on powerpc.
Previous commit 46723bfa540... introduced a new config option,
HAVE_BOOTMEM_INFO_NODE, to enable registering of bootmem pages. As a result
the bootmem pages for powerpc are not registered since we do not define this.
This causes a BUG_ON in put_page_bootmem() when trying to hotplug remove
memory on powerpc.
This patch resolves this by doing three things;
- define HAVE_BOOTMEM_INFO_NODE for powerpc
- Add a routine to register bootmem via register_page_bootmem_info_node()
in mem_init().
- Stub out the register_page_bootmem_memmap() routine needed for building
with SPARSE_VMEMMAP enabled.
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
---
arch/powerpc/mm/init_64.c | 6 ++++++
arch/powerpc/mm/mem.c | 9 +++++++++
mm/Kconfig | 2 +-
3 files changed, 16 insertions(+), 1 deletion(-)
Index: powerpc/arch/powerpc/mm/init_64.c
===================================================================
--- powerpc.orig/arch/powerpc/mm/init_64.c
+++ powerpc/arch/powerpc/mm/init_64.c
@@ -300,5 +300,11 @@ void vmemmap_free(unsigned long start, u
{
}
+void register_page_bootmem_memmap(unsigned long section_nr,
+ struct page *start_page, unsigned long size)
+{
+ WARN_ONCE(1, KERN_INFO
+ "Sparse Vmemmap not fully supported for bootmem info nodes\n");
+}
#endif /* CONFIG_SPARSEMEM_VMEMMAP */
Index: powerpc/arch/powerpc/mm/mem.c
===================================================================
--- powerpc.orig/arch/powerpc/mm/mem.c
+++ powerpc/arch/powerpc/mm/mem.c
@@ -297,12 +297,21 @@ void __init paging_init(void)
}
#endif /* ! CONFIG_NEED_MULTIPLE_NODES */
+static void __init register_page_bootmem_info(void)
+{
+ int i;
+
+ for_each_online_node(i)
+ register_page_bootmem_info_node(NODE_DATA(i));
+}
+
void __init mem_init(void)
{
#ifdef CONFIG_SWIOTLB
swiotlb_init(0);
#endif
+ register_page_bootmem_info();
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
set_max_mapnr(max_pfn);
free_all_bootmem();
Index: powerpc/mm/Kconfig
===================================================================
--- powerpc.orig/mm/Kconfig
+++ powerpc/mm/Kconfig
@@ -183,7 +183,7 @@ config MEMORY_HOTPLUG_SPARSE
config MEMORY_HOTREMOVE
bool "Allow for memory hot remove"
select MEMORY_ISOLATION
- select HAVE_BOOTMEM_INFO_NODE if X86_64
+ select HAVE_BOOTMEM_INFO_NODE if (X86_64 || PPC64)
depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE
depends on MIGRATION
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] Register bootmem pages at boot on powerpc
2013-08-09 15:32 ` [PATCH 2/2] Register bootmem pages at boot on powerpc Nathan Fontenot
@ 2013-08-12 0:19 ` Benjamin Herrenschmidt
2013-08-12 13:01 ` Nathan Fontenot
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2013-08-12 0:19 UTC (permalink / raw)
To: Nathan Fontenot; +Cc: linuxppc-dev, linux-mm
On Fri, 2013-08-09 at 10:32 -0500, Nathan Fontenot wrote:
> +void register_page_bootmem_memmap(unsigned long section_nr,
> + struct page *start_page, unsigned long size)
> +{
> + WARN_ONCE(1, KERN_INFO
> + "Sparse Vmemmap not fully supported for bootmem info nodes\n");
> +}
> #endif /* CONFIG_SPARSEMEM_VMEMMAP */
But SPARSEMEM_VMEMMAP is our default on ppc64 pseries ... and you are
select'ing the new option, so it looks like we are missing something
here...
Can you tell me a bit more, the above makes me nervous...
Cheers,
Ben.
> Index: powerpc/arch/powerpc/mm/mem.c
> ===================================================================
> --- powerpc.orig/arch/powerpc/mm/mem.c
> +++ powerpc/arch/powerpc/mm/mem.c
> @@ -297,12 +297,21 @@ void __init paging_init(void)
> }
> #endif /* ! CONFIG_NEED_MULTIPLE_NODES */
>
> +static void __init register_page_bootmem_info(void)
> +{
> + int i;
> +
> + for_each_online_node(i)
> + register_page_bootmem_info_node(NODE_DATA(i));
> +}
> +
> void __init mem_init(void)
> {
> #ifdef CONFIG_SWIOTLB
> swiotlb_init(0);
> #endif
>
> + register_page_bootmem_info();
> high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
> set_max_mapnr(max_pfn);
> free_all_bootmem();
> Index: powerpc/mm/Kconfig
> ===================================================================
> --- powerpc.orig/mm/Kconfig
> +++ powerpc/mm/Kconfig
> @@ -183,7 +183,7 @@ config MEMORY_HOTPLUG_SPARSE
> config MEMORY_HOTREMOVE
> bool "Allow for memory hot remove"
> select MEMORY_ISOLATION
> - select HAVE_BOOTMEM_INFO_NODE if X86_64
> + select HAVE_BOOTMEM_INFO_NODE if (X86_64 || PPC64)
> depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE
> depends on MIGRATION
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] Register bootmem pages at boot on powerpc
2013-08-12 0:19 ` Benjamin Herrenschmidt
@ 2013-08-12 13:01 ` Nathan Fontenot
2013-08-12 21:13 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 6+ messages in thread
From: Nathan Fontenot @ 2013-08-12 13:01 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, linux-mm
On 08/11/2013 07:19 PM, Benjamin Herrenschmidt wrote:
> On Fri, 2013-08-09 at 10:32 -0500, Nathan Fontenot wrote:
>
>> +void register_page_bootmem_memmap(unsigned long section_nr,
>> + struct page *start_page, unsigned long size)
>> +{
>> + WARN_ONCE(1, KERN_INFO
>> + "Sparse Vmemmap not fully supported for bootmem info nodes\n");
>> +}
>> #endif /* CONFIG_SPARSEMEM_VMEMMAP */
>
> But SPARSEMEM_VMEMMAP is our default on ppc64 pseries ... and you are
> select'ing the new option, so it looks like we are missing something
> here...
>
> Can you tell me a bit more, the above makes me nervous...
Ok, I agree. that message isn't quite right.
What I wanted to convey is that memory hotplug is not fully supported
on powerpc with SPARSE_VMEMMAP enabled.. Perhaps the message should read
"Memory hotplug is not fully supported for bootmem info nodes".
Thoughts?
-Nathan
>
> Cheers,
> Ben.
>
>> Index: powerpc/arch/powerpc/mm/mem.c
>> ===================================================================
>> --- powerpc.orig/arch/powerpc/mm/mem.c
>> +++ powerpc/arch/powerpc/mm/mem.c
>> @@ -297,12 +297,21 @@ void __init paging_init(void)
>> }
>> #endif /* ! CONFIG_NEED_MULTIPLE_NODES */
>>
>> +static void __init register_page_bootmem_info(void)
>> +{
>> + int i;
>> +
>> + for_each_online_node(i)
>> + register_page_bootmem_info_node(NODE_DATA(i));
>> +}
>> +
>> void __init mem_init(void)
>> {
>> #ifdef CONFIG_SWIOTLB
>> swiotlb_init(0);
>> #endif
>>
>> + register_page_bootmem_info();
>> high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
>> set_max_mapnr(max_pfn);
>> free_all_bootmem();
>> Index: powerpc/mm/Kconfig
>> ===================================================================
>> --- powerpc.orig/mm/Kconfig
>> +++ powerpc/mm/Kconfig
>> @@ -183,7 +183,7 @@ config MEMORY_HOTPLUG_SPARSE
>> config MEMORY_HOTREMOVE
>> bool "Allow for memory hot remove"
>> select MEMORY_ISOLATION
>> - select HAVE_BOOTMEM_INFO_NODE if X86_64
>> + select HAVE_BOOTMEM_INFO_NODE if (X86_64 || PPC64)
>> depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE
>> depends on MIGRATION
>>
>>
>> _______________________________________________
>> Linuxppc-dev mailing list
>> Linuxppc-dev@lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] Register bootmem pages at boot on powerpc
2013-08-12 13:01 ` Nathan Fontenot
@ 2013-08-12 21:13 ` Benjamin Herrenschmidt
2013-08-12 21:25 ` Nathan Fontenot
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2013-08-12 21:13 UTC (permalink / raw)
To: Nathan Fontenot; +Cc: linuxppc-dev, linux-mm
On Mon, 2013-08-12 at 08:01 -0500, Nathan Fontenot wrote:
> > Can you tell me a bit more, the above makes me nervous...
>
> Ok, I agree. that message isn't quite right.
>
> What I wanted to convey is that memory hotplug is not fully supported
> on powerpc with SPARSE_VMEMMAP enabled.. Perhaps the message should read
> "Memory hotplug is not fully supported for bootmem info nodes".
>
> Thoughts?
Since SPARSE_VMEMMAP is our default and enabled in our distros, that mean
that memory hotplug isn't fully supported for us in general ?
What do you mean by "not fully supported" ? What precisely is missing ?
What will happen if one tries to plug or unplug memory?
Shouldn't we fix it ?
Cheers,
Ben.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] Register bootmem pages at boot on powerpc
2013-08-12 21:13 ` Benjamin Herrenschmidt
@ 2013-08-12 21:25 ` Nathan Fontenot
2013-08-12 21:59 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 6+ messages in thread
From: Nathan Fontenot @ 2013-08-12 21:25 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, linux-mm
On 08/12/2013 04:13 PM, Benjamin Herrenschmidt wrote:
> On Mon, 2013-08-12 at 08:01 -0500, Nathan Fontenot wrote:
>>> Can you tell me a bit more, the above makes me nervous...
>>
>> Ok, I agree. that message isn't quite right.
>>
>> What I wanted to convey is that memory hotplug is not fully supported
>> on powerpc with SPARSE_VMEMMAP enabled.. Perhaps the message should read
>> "Memory hotplug is not fully supported for bootmem info nodes".
>>
>> Thoughts?
>
> Since SPARSE_VMEMMAP is our default and enabled in our distros, that mean
> that memory hotplug isn't fully supported for us in general ?
Actually... We have had the distros (at least SLES 11 and RHEL 6 releases)
disable SPARSE_VMEMMAP in their releases.
>
> What do you mean by "not fully supported" ? What precisely is missing ?
> What will happen if one tries to plug or unplug memory?
I don't know everything that is missing, but there are several routines
that need to be defined for power to support memory hotplug with SPARSE_VMEMMAP.
>
> Shouldn't we fix it ?
Working on it, but it's not there yet.
>
> Cheers,
> Ben.
>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] Register bootmem pages at boot on powerpc
2013-08-12 21:25 ` Nathan Fontenot
@ 2013-08-12 21:59 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2013-08-12 21:59 UTC (permalink / raw)
To: Nathan Fontenot; +Cc: linuxppc-dev, linux-mm
On Mon, 2013-08-12 at 16:25 -0500, Nathan Fontenot wrote:
> On 08/12/2013 04:13 PM, Benjamin Herrenschmidt wrote:
> > On Mon, 2013-08-12 at 08:01 -0500, Nathan Fontenot wrote:
> >>> Can you tell me a bit more, the above makes me nervous...
> >>
> >> Ok, I agree. that message isn't quite right.
> >>
> >> What I wanted to convey is that memory hotplug is not fully supported
> >> on powerpc with SPARSE_VMEMMAP enabled.. Perhaps the message should read
> >> "Memory hotplug is not fully supported for bootmem info nodes".
> >>
> >> Thoughts?
> >
> > Since SPARSE_VMEMMAP is our default and enabled in our distros, that mean
> > that memory hotplug isn't fully supported for us in general ?
>
> Actually... We have had the distros (at least SLES 11 and RHEL 6 releases)
> disable SPARSE_VMEMMAP in their releases.
Yuck ! That has a significant impact on performances... Additionally our
VFIO implementation for KVM requires SPARSE_VMEMMAP. Why is it that this
was never fixed in all these years ?
> >
> > What do you mean by "not fully supported" ? What precisely is missing ?
> > What will happen if one tries to plug or unplug memory?
>
> I don't know everything that is missing, but there are several routines
> that need to be defined for power to support memory hotplug with SPARSE_VMEMMAP.
>
> >
> > Shouldn't we fix it ?
>
> Working on it, but it's not there yet.
Ok, thanks.
Cheers,
Ben.
> >
> > Cheers,
> > Ben.
> >
> >
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-08-12 21:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <52050ACE.4090001@linux.vnet.ibm.com>
2013-08-09 15:32 ` [PATCH 2/2] Register bootmem pages at boot on powerpc Nathan Fontenot
2013-08-12 0:19 ` Benjamin Herrenschmidt
2013-08-12 13:01 ` Nathan Fontenot
2013-08-12 21:13 ` Benjamin Herrenschmidt
2013-08-12 21:25 ` Nathan Fontenot
2013-08-12 21:59 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).