public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Evan Green <evan@rivosinc.com>, libc-alpha@sourceware.org
Cc: slewis@rivosinc.com, vineetg@rivosinc.com, palmer@rivosinc.com
Subject: Re: [PATCH 0/2] RISC-V: ifunced memcpy using new kernel hwprobe interface
Date: Mon, 6 Feb 2023 11:28:49 -1000	[thread overview]
Message-ID: <878ce324-c4d7-5fc5-b964-d59220f724d2@linaro.org> (raw)
In-Reply-To: <20230206194819.1679472-1-evan@rivosinc.com>

On 2/6/23 09:48, 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).
> 
> v1 of the Linux series can be found at [2]. I'm about to post v2 (but
> haven't yet!), I can reply here with the link once v2 is posted.
> 
> [1] https://pastebin.com/Nj8ixpkX
> [2] https://yhbt.net/lore/all/20221013163551.6775-1-palmer@rivosinc.com/

Re the syscall:

I question whether the heterogenous cpu case is something that you really want to query. 
In order to handle migration between such cpus, any such query must return the minimum 
level of support.

Remove that possibility, and this becomes a simple array reference.  Now you need to 
decide whether a vdso call, or HWCAP2 as pointer to read-only data is more or less 
efficient or extensible.


r~

  parent reply	other threads:[~2023-02-06 21:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 19:48 Evan Green
2023-02-06 19:48 ` [PATCH 1/2] riscv: Add Linux hwprobe syscall support Evan Green
2023-02-07 13:05   ` Adhemerval Zanella Netto
2023-02-09 20:55     ` Evan Green
2023-02-12 16:58     ` Jeff Law
2023-02-06 19:48 ` [PATCH 2/2] riscv: Add and use alignment-ignorant memcpy Evan Green
2023-02-06 22:05   ` Richard Henderson
2023-02-09 21:04     ` Evan Green
2023-02-06 21:28 ` Richard Henderson [this message]
2023-02-07 12:49   ` [PATCH 0/2] RISC-V: ifunced memcpy using new kernel hwprobe interface Adhemerval Zanella Netto

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=878ce324-c4d7-5fc5-b964-d59220f724d2@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=evan@rivosinc.com \
    --cc=libc-alpha@sourceware.org \
    --cc=palmer@rivosinc.com \
    --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).