[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.999.2304121350020.17765@utopia.booyaka.com>
Date: Wed, 12 Apr 2023 13:50:32 +0000 (UTC)
From: Paul Walmsley <paul@...yaka.com>
To: Evan Green <evan@...osinc.com>
cc: Palmer Dabbelt <palmer@...osinc.com>, heiko@...ech.de,
linux-doc@...r.kernel.org,
Andrew Bresticker <abrestic@...osinc.com>,
Atish Patra <atishp@...osinc.com>,
Conor Dooley <conor.dooley@...rochip.com>,
Celeste Liu <coelacanthus@...look.com>,
Jisheng Zhang <jszhang@...nel.org>,
linux-riscv@...ts.infradead.org, Jonathan Corbet <corbet@....net>,
Andrew Jones <ajones@...tanamicro.com>,
Albert Ou <aou@...s.berkeley.edu>,
Ley Foon Tan <leyfoon.tan@...rfivetech.com>,
vineetg@...osinc.com, Philipp Tomsich <philipp.tomsich@...ll.eu>,
Paul Walmsley <paul.walmsley@...ive.com>,
Heiko Stuebner <heiko.stuebner@...ll.eu>, slewis@...osinc.com,
Samuel Holland <samuel@...lland.org>,
linux-kernel@...r.kernel.org, Conor Dooley <conor@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>,
Guo Ren <guoren@...nel.org>
Subject: Re: [PATCH v6 4/6] RISC-V: hwprobe: Support probing of misaligned
access performance
On Fri, 7 Apr 2023, Evan Green wrote:
> This allows userspace to select various routines to use based on the
> performance of misaligned access on the target hardware.
>
> Rather than adding DT bindings, this change taps into the alternatives
> mechanism used to probe CPU errata. Add a new function pointer alongside
> the vendor-specific errata_patch_func() that probes for desirable errata
> (otherwise known as "features"). Unlike the errata_patch_func(), this
> function is called on each CPU as it comes up, so it can save
> feature information per-CPU.
>
> The T-head C906 has fast unaligned access, both as defined by GCC [1],
> and in performing a basic benchmark, which determined that byte copies
> are >50% slower than a misaligned word copy of the same data size (source
> for this test at [2]):
>
> bytecopy size f000 count 50000 offset 0 took 31664899 us
> wordcopy size f000 count 50000 offset 0 took 5180919 us
> wordcopy size f000 count 50000 offset 1 took 13416949 us
>
> [1] https://github.com/gcc-mirror/gcc/blob/master/gcc/config/riscv/riscv.cc#L353
> [2] https://pastebin.com/EPXvDHSW
>
> Co-developed-by: Palmer Dabbelt <palmer@...osinc.com>
> Signed-off-by: Palmer Dabbelt <palmer@...osinc.com>
> Signed-off-by: Evan Green <evan@...osinc.com>
> Reviewed-by: Heiko Stuebner <heiko.stuebner@...ll.eu>
> Tested-by: Heiko Stuebner <heiko.stuebner@...ll.eu>
Reviewed-by: Paul Walmsley <paul.walmsley@...ive.com>
- Paul
Powered by blists - more mailing lists