[PW_SID:1076174] [v2] riscv: vector: treat VS_INITIAL as discard#1704
[PW_SID:1076174] [v2] riscv: vector: treat VS_INITIAL as discard#1704linux-riscv-bot wants to merge 1 commit into
Conversation
The purpose of riscv_v_vstate_discard() is to invalidate v context at entries of syscalls. So users happen to use v after a syscall without re-configuring would see a failure. It was achieved by setting vector registers and CSRs to -1 and marking the context busy. However, this results in redundant saving of v-context if the process is scheduled out in a syscall. Moreover, restoring the invalidated context from memory is a costly operation. In fact, all can be prevented if we can delay vstate_discard before returning back to the user space. To be more specific, the kernel can mark v-context as INITIAL and set the restore flag at syscall entries. This is the indication for the vstate_restore, so it awares that the vstate has to be invalidated before returning back to the user space. After applying this patch, the context switch performance has improved 6.78% on vector enabled lmbench running on a FPGA with VLEN=512. The result was obtained by averaging the output from the following command. $ lat_ctx 2 Before the patch: 599.8357692 After the patch: 559.1748148 Signed-off-by: Andy Chiu <andy.chiu@sifive.com> Signed-off-by: Andy Chiu <andybnac@gmail.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v2] riscv: vector: treat VS_INITIAL as discard" |
|
Patch 1: "[v2] riscv: vector: treat VS_INITIAL as discard" |
|
Patch 1: "[v2] riscv: vector: treat VS_INITIAL as discard" |
|
Patch 1: "[v2] riscv: vector: treat VS_INITIAL as discard" |
|
Patch 1: "[v2] riscv: vector: treat VS_INITIAL as discard" |
|
Patch 1: "[v2] riscv: vector: treat VS_INITIAL as discard" |
|
Patch 1: "[v2] riscv: vector: treat VS_INITIAL as discard" |
|
Patch 1: "[v2] riscv: vector: treat VS_INITIAL as discard" |
|
Patch 1: "[v2] riscv: vector: treat VS_INITIAL as discard" |
|
Patch 1: "[v2] riscv: vector: treat VS_INITIAL as discard" |
|
Patch 1: "[v2] riscv: vector: treat VS_INITIAL as discard" |
|
Patch 1: "[v2] riscv: vector: treat VS_INITIAL as discard" |
PR for series 1076174 applied to workflow__riscv__fixes
Name: [v2] riscv: vector: treat VS_INITIAL as discard
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1076174
Version: 2