From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Matthew Wilcox <willy@infradead.org>,
Paul Mackerras <paulus@au1.ibm.com>,
linuxppc-dev@lists.ozlabs.org, Anton Blanchard <anton@samba.org>
Subject: Re: [PATCH 1/2] powerpc: string: implement optimized memset variants
Date: Tue, 28 Mar 2017 15:51:09 +0530 [thread overview]
Message-ID: <20170328102109.GC4762@naverao1-tp.localdomain> (raw)
In-Reply-To: <87mvc6b575.fsf@concordia.ellerman.id.au>
On 2017/03/28 11:44AM, Michael Ellerman wrote:
> "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:
>
> > diff --git a/arch/powerpc/lib/mem_64.S b/arch/powerpc/lib/mem_64.S
> > index 85fa9869aec5..ec531de99996 100644
> > --- a/arch/powerpc/lib/mem_64.S
> > +++ b/arch/powerpc/lib/mem_64.S
> > @@ -13,6 +13,23 @@
> > #include <asm/ppc_asm.h>
> > #include <asm/export.h>
> >
> > +_GLOBAL(__memset16)
> > + rlwimi r4,r4,16,0,15
> > + /* fall through */
> > +
> > +_GLOBAL(__memset32)
> > + rldimi r4,r4,32,0
> > + /* fall through */
> > +
> > +_GLOBAL(__memset64)
> > + neg r0,r3
> > + andi. r0,r0,7
> > + cmplw cr1,r5,r0
> > + b .Lms
> > +EXPORT_SYMBOL(__memset16)
> > +EXPORT_SYMBOL(__memset32)
> > +EXPORT_SYMBOL(__memset64)
>
> You'll have to convince me that's better than what GCC produces.
Sure :) I got lazy yesterday night and didn't post the test results...
I hadn't tested zram yesterday, but only done tests with a naive test
module that memset's a large 1GB buffer with integers. With that test, I
saw:
without patch: 0.389253910 seconds time elapsed ( +- 1.49% )
with patch: 0.173269267 seconds time elapsed ( +- 1.55% )
.. which is better than 2x.
I also tested zram today with the command shared by Wilcox:
without patch: 1.493782568 seconds time elapsed ( +- 0.08% )
with patch: 1.408457577 seconds time elapsed ( +- 0.15% )
... which also shows an improvement along the same lines as x86, as
reported by Minchan Kim.
- Naveen
next prev parent reply other threads:[~2017-03-28 10:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-20 21:14 Optimised memset64/memset32 for powerpc Matthew Wilcox
2017-03-20 21:23 ` Benjamin Herrenschmidt
2017-03-21 12:23 ` Christophe LEROY
2017-03-21 13:29 ` Matthew Wilcox
2017-03-21 16:45 ` Segher Boessenkool
2017-03-21 21:26 ` Benjamin Herrenschmidt
2017-03-22 13:18 ` Matthew Wilcox
2017-03-22 19:30 ` Matthew Wilcox
2017-03-27 19:37 ` Naveen N. Rao
2017-03-27 19:37 ` [PATCH 1/2] powerpc: string: implement optimized memset variants Naveen N. Rao
2017-03-28 0:44 ` Michael Ellerman
2017-03-28 10:21 ` Naveen N. Rao [this message]
2017-03-29 11:36 ` Michael Ellerman
2017-03-30 7:16 ` Naveen N. Rao
2017-04-04 12:00 ` Michael Ellerman
2017-04-18 6:45 ` Michael Ellerman
2017-04-05 5:51 ` PrasannaKumar Muralidharan
2017-04-12 15:05 ` Naveen N. Rao
2017-08-18 12:50 ` [1/2] " Michael Ellerman
2017-03-27 19:37 ` [PATCH 2/2] powerpc: bpf: use memset32() to pre-fill traps in BPF page(s) Naveen N. Rao
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=20170328102109.GC4762@naverao1-tp.localdomain \
--to=naveen.n.rao@linux.vnet.ibm.com \
--cc=anton@samba.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@au1.ibm.com \
--cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).