From: Alexandre Ghiti <alex@ghiti.fr>
To: Xiao Wang <xiao.w.wang@intel.com>,
paul.walmsley@sifive.com, palmer@dabbelt.com,
aou@eecs.berkeley.edu
Cc: jerry.shih@sifive.com, nick.knight@sifive.com,
ajones@ventanamicro.com, bjorn@rivosinc.com,
andy.chiu@sifive.com, viro@zeniv.linux.org.uk,
cleger@rivosinc.com, alexghiti@rivosinc.com,
haicheng.li@intel.com, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: uaccess: Relax the threshold for fast path
Date: Fri, 3 May 2024 14:14:34 +0200 [thread overview]
Message-ID: <20798b97-fa19-46fa-abce-54f7931c9210@ghiti.fr> (raw)
In-Reply-To: <20240313091929.4029960-1-xiao.w.wang@intel.com>
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
prev parent reply other threads:[~2024-05-03 12:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-13 9:19 [PATCH] riscv: uaccess: Relax the threshold for fast path Xiao Wang
2024-05-03 12:14 ` Alexandre Ghiti [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20798b97-fa19-46fa-abce-54f7931c9210@ghiti.fr \
--to=alex@ghiti.fr \
--cc=ajones@ventanamicro.com \
--cc=alexghiti@rivosinc.com \
--cc=andy.chiu@sifive.com \
--cc=aou@eecs.berkeley.edu \
--cc=bjorn@rivosinc.com \
--cc=cleger@rivosinc.com \
--cc=haicheng.li@intel.com \
--cc=jerry.shih@sifive.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=nick.knight@sifive.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=viro@zeniv.linux.org.uk \
--cc=xiao.w.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).