[PW_SID:1123077] RISC-V: KVM: Optimize hfence request handling for SMP guests#2239
[PW_SID:1123077] RISC-V: KVM: Optimize hfence request handling for SMP guests#2239linux-riscv-bot wants to merge 2 commits into
Conversation
FENCE.I does not need hfence data, but it currently goes through the generic make_xfence_request() path with NULL data, incurring unnecessary per-VCPU checks. Split out a separate make_xfence_request_nodata() function to handle FENCE.I directly, and move the data validity check to the top of the generic function to avoid redundant checks. Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
When handling hfence requests in make_xfence_request(), the current code uses a single 'actual_req' variable and a single vcpu_mask. If any VCPU fails to enqueue the hfence data (because its queue is full), the request falls back to 'fallback_req' for all VCPUs, even if other VCPUs still have available queue space. This can cause unnecessary fallback for healthy VCPUs, and more seriously, those healthy VCPUs will not process their already-enqueued hfence requests because no 'req' is set for them. As a result, their queues will quickly become full as well, degrading performance for SMP guests. Fix this by maintaining two separate bitmaps: one for VCPUs that successfully enqueued the hfence data (req_vcpu_mask) and another for those that failed (fallback_req_vcpu_mask). Then send the appropriate requests to each group. This ensures that fallback is only applied to VCPUs that actually need it, preserving the efficiency of the normal path for others. Fixes: 13acfec ("RISC-V: KVM: Add remote HFENCE functions based on VCPU requests") Signed-off-by: Wang Yechao <wang.yechao255@zte.com.cn> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v2,1/2] RISC-V: KVM: Introduce make_xfence_request_nodata for FENCE.I requests" |
|
Patch 1: "[v2,1/2] RISC-V: KVM: Introduce make_xfence_request_nodata for FENCE.I requests" |
|
Patch 1: "[v2,1/2] RISC-V: KVM: Introduce make_xfence_request_nodata for FENCE.I requests" |
|
Patch 1: "[v2,1/2] RISC-V: KVM: Introduce make_xfence_request_nodata for FENCE.I requests" |
|
Patch 1: "[v2,1/2] RISC-V: KVM: Introduce make_xfence_request_nodata for FENCE.I requests" |
|
Patch 1: "[v2,1/2] RISC-V: KVM: Introduce make_xfence_request_nodata for FENCE.I requests" |
|
Patch 1: "[v2,1/2] RISC-V: KVM: Introduce make_xfence_request_nodata for FENCE.I requests" |
|
Patch 1: "[v2,1/2] RISC-V: KVM: Introduce make_xfence_request_nodata for FENCE.I requests" |
|
Patch 1: "[v2,1/2] RISC-V: KVM: Introduce make_xfence_request_nodata for FENCE.I requests" |
|
Patch 1: "[v2,1/2] RISC-V: KVM: Introduce make_xfence_request_nodata for FENCE.I requests" |
|
Patch 1: "[v2,1/2] RISC-V: KVM: Introduce make_xfence_request_nodata for FENCE.I requests" |
|
Patch 1: "[v2,1/2] RISC-V: KVM: Introduce make_xfence_request_nodata for FENCE.I requests" |
|
Patch 2: "[v2,2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request" |
|
Patch 2: "[v2,2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request" |
|
Patch 2: "[v2,2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request" |
|
Patch 2: "[v2,2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request" |
|
Patch 2: "[v2,2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request" |
|
Patch 2: "[v2,2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request" |
|
Patch 2: "[v2,2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request" |
|
Patch 2: "[v2,2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request" |
|
Patch 2: "[v2,2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request" |
|
Patch 2: "[v2,2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request" |
|
Patch 2: "[v2,2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request" |
|
Patch 2: "[v2,2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request" |
PR for series 1123077 applied to workflow__riscv__fixes
Name: RISC-V: KVM: Optimize hfence request handling for SMP guests
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1123077
Version: 2