* [PATCH v3] arm64: add ARM64-specific support for flatmem
@ 2018-07-06 17:47 Nikunj Kela
2018-07-10 12:55 ` Arnd Bergmann
0 siblings, 1 reply; 5+ messages in thread
From: Nikunj Kela @ 2018-07-06 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Flatmem is useful in reducing kernel memory usage.
One usecase is in kdump kernel. We are able to save
~14M by moving to flatmem scheme.
Cc: xe-kernel at external.cisco.com
Cc: Nikunj Kela <nkela@cisco.com>
Signed-off-by: Nikunj Kela <nkela@cisco.com>
---
arch/arm64/Kconfig | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 42c090c..f5b4c49 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -775,6 +775,9 @@ config ARCH_SPARSEMEM_DEFAULT
config ARCH_SELECT_MEMORY_MODEL
def_bool ARCH_SPARSEMEM_ENABLE
+config ARCH_FLATMEM_ENABLE
+ def_bool y
+
config HAVE_ARCH_PFN_VALID
def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM
--
2.10.3.dirty
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3] arm64: add ARM64-specific support for flatmem
2018-07-06 17:47 [PATCH v3] arm64: add ARM64-specific support for flatmem Nikunj Kela
@ 2018-07-10 12:55 ` Arnd Bergmann
2018-07-10 13:06 ` Will Deacon
0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2018-07-10 12:55 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jul 6, 2018 at 7:47 PM, Nikunj Kela <nkela@cisco.com> wrote:
> Flatmem is useful in reducing kernel memory usage.
> One usecase is in kdump kernel. We are able to save
> ~14M by moving to flatmem scheme.
>
> Cc: xe-kernel at external.cisco.com
> Cc: Nikunj Kela <nkela@cisco.com>
> Signed-off-by: Nikunj Kela <nkela@cisco.com>
> ---
> arch/arm64/Kconfig | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 42c090c..f5b4c49 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -775,6 +775,9 @@ config ARCH_SPARSEMEM_DEFAULT
> config ARCH_SELECT_MEMORY_MODEL
> def_bool ARCH_SPARSEMEM_ENABLE
>
> +config ARCH_FLATMEM_ENABLE
> + def_bool y
> +
> config HAVE_ARCH_PFN_VALID
> def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM
>
I'm getting hundreds of errors in randconfig builds with this:
+ /home/arnd/cross/x86_64/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-ld
-EB -maarch64elfb --no-undefined -X -pie -shared -Bsymbolic
--no-apply-dynamic-relocs --build-id -o .tmp_vmlinux1 -T
./arch/arm64/kernel/vmlinux.lds --whole-archive built-in.a
--no-whole-archive --start-group arch/arm64/lib/lib.a lib/lib.a
--end-group
init/do_mounts.o: In function `mount_block_root':
do_mounts.c:(.init.text+0x1e8): undefined reference to `mem_map'
/home/arnd/cross/x86_64/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-ld:
init/do_mounts.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol
`mem_map' which may bind externally can not be used when making a
shared object; recompile with -fPIC
do_mounts.c:(.init.text+0x1e8): dangerous relocation: unsupported relocation
do_mounts.c:(.init.text+0x1f4): undefined reference to `mem_map'
arch/arm64/kernel/vdso.o: In function `vdso_init':
vdso.c:(.init.text+0xb4): undefined reference to `mem_map'
/home/arnd/cross/x86_64/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-ld:
arch/arm64/kernel/vdso.o: relocation R_AARCH64_ADR_PREL_PG_HI21
against symbol `mem_map' which may bind externally can not be used
when making a shared object; recompile with -fPIC
vdso.c:(.init.text+0xb4): dangerous relocation: unsupported relocation
vdso.c:(.init.text+0xbc): undefined reference to `mem_map'
vdso.c:(.init.text+0xec): undefined reference to `mem_map'
arch/arm64/kernel/insn.o:insn.c:(.text+0x2ec): more undefined
references to `mem_map' follow
/home/arnd/cross/x86_64/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-ld:
arch/arm64/kernel/insn.o: relocation R_AARCH64_ADR_PREL_PG_HI21
against symbol `mem_map' which may bind externally can not be used
when making a shared object; recompile with -fPIC
The problem seems to be that CONFIG_NUMA is enabled in my
build, so mem_map[] is not defined anywhere.
Arnd
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3] arm64: add ARM64-specific support for flatmem
2018-07-10 12:55 ` Arnd Bergmann
@ 2018-07-10 13:06 ` Will Deacon
2018-07-10 13:25 ` Arnd Bergmann
0 siblings, 1 reply; 5+ messages in thread
From: Will Deacon @ 2018-07-10 13:06 UTC (permalink / raw)
To: linux-arm-kernel
Hi Arnd,
On Tue, Jul 10, 2018 at 02:55:41PM +0200, Arnd Bergmann wrote:
> On Fri, Jul 6, 2018 at 7:47 PM, Nikunj Kela <nkela@cisco.com> wrote:
> > Flatmem is useful in reducing kernel memory usage.
> > One usecase is in kdump kernel. We are able to save
> > ~14M by moving to flatmem scheme.
> >
> > Cc: xe-kernel at external.cisco.com
> > Cc: Nikunj Kela <nkela@cisco.com>
> > Signed-off-by: Nikunj Kela <nkela@cisco.com>
> > ---
> > arch/arm64/Kconfig | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > index 42c090c..f5b4c49 100644
> > --- a/arch/arm64/Kconfig
> > +++ b/arch/arm64/Kconfig
> > @@ -775,6 +775,9 @@ config ARCH_SPARSEMEM_DEFAULT
> > config ARCH_SELECT_MEMORY_MODEL
> > def_bool ARCH_SPARSEMEM_ENABLE
> >
> > +config ARCH_FLATMEM_ENABLE
> > + def_bool y
> > +
> > config HAVE_ARCH_PFN_VALID
> > def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM
> >
>
> I'm getting hundreds of errors in randconfig builds with this:
Damn, I was worried something like this might happen. Sorry!
Does randconfig also fuzz CONFIG_EXPERT? We only added ARCH_FLATMEM_ENABLE
so that people can hand-configure crashkernels to make them small; there will
be plenty of situations where it's just going to cause more problems than it
solves, so I'd be happy hiding it behind EXPERT if it helps.
Otherwise we can probably through a 'def_bool !NUMA' at it.
Will
> + /home/arnd/cross/x86_64/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-ld
> -EB -maarch64elfb --no-undefined -X -pie -shared -Bsymbolic
> --no-apply-dynamic-relocs --build-id -o .tmp_vmlinux1 -T
> ./arch/arm64/kernel/vmlinux.lds --whole-archive built-in.a
> --no-whole-archive --start-group arch/arm64/lib/lib.a lib/lib.a
> --end-group
> init/do_mounts.o: In function `mount_block_root':
> do_mounts.c:(.init.text+0x1e8): undefined reference to `mem_map'
> /home/arnd/cross/x86_64/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-ld:
> init/do_mounts.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol
> `mem_map' which may bind externally can not be used when making a
> shared object; recompile with -fPIC
> do_mounts.c:(.init.text+0x1e8): dangerous relocation: unsupported relocation
> do_mounts.c:(.init.text+0x1f4): undefined reference to `mem_map'
> arch/arm64/kernel/vdso.o: In function `vdso_init':
> vdso.c:(.init.text+0xb4): undefined reference to `mem_map'
> /home/arnd/cross/x86_64/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-ld:
> arch/arm64/kernel/vdso.o: relocation R_AARCH64_ADR_PREL_PG_HI21
> against symbol `mem_map' which may bind externally can not be used
> when making a shared object; recompile with -fPIC
> vdso.c:(.init.text+0xb4): dangerous relocation: unsupported relocation
> vdso.c:(.init.text+0xbc): undefined reference to `mem_map'
> vdso.c:(.init.text+0xec): undefined reference to `mem_map'
> arch/arm64/kernel/insn.o:insn.c:(.text+0x2ec): more undefined
> references to `mem_map' follow
> /home/arnd/cross/x86_64/gcc-8.1.0-nolibc/aarch64-linux/bin/aarch64-linux-ld:
> arch/arm64/kernel/insn.o: relocation R_AARCH64_ADR_PREL_PG_HI21
> against symbol `mem_map' which may bind externally can not be used
> when making a shared object; recompile with -fPIC
>
> The problem seems to be that CONFIG_NUMA is enabled in my
> build, so mem_map[] is not defined anywhere.
>
> Arnd
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3] arm64: add ARM64-specific support for flatmem
2018-07-10 13:06 ` Will Deacon
@ 2018-07-10 13:25 ` Arnd Bergmann
2018-07-10 14:16 ` Will Deacon
0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2018-07-10 13:25 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jul 10, 2018 at 3:06 PM, Will Deacon <will.deacon@arm.com> wrote:
> Hi Arnd,
>
> On Tue, Jul 10, 2018 at 02:55:41PM +0200, Arnd Bergmann wrote:
>> On Fri, Jul 6, 2018 at 7:47 PM, Nikunj Kela <nkela@cisco.com> wrote:
>> > Flatmem is useful in reducing kernel memory usage.
>> > One usecase is in kdump kernel. We are able to save
>> > ~14M by moving to flatmem scheme.
>> >
>> > Cc: xe-kernel at external.cisco.com
>> > Cc: Nikunj Kela <nkela@cisco.com>
>> > Signed-off-by: Nikunj Kela <nkela@cisco.com>
>> > ---
>> > arch/arm64/Kconfig | 3 +++
>> > 1 file changed, 3 insertions(+)
>> >
>> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
>> > index 42c090c..f5b4c49 100644
>> > --- a/arch/arm64/Kconfig
>> > +++ b/arch/arm64/Kconfig
>> > @@ -775,6 +775,9 @@ config ARCH_SPARSEMEM_DEFAULT
>> > config ARCH_SELECT_MEMORY_MODEL
>> > def_bool ARCH_SPARSEMEM_ENABLE
>> >
>> > +config ARCH_FLATMEM_ENABLE
>> > + def_bool y
>> > +
>> > config HAVE_ARCH_PFN_VALID
>> > def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM
>> >
>>
>> I'm getting hundreds of errors in randconfig builds with this:
>
> Damn, I was worried something like this might happen. Sorry!
>
> Does randconfig also fuzz CONFIG_EXPERT? We only added ARCH_FLATMEM_ENABLE
> so that people can hand-configure crashkernels to make them small; there will
> be plenty of situations where it's just going to cause more problems than it
> solves, so I'd be happy hiding it behind EXPERT if it helps.
Yes, randconfig also tests EXPERT and COMPILE_TEST configurations, though I
don't test the !COMPILE_TEST ones myself, so you can also hide options from
me by making them 'depends on !COMPILE_TEST'.
> Otherwise we can probably through a 'def_bool !NUMA' at it.
Yes, I was going to send a patch with that next after testing it some more.
So far it's holding up. This is also what some other architectures have, so
it's probably safe.
Arnd
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3] arm64: add ARM64-specific support for flatmem
2018-07-10 13:25 ` Arnd Bergmann
@ 2018-07-10 14:16 ` Will Deacon
0 siblings, 0 replies; 5+ messages in thread
From: Will Deacon @ 2018-07-10 14:16 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jul 10, 2018 at 03:25:14PM +0200, Arnd Bergmann wrote:
> On Tue, Jul 10, 2018 at 3:06 PM, Will Deacon <will.deacon@arm.com> wrote:
> > On Tue, Jul 10, 2018 at 02:55:41PM +0200, Arnd Bergmann wrote:
> >> On Fri, Jul 6, 2018 at 7:47 PM, Nikunj Kela <nkela@cisco.com> wrote:
> >> > Flatmem is useful in reducing kernel memory usage.
> >> > One usecase is in kdump kernel. We are able to save
> >> > ~14M by moving to flatmem scheme.
> >> >
> >> > Cc: xe-kernel at external.cisco.com
> >> > Cc: Nikunj Kela <nkela@cisco.com>
> >> > Signed-off-by: Nikunj Kela <nkela@cisco.com>
> >> > ---
> >> > arch/arm64/Kconfig | 3 +++
> >> > 1 file changed, 3 insertions(+)
> >> >
> >> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> >> > index 42c090c..f5b4c49 100644
> >> > --- a/arch/arm64/Kconfig
> >> > +++ b/arch/arm64/Kconfig
> >> > @@ -775,6 +775,9 @@ config ARCH_SPARSEMEM_DEFAULT
> >> > config ARCH_SELECT_MEMORY_MODEL
> >> > def_bool ARCH_SPARSEMEM_ENABLE
> >> >
> >> > +config ARCH_FLATMEM_ENABLE
> >> > + def_bool y
> >> > +
> >> > config HAVE_ARCH_PFN_VALID
> >> > def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM
> >> >
> >>
> >> I'm getting hundreds of errors in randconfig builds with this:
> >
> > Damn, I was worried something like this might happen. Sorry!
> >
> > Does randconfig also fuzz CONFIG_EXPERT? We only added ARCH_FLATMEM_ENABLE
> > so that people can hand-configure crashkernels to make them small; there will
> > be plenty of situations where it's just going to cause more problems than it
> > solves, so I'd be happy hiding it behind EXPERT if it helps.
>
> Yes, randconfig also tests EXPERT and COMPILE_TEST configurations, though I
> don't test the !COMPILE_TEST ones myself, so you can also hide options from
> me by making them 'depends on !COMPILE_TEST'.
>
> > Otherwise we can probably through a 'def_bool !NUMA' at it.
>
> Yes, I was going to send a patch with that next after testing it some more.
> So far it's holding up. This is also what some other architectures have, so
> it's probably safe.
Ok, let's go with that then. If I don't see a patch from you in a day or
two, I'll write one myself :)
Will
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-07-10 14:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-06 17:47 [PATCH v3] arm64: add ARM64-specific support for flatmem Nikunj Kela
2018-07-10 12:55 ` Arnd Bergmann
2018-07-10 13:06 ` Will Deacon
2018-07-10 13:25 ` Arnd Bergmann
2018-07-10 14:16 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).