riscv: mm: hugetlb: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
PATCH v2 1/1 riscv: mm: hugetlb: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
From: Guo Ren <[email protected]>
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.>
---
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/[email protected]/
--- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/riscv/Kconfig +1 -0
@@ -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
Signature · 1 line
2.36.1
Quoted 4 lines · On Fri, Jan 27, 2023 at 12:04:21AM -0500, [email protected] wrote:
From: Guo Ren <[email protected]>
Add HVO support for RISC-V; see commit
6be24bed9da3("mm: hugetlb:
introduce a new configHUGETLB_PAGE_FREE_VMEMMAP").
I found Documentation/mm/vmemmap_dedup.rst even more enlightening about HVO than the commit message of 6be24bed9da3.
Quoted 48 lines
This patch is
similar to commit1e63ac088f20("arm64: mm: hugetlb: enableHUGETLB_PAGE_FREE_VMEMMAPfor arm64"), and riscv's motivation is the same as arm64. The current riscv was ready to enable HVO after fixup, ref commitd33deda095d3("riscv/mm: hugepage'sPG_dcache_cleanflag 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_hugepagesmount -t hugetlbfs none test/ -o pagesize=2048k
<Try some simple hugetlb test in test dir, no problem found.>Signed-off-by Guo Ren <[email protected]>Signed-off-by Guo Ren <[email protected]>Acked-by Muchun Song <[email protected]>---
Changelog:
V2:
- Optimize the commit log
- Remove riscv pagecompound_headfixup which has been merged.
- Rebase on riscv for-next (20230127)
- Add HVO author's acked-byV1:
https://lore.kernel.org/linux-riscv/[email protected]/--- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+)arch/riscv/Kconfig +1
-0@@ -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 MMUSignature · 1 line
2.36.1
Thanks,
drew
Quoted 41 lines · On Fri, Jan 27, 2023 at 12:04:21AM -0500, [email protected] wrote:
From: Guo Ren <[email protected]>
Add HVO support for RISC-V; see commit
6be24bed9da3("mm: hugetlb:
introduce a new configHUGETLB_PAGE_FREE_VMEMMAP"). This patch is similar to commit1e63ac088f20("arm64: mm: hugetlb: enableHUGETLB_PAGE_FREE_VMEMMAPfor arm64"), and riscv's motivation is the same as arm64. The current riscv was ready to enable HVO after fixup, ref commitd33deda095d3("riscv/mm: hugepage'sPG_dcache_cleanflag 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_hugepagesmount -t hugetlbfs none test/ -o pagesize=2048k
<Try some simple hugetlb test in test dir, no problem found.>Signed-off-by Guo Ren <[email protected]>Signed-off-by Guo Ren <[email protected]>Acked-by Muchun Song <[email protected]>---
Changelog:
V2:
- Optimize the commit log
- Remove riscv pagecompound_headfixup which has been merged.
- Rebase on riscv for-next (20230127)
- Add HVO author's acked-byV1:
https://lore.kernel.org/linux-riscv/[email protected]/--- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+)arch/riscv/Kconfig +0
-0
arch/riscv/Kconfig config RISCV · line 49
Quoted 4 lines
arch/riscv/Kconfig +1
-0@@ -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!
Quoted 6 lines
arch/riscv/Kconfig +0
-0select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU select BUILDTIME_TABLE_SORT if MMUSignature · 1 line
2.36.1
Quoted 9 lines · Andrew Jones
Quoted 4 lines · On Fri, Jan 27, 2023 at 12:04:21AM -0500, [email protected] wrote:
From: Guo Ren <[email protected]>
Add HVO support for RISC-V; see commit
6be24bed9da3("mm: hugetlb:
introduce a new configHUGETLB_PAGE_FREE_VMEMMAP").I found
Documentation/mm/vmemmap_dedup.rsteven more enlightening about HVO than the commit message of6be24bed9da3.
I've put that in v3 commit log.
Quoted 54 lines
Quoted 47 lines
This patch is
similar to commit1e63ac088f20("arm64: mm: hugetlb: enableHUGETLB_PAGE_FREE_VMEMMAPfor arm64"), and riscv's motivation is the same as arm64. The current riscv was ready to enable HVO after fixup, ref commitd33deda095d3("riscv/mm: hugepage'sPG_dcache_cleanflag 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_hugepagesmount -t hugetlbfs none test/ -o pagesize=2048k
<Try some simple hugetlb test in test dir, no problem found.>Signed-off-by Guo Ren <[email protected]>Signed-off-by Guo Ren <[email protected]>Acked-by Muchun Song <[email protected]>---
Changelog:
V2:
- Optimize the commit log
- Remove riscv pagecompound_headfixup which has been merged.
- Rebase on riscv for-next (20230127)
- Add HVO author's acked-byV1:
https://lore.kernel.org/linux-riscv/[email protected]/--- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+)arch/riscv/Kconfig +1
-1@@ -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 --Quoted 2 lines
2.36.1
Reviewed-by Andrew Jones <[email protected]>Thanks,
drew
Signature · 2 lines
Best Regards Guo Ren
Quoted 38 lines · Conor Dooley
Quoted 36 lines · On Fri, Jan 27, 2023 at 12:04:21AM -0500, [email protected] wrote:
From: Guo Ren <[email protected]>
Add HVO support for RISC-V; see commit
6be24bed9da3("mm: hugetlb:
introduce a new configHUGETLB_PAGE_FREE_VMEMMAP"). This patch is similar to commit1e63ac088f20("arm64: mm: hugetlb: enableHUGETLB_PAGE_FREE_VMEMMAPfor arm64"), and riscv's motivation is the same as arm64. The current riscv was ready to enable HVO after fixup, ref commitd33deda095d3("riscv/mm: hugepage'sPG_dcache_cleanflag 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_hugepagesmount -t hugetlbfs none test/ -o pagesize=2048k
<Try some simple hugetlb test in test dir, no problem found.>Signed-off-by Guo Ren <[email protected]>Signed-off-by Guo Ren <[email protected]>Acked-by Muchun Song <[email protected]>---
Changelog:
V2:
- Optimize the commit log
- Remove riscv pagecompound_headfixup which has been merged.
- Rebase on riscv for-next (20230127)
- Add HVO author's acked-byV1:
https://lore.kernel.org/linux-riscv/[email protected]/--- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+)
Quoted 14 lines
arch/riscv/Kconfig config RISCV · line 49
Quoted 9 lines
arch/riscv/Kconfig +1
-0@@ -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_VMEMMAPCI 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
Quoted 7 lines
Quoted 7 lines
arch/riscv/Kconfig +0
-1select 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
Signature · 2 lines
Best Regards Guo Ren