From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Xi Ruoyao <xry111@xry111.site>
Cc: Huacai Chen <chenhuacai@kernel.org>,
WANG Xuerui <kernel@xen0n.name>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
linux-crypto@vger.kernel.org, loongarch@lists.linux.dev,
linux-kernel@vger.kernel.org, Jinyang He <hejinyang@loongson.cn>,
Tiezhu Yang <yangtiezhu@loongson.cn>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH] LoongArch: vDSO: Tune the chacha20 implementation
Date: Fri, 20 Sep 2024 17:11:05 +0200 [thread overview]
Message-ID: <Zu2Qif3n7oIMweJ2@zx2c4.com> (raw)
In-Reply-To: <20240919091359.7023-1-xry111@xry111.site>
On Thu, Sep 19, 2024 at 05:13:59PM +0800, Xi Ruoyao wrote:
> As Christophe pointed out, tuning the chacha20 implementation by
> scheduling the instructions like what GCC does can improve the
> performance.
>
> The tuning does not introduce too much complexity (basically it's just
> reordering some instructions). And the tuning does not hurt readibility
> too much: actually the tuned code looks even more similar to a
> textbook-style implementation based on 128-bit vectors. So overall it's
> a good deal to me.
>
> Tested with vdso_test_getchacha and benched with vdso_test_getrandom.
> On a LA664 the speedup is 5%, and I expect a larger speedup on LA[2-4]64
> with a lower issue rate.
>
> Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> Link: https://lore.kernel.org/all/77655d9e-fc05-4300-8f0d-7b2ad840d091@csgroup.eu/
> Signed-off-by: Xi Ruoyao <xry111@xry111.site>
That seems like a reasonable optimization to me. I'll queue it up in
random.git and send it in my pull next week.
Thanks.
Jason
next prev parent reply other threads:[~2024-09-20 15:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 9:13 [PATCH] LoongArch: vDSO: Tune the chacha20 implementation Xi Ruoyao
2024-09-20 15:11 ` Jason A. Donenfeld [this message]
2024-09-23 7:15 ` Huacai Chen
2024-09-23 8:06 ` Xi Ruoyao
2024-09-23 12:48 ` Jason A. Donenfeld
2024-09-24 7:12 ` Huacai Chen
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=Zu2Qif3n7oIMweJ2@zx2c4.com \
--to=jason@zx2c4.com \
--cc=arnd@arndb.de \
--cc=chenhuacai@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=hejinyang@loongson.cn \
--cc=kernel@xen0n.name \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=xry111@xry111.site \
--cc=yangtiezhu@loongson.cn \
/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