Skip to content

[PW_SID:1119717] Implement Eager Page Splitting for RISC-V#2190

Closed
linux-riscv-bot wants to merge 6 commits into
workflow__riscv__fixesfrom
pw1119717
Closed

[PW_SID:1119717] Implement Eager Page Splitting for RISC-V#2190
linux-riscv-bot wants to merge 6 commits into
workflow__riscv__fixesfrom
pw1119717

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 1119717 applied to workflow__riscv__fixes

Name: Implement Eager Page Splitting for RISC-V
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1119717
Version: 4

Linux RISC-V bot and others added 6 commits July 1, 2026 03:48
Add the split page cache for dirty logging enablement and the
KVM_CLEAR_DIRTY_LOG ioctl.

Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Split huge pages eagerly when enabling dirty logging. The goal is to
avoid doing it while faulting on write-protected pages, which
negatively impacts guest performance.

The benefits of eager page splitting are the same as in x86 and arm64,
added with commit a3fe5db ("KVM: x86/mmu: Split huge pages mapped
by the TDP MMU when dirty logging is enabled") and commit e7bf7a4
("KVM: arm64: Split huge pages when dirty logging is enabled")

Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The function kvm_arch_mmu_enable_log_dirty_pt_masked() is invoked from
two distinct call paths:

kvm_clear_dirty_log_protect()
  kvm_arch_mmu_enable_log_dirty_pt_masked()

kvm_vm_ioctl_reset_dirty_pages()
  kvm_dirty_ring_reset()
    kvm_reset_dirty_gfn()
        kvm_arch_mmu_enable_log_dirty_pt_masked()

In both scenarios, the caller already performs a remote TLB flush after
dirty logging is enabled, so the TLB flush inside
kvm_arch_mmu_enable_log_dirty_pt_masked() is unnecessary. Remove it.

Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Split huge pages on the range specified using KVM_CLEAR_DIRTY_LOG.
And do not split when enabling dirty logging if
KVM_DIRTY_LOG_INITIALLY_SET is set.

Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add an eager_page_split module parameter for RISC-V KVM, following
the same approach as on x86. This parameter controls whether eager
page splitting is enabled. The default value is on.

When eager page splitting is enabled, KVM proactively splits large
pages (huge pages) into smaller pages when needed for dirty logging
or other operations. Disabling it can be beneficial for VM workloads
that rarely perform writes, or that only write to a small region of
memory, as it allows huge pages to remain intact for read accesses.

Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/5] RISC-V: KVM: Add the split page cache for ioctl context"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 121.73 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/5] RISC-V: KVM: Add the split page cache for ioctl context"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1185.82 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/5] RISC-V: KVM: Add the split page cache for ioctl context"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1469.52 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/5] RISC-V: KVM: Add the split page cache for ioctl context"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.80 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/5] RISC-V: KVM: Add the split page cache for ioctl context"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 23.56 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/5] RISC-V: KVM: Add the split page cache for ioctl context"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.98 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/5] RISC-V: KVM: Add the split page cache for ioctl context"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 80.50 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/5] RISC-V: KVM: Add the split page cache for ioctl context"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/5] RISC-V: KVM: Add the split page cache for ioctl context"
kdoc
Desc: Detects for kdoc errors
Duration: 0.74 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/5] RISC-V: KVM: Add the split page cache for ioctl context"
module-param
Desc: Detect module_param changes
Duration: 0.46 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/5] RISC-V: KVM: Add the split page cache for ioctl context"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v4,1/5] RISC-V: KVM: Add the split page cache for ioctl context"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/5] RISC-V: KVM: Split huge pages when dirty logging is enabled"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 120.67 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/5] RISC-V: KVM: Split huge pages when dirty logging is enabled"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1188.26 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/5] RISC-V: KVM: Split huge pages when dirty logging is enabled"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1465.20 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/5] RISC-V: KVM: Split huge pages when dirty logging is enabled"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 22.04 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/5] RISC-V: KVM: Split huge pages when dirty logging is enabled"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 23.70 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/5] RISC-V: KVM: Split huge pages when dirty logging is enabled"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.99 seconds
Result: WARNING
Output:

CHECK: Alignment should match open parenthesis
#144: FILE: arch/riscv/kvm/mmu.c:128:
+				kvm_flush_remote_tlbs_range(kvm, last_flush_gfn,
+					  (addr >> PAGE_SHIFT) - last_flush_gfn);

total: 0 errors, 0 warnings, 1 checks, 168 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 644485e25944 ("RISC-V: KVM: Split huge pages when dirty logging is enabled") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 1 checks, 168 lines checked
CHECK: Alignment should match open parenthesis


@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/5] RISC-V: KVM: Split huge pages when dirty logging is enabled"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 81.11 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/5] RISC-V: KVM: Split huge pages when dirty logging is enabled"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/5] RISC-V: KVM: Split huge pages when dirty logging is enabled"
kdoc
Desc: Detects for kdoc errors
Duration: 0.75 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/5] RISC-V: KVM: Split huge pages when dirty logging is enabled"
module-param
Desc: Detect module_param changes
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/5] RISC-V: KVM: Split huge pages when dirty logging is enabled"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v4,2/5] RISC-V: KVM: Split huge pages when dirty logging is enabled"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[v4,3/5] RISC-V: KVM: Remove redundant TLB flush operations"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[v4,3/5] RISC-V: KVM: Remove redundant TLB flush operations"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 3: "[v4,3/5] RISC-V: KVM: Remove redundant TLB flush operations"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[v4,4/5] RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 118.63 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[v4,4/5] RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1150.96 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[v4,4/5] RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1437.75 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[v4,4/5] RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 22.08 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[v4,4/5] RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 23.47 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[v4,4/5] RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.59 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[v4,4/5] RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 81.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[v4,4/5] RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[v4,4/5] RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG"
kdoc
Desc: Detects for kdoc errors
Duration: 0.74 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[v4,4/5] RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG"
module-param
Desc: Detect module_param changes
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[v4,4/5] RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 4: "[v4,4/5] RISC-V: KVM: Split huge pages during KVM_CLEAR_DIRTY_LOG"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[v4,5/5] RISC-V: KVM: Add the eager_page_split module parameter"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 122.56 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[v4,5/5] RISC-V: KVM: Add the eager_page_split module parameter"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1139.83 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[v4,5/5] RISC-V: KVM: Add the eager_page_split module parameter"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1441.72 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[v4,5/5] RISC-V: KVM: Add the eager_page_split module parameter"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.85 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[v4,5/5] RISC-V: KVM: Add the eager_page_split module parameter"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 23.89 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[v4,5/5] RISC-V: KVM: Add the eager_page_split module parameter"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.82 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[v4,5/5] RISC-V: KVM: Add the eager_page_split module parameter"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 78.90 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[v4,5/5] RISC-V: KVM: Add the eager_page_split module parameter"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[v4,5/5] RISC-V: KVM: Add the eager_page_split module parameter"
kdoc
Desc: Detects for kdoc errors
Duration: 0.77 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[v4,5/5] RISC-V: KVM: Add the eager_page_split module parameter"
module-param
Desc: Detect module_param changes
Duration: 1.19 seconds
Result: ERROR
Output:

Was 0 now: 1
Detected module_param
+module_param(eager_page_split, bool, 0644);


@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[v4,5/5] RISC-V: KVM: Add the eager_page_split module parameter"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[v4,5/5] RISC-V: KVM: Add the eager_page_split module parameter"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot force-pushed the workflow__riscv__fixes branch from 89be0ce to dc5ff20 Compare July 7, 2026 03:25
@linux-riscv-bot
linux-riscv-bot deleted the pw1119717 branch July 8, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants