public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Palmer Dabbelt <palmer@rivosinc.com>
To: jeffreyalaw@gmail.com
Cc: adhemerval.zanella@linaro.org, Evan Green <evan@rivosinc.com>,
	libc-alpha@sourceware.org, slewis@rivosinc.com,
	Vineet Gupta <vineetg@rivosinc.com>
Subject: Re: [PATCH v2 0/3] RISC-V: ifunced memcpy using new kernel hwprobe interface
Date: Fri, 07 Apr 2023 08:36:31 -0700 (PDT)	[thread overview]
Message-ID: <mhng-6d96eafb-0aad-430c-b005-6b554b9e35a7@palmer-ri-x1c9> (raw)
In-Reply-To: <61b659b7-7c08-028a-1e7a-2e1b19df080a@gmail.com>

On Fri, 31 Mar 2023 15:10:24 PDT (-0700), jeffreyalaw@gmail.com wrote:
>
>
> On 3/31/23 15:38, Palmer Dabbelt wrote:
>> On Fri, 31 Mar 2023 14:35:36 PDT (-0700), jeffreyalaw@gmail.com wrote:
>>>
>>>
>>> On 3/31/23 15:03, Palmer Dabbelt wrote:
>>>> On Fri, 31 Mar 2023 13:19:19 PDT (-0700), jeffreyalaw@gmail.com wrote:
>>>>
>>>> [just snipping the rest so we can focus on Jeff's ask, the other stuff
>>>> is interesting but a longer reply and we'd probably want to fork the
>>>> thread anyway...]
>>>>
>>>>> So perhaps we can narrow down the scope right now even further.  Can we
>>>>> agree to try and settle on a base implementation with no ISA extensions
>>>>> and no uarch variants?  ISTM if we can settle on those implementations
>>>>> that it should be usable immediately by the RV community at large and
>>>>> doesn't depend on the kernel->glibc interface work.
>>>>
>>>> That base includes V and ZBB?  In that case we'd be dropping support for
>>>> all existing hardware, which I would be very much against.
>>> No, it would not include V or ZBB.  It would be something that could
>>> work on any risc-v hardware.  Sorry if I wasn't clear about that.
>>
>> I'm still kind of confused then, maybe it's just too abstract?  Is there
>> something you could propose as being the base?
> So right now we use the generic (architecture independent) routines for
> str* and mem*.
>
> If we look at (for example) strcmp there's hand written variants out
> there are are purported to have better performance than the generic code
> in glibc.
>
> Note that any such performance claims likely predate the work from
> Adhemerval and others earlier this year to reduce the reliance on
> hand-coded assembly.
>
> So the first step is to answer the question, for any str* or mem* where
> we've received a patch submission of a hand coded assembly variant
> (which isn't using ZBB or V), does that hand coded assembly variant
> significantly out perform the generic code currently in glibc.  If yes
> and the generic code can't be significantly improved, then we should
> declare that hand written variant as the standard baseline for risc-v in
> glibc.  Review, adjust, commit and move on.
>
> My hope would be that many (most, all?) of the base architecture hand
> coded assembly variants no longer provide any significant benefit over
> the current generic versions.
>
> That's my minimal proposal for now.  It's not meant to solve everything
> in this space, but at least carve out a chunk of the work and get it
> resolved one way or the other.
>
> Does that help clarify what I'm suggesting?

Sorry for being slow here, this fell off the queue.

I think this proposal is in theory what we've done, it's just that 
nobody's posted patches like that -- unless I missed something?  
Certainly the original port had some assembly routines an we tossed 
those because we didn't care enough to justify them.  If someone's got 
code then I'm happy to look, but we'd also need some benchmarks (on real 
HW that's publicly available) and that's usually the sticking point.

That said, I'd guess that anyone trying to ship real product is going to 
need at least V (or some other explicitly data parallel instructions) 
before the performance of these routines matters.

      reply	other threads:[~2023-04-07 15:36 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 ` [PATCH v2 0/3] RISC-V: ifunced memcpy using new kernel hwprobe interface Palmer Dabbelt
2023-03-28 23:41   ` 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 [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=mhng-6d96eafb-0aad-430c-b005-6b554b9e35a7@palmer-ri-x1c9 \
    --to=palmer@rivosinc.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=evan@rivosinc.com \
    --cc=jeffreyalaw@gmail.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).