This patch series extracts out code for unloading the initramfs that
was identical across 14 architectures, and moves those architectures
to the common code path. Additionally, RISC-V is newly moved to the
common code path.
In addition to reducing duplication, this allows us to bring future
improvements (such as generalizing existing "keep initrd" command line
options) to multiple architectures at once.
v4: Use weak symbols instead of Kconfig.
v3: Make the generic path opt-out instead of opt-in.
v2: Mark generic free_initrd_mem __init.
Signed-off-by: Shea Levy <[email protected]>
---
arch/alpha/mm/init.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 9d74520298ab..55f7c8efa962 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -291,11 +291,3 @@ free_initmem(void)
{
free_initmem_default(-1);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void
-free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
arch/h8300/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index 015287ac8ce8..37574332b202 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -102,13 +102,6 @@ void __init mem_init(void)
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void
free_initmem(void)
{
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
arch/m68k/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index e85acd131fa8..e20bef09258c 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -172,10 +172,3 @@ void __init mem_init(void)
mem_init_print_info(NULL);
print_memmap();
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
arch/um/kernel/mem.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 3c0e470ea646..2d26eec92126 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -170,13 +170,6 @@ void free_initmem(void)
{
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
/* Allocate and free page tables. */
pgd_t *pgd_alloc(struct mm_struct *mm)
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
arch/sh/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index ce0bbaa7e404..7451459d0725 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -477,13 +477,6 @@ void free_initmem(void)
free_initmem_default(-1);
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
#ifdef CONFIG_MEMORY_HOTPLUG
int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
bool want_memblock)
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
arch/parisc/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index cab32ee824d2..3643399230f3 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -932,10 +932,3 @@ void flush_tlb_all(void)
spin_unlock(&sid_lock);
}
#endif
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
arch/c6x/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c
index 4cc72b0d1c1d..a11cb657182a 100644
--- a/arch/c6x/mm/init.c
+++ b/arch/c6x/mm/init.c
@@ -66,13 +66,6 @@ void __init mem_init(void)
mem_init_print_info(NULL);
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void __init free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
arch/nios2/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/nios2/mm/init.c b/arch/nios2/mm/init.c
index c92fe4234009..3df75ff8c768 100644
--- a/arch/nios2/mm/init.c
+++ b/arch/nios2/mm/init.c
@@ -82,13 +82,6 @@ void __init mmu_init(void)
flush_tlb_all();
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void __ref free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
arch/openrisc/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c
index 6972d5d6f23f..c1a3dcf9ad40 100644
--- a/arch/openrisc/mm/init.c
+++ b/arch/openrisc/mm/init.c
@@ -222,13 +222,6 @@ void __init mem_init(void)
return;
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
arch/microblaze/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index df6de7ccdc2e..ea058dfda222 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -187,13 +187,6 @@ void __init setup_memory(void)
paging_init();
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
arch/m32r/mm/init.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c
index 93abc8c3a46e..e2b5f09209ee 100644
--- a/arch/m32r/mm/init.c
+++ b/arch/m32r/mm/init.c
@@ -139,14 +139,3 @@ void free_initmem(void)
{
free_initmem_default(-1);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-/*======================================================================*
- * free_initrd_mem() :
- * orig : arch/sh/mm/init.c
- *======================================================================*/
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
arch/frv/mm/init.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c
index cf464100e838..345edc4dc462 100644
--- a/arch/frv/mm/init.c
+++ b/arch/frv/mm/init.c
@@ -131,14 +131,3 @@ void free_initmem(void)
free_initmem_default(-1);
#endif
} /* end free_initmem() */
-
-/*****************************************************************************/
-/*
- * free the initial ramdisk memory
- */
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-} /* end free_initrd_mem() */
-#endif
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
arch/riscv/mm/init.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index c77df8142be2..36f83fe8a726 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -62,9 +62,3 @@ void free_initmem(void)
{
free_initmem_default(0);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-}
-#endif /* CONFIG_BLK_DEV_INITRD */
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
init/initramfs.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/init/initramfs.c b/init/initramfs.c
index 7e99a0038942..c8fe150f958a 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
#include <linux/initrd.h>
#include <linux/kexec.h>
+void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
+{
+ free_reserved_area((void *)start, (void *)end, -1, "initrd");
+}
+
static void __init free_initrd(void)
{
#ifdef CONFIG_KEXEC_CORE
--
2.16.2
Signed-off-by: Shea Levy <[email protected]>
---
arch/arc/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index ba145065c579..7bcf23ab1756 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -229,10 +229,3 @@ void __ref free_initmem(void)
{
free_initmem_default(-1);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
On Wed, 2018-03-28 at 16:36 -0400, Shea Levy wrote:
> Signed-off-by: Shea Levy <[email protected]>
Most people seem to want some form of commit message
and not just your sign-off.
And btw:
It seems you used get_maintainer to determine who to
send these patches to.
I suggest you add --nogit and --nogit-fallback to the
get_maintainer command line you use to avoid sending
these patches to people like me that have done drive-by
cleanup work on these files.
Joe Perches <[email protected]> writes:
> On Wed, 2018-03-28 at 16:36 -0400, Shea Levy wrote:
>> Signed-off-by: Shea Levy <[email protected]>
>
> Most people seem to want some form of commit message
> and not just your sign-off.
>
Ah, if the subject is insufficient I can add some more detail.
>
> And btw:
>
> It seems you used get_maintainer to determine who to
> send these patches to.
>
> I suggest you add --nogit and --nogit-fallback to the
> get_maintainer command line you use to avoid sending
> these patches to people like me that have done drive-by
> cleanup work on these files.
Whoops, thanks for the tip and sorry for the noise!
Signed-off-by: Shea Levy <[email protected]>
---
arch/powerpc/mm/mem.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index fe8c61149fb8..e85b2a3cd264 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -404,13 +404,6 @@ void free_initmem(void)
free_initmem_default(POISON_FREE_INITMEM);
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
/*
* This is called when a page has been modified by the kernel.
* It just marks the page as not i-cache clean. We do the i-cache
--
2.16.2
On Wed, Mar 28, 2018 at 10:36 PM, Shea Levy <[email protected]> wrote:
> Signed-off-by: Shea Levy <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
On 28/03/18 21:36, Shea Levy wrote:
> Signed-off-by: Shea Levy <[email protected]>
> ---
> arch/riscv/mm/init.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index c77df8142be2..36f83fe8a726 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -62,9 +62,3 @@ void free_initmem(void)
> {
> free_initmem_default(0);
> }
> -
> -#ifdef CONFIG_BLK_DEV_INITRD
> -void free_initrd_mem(unsigned long start, unsigned long end)
> -{
> -}
> -#endif /* CONFIG_BLK_DEV_INITRD */
This looks like a change of behavior since the weakly defined code does
not implement a nop.
I'm not saying the change is wrong, but if this is a deliberate bug fix
then we need more than an empty commit message to explain what is
happening here.
Daniel.
Daniel Thompson <[email protected]> writes:
> On 28/03/18 21:36, Shea Levy wrote:
>> Signed-off-by: Shea Levy <[email protected]>
>> ---
>> arch/riscv/mm/init.c | 6 ------
>> 1 file changed, 6 deletions(-)
>>
>> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
>> index c77df8142be2..36f83fe8a726 100644
>> --- a/arch/riscv/mm/init.c
>> +++ b/arch/riscv/mm/init.c
>> @@ -62,9 +62,3 @@ void free_initmem(void)
>> {
>> free_initmem_default(0);
>> }
>> -
>> -#ifdef CONFIG_BLK_DEV_INITRD
>> -void free_initrd_mem(unsigned long start, unsigned long end)
>> -{
>> -}
>> -#endif /* CONFIG_BLK_DEV_INITRD */
>
> This looks like a change of behavior since the weakly defined code does
> not implement a nop.
>
> I'm not saying the change is wrong, but if this is a deliberate bug fix
> then we need more than an empty commit message to explain what is
> happening here.
>
Right, sorry, will re-send with a proper commit message here.
>
>
> Daniel.
Now that there is a generic implementation, riscv's noop stub can be
removed.
Signed-off-by: Shea Levy <[email protected]>
---
arch/riscv/mm/init.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index c77df8142be2..36f83fe8a726 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -62,9 +62,3 @@ void free_initmem(void)
{
free_initmem_default(0);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-}
-#endif /* CONFIG_BLK_DEV_INITRD */
--
2.16.2
The generic implementation is functionally identical.
Signed-off-by: Shea Levy <[email protected]>
---
arch/alpha/mm/init.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 9d74520298ab..55f7c8efa962 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -291,11 +291,3 @@ free_initmem(void)
{
free_initmem_default(-1);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void
-free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
The generic implementation is functionally identical.
Signed-off-by: Shea Levy <[email protected]>
---
arch/frv/mm/init.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c
index cf464100e838..345edc4dc462 100644
--- a/arch/frv/mm/init.c
+++ b/arch/frv/mm/init.c
@@ -131,14 +131,3 @@ void free_initmem(void)
free_initmem_default(-1);
#endif
} /* end free_initmem() */
-
-/*****************************************************************************/
-/*
- * free the initial ramdisk memory
- */
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-} /* end free_initrd_mem() */
-#endif
--
2.16.2
The generic implementation is functionally identical.
Signed-off-by: Shea Levy <[email protected]>
---
arch/microblaze/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index df6de7ccdc2e..ea058dfda222 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -187,13 +187,6 @@ void __init setup_memory(void)
paging_init();
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
The generic implementation is functionally identical.
Signed-off-by: Shea Levy <[email protected]>
---
arch/um/kernel/mem.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 3c0e470ea646..2d26eec92126 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -170,13 +170,6 @@ void free_initmem(void)
{
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
/* Allocate and free page tables. */
pgd_t *pgd_alloc(struct mm_struct *mm)
--
2.16.2
The generic implementation is functionally identical.
Signed-off-by: Shea Levy <[email protected]>
---
arch/sh/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index ce0bbaa7e404..7451459d0725 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -477,13 +477,6 @@ void free_initmem(void)
free_initmem_default(-1);
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
#ifdef CONFIG_MEMORY_HOTPLUG
int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
bool want_memblock)
--
2.16.2
The generic implementation is functionally identical.
Signed-off-by: Shea Levy <[email protected]>
---
arch/powerpc/mm/mem.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index fe8c61149fb8..e85b2a3cd264 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -404,13 +404,6 @@ void free_initmem(void)
free_initmem_default(POISON_FREE_INITMEM);
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
/*
* This is called when a page has been modified by the kernel.
* It just marks the page as not i-cache clean. We do the i-cache
--
2.16.2
The generic implementation is functionally identical.
Signed-off-by: Shea Levy <[email protected]>
---
arch/m32r/mm/init.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c
index 93abc8c3a46e..e2b5f09209ee 100644
--- a/arch/m32r/mm/init.c
+++ b/arch/m32r/mm/init.c
@@ -139,14 +139,3 @@ void free_initmem(void)
{
free_initmem_default(-1);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-/*======================================================================*
- * free_initrd_mem() :
- * orig : arch/sh/mm/init.c
- *======================================================================*/
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
The generic implementation is functionally identical.
Acked-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Shea Levy <[email protected]>
---
arch/m68k/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index e85acd131fa8..e20bef09258c 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -172,10 +172,3 @@ void __init mem_init(void)
mem_init_print_info(NULL);
print_memmap();
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
The generic implementation is functionally identical.
Signed-off-by: Shea Levy <[email protected]>
---
arch/nios2/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/nios2/mm/init.c b/arch/nios2/mm/init.c
index c92fe4234009..3df75ff8c768 100644
--- a/arch/nios2/mm/init.c
+++ b/arch/nios2/mm/init.c
@@ -82,13 +82,6 @@ void __init mmu_init(void)
flush_tlb_all();
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void __ref free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
The generic implementation is functionally identical.
Signed-off-by: Shea Levy <[email protected]>
---
arch/parisc/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index cab32ee824d2..3643399230f3 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -932,10 +932,3 @@ void flush_tlb_all(void)
spin_unlock(&sid_lock);
}
#endif
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
The generic implementation is functionally identical.
Signed-off-by: Shea Levy <[email protected]>
---
arch/h8300/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index 015287ac8ce8..37574332b202 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -102,13 +102,6 @@ void __init mem_init(void)
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void
free_initmem(void)
{
--
2.16.2
The generic implementation is functionally identical.
Signed-off-by: Shea Levy <[email protected]>
---
arch/openrisc/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c
index 6972d5d6f23f..c1a3dcf9ad40 100644
--- a/arch/openrisc/mm/init.c
+++ b/arch/openrisc/mm/init.c
@@ -222,13 +222,6 @@ void __init mem_init(void)
return;
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
The generic implementation is functionally identical.
Signed-off-by: Shea Levy <[email protected]>
---
arch/c6x/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c
index 4cc72b0d1c1d..a11cb657182a 100644
--- a/arch/c6x/mm/init.c
+++ b/arch/c6x/mm/init.c
@@ -66,13 +66,6 @@ void __init mem_init(void)
mem_init_print_info(NULL);
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void __init free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
The generic implementation is functionally identical.
Signed-off-by: Shea Levy <[email protected]>
---
arch/arc/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index ba145065c579..7bcf23ab1756 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -229,10 +229,3 @@ void __ref free_initmem(void)
{
free_initmem_default(-1);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
This function is effectively identical across 14 architectures, and
the generic implementation is small enough to be negligible in the
architectures that do override it. Many of the remaining divergent
implementations can be included in the common code path in future,
further reducing code duplication and sharing improvements between
architectures.
v5: Add more complete commit messages.
v4: Use weak symbols instead of Kconfig.
v3: Make the generic path opt-out instead of opt-in.
v2: Mark generic free_initrd_mem __init.
Signed-off-by: Shea Levy <[email protected]>
---
init/initramfs.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/init/initramfs.c b/init/initramfs.c
index 7e99a0038942..c8fe150f958a 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
#include <linux/initrd.h>
#include <linux/kexec.h>
+void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
+{
+ free_reserved_area((void *)start, (void *)end, -1, "initrd");
+}
+
static void __init free_initrd(void)
{
#ifdef CONFIG_KEXEC_CORE
--
2.16.2
On Thu, Mar 29, 2018 at 07:32:03AM -0400, Shea Levy wrote:
> The generic implementation is functionally identical.
>
> Signed-off-by: Shea Levy <[email protected]>
Acked-by: Stafford Horne <[email protected]>
> ---
> arch/openrisc/mm/init.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c
> index 6972d5d6f23f..c1a3dcf9ad40 100644
> --- a/arch/openrisc/mm/init.c
> +++ b/arch/openrisc/mm/init.c
> @@ -222,13 +222,6 @@ void __init mem_init(void)
> return;
> }
>
> -#ifdef CONFIG_BLK_DEV_INITRD
> -void free_initrd_mem(unsigned long start, unsigned long end)
> -{
> - free_reserved_area((void *)start, (void *)end, -1, "initrd");
> -}
> -#endif
> -
> void free_initmem(void)
> {
> free_initmem_default(-1);
> --
> 2.16.2
>
Shea Levy <[email protected]> writes:
> Joe Perches <[email protected]> writes:
>
>> On Wed, 2018-03-28 at 16:36 -0400, Shea Levy wrote:
>>> Signed-off-by: Shea Levy <[email protected]>
>>
>> Most people seem to want some form of commit message
>> and not just your sign-off.
>>
>
> Ah, if the subject is insufficient I can add some more detail.
Yeah please do.
Seeing this patch in isolation, with no change log, I might think it's
safe for me to just apply it.
But that would break the build because I don't have patch 1.
So for starters you need to explain that part, eg something like:
A previous patch in the series added a weak definition of
free_initrd_mem() in init/initramfs.c.
The powerpc implementation is identical, so it can be removed allowing
the generic version to be used.
Then you could also tell me if you did/didn't build/boot test it.
cheers
On Thu, Mar 29, 2018 at 07:32:06AM -0400, Shea Levy wrote:
> The generic implementation is functionally identical.
>
> Signed-off-by: Shea Levy <[email protected]>
> ---
> arch/sh/mm/init.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
> index ce0bbaa7e404..7451459d0725 100644
> --- a/arch/sh/mm/init.c
> +++ b/arch/sh/mm/init.c
> @@ -477,13 +477,6 @@ void free_initmem(void)
> free_initmem_default(-1);
> }
>
> -#ifdef CONFIG_BLK_DEV_INITRD
> -void free_initrd_mem(unsigned long start, unsigned long end)
> -{
> - free_reserved_area((void *)start, (void *)end, -1, "initrd");
> -}
> -#endif
> -
> #ifdef CONFIG_MEMORY_HOTPLUG
> int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
> bool want_memblock)
> --
> 2.16.2
LGTM.
Acked-by: Rich Felker <[email protected]>
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Signed-off-by: Shea Levy <[email protected]>
---
arch/um/kernel/mem.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 3c0e470ea646..2d26eec92126 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -170,13 +170,6 @@ void free_initmem(void)
{
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
/* Allocate and free page tables. */
pgd_t *pgd_alloc(struct mm_struct *mm)
--
2.16.2
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Acked-by: Rich Felker <[email protected]>
Signed-off-by: Shea Levy <[email protected]>
---
arch/sh/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index ce0bbaa7e404..7451459d0725 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -477,13 +477,6 @@ void free_initmem(void)
free_initmem_default(-1);
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
#ifdef CONFIG_MEMORY_HOTPLUG
int arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap *altmap,
bool want_memblock)
--
2.16.2
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Signed-off-by: Shea Levy <[email protected]>
---
arch/arc/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index ba145065c579..7bcf23ab1756 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -229,10 +229,3 @@ void __ref free_initmem(void)
{
free_initmem_default(-1);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
This function is effectively identical across 14 architectures, and
the generic implementation is small enough to be negligible in the
architectures that do override it. Many of the remaining divergent
implementations can be included in the common code path in future,
further reducing code duplication and sharing improvements between
architectures.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
v6: Add information about build/run testing.
v5: Add more complete commit messages.
v4: Use weak symbols instead of Kconfig.
v3: Make the generic path opt-out instead of opt-in.
v2: Mark generic free_initrd_mem __init.
Signed-off-by: Shea Levy <[email protected]>
---
init/initramfs.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/init/initramfs.c b/init/initramfs.c
index 7e99a0038942..c8fe150f958a 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
#include <linux/initrd.h>
#include <linux/kexec.h>
+void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
+{
+ free_reserved_area((void *)start, (void *)end, -1, "initrd");
+}
+
static void __init free_initrd(void)
{
#ifdef CONFIG_KEXEC_CORE
--
2.16.2
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Signed-off-by: Shea Levy <[email protected]>
---
arch/nios2/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/nios2/mm/init.c b/arch/nios2/mm/init.c
index c92fe4234009..3df75ff8c768 100644
--- a/arch/nios2/mm/init.c
+++ b/arch/nios2/mm/init.c
@@ -82,13 +82,6 @@ void __init mmu_init(void)
flush_tlb_all();
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void __ref free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Signed-off-by: Shea Levy <[email protected]>
---
arch/parisc/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index cab32ee824d2..3643399230f3 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -932,10 +932,3 @@ void flush_tlb_all(void)
spin_unlock(&sid_lock);
}
#endif
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
Hi Michael,
Michael Ellerman <[email protected]> writes:
> Shea Levy <[email protected]> writes:
>
>> Joe Perches <[email protected]> writes:
>>
>>> On Wed, 2018-03-28 at 16:36 -0400, Shea Levy wrote:
>>>> Signed-off-by: Shea Levy <[email protected]>
>>>
>>> Most people seem to want some form of commit message
>>> and not just your sign-off.
>>>
>>
>> Ah, if the subject is insufficient I can add some more detail.
>
> Yeah please do.
>
> Seeing this patch in isolation, with no change log, I might think it's
> safe for me to just apply it.
>
> But that would break the build because I don't have patch 1.
>
> So for starters you need to explain that part, eg something like:
>
> A previous patch in the series added a weak definition of
> free_initrd_mem() in init/initramfs.c.
>
> The powerpc implementation is identical, so it can be removed allowing
> the generic version to be used.
>
>
> Then you could also tell me if you did/didn't build/boot test it.
Thanks for the feedback, can you let me know if the recently posted v6
fits the bill?
>
> cheers
Thanks,
Shea
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Signed-off-by: Shea Levy <[email protected]>
---
arch/powerpc/mm/mem.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index fe8c61149fb8..e85b2a3cd264 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -404,13 +404,6 @@ void free_initmem(void)
free_initmem_default(POISON_FREE_INITMEM);
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
/*
* This is called when a page has been modified by the kernel.
* It just marks the page as not i-cache clean. We do the i-cache
--
2.16.2
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Signed-off-by: Shea Levy <[email protected]>
---
arch/m32r/mm/init.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c
index 93abc8c3a46e..e2b5f09209ee 100644
--- a/arch/m32r/mm/init.c
+++ b/arch/m32r/mm/init.c
@@ -139,14 +139,3 @@ void free_initmem(void)
{
free_initmem_default(-1);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-/*======================================================================*
- * free_initrd_mem() :
- * orig : arch/sh/mm/init.c
- *======================================================================*/
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Signed-off-by: Shea Levy <[email protected]>
---
arch/openrisc/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c
index 6972d5d6f23f..c1a3dcf9ad40 100644
--- a/arch/openrisc/mm/init.c
+++ b/arch/openrisc/mm/init.c
@@ -222,13 +222,6 @@ void __init mem_init(void)
return;
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Signed-off-by: Shea Levy <[email protected]>
---
arch/microblaze/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index df6de7ccdc2e..ea058dfda222 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -187,13 +187,6 @@ void __init setup_memory(void)
paging_init();
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Acked-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Shea Levy <[email protected]>
---
arch/m68k/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index e85acd131fa8..e20bef09258c 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -172,10 +172,3 @@ void __init mem_init(void)
mem_init_print_info(NULL);
print_memmap();
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Signed-off-by: Shea Levy <[email protected]>
---
arch/h8300/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index 015287ac8ce8..37574332b202 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -102,13 +102,6 @@ void __init mem_init(void)
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void
free_initmem(void)
{
--
2.16.2
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Signed-off-by: Shea Levy <[email protected]>
---
arch/alpha/mm/init.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 9d74520298ab..55f7c8efa962 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -291,11 +291,3 @@ free_initmem(void)
{
free_initmem_default(-1);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void
-free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Signed-off-by: Shea Levy <[email protected]>
---
arch/c6x/mm/init.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c
index 4cc72b0d1c1d..a11cb657182a 100644
--- a/arch/c6x/mm/init.c
+++ b/arch/c6x/mm/init.c
@@ -66,13 +66,6 @@ void __init mem_init(void)
mem_init_print_info(NULL);
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void __init free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
The first patch in this series added a weakly-defined generic
implementation, which is functionally identical to the
architecture-specific one removed here.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Signed-off-by: Shea Levy <[email protected]>
---
arch/frv/mm/init.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c
index cf464100e838..345edc4dc462 100644
--- a/arch/frv/mm/init.c
+++ b/arch/frv/mm/init.c
@@ -131,14 +131,3 @@ void free_initmem(void)
free_initmem_default(-1);
#endif
} /* end free_initmem() */
-
-/*****************************************************************************/
-/*
- * free the initial ramdisk memory
- */
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-} /* end free_initrd_mem() */
-#endif
--
2.16.2
The first patch in this series added a weakly-defined generic
implementation, which works on RISC-V.
Series boot-tested on RISC-V (which now uses the generic
implementation) and x86_64 (which doesn't).
Signed-off-by: Shea Levy <[email protected]>
---
arch/riscv/mm/init.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index c77df8142be2..36f83fe8a726 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -62,9 +62,3 @@ void free_initmem(void)
{
free_initmem_default(0);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-}
-#endif /* CONFIG_BLK_DEV_INITRD */
--
2.16.2
On Sun, 2018-04-01 at 10:59 -0400, Shea Levy wrote:
> The first patch in this series added a weakly-defined generic
> implementation, which is functionally identical to the
> architecture-specific one removed here.
>
> Series boot-tested on RISC-V (which now uses the generic
> implementation) and x86_64 (which doesn't).
>
> Signed-off-by: Shea Levy <[email protected]>
Acked-by: Ley Foon Tan <[email protected]>
> ---
> arch/nios2/mm/init.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/arch/nios2/mm/init.c b/arch/nios2/mm/init.c
> index c92fe4234009..3df75ff8c768 100644
> --- a/arch/nios2/mm/init.c
> +++ b/arch/nios2/mm/init.c
> @@ -82,13 +82,6 @@ void __init mmu_init(void)
> flush_tlb_all();
> }
>
> -#ifdef CONFIG_BLK_DEV_INITRD
> -void __init free_initrd_mem(unsigned long start, unsigned long end)
> -{
> - free_reserved_area((void *)start, (void *)end, -1, "initrd");
> -}
> -#endif
> -
> void __ref free_initmem(void)
> {
> free_initmem_default(-1);
> --
> 2.16.2
On 01.04.2018 16:59, Shea Levy wrote:
> The first patch in this series added a weakly-defined generic
> implementation, which is functionally identical to the
> architecture-specific one removed here.
>
> Series boot-tested on RISC-V (which now uses the generic
> implementation) and x86_64 (which doesn't).
>
> Signed-off-by: Shea Levy <[email protected]>
Acked-by: Helge Deller <[email protected]> # parisc
> ---
> arch/parisc/mm/init.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
> index cab32ee824d2..3643399230f3 100644
> --- a/arch/parisc/mm/init.c
> +++ b/arch/parisc/mm/init.c
> @@ -932,10 +932,3 @@ void flush_tlb_all(void)
> spin_unlock(&sid_lock);
> }
> #endif
> -
> -#ifdef CONFIG_BLK_DEV_INITRD
> -void free_initrd_mem(unsigned long start, unsigned long end)
> -{
> - free_reserved_area((void *)start, (void *)end, -1, "initrd");
> -}
> -#endif
>
Hi Shea,
On Sun, 2018-04-01 at 10:59 -0400, Shea Levy wrote:
> The first patch in this series added a weakly-defined generic
> implementation, which is functionally identical to the
> architecture-specific one removed here.
>
> Series boot-tested on RISC-V (which now uses the generic
> implementation) and x86_64 (which doesn't).
>
> Signed-off-by: Shea Levy <[email protected]>
Boot-tested on ARC, thus...
Tested-by: Alexey Brodkin <[email protected]>
-Alexey
P.S. Note Vineet is out this week so please wait for him to return
next week to ack your patch.
On 04/01/2018 08:00 AM, Shea Levy wrote:
> The first patch in this series added a weakly-defined generic
> implementation, which is functionally identical to the
> architecture-specific one removed here.
>
> Series boot-tested on RISC-V (which now uses the generic
> implementation) and x86_64 (which doesn't).
>
> Signed-off-by: Shea Levy <[email protected]>
> ---
> arch/arc/mm/init.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
> index ba145065c579..7bcf23ab1756 100644
> --- a/arch/arc/mm/init.c
> +++ b/arch/arc/mm/init.c
> @@ -229,10 +229,3 @@ void __ref free_initmem(void)
> {
> free_initmem_default(-1);
> }
> -
> -#ifdef CONFIG_BLK_DEV_INITRD
> -void __init free_initrd_mem(unsigned long start, unsigned long end)
> -{
> - free_reserved_area((void *)start, (void *)end, -1, "initrd");
> -}
> -#endif
LGTM.
Acked-by: Vineet Gupta <[email protected]>
-Vineet
Hi all,
Shea Levy <[email protected]> writes:
> This function is effectively identical across 14 architectures, and
> the generic implementation is small enough to be negligible in the
> architectures that do override it. Many of the remaining divergent
> implementations can be included in the common code path in future,
> further reducing code duplication and sharing improvements between
> architectures.
>
> Series boot-tested on RISC-V (which now uses the generic
> implementation) and x86_64 (which doesn't).
>
> v6: Add information about build/run testing.
> v5: Add more complete commit messages.
> v4: Use weak symbols instead of Kconfig.
> v3: Make the generic path opt-out instead of opt-in.
> v2: Mark generic free_initrd_mem __init.
>
> Signed-off-by: Shea Levy <[email protected]>
> ---
> init/initramfs.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/init/initramfs.c b/init/initramfs.c
> index 7e99a0038942..c8fe150f958a 100644
> --- a/init/initramfs.c
> +++ b/init/initramfs.c
> @@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
> #include <linux/initrd.h>
> #include <linux/kexec.h>
>
> +void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
> +{
> + free_reserved_area((void *)start, (void *)end, -1, "initrd");
> +}
> +
> static void __init free_initrd(void)
> {
> #ifdef CONFIG_KEXEC_CORE
> --
> 2.16.2
This series has been quiet for a few weeks other than picking up some
arch-specific acks. What is the next step here?
Thanks,
Shea
On Sun, 2018-04-01 at 10:59 -0400, Shea Levy wrote:
> The first patch in this series added a weakly-defined generic
> implementation, which is functionally identical to the
> architecture-specific one removed here.
>
> Series boot-tested on RISC-V (which now uses the generic
> implementation) and x86_64 (which doesn't).
>
> Signed-off-by: Shea Levy <[email protected]>
> ---
> arch/c6x/mm/init.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c
> index 4cc72b0d1c1d..a11cb657182a 100644
> --- a/arch/c6x/mm/init.c
> +++ b/arch/c6x/mm/init.c
> @@ -66,13 +66,6 @@ void __init mem_init(void)
> mem_init_print_info(NULL);
> }
>
> -#ifdef CONFIG_BLK_DEV_INITRD
> -void __init free_initrd_mem(unsigned long start, unsigned long end)
> -{
> - free_reserved_area((void *)start, (void *)end, -1, "initrd");
> -}
> -#endif
> -
> void __init free_initmem(void)
> {
> free_initmem_default(-1);
Acked-by: Mark Salter <[email protected]>
On Wed, 18 Apr 2018 04:10:16 PDT (-0700), [email protected] wrote:
> Hi all,
>
> Shea Levy <[email protected]> writes:
>
>> This function is effectively identical across 14 architectures, and
>> the generic implementation is small enough to be negligible in the
>> architectures that do override it. Many of the remaining divergent
>> implementations can be included in the common code path in future,
>> further reducing code duplication and sharing improvements between
>> architectures.
>>
>> Series boot-tested on RISC-V (which now uses the generic
>> implementation) and x86_64 (which doesn't).
>>
>> v6: Add information about build/run testing.
>> v5: Add more complete commit messages.
>> v4: Use weak symbols instead of Kconfig.
>> v3: Make the generic path opt-out instead of opt-in.
>> v2: Mark generic free_initrd_mem __init.
>>
>> Signed-off-by: Shea Levy <[email protected]>
>> ---
>> init/initramfs.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/init/initramfs.c b/init/initramfs.c
>> index 7e99a0038942..c8fe150f958a 100644
>> --- a/init/initramfs.c
>> +++ b/init/initramfs.c
>> @@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
>> #include <linux/initrd.h>
>> #include <linux/kexec.h>
>>
>> +void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
>> +{
>> + free_reserved_area((void *)start, (void *)end, -1, "initrd");
>> +}
>> +
>> static void __init free_initrd(void)
>> {
>> #ifdef CONFIG_KEXEC_CORE
>> --
>> 2.16.2
>
> This series has been quiet for a few weeks other than picking up some
> arch-specific acks. What is the next step here?
I'm not sure. I don't really think it's sane for the RISC-V tree because it
touches so many architectures -- I haven't looked closely, though. IIRC
there's a slight behavior change to the RISC-V port, which I'd be OK taking
through my tree (and then obviously the RISC-V cleanup as well, unless it goes
in as a whole patch set).
For the IRQ cleanup I currently have in flight
* Add the generic support
* Move every arch over (RISC-V is in, the rest aren't yet)
* Clean up a bit now that everyone is generic
That lets all the arch-specific patches go in parallel, but can be a bit of a
headache to manage.
I'm adding Arnd and Olof, as they know a lot more about Linux than I do.
Here's the top-level of the v4 patch set: https://lkml.org/lkml/2018/3/28/744
Hi Palmer,
Palmer Dabbelt <[email protected]> writes:
> On Wed, 18 Apr 2018 04:10:16 PDT (-0700), [email protected] wrote:
>> Hi all,
>>
>> Shea Levy <[email protected]> writes:
>>
>>> This function is effectively identical across 14 architectures, and
>>> the generic implementation is small enough to be negligible in the
>>> architectures that do override it. Many of the remaining divergent
>>> implementations can be included in the common code path in future,
>>> further reducing code duplication and sharing improvements between
>>> architectures.
>>>
>>> Series boot-tested on RISC-V (which now uses the generic
>>> implementation) and x86_64 (which doesn't).
>>>
>>> v6: Add information about build/run testing.
>>> v5: Add more complete commit messages.
>>> v4: Use weak symbols instead of Kconfig.
>>> v3: Make the generic path opt-out instead of opt-in.
>>> v2: Mark generic free_initrd_mem __init.
>>>
>>> Signed-off-by: Shea Levy <[email protected]>
>>> ---
>>> init/initramfs.c | 5 +++++
>>> 1 file changed, 5 insertions(+)
>>>
>>> diff --git a/init/initramfs.c b/init/initramfs.c
>>> index 7e99a0038942..c8fe150f958a 100644
>>> --- a/init/initramfs.c
>>> +++ b/init/initramfs.c
>>> @@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
>>> #include <linux/initrd.h>
>>> #include <linux/kexec.h>
>>>
>>> +void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
>>> +{
>>> + free_reserved_area((void *)start, (void *)end, -1, "initrd");
>>> +}
>>> +
>>> static void __init free_initrd(void)
>>> {
>>> #ifdef CONFIG_KEXEC_CORE
>>> --
>>> 2.16.2
>>
>> This series has been quiet for a few weeks other than picking up some
>> arch-specific acks. What is the next step here?
>
> I'm not sure. I don't really think it's sane for the RISC-V tree because it
> touches so many architectures -- I haven't looked closely, though.
Yeah, I think that makes sense.
> IIRC
> there's a slight behavior change to the RISC-V port, which I'd be OK taking
> through my tree (and then obviously the RISC-V cleanup as well, unless it goes
> in as a whole patch set).
>
So currently the behavior for RISC-V is changed by simply deleting the
arch-specific free_initrd_mem, which was a noop. Would you like me to
first submit a patch to have the arch-specific free_initrd_mem and then
change that in this series?
>
> For the IRQ cleanup I currently have in flight
>
> * Add the generic support
> * Move every arch over (RISC-V is in, the rest aren't yet)
> * Clean up a bit now that everyone is generic
>
> That lets all the arch-specific patches go in parallel, but can be a bit of a
> headache to manage.
With the current series, the first patch could go in on its own and all
of the arch-specific patches can go in in parallel if we wanted to, but
beyond the above-suggested implementation of the RISC-V free_initrd_mem
there's no real reordering meaningful here.
>
> I'm adding Arnd and Olof, as they know a lot more about Linux than I do.
> Here's the top-level of the v4 patch set: https://lkml.org/lkml/2018/3/28/744
And here's the top-level of v6, the latest: https://lkml.org/lkml/2018/4/1/50
Hi all,
Shea Levy <[email protected]> writes:
> Hi Palmer,
>
> Palmer Dabbelt <[email protected]> writes:
>
>> On Wed, 18 Apr 2018 04:10:16 PDT (-0700), [email protected] wrote:
>>> Hi all,
>>>
>>> Shea Levy <[email protected]> writes:
>>>
>>>> This function is effectively identical across 14 architectures, and
>>>> the generic implementation is small enough to be negligible in the
>>>> architectures that do override it. Many of the remaining divergent
>>>> implementations can be included in the common code path in future,
>>>> further reducing code duplication and sharing improvements between
>>>> architectures.
>>>>
>>>> Series boot-tested on RISC-V (which now uses the generic
>>>> implementation) and x86_64 (which doesn't).
>>>>
>>>> v6: Add information about build/run testing.
>>>> v5: Add more complete commit messages.
>>>> v4: Use weak symbols instead of Kconfig.
>>>> v3: Make the generic path opt-out instead of opt-in.
>>>> v2: Mark generic free_initrd_mem __init.
>>>>
>>>> Signed-off-by: Shea Levy <[email protected]>
>>>> ---
>>>> init/initramfs.c | 5 +++++
>>>> 1 file changed, 5 insertions(+)
>>>>
>>>> diff --git a/init/initramfs.c b/init/initramfs.c
>>>> index 7e99a0038942..c8fe150f958a 100644
>>>> --- a/init/initramfs.c
>>>> +++ b/init/initramfs.c
>>>> @@ -526,6 +526,11 @@ extern unsigned long __initramfs_size;
>>>> #include <linux/initrd.h>
>>>> #include <linux/kexec.h>
>>>>
>>>> +void __init __weak free_initrd_mem(unsigned long start, unsigned long end)
>>>> +{
>>>> + free_reserved_area((void *)start, (void *)end, -1, "initrd");
>>>> +}
>>>> +
>>>> static void __init free_initrd(void)
>>>> {
>>>> #ifdef CONFIG_KEXEC_CORE
>>>> --
>>>> 2.16.2
>>>
>>> This series has been quiet for a few weeks other than picking up some
>>> arch-specific acks. What is the next step here?
>>
>> I'm not sure. I don't really think it's sane for the RISC-V tree because it
>> touches so many architectures -- I haven't looked closely, though.
>
> Yeah, I think that makes sense.
>
>> IIRC
>> there's a slight behavior change to the RISC-V port, which I'd be OK taking
>> through my tree (and then obviously the RISC-V cleanup as well, unless it goes
>> in as a whole patch set).
>>
>
> So currently the behavior for RISC-V is changed by simply deleting the
> arch-specific free_initrd_mem, which was a noop. Would you like me to
> first submit a patch to have the arch-specific free_initrd_mem and then
> change that in this series?
>
>>
>> For the IRQ cleanup I currently have in flight
>>
>> * Add the generic support
>> * Move every arch over (RISC-V is in, the rest aren't yet)
>> * Clean up a bit now that everyone is generic
>>
>> That lets all the arch-specific patches go in parallel, but can be a bit of a
>> headache to manage.
>
> With the current series, the first patch could go in on its own and all
> of the arch-specific patches can go in in parallel if we wanted to, but
> beyond the above-suggested implementation of the RISC-V free_initrd_mem
> there's no real reordering meaningful here.
>
>>
>> I'm adding Arnd and Olof, as they know a lot more about Linux than I do.
>> Here's the top-level of the v4 patch set: https://lkml.org/lkml/2018/3/28/744
>
> And here's the top-level of v6, the latest: https://lkml.org/lkml/2018/4/1/50
What's the right next step here?
Thanks,
Shea