mbox series

[V14,0/4] mm/sparse-vmemmap: Generalise helpers and enable for LoongArch

Message ID 20221027125253.3458989-1-chenhuacai@loongson.cn (mailing list archive)
Headers show
Series mm/sparse-vmemmap: Generalise helpers and enable for LoongArch | expand

Message

Huacai Chen Oct. 27, 2022, 12:52 p.m. UTC
This series is in order to enable sparse-vmemmap for LoongArch. But
LoongArch cannot use generic helpers directly because MIPS&LoongArch
need to call pgd_init()/pud_init()/pmd_init() when populating page
tables. So we adjust the prototypes of p?d_init() to make generic
helpers can call them, then enable sparse-vmemmap with generic helpers,
and to be further, generalise vmemmap_populate_hugepages() for ARM64,
X86 and LoongArch.

V1 -> V2:
Split ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP to a separate patch.

V2 -> V3:
1, Change the Signed-off-by order of author and committer;
2, Update commit message about the build error on LoongArch.

V3 -> V4:
Change pmd to pmdp for ARM64 for consistency.

V4 -> V5:
Add a detailed comment for no-fallback in the altmap case.

V5 -> V6:
1, Fix build error for NIOS2;
2, Fix build error for allnoconfig;
3, Update comment for no-fallback in the altmap case.

V6 -> V7:
Fix build warnings of "no previous prototype".

V7 -> V8:
Fix build error for MIPS pud_init().

V8 -> V9:
Remove redundant #include to avoid build error with latest upstream
kernel.

V9 -> V10:
Fix build error due to VMEMMAP changes in 6.0-rc1.

V10 -> V11:
Adjust context due to ARM64 changes in 6.1-rc1.

V11 -> V12:
1, Fix build error for !SPARSEMEM;
2, Simplify pagetable_init() for MIPS32.

V12 -> V13:
1, Add Acked-by and Reviewed-by tags;
2, Update commit message for the 4th patch.

V13 -> V14:
Remove the static_key.h inclusion in the 4th patch.

Huacai Chen and Feiyang Chen(4):
 MIPS&LoongArch&NIOS2: Adjust prototypes of p?d_init().
 LoongArch: Add sparse memory vmemmap support.
 mm/sparse-vmemmap: Generalise vmemmap_populate_hugepages().
 LoongArch: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn> 
---
 arch/arm64/mm/mmu.c                    | 53 ++++++--------------
 arch/loongarch/Kconfig                 |  2 +
 arch/loongarch/include/asm/pgalloc.h   | 13 +----
 arch/loongarch/include/asm/pgtable.h   | 13 +++--
 arch/loongarch/include/asm/sparsemem.h |  8 +++
 arch/loongarch/kernel/numa.c           |  4 +-
 arch/loongarch/mm/init.c               | 44 +++++++++++++++-
 arch/loongarch/mm/pgtable.c            | 23 +++++----
 arch/mips/include/asm/pgalloc.h        |  8 +--
 arch/mips/include/asm/pgtable-64.h     |  8 +--
 arch/mips/kvm/mmu.c                    |  3 +-
 arch/mips/mm/pgtable-32.c              | 10 ++--
 arch/mips/mm/pgtable-64.c              | 18 ++++---
 arch/mips/mm/pgtable.c                 |  2 +-
 arch/x86/mm/init_64.c                  | 92 ++++++++++++----------------------
 include/linux/mm.h                     |  8 +++
 include/linux/page-flags.h             |  1 +
 mm/sparse-vmemmap.c                    | 64 +++++++++++++++++++++++
 18 files changed, 222 insertions(+), 152 deletions(-)
--
2.27.0

Comments

Huacai Chen Nov. 12, 2022, 10:26 a.m. UTC | #1
Hi, Arnd,

Just a gentle ping, is this series good enough now? I think the last
problem (static-key.h inclusion) has also been solved.


Huacai

On Thu, Oct 27, 2022 at 8:54 PM Huacai Chen <chenhuacai@loongson.cn> wrote:
>
> This series is in order to enable sparse-vmemmap for LoongArch. But
> LoongArch cannot use generic helpers directly because MIPS&LoongArch
> need to call pgd_init()/pud_init()/pmd_init() when populating page
> tables. So we adjust the prototypes of p?d_init() to make generic
> helpers can call them, then enable sparse-vmemmap with generic helpers,
> and to be further, generalise vmemmap_populate_hugepages() for ARM64,
> X86 and LoongArch.
>
> V1 -> V2:
> Split ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP to a separate patch.
>
> V2 -> V3:
> 1, Change the Signed-off-by order of author and committer;
> 2, Update commit message about the build error on LoongArch.
>
> V3 -> V4:
> Change pmd to pmdp for ARM64 for consistency.
>
> V4 -> V5:
> Add a detailed comment for no-fallback in the altmap case.
>
> V5 -> V6:
> 1, Fix build error for NIOS2;
> 2, Fix build error for allnoconfig;
> 3, Update comment for no-fallback in the altmap case.
>
> V6 -> V7:
> Fix build warnings of "no previous prototype".
>
> V7 -> V8:
> Fix build error for MIPS pud_init().
>
> V8 -> V9:
> Remove redundant #include to avoid build error with latest upstream
> kernel.
>
> V9 -> V10:
> Fix build error due to VMEMMAP changes in 6.0-rc1.
>
> V10 -> V11:
> Adjust context due to ARM64 changes in 6.1-rc1.
>
> V11 -> V12:
> 1, Fix build error for !SPARSEMEM;
> 2, Simplify pagetable_init() for MIPS32.
>
> V12 -> V13:
> 1, Add Acked-by and Reviewed-by tags;
> 2, Update commit message for the 4th patch.
>
> V13 -> V14:
> Remove the static_key.h inclusion in the 4th patch.
>
> Huacai Chen and Feiyang Chen(4):
>  MIPS&LoongArch&NIOS2: Adjust prototypes of p?d_init().
>  LoongArch: Add sparse memory vmemmap support.
>  mm/sparse-vmemmap: Generalise vmemmap_populate_hugepages().
>  LoongArch: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP.
>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
> ---
>  arch/arm64/mm/mmu.c                    | 53 ++++++--------------
>  arch/loongarch/Kconfig                 |  2 +
>  arch/loongarch/include/asm/pgalloc.h   | 13 +----
>  arch/loongarch/include/asm/pgtable.h   | 13 +++--
>  arch/loongarch/include/asm/sparsemem.h |  8 +++
>  arch/loongarch/kernel/numa.c           |  4 +-
>  arch/loongarch/mm/init.c               | 44 +++++++++++++++-
>  arch/loongarch/mm/pgtable.c            | 23 +++++----
>  arch/mips/include/asm/pgalloc.h        |  8 +--
>  arch/mips/include/asm/pgtable-64.h     |  8 +--
>  arch/mips/kvm/mmu.c                    |  3 +-
>  arch/mips/mm/pgtable-32.c              | 10 ++--
>  arch/mips/mm/pgtable-64.c              | 18 ++++---
>  arch/mips/mm/pgtable.c                 |  2 +-
>  arch/x86/mm/init_64.c                  | 92 ++++++++++++----------------------
>  include/linux/mm.h                     |  8 +++
>  include/linux/page-flags.h             |  1 +
>  mm/sparse-vmemmap.c                    | 64 +++++++++++++++++++++++
>  18 files changed, 222 insertions(+), 152 deletions(-)
> --
> 2.27.0
>
Arnd Bergmann Nov. 14, 2022, 8:09 p.m. UTC | #2
On Sat, Nov 12, 2022, at 11:26, Huacai Chen wrote:
> Hi, Arnd,
>
> Just a gentle ping, is this series good enough now? I think the last
> problem (static-key.h inclusion) has also been solved.

Yes, this looks fine to me. Sorry I didn't have this on my
radar any more.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

I guess the series should be merged through Andrew's linux-mm
tree. Let me know if for some reason I should pick it up into
the asm-generic tree instead.

     Arnd
Huacai Chen Nov. 27, 2022, 5:01 a.m. UTC | #3
Hi, Andrew,

On Tue, Nov 15, 2022 at 4:09 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Sat, Nov 12, 2022, at 11:26, Huacai Chen wrote:
> > Hi, Arnd,
> >
> > Just a gentle ping, is this series good enough now? I think the last
> > problem (static-key.h inclusion) has also been solved.
>
> Yes, this looks fine to me. Sorry I didn't have this on my
> radar any more.
>
> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
>
> I guess the series should be merged through Andrew's linux-mm
> tree. Let me know if for some reason I should pick it up into
> the asm-generic tree instead.
Another gentle ping, can this series be merged to linux-mm in the 6.2 cycle?

Huacai
>
>      Arnd
Andrew Morton Nov. 28, 2022, 11:10 p.m. UTC | #4
On Sun, 27 Nov 2022 13:01:19 +0800 Huacai Chen <chenhuacai@kernel.org> wrote:

> Hi, Andrew,
> 
> On Tue, Nov 15, 2022 at 4:09 AM Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > On Sat, Nov 12, 2022, at 11:26, Huacai Chen wrote:
> > > Hi, Arnd,
> > >
> > > Just a gentle ping, is this series good enough now? I think the last
> > > problem (static-key.h inclusion) has also been solved.
> >
> > Yes, this looks fine to me. Sorry I didn't have this on my
> > radar any more.
> >
> > Reviewed-by: Arnd Bergmann <arnd@arndb.de>
> >
> > I guess the series should be merged through Andrew's linux-mm
> > tree. Let me know if for some reason I should pick it up into
> > the asm-generic tree instead.
> Another gentle ping, can this series be merged to linux-mm in the 6.2 cycle?

It's a pretty large patchset and I'm a bit concerned about the amount
of review and test which it has received from the MIPS side?

Prudence suggest that we merge this in 6.3-rc1.  But I'll queue it up
for now, get a bit of testing while we consider this.
Huacai Chen Nov. 29, 2022, 3:26 a.m. UTC | #5
On Tue, Nov 29, 2022 at 7:10 AM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Sun, 27 Nov 2022 13:01:19 +0800 Huacai Chen <chenhuacai@kernel.org> wrote:
>
> > Hi, Andrew,
> >
> > On Tue, Nov 15, 2022 at 4:09 AM Arnd Bergmann <arnd@arndb.de> wrote:
> > >
> > > On Sat, Nov 12, 2022, at 11:26, Huacai Chen wrote:
> > > > Hi, Arnd,
> > > >
> > > > Just a gentle ping, is this series good enough now? I think the last
> > > > problem (static-key.h inclusion) has also been solved.
> > >
> > > Yes, this looks fine to me. Sorry I didn't have this on my
> > > radar any more.
> > >
> > > Reviewed-by: Arnd Bergmann <arnd@arndb.de>
> > >
> > > I guess the series should be merged through Andrew's linux-mm
> > > tree. Let me know if for some reason I should pick it up into
> > > the asm-generic tree instead.
> > Another gentle ping, can this series be merged to linux-mm in the 6.2 cycle?
>
> It's a pretty large patchset and I'm a bit concerned about the amount
> of review and test which it has received from the MIPS side?
We have tested on MIPS-based Loongson. :)

>
> Prudence suggest that we merge this in 6.3-rc1.  But I'll queue it up
> for now, get a bit of testing while we consider this.
>
OK, thanks, you are free to decide this.

Huacai