riscv: don't probe unaligned access speed if already done
PATCH 1/1 riscv: don't probe unaligned access speed if already done
If misaligned_access_speed percpu var isn't so called "HWPROBE MISALIGNED UNKNOWN", it means the probe has happened(this is possible for example, hotplug off then hotplug on one cpu), and the percpu var has been set, don't probe again in this case.
--- arch/riscv/kernel/cpufeature.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/riscv/kernel/cpufeature.c +4 -0
@@ -568,6 +568,10 @@ void check_unaligned_access(int cpu)void *src;long speed =RISCV_HWPROBE_MISALIGNED_SLOW ; +/* We are already set since the last check */ +if (per_cpu (misaligned_access_speed, cpu) !=RISCV_HWPROBE_MISALIGNED_UNKNOWN ) +return ; + page =alloc_pages (GFP_NOWAIT ,get_order (MISALIGNED_BUFFER_SIZE ));if (!page) {pr_warn ("Can't alloc pages to measure memcpy performance" );
Signature · 1 line
2.40.1
Quoted 6 lines · Jisheng Zhang
If
misaligned_access_speedpercpu var isn't so called "HWPROBE MISALIGNED UNKNOWN", it means the probe hashappened(this is possible for example, hotplug off then hotplug on one cpu), and the percpu var has been set, don't probe again in this case.Signed-off-by Jisheng Zhang <[email protected]>
Presumably this should grow a
on application.
Patch seems fine to me,
Thanks,
Conor.
Quoted 22 lines
--- arch/riscv/kernel/cpufeature.c | 4 ++++ 1 file changed, 4 insertions(+)arch/riscv/kernel/cpufeature.c +4
-0@@ -568,6 +568,10 @@ void check_unaligned_access(int cpu)void *src;long speed =RISCV_HWPROBE_MISALIGNED_SLOW ; +/* We are already set since the last check */ +if (per_cpu (misaligned_access_speed, cpu) !=RISCV_HWPROBE_MISALIGNED_UNKNOWN ) +return ; + page =alloc_pages (GFP_NOWAIT ,get_order (MISALIGNED_BUFFER_SIZE ));if (!page) {pr_warn ("Can't alloc pages to measure memcpy performance" );Signature · 1 line
2.40.1
This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:
Hello:
This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:
Quoted 8 lines · On Tue, 12 Sep 2023 23:40:40 +0800 you wrote:
If
misaligned_access_speedpercpu var isn't so called "HWPROBE MISALIGNED UNKNOWN", it means the probe hashappened(this is possible for example, hotplug off then hotplug on one cpu), and the percpu var has been set, don't probe again in this case.Signed-off-by Jisheng Zhang <[email protected]>[...]
Here is the summary with links:
- riscv: don't probe unaligned access speed if already done
https://git.kernel.org/riscv/c/c20d36cc2a20
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html