From: Palmer Dabbelt <palmer@rivosinc.com>
To: Evan Green <evan@rivosinc.com>
Cc: libc-alpha@sourceware.org, slewis@rivosinc.com,
Vineet Gupta <vineetg@rivosinc.com>,
Evan Green <evan@rivosinc.com>
Subject: Re: [PATCH v2 0/3] RISC-V: ifunced memcpy using new kernel hwprobe interface
Date: Tue, 28 Mar 2023 15:54:57 -0700 (PDT) [thread overview]
Message-ID: <mhng-47f49a93-a4f1-4aad-8fc1-5a3e8f6a35e6@palmer-ri-x1c9a> (raw)
In-Reply-To: <20230221191537.3159966-1-evan@rivosinc.com>
On Tue, 21 Feb 2023 11:15:34 PST (-0800), Evan Green wrote:
>
> This series illustrates the use of a proposed Linux syscall that
> enumerates architectural information about the RISC-V cores the system
> is running on. In this series we expose a small wrapper function around
> the syscall. An ifunc selector for memcpy queries it to see if unaligned
> access is "fast" on this hardware. If it is, it selects a newly provided
> implementation of memcpy that doesn't work hard at aligning the src and
> destination buffers.
>
> This is somewhat of a proof of concept for the syscall itself, but I do
> find that in my goofy memcpy test [1], the unaligned memcpy performed at
> least as well as the generic C version. This is however on Qemu on an M1
> mac, so not a test of any real hardware (more a smoke test that the
> implementation isn't silly).
QEMU isn't a good enough benchmark to justify a new memcpy routine in
glibc. Evan has a D1, which does support misaligned access and runs
some simple benchmarks faster. There's also been some minor changes to
the Linux side of things that warrant a v3 anyway, so he'll just post
some benchmarks on HW along with that.
Aside from those comments,
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
There's a lot more stuff to probe for, but I think we've got enough of a
proof of concept for the hwprobe stuff that we can move forward with the
core interface bits in Linux/glibc and then unleash the chaos...
Unless anyone else has comments?
> v3 of the Linux series can be found at [2].
>
> [1] https://pastebin.com/Nj8ixpkX
> [2] https://lore.kernel.org/lkml/20230221190858.3159617-1-evan@rivosinc.com/T/#t
>
> Changes in v2:
> - hwprobe.h: Use __has_include and duplicate Linux content to make
> compilation work when Linux headers are absent (Adhemerval)
> - hwprobe.h: Put declaration under __USE_GNU (Adhemerval)
> - Use INLINE_SYSCALL_CALL (Adhemerval)
> - Update versions
> - Update UNALIGNED_MASK to match kernel v3 series.
> - Add vDSO interface
> - Used _MASK instead of _FAST value itself.
>
> Evan Green (3):
> riscv: Add Linux hwprobe syscall support
> riscv: Add hwprobe vdso call support
> riscv: Add and use alignment-ignorant memcpy
>
> sysdeps/riscv/memcopy.h | 28 +++++
> sysdeps/riscv/memcpy.c | 65 +++++++++++
> sysdeps/riscv/memcpy_noalignment.S | 103 ++++++++++++++++++
> sysdeps/unix/sysv/linux/dl-vdso-setup.c | 10 ++
> sysdeps/unix/sysv/linux/dl-vdso-setup.h | 3 +
> sysdeps/unix/sysv/linux/riscv/Makefile | 8 +-
> sysdeps/unix/sysv/linux/riscv/Versions | 3 +
> sysdeps/unix/sysv/linux/riscv/hwprobe.c | 36 ++++++
> .../unix/sysv/linux/riscv/memcpy-generic.c | 24 ++++
> .../unix/sysv/linux/riscv/rv32/arch-syscall.h | 1 +
> .../unix/sysv/linux/riscv/rv32/libc.abilist | 1 +
> .../unix/sysv/linux/riscv/rv64/arch-syscall.h | 1 +
> .../unix/sysv/linux/riscv/rv64/libc.abilist | 1 +
> sysdeps/unix/sysv/linux/riscv/sys/hwprobe.h | 67 ++++++++++++
> sysdeps/unix/sysv/linux/riscv/sysdep.h | 1 +
> sysdeps/unix/sysv/linux/syscall-names.list | 1 +
> 16 files changed, 351 insertions(+), 2 deletions(-)
> create mode 100644 sysdeps/riscv/memcopy.h
> create mode 100644 sysdeps/riscv/memcpy.c
> create mode 100644 sysdeps/riscv/memcpy_noalignment.S
> create mode 100644 sysdeps/unix/sysv/linux/riscv/hwprobe.c
> create mode 100644 sysdeps/unix/sysv/linux/riscv/memcpy-generic.c
> create mode 100644 sysdeps/unix/sysv/linux/riscv/sys/hwprobe.h
Thanks!
next prev parent reply other threads:[~2023-03-28 22:54 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 19:15 Evan Green
2023-02-21 19:15 ` [PATCH v2 1/3] riscv: Add Linux hwprobe syscall support Evan Green
2023-03-29 18:38 ` Adhemerval Zanella Netto
2023-02-21 19:15 ` [PATCH v2 2/3] riscv: Add hwprobe vdso call support Evan Green
2023-03-29 18:39 ` Adhemerval Zanella Netto
2023-02-21 19:15 ` [PATCH v2 3/3] riscv: Add and use alignment-ignorant memcpy Evan Green
2023-03-28 22:54 ` Palmer Dabbelt [this message]
2023-03-28 23:41 ` [PATCH v2 0/3] RISC-V: ifunced memcpy using new kernel hwprobe interface Adhemerval Zanella Netto
2023-03-29 0:01 ` Palmer Dabbelt
2023-03-29 19:16 ` Adhemerval Zanella Netto
2023-03-29 19:45 ` Palmer Dabbelt
2023-03-29 20:13 ` Adhemerval Zanella Netto
2023-03-30 18:31 ` Evan Green
2023-03-30 19:43 ` Adhemerval Zanella Netto
2023-03-30 6:20 ` Jeff Law
2023-03-30 18:43 ` Evan Green
2023-03-31 5:09 ` Jeff Law
2023-03-30 19:38 ` Adhemerval Zanella Netto
2023-03-31 18:07 ` Jeff Law
2023-03-31 18:34 ` Palmer Dabbelt
2023-03-31 19:32 ` Adhemerval Zanella Netto
2023-03-31 20:19 ` Jeff Law
2023-03-31 21:03 ` Palmer Dabbelt
2023-03-31 21:35 ` Jeff Law
2023-03-31 21:38 ` Palmer Dabbelt
2023-03-31 22:10 ` Jeff Law
2023-04-07 15:36 ` Palmer Dabbelt
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=mhng-47f49a93-a4f1-4aad-8fc1-5a3e8f6a35e6@palmer-ri-x1c9a \
--to=palmer@rivosinc.com \
--cc=evan@rivosinc.com \
--cc=libc-alpha@sourceware.org \
--cc=slewis@rivosinc.com \
--cc=vineetg@rivosinc.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).