diff mbox series

[-next,V2] riscv: mm: hugetlb: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP

Message ID 20230127050421.1920048-1-guoren@kernel.org (mailing list archive)
State Superseded
Headers show
Series [-next,V2] riscv: mm: hugetlb: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP | expand

Checks

Context Check Description
conchuod/cover_letter success Single patches do not need cover letters
conchuod/tree_selection success Guessed tree name to be for-next
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 13 and now 13
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 2046 this patch: 2046
conchuod/alphanumeric_selects fail Out of order selects before the patch: 57 and now 59
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 2 this patch: 2
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
conchuod/source_inline success Was 0 now: 0
conchuod/build_rv64_nommu_k210_defconfig success Build OK
conchuod/verify_fixes success No Fixes tag
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Guo Ren Jan. 27, 2023, 5:04 a.m. UTC
From: Guo Ren <guoren@linux.alibaba.com>

Add HVO support for RISC-V; see commit 6be24bed9da3 ("mm: hugetlb:
introduce a new config HUGETLB_PAGE_FREE_VMEMMAP"). This patch is
similar to commit 1e63ac088f20 ("arm64: mm: hugetlb: enable
HUGETLB_PAGE_FREE_VMEMMAP for arm64"), and riscv's motivation is the
same as arm64. The current riscv was ready to enable HVO after fixup,
ref commit d33deda095d3 ("riscv/mm: hugepage's PG_dcache_clean flag
is only set in head page").

The HugeTLB VmemmapvOptimization (HVO) defaults to off in Kconfig.

Here is the riscv test log:
cat /proc/sys/vm/hugetlb_optimize_vmemmap
echo 8 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
mount -t hugetlbfs none test/ -o pagesize=2048k
<Try some simple hugetlb test in test dir, no problem found.>

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/linux-riscv/1F5AF29D-708A-483B-A29F-CAEE6F554866@linux.dev/
Acked-by: Muchun Song <songmuchun@bytedance.com>
---
Changelog:
V2:
 - Optimize the commit log
 - Remove riscv page compound_head fixup which has been merged.
 - Rebase on riscv for-next (20230127)
 - Add HVO author's acked-by

V1:
https://lore.kernel.org/linux-riscv/20221023133205.3493564-1-guoren@kernel.org/
---
 arch/riscv/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Andrew Jones Jan. 27, 2023, 11:57 a.m. UTC | #1
On Fri, Jan 27, 2023 at 12:04:21AM -0500, guoren@kernel.org wrote:
> From: Guo Ren <guoren@linux.alibaba.com>
> 
> Add HVO support for RISC-V; see commit 6be24bed9da3 ("mm: hugetlb:
> introduce a new config HUGETLB_PAGE_FREE_VMEMMAP").

I found Documentation/mm/vmemmap_dedup.rst even more enlightening
about HVO than the commit message of 6be24bed9da3.

> This patch is
> similar to commit 1e63ac088f20 ("arm64: mm: hugetlb: enable
> HUGETLB_PAGE_FREE_VMEMMAP for arm64"), and riscv's motivation is the
> same as arm64. The current riscv was ready to enable HVO after fixup,
> ref commit d33deda095d3 ("riscv/mm: hugepage's PG_dcache_clean flag
> is only set in head page").
> 
> The HugeTLB VmemmapvOptimization (HVO) defaults to off in Kconfig.
> 
> Here is the riscv test log:
> cat /proc/sys/vm/hugetlb_optimize_vmemmap
> echo 8 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
> mount -t hugetlbfs none test/ -o pagesize=2048k
> <Try some simple hugetlb test in test dir, no problem found.>
> 
> Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
> Signed-off-by: Guo Ren <guoren@kernel.org>
> Link: https://lore.kernel.org/linux-riscv/1F5AF29D-708A-483B-A29F-CAEE6F554866@linux.dev/
> Acked-by: Muchun Song <songmuchun@bytedance.com>
> ---
> Changelog:
> V2:
>  - Optimize the commit log
>  - Remove riscv page compound_head fixup which has been merged.
>  - Rebase on riscv for-next (20230127)
>  - Add HVO author's acked-by
> 
> V1:
> https://lore.kernel.org/linux-riscv/20221023133205.3493564-1-guoren@kernel.org/
> ---
>  arch/riscv/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index e2b656043abf..949974a38a41 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -46,6 +46,7 @@ config RISCV
>  	select ARCH_WANT_FRAME_POINTERS
>  	select ARCH_WANT_GENERAL_HUGETLB
>  	select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
> +	select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
>  	select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
>  	select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
>  	select BUILDTIME_TABLE_SORT if MMU
> -- 
> 2.36.1
>

Reviewed-by: Andrew Jones <ajones@ventanamicro.com>

Thanks,
drew
Conor Dooley Jan. 31, 2023, 6:23 p.m. UTC | #2
On Fri, Jan 27, 2023 at 12:04:21AM -0500, guoren@kernel.org wrote:
> From: Guo Ren <guoren@linux.alibaba.com>
> 
> Add HVO support for RISC-V; see commit 6be24bed9da3 ("mm: hugetlb:
> introduce a new config HUGETLB_PAGE_FREE_VMEMMAP"). This patch is
> similar to commit 1e63ac088f20 ("arm64: mm: hugetlb: enable
> HUGETLB_PAGE_FREE_VMEMMAP for arm64"), and riscv's motivation is the
> same as arm64. The current riscv was ready to enable HVO after fixup,
> ref commit d33deda095d3 ("riscv/mm: hugepage's PG_dcache_clean flag
> is only set in head page").
> 
> The HugeTLB VmemmapvOptimization (HVO) defaults to off in Kconfig.
> 
> Here is the riscv test log:
> cat /proc/sys/vm/hugetlb_optimize_vmemmap
> echo 8 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
> mount -t hugetlbfs none test/ -o pagesize=2048k
> <Try some simple hugetlb test in test dir, no problem found.>
> 
> Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
> Signed-off-by: Guo Ren <guoren@kernel.org>
> Link: https://lore.kernel.org/linux-riscv/1F5AF29D-708A-483B-A29F-CAEE6F554866@linux.dev/
> Acked-by: Muchun Song <songmuchun@bytedance.com>
> ---
> Changelog:
> V2:
>  - Optimize the commit log
>  - Remove riscv page compound_head fixup which has been merged.
>  - Rebase on riscv for-next (20230127)
>  - Add HVO author's acked-by
> 
> V1:
> https://lore.kernel.org/linux-riscv/20221023133205.3493564-1-guoren@kernel.org/
> ---
>  arch/riscv/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index e2b656043abf..949974a38a41 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -46,6 +46,7 @@ config RISCV
>  	select ARCH_WANT_FRAME_POINTERS
>  	select ARCH_WANT_GENERAL_HUGETLB
>  	select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
> +	select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP

CI is telling me that this is added out of order. I suppose that means
that T is before _ in the "alphabet", and this should be moved up one
line.
Perhaps it can be fixed on application!

>  	select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
>  	select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
>  	select BUILDTIME_TABLE_SORT if MMU
> -- 
> 2.36.1
>
Guo Ren Feb. 1, 2023, 1:53 a.m. UTC | #3
On Fri, Jan 27, 2023 at 7:57 PM Andrew Jones <ajones@ventanamicro.com> wrote:
>
> On Fri, Jan 27, 2023 at 12:04:21AM -0500, guoren@kernel.org wrote:
> > From: Guo Ren <guoren@linux.alibaba.com>
> >
> > Add HVO support for RISC-V; see commit 6be24bed9da3 ("mm: hugetlb:
> > introduce a new config HUGETLB_PAGE_FREE_VMEMMAP").
>
> I found Documentation/mm/vmemmap_dedup.rst even more enlightening
> about HVO than the commit message of 6be24bed9da3.
I've put that in v3 commit log.
>
> > This patch is
> > similar to commit 1e63ac088f20 ("arm64: mm: hugetlb: enable
> > HUGETLB_PAGE_FREE_VMEMMAP for arm64"), and riscv's motivation is the
> > same as arm64. The current riscv was ready to enable HVO after fixup,
> > ref commit d33deda095d3 ("riscv/mm: hugepage's PG_dcache_clean flag
> > is only set in head page").
> >
> > The HugeTLB VmemmapvOptimization (HVO) defaults to off in Kconfig.
> >
> > Here is the riscv test log:
> > cat /proc/sys/vm/hugetlb_optimize_vmemmap
> > echo 8 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
> > mount -t hugetlbfs none test/ -o pagesize=2048k
> > <Try some simple hugetlb test in test dir, no problem found.>
> >
> > Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
> > Signed-off-by: Guo Ren <guoren@kernel.org>
> > Link: https://lore.kernel.org/linux-riscv/1F5AF29D-708A-483B-A29F-CAEE6F554866@linux.dev/
> > Acked-by: Muchun Song <songmuchun@bytedance.com>
> > ---
> > Changelog:
> > V2:
> >  - Optimize the commit log
> >  - Remove riscv page compound_head fixup which has been merged.
> >  - Rebase on riscv for-next (20230127)
> >  - Add HVO author's acked-by
> >
> > V1:
> > https://lore.kernel.org/linux-riscv/20221023133205.3493564-1-guoren@kernel.org/
> > ---
> >  arch/riscv/Kconfig | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> > index e2b656043abf..949974a38a41 100644
> > --- a/arch/riscv/Kconfig
> > +++ b/arch/riscv/Kconfig
> > @@ -46,6 +46,7 @@ config RISCV
> >       select ARCH_WANT_FRAME_POINTERS
> >       select ARCH_WANT_GENERAL_HUGETLB
> >       select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
> > +     select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
> >       select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
> >       select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
> >       select BUILDTIME_TABLE_SORT if MMU
> > --
> > 2.36.1
> >
>
> Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
>
> Thanks,
> drew
Guo Ren Feb. 1, 2023, 1:54 a.m. UTC | #4
On Wed, Feb 1, 2023 at 2:23 AM Conor Dooley <conor@kernel.org> wrote:
>
> On Fri, Jan 27, 2023 at 12:04:21AM -0500, guoren@kernel.org wrote:
> > From: Guo Ren <guoren@linux.alibaba.com>
> >
> > Add HVO support for RISC-V; see commit 6be24bed9da3 ("mm: hugetlb:
> > introduce a new config HUGETLB_PAGE_FREE_VMEMMAP"). This patch is
> > similar to commit 1e63ac088f20 ("arm64: mm: hugetlb: enable
> > HUGETLB_PAGE_FREE_VMEMMAP for arm64"), and riscv's motivation is the
> > same as arm64. The current riscv was ready to enable HVO after fixup,
> > ref commit d33deda095d3 ("riscv/mm: hugepage's PG_dcache_clean flag
> > is only set in head page").
> >
> > The HugeTLB VmemmapvOptimization (HVO) defaults to off in Kconfig.
> >
> > Here is the riscv test log:
> > cat /proc/sys/vm/hugetlb_optimize_vmemmap
> > echo 8 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
> > mount -t hugetlbfs none test/ -o pagesize=2048k
> > <Try some simple hugetlb test in test dir, no problem found.>
> >
> > Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
> > Signed-off-by: Guo Ren <guoren@kernel.org>
> > Link: https://lore.kernel.org/linux-riscv/1F5AF29D-708A-483B-A29F-CAEE6F554866@linux.dev/
> > Acked-by: Muchun Song <songmuchun@bytedance.com>
> > ---
> > Changelog:
> > V2:
> >  - Optimize the commit log
> >  - Remove riscv page compound_head fixup which has been merged.
> >  - Rebase on riscv for-next (20230127)
> >  - Add HVO author's acked-by
> >
> > V1:
> > https://lore.kernel.org/linux-riscv/20221023133205.3493564-1-guoren@kernel.org/
> > ---
> >  arch/riscv/Kconfig | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> > index e2b656043abf..949974a38a41 100644
> > --- a/arch/riscv/Kconfig
> > +++ b/arch/riscv/Kconfig
> > @@ -46,6 +46,7 @@ config RISCV
> >       select ARCH_WANT_FRAME_POINTERS
> >       select ARCH_WANT_GENERAL_HUGETLB
> >       select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
> > +     select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
>
> CI is telling me that this is added out of order. I suppose that means
> that T is before _ in the "alphabet", and this should be moved up one
> line.
> Perhaps it can be fixed on application!
okay

>
> >       select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
> >       select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
> >       select BUILDTIME_TABLE_SORT if MMU
> > --
> > 2.36.1
> >
diff mbox series

Patch

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index e2b656043abf..949974a38a41 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -46,6 +46,7 @@  config RISCV
 	select ARCH_WANT_FRAME_POINTERS
 	select ARCH_WANT_GENERAL_HUGETLB
 	select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
+	select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
 	select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
 	select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
 	select BUILDTIME_TABLE_SORT if MMU