From: Matteo Croce <mcroce@linux.microsoft.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
David Laight <David.Laight@aculab.com>,
drew@beagleboard.org, Guo Ren <guoren@kernel.org>,
Christoph Hellwig <hch@infradead.org>,
kernel@esmil.dk, Linux-MM <linux-mm@kvack.org>,
mcroce@microsoft.com, mick@ics.forth.gr,
mm-commits@vger.kernel.org,
Nick Desaulniers <ndesaulniers@google.com>,
Palmer Dabbelt <palmer@dabbelt.com>
Subject: Re: [patch 103/147] lib/string: optimized memset
Date: Thu, 9 Sep 2021 12:27:06 +0200 [thread overview]
Message-ID: <20210909122706.58d9fe20@linux.microsoft.com> (raw)
In-Reply-To: <CAHk-=wjza9+kJJfDXtnQ4YkS637+8H4QZ1tTGRfr39_abkSV-A@mail.gmail.com>
On Wed, 8 Sep 2021 11:34:27 -0700
Linus Torvalds <torvalds@linux-foundation.org> wrote:
> I'm dropping this one just to be consistent, although for memset()
> it's possibly a bit more reasonable to fall back on some default.
>
> But probably not. memcpy and memset really are *so* special that these
> generic versions should be considered to be "stupid placeholders for
> bringup, and nothing more".
>
> On Tue, Sep 7, 2021 at 7:58 PM Andrew Morton
> <akpm@linux-foundation.org> wrote:
> >
> > On a RISC-V machine the speed goes from 140 Mb/s to 241 Mb/s, and
> > this the binary size increase according to bloat-o-meter:
>
> I also react to the benchmark numbers: RISC-V already has
>
> #define __HAVE_ARCH_MEMSET
> #define __HAVE_ARCH_MEMCPY
> #define __HAVE_ARCH_MEMMOVE
>
> in its <asm/string.h> file, so these are just odd.
>
> Did you benchmark these generic functions on their own, rather than
> the ones that actually get *used*?
>
> Linus
I benchmarked against the generic routines. The RISC-V specific are
even slower than the generic ones, because generates lot of unaligned
accesses.
That was the whole point of the series initially. These C routines
should have replaced the risc-v specific assembly ones, but then it was
proposed to use them as generic:
https://lore.kernel.org/linux-riscv/YNChl0tkofSGzvIX@infradead.org/
--
per aspera ad upstream
next parent reply other threads:[~2021-09-09 10:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210907195226.14b1d22a07c085b22968b933@linux-foundation.org>
[not found] ` <20210908025845.cwXLsq_Uo%akpm@linux-foundation.org>
[not found] ` <CAHk-=wjza9+kJJfDXtnQ4YkS637+8H4QZ1tTGRfr39_abkSV-A@mail.gmail.com>
2021-09-09 10:27 ` Matteo Croce [this message]
[not found] ` <20210908030026.2dLZCmkE4%akpm@linux-foundation.org>
2021-09-24 10:35 ` [patch 136/147] nilfs2: use refcount_dec_and_lock() to fix potential UAF Pavel Machek
2021-09-24 11:09 ` Ryusuke Konishi
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=20210909122706.58d9fe20@linux.microsoft.com \
--to=mcroce@linux.microsoft.com \
--cc=David.Laight@aculab.com \
--cc=akpm@linux-foundation.org \
--cc=drew@beagleboard.org \
--cc=guoren@kernel.org \
--cc=hch@infradead.org \
--cc=kernel@esmil.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mcroce@microsoft.com \
--cc=mick@ics.forth.gr \
--cc=mm-commits@vger.kernel.org \
--cc=ndesaulniers@google.com \
--cc=palmer@dabbelt.com \
--cc=torvalds@linux-foundation.org \
/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