2018-03-28 20:38:41

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 0/16] Generic initrd_free_mem

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.



2018-03-28 20:38:48

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 03/16] alpha: Use generic free_initrd_mem.

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


2018-03-28 20:39:06

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 07/16] h8300: Use generic free_initrd_mem.

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


2018-03-28 20:39:18

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 09/16] m68k: Use generic free_initrd_mem.

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


2018-03-28 20:39:28

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 16/16] um: Use generic free_initrd_mem.

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


2018-03-28 20:39:36

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 15/16] sh: Use generic free_initrd_mem.

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


2018-03-28 20:39:52

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 13/16] parisc: Use generic free_initrd_mem.

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


2018-03-28 20:40:05

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 05/16] c6x: Use generic free_initrd_mem.

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


2018-03-28 20:40:31

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 11/16] nios2: Use generic free_initrd_mem.

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


2018-03-28 20:40:34

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 12/16] openrisc: Use generic free_initrd_mem.

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


2018-03-28 20:40:46

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 10/16] microblaze: Use generic free_initrd_mem.

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


2018-03-28 20:41:09

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 08/16] m32r: Use generic free_initrd_mem.

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


2018-03-28 20:42:00

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 06/16] frv: Use generic free_initrd_mem.

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


2018-03-28 20:42:23

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 02/16] riscv: Use generic free_initrd_mem.

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


2018-03-28 20:42:31

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 01/16] initrd: Add weakly-linked generic free_initrd_mem.

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


2018-03-28 20:43:02

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 04/16] arc: Use generic free_initrd_mem.

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


2018-03-28 20:45:24

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH v4 14/16] powerpc: Use generic free_initrd_mem.

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.


2018-03-28 20:55:27

by Shea Levy

[permalink] [raw]
Subject: Re: [PATCH v4 14/16] powerpc: Use generic free_initrd_mem.

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!


Attachments:
signature.asc (847.00 B)

2018-03-28 21:08:33

by Shea Levy

[permalink] [raw]
Subject: [PATCH v4 14/16] powerpc: Use generic free_initrd_mem.

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


2018-03-29 06:56:55

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v4 09/16] m68k: Use generic free_initrd_mem.

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

2018-03-29 09:54:22

by Daniel Thompson

[permalink] [raw]
Subject: Re: [PATCH v4 02/16] riscv: Use generic free_initrd_mem.

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.

2018-03-29 11:14:19

by Shea Levy

[permalink] [raw]
Subject: Re: [PATCH v4 02/16] riscv: Use generic free_initrd_mem.

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.


Attachments:
signature.asc (847.00 B)

2018-03-29 11:33:51

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 02/16] riscv: Free initrds with generic free_initrd_mem.

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


2018-03-29 11:33:59

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 03/16] alpha: Switch to generic free_initrd_mem.

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


2018-03-29 11:34:02

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 06/16] frv: Switch to generic free_initrd_mem.

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


2018-03-29 11:34:13

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 10/16] microblaze: Switch to generic free_initrd_mem.

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


2018-03-29 11:34:27

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 16/16] um: Switch to generic free_initrd_mem.

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


2018-03-29 11:34:43

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 15/16] sh: Switch to generic free_initrd_mem.

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


2018-03-29 11:34:49

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 14/16] powerpc: Switch to generic free_initrd_mem.

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


2018-03-29 11:35:42

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 08/16] m32r: Switch to generic free_initrd_mem.

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


2018-03-29 11:35:46

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 09/16] m68k: Switch to generic free_initrd_mem.

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


2018-03-29 11:36:07

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 11/16] nios2: Switch to generic free_initrd_mem.

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


2018-03-29 11:36:27

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 13/16] parisc: Switch to generic free_initrd_mem.

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


2018-03-29 11:37:01

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 07/16] h8300: Switch to generic free_initrd_mem.

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


2018-03-29 11:37:09

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 12/16] openrisc: Switch to generic free_initrd_mem.

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


2018-03-29 11:37:17

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 05/16] c6x: Switch to generic free_initrd_mem.

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


2018-03-29 11:37:48

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 04/16] arc: Switch to generic free_initrd_mem.

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


2018-03-29 11:38:06

by Shea Levy

[permalink] [raw]
Subject: [PATCH v5 01/16] initrd: Add weakly-linked generic free_initrd_mem.

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


2018-03-29 11:52:04

by Stafford Horne

[permalink] [raw]
Subject: Re: [PATCH v5 12/16] openrisc: Switch to generic free_initrd_mem.

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
>

2018-03-29 13:22:36

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH v4 14/16] powerpc: Use generic free_initrd_mem.

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

2018-03-29 16:28:30

by Rich Felker

[permalink] [raw]
Subject: Re: [PATCH v5 15/16] sh: Switch to generic free_initrd_mem.

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]>

2018-04-01 15:03:35

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 16/16] um: Switch to generic free_initrd_mem.

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


2018-04-01 15:03:35

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 15/16] sh: Switch to generic free_initrd_mem.

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


2018-04-01 15:03:35

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 04/16] arc: Switch to generic free_initrd_mem.

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


2018-04-01 15:03:35

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 01/16] initrd: Add weakly-linked generic free_initrd_mem.

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


2018-04-01 15:03:39

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 11/16] nios2: Switch to generic free_initrd_mem.

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


2018-04-01 15:03:40

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 13/16] parisc: Switch to generic free_initrd_mem.

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


2018-04-01 15:03:52

by Shea Levy

[permalink] [raw]
Subject: Re: [PATCH v4 14/16] powerpc: Use generic free_initrd_mem.

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


Attachments:
signature.asc (847.00 B)

2018-04-01 15:04:12

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 14/16] powerpc: Switch to generic free_initrd_mem.

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


2018-04-01 15:04:21

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 08/16] m32r: Switch to generic free_initrd_mem.

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


2018-04-01 15:04:27

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 12/16] openrisc: Switch to generic free_initrd_mem.

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


2018-04-01 15:04:43

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 10/16] microblaze: Switch to generic free_initrd_mem.

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


2018-04-01 15:04:59

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 09/16] m68k: Switch to generic free_initrd_mem.

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


2018-04-01 15:05:00

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 07/16] h8300: Switch to generic free_initrd_mem.

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


2018-04-01 15:05:21

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 03/16] alpha: Switch to generic free_initrd_mem.

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


2018-04-01 15:05:50

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 05/16] c6x: Switch to generic free_initrd_mem.

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


2018-04-01 15:06:17

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 06/16] frv: Switch to generic free_initrd_mem.

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


2018-04-01 15:06:53

by Shea Levy

[permalink] [raw]
Subject: [PATCH v6 02/16] riscv: Free initrds with generic free_initrd_mem.

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


2018-04-02 08:06:17

by Tan, Ley Foon

[permalink] [raw]
Subject: Re: [PATCH v6 11/16] nios2: Switch to generic free_initrd_mem.

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

2018-04-02 20:09:26

by Helge Deller

[permalink] [raw]
Subject: Re: [PATCH v6 13/16] parisc: Switch to generic free_initrd_mem.

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
>


2018-04-04 15:23:21

by Alexey Brodkin

[permalink] [raw]
Subject: Re: [PATCH v6 04/16] arc: Switch to generic free_initrd_mem.

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.

2018-04-09 16:45:03

by Vineet Gupta

[permalink] [raw]
Subject: Re: [PATCH v6 04/16] arc: Switch to generic free_initrd_mem.

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

2018-04-18 11:12:03

by Shea Levy

[permalink] [raw]
Subject: Re: [PATCH v6 01/16] initrd: Add weakly-linked generic free_initrd_mem.

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


Attachments:
signature.asc (847.00 B)

2018-04-19 16:39:22

by Mark Salter

[permalink] [raw]
Subject: Re: [PATCH v6 05/16] c6x: Switch to generic free_initrd_mem.

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]>


2018-04-20 20:25:59

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH v6 01/16] initrd: Add weakly-linked generic free_initrd_mem.

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

2018-04-20 22:53:29

by Shea Levy

[permalink] [raw]
Subject: Re: [PATCH v6 01/16] initrd: Add weakly-linked generic free_initrd_mem.

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


Attachments:
signature.asc (847.00 B)

2018-05-09 11:16:10

by Shea Levy

[permalink] [raw]
Subject: Re: [PATCH v6 01/16] initrd: Add weakly-linked generic free_initrd_mem.

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


Attachments:
signature.asc (847.00 B)