* [PATCH] riscv: uaccess: Relax the threshold for fast path
@ 2024-03-13 9:19 ` Xiao Wang
0 siblings, 0 replies; 6+ messages in thread
From: Xiao Wang @ 2024-03-13 9:19 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: jerry.shih, nick.knight, ajones, bjorn, andy.chiu, viro, cleger,
alexghiti, haicheng.li, linux-riscv, linux-kernel, Xiao Wang
The bytes copy for unaligned head would cover at most SZREG-1 bytes, so
it's better to set the threshold as >= (SZREG-1 + word_copy stride size)
which equals to 9*SZREG-1.
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
arch/riscv/lib/uaccess.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/lib/uaccess.S b/arch/riscv/lib/uaccess.S
index bc22c078aba8..2e665f8f8fcc 100644
--- a/arch/riscv/lib/uaccess.S
+++ b/arch/riscv/lib/uaccess.S
@@ -44,7 +44,7 @@ SYM_FUNC_START(fallback_scalar_usercopy)
* Use byte copy only if too small.
* SZREG holds 4 for RV32 and 8 for RV64
*/
- li a3, 9*SZREG /* size must be larger than size in word_copy */
+ li a3, 9*SZREG-1 /* size must >= (word_copy stride + SZREG-1) */
bltu a2, a3, .Lbyte_copy_tail
/*
--
2.25.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] riscv: uaccess: Relax the threshold for fast path
@ 2024-03-13 9:19 ` Xiao Wang
0 siblings, 0 replies; 6+ messages in thread
From: Xiao Wang @ 2024-03-13 9:19 UTC (permalink / raw)
To: paul.walmsley, palmer, aou
Cc: jerry.shih, nick.knight, ajones, bjorn, andy.chiu, viro, cleger,
alexghiti, haicheng.li, linux-riscv, linux-kernel, Xiao Wang
The bytes copy for unaligned head would cover at most SZREG-1 bytes, so
it's better to set the threshold as >= (SZREG-1 + word_copy stride size)
which equals to 9*SZREG-1.
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
arch/riscv/lib/uaccess.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/lib/uaccess.S b/arch/riscv/lib/uaccess.S
index bc22c078aba8..2e665f8f8fcc 100644
--- a/arch/riscv/lib/uaccess.S
+++ b/arch/riscv/lib/uaccess.S
@@ -44,7 +44,7 @@ SYM_FUNC_START(fallback_scalar_usercopy)
* Use byte copy only if too small.
* SZREG holds 4 for RV32 and 8 for RV64
*/
- li a3, 9*SZREG /* size must be larger than size in word_copy */
+ li a3, 9*SZREG-1 /* size must >= (word_copy stride + SZREG-1) */
bltu a2, a3, .Lbyte_copy_tail
/*
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] riscv: uaccess: Relax the threshold for fast path
2024-03-13 9:19 ` Xiao Wang
@ 2024-05-03 12:14 ` Alexandre Ghiti
-1 siblings, 0 replies; 6+ messages in thread
From: Alexandre Ghiti @ 2024-05-03 12:14 UTC (permalink / raw)
To: Xiao Wang, paul.walmsley, palmer, aou
Cc: jerry.shih, nick.knight, ajones, bjorn, andy.chiu, viro, cleger,
alexghiti, haicheng.li, linux-riscv, linux-kernel
Hi Xiao,
On 13/03/2024 10:19, Xiao Wang wrote:
> The bytes copy for unaligned head would cover at most SZREG-1 bytes, so
> it's better to set the threshold as >= (SZREG-1 + word_copy stride size)
> which equals to 9*SZREG-1.
>
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> ---
> arch/riscv/lib/uaccess.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/lib/uaccess.S b/arch/riscv/lib/uaccess.S
> index bc22c078aba8..2e665f8f8fcc 100644
> --- a/arch/riscv/lib/uaccess.S
> +++ b/arch/riscv/lib/uaccess.S
> @@ -44,7 +44,7 @@ SYM_FUNC_START(fallback_scalar_usercopy)
> * Use byte copy only if too small.
> * SZREG holds 4 for RV32 and 8 for RV64
> */
> - li a3, 9*SZREG /* size must be larger than size in word_copy */
> + li a3, 9*SZREG-1 /* size must >= (word_copy stride + SZREG-1) */
> bltu a2, a3, .Lbyte_copy_tail
>
> /*
This looks good to me:
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Thanks,
Alex
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] riscv: uaccess: Relax the threshold for fast path
@ 2024-05-03 12:14 ` Alexandre Ghiti
0 siblings, 0 replies; 6+ messages in thread
From: Alexandre Ghiti @ 2024-05-03 12:14 UTC (permalink / raw)
To: Xiao Wang, paul.walmsley, palmer, aou
Cc: jerry.shih, nick.knight, ajones, bjorn, andy.chiu, viro, cleger,
alexghiti, haicheng.li, linux-riscv, linux-kernel
Hi Xiao,
On 13/03/2024 10:19, Xiao Wang wrote:
> The bytes copy for unaligned head would cover at most SZREG-1 bytes, so
> it's better to set the threshold as >= (SZREG-1 + word_copy stride size)
> which equals to 9*SZREG-1.
>
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> ---
> arch/riscv/lib/uaccess.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/lib/uaccess.S b/arch/riscv/lib/uaccess.S
> index bc22c078aba8..2e665f8f8fcc 100644
> --- a/arch/riscv/lib/uaccess.S
> +++ b/arch/riscv/lib/uaccess.S
> @@ -44,7 +44,7 @@ SYM_FUNC_START(fallback_scalar_usercopy)
> * Use byte copy only if too small.
> * SZREG holds 4 for RV32 and 8 for RV64
> */
> - li a3, 9*SZREG /* size must be larger than size in word_copy */
> + li a3, 9*SZREG-1 /* size must >= (word_copy stride + SZREG-1) */
> bltu a2, a3, .Lbyte_copy_tail
>
> /*
This looks good to me:
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Thanks,
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] riscv: uaccess: Relax the threshold for fast path
2024-03-13 9:19 ` Xiao Wang
@ 2024-05-22 23:51 ` patchwork-bot+linux-riscv
-1 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+linux-riscv @ 2024-05-22 23:51 UTC (permalink / raw)
To: Xiao Wang
Cc: linux-riscv, paul.walmsley, palmer, aou, jerry.shih, nick.knight,
ajones, bjorn, andy.chiu, viro, cleger, alexghiti, haicheng.li,
linux-kernel
Hello:
This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:
On Wed, 13 Mar 2024 17:19:29 +0800 you wrote:
> The bytes copy for unaligned head would cover at most SZREG-1 bytes, so
> it's better to set the threshold as >= (SZREG-1 + word_copy stride size)
> which equals to 9*SZREG-1.
>
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> ---
> arch/riscv/lib/uaccess.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- riscv: uaccess: Relax the threshold for fast path
https://git.kernel.org/riscv/c/e8c7995ea148
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] riscv: uaccess: Relax the threshold for fast path
@ 2024-05-22 23:51 ` patchwork-bot+linux-riscv
0 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+linux-riscv @ 2024-05-22 23:51 UTC (permalink / raw)
To: Xiao Wang
Cc: linux-riscv, paul.walmsley, palmer, aou, jerry.shih, nick.knight,
ajones, bjorn, andy.chiu, viro, cleger, alexghiti, haicheng.li,
linux-kernel
Hello:
This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:
On Wed, 13 Mar 2024 17:19:29 +0800 you wrote:
> The bytes copy for unaligned head would cover at most SZREG-1 bytes, so
> it's better to set the threshold as >= (SZREG-1 + word_copy stride size)
> which equals to 9*SZREG-1.
>
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> ---
> arch/riscv/lib/uaccess.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- riscv: uaccess: Relax the threshold for fast path
https://git.kernel.org/riscv/c/e8c7995ea148
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-05-22 23:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13 9:19 [PATCH] riscv: uaccess: Relax the threshold for fast path Xiao Wang
2024-03-13 9:19 ` Xiao Wang
2024-05-03 12:14 ` Alexandre Ghiti
2024-05-03 12:14 ` Alexandre Ghiti
2024-05-22 23:51 ` patchwork-bot+linux-riscv
2024-05-22 23:51 ` patchwork-bot+linux-riscv
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.