qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Vijay Kilari <vijay.kilari@gmail.com>
Cc: qemu-arm <qemu-arm@nongnu.org>,
	Peter Maydell <peter.maydell@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"prasun.kapoor" <Prasun.Kapoor@cavium.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Vijaya Kumar K <Vijaya.Kumar@cavium.com>
Subject: Re: [Qemu-devel] [RFC PATCH v1 2/2] utils: Add prefetch for Thunderx platform
Date: Fri, 12 Aug 2016 14:20:43 +0100	[thread overview]
Message-ID: <a043438c-25a3-4a50-d105-78ee91ba032e@twiddle.net> (raw)
In-Reply-To: <CALicx6so0YyDumHm3VX0WiUCdkKQx1MQHXEzTzbMyUHXT+Z4AQ@mail.gmail.com>

On 08/12/2016 12:32 PM, Vijay Kilari wrote:
> On Sat, Aug 6, 2016 at 3:47 PM, Richard Henderson <rth@twiddle.net> wrote:
>> On 08/02/2016 03:50 PM, vijay.kilari@gmail.com wrote:
>>>
>>> +#define VEC_PREFETCH(base, index) \
>>> +        asm volatile ("prfm pldl1strm, [%x[a]]\n" : :
>>> [a]"r"(&base[(index)]))
>>
>>
>> Is this not __builtin_prefetch(base + index) ?
>>
>> I.e. you can defined this generically for all targets.
>
> __builtin_prefetch() is available only in gcc 5.3 for arm64.

So?  You can't really defend the position that you care about aarch64 code 
quality if you're using gcc 4.x.  Essentially all of the performance work has 
been done for later versions.

>> I'll note that you're also prefetching too much, off the end of the block,
>> and that you're probably not prefetching far enough.  You'd need to break
>> off the last iteration(s) of the loop.
>>
>> I'll note that you're also prefetching too close.  The loop operates on
>> 8*vecsize units.  In the case of aarch64, 128 byte units.  Both i+32 and
>
> 128 unit is specific to thunder. I will move this to thunder
> specific function

No, you misunderstand.

While it's true that thunderx is unique within other aarch64 implementations in 
having a 128-byte cacheline size, the "128" I mention above has nothing to do 
with that.

The loop is operating on BUFFER_FIND_NONZERO_OFFSET_UNROLL_FACTOR bytes, which 
is defined above as 8 * sizeof(vector), which happens to be 128.


r~

      reply	other threads:[~2016-08-12 14:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02 10:20 [Qemu-devel] [RFC PATCH v1 0/2] Live migration optimization for Thunderx platform vijay.kilari
2016-08-02 10:20 ` [Qemu-devel] [RFC PATCH v1 1/2] utils: Add helper to read arm MIDR_EL1 register vijay.kilari
2016-08-02 10:48   ` Paolo Bonzini
2016-08-04  9:16     ` Vijay Kilari
2016-08-04 12:16       ` Paolo Bonzini
2016-08-02 11:10   ` Peter Maydell
2016-08-02 10:20 ` [Qemu-devel] [RFC PATCH v1 2/2] utils: Add prefetch for Thunderx platform vijay.kilari
2016-08-06 10:17   ` Richard Henderson
2016-08-12 11:32     ` Vijay Kilari
2016-08-12 13:20       ` Richard Henderson [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=a043438c-25a3-4a50-d105-78ee91ba032e@twiddle.net \
    --to=rth@twiddle.net \
    --cc=Prasun.Kapoor@cavium.com \
    --cc=Vijaya.Kumar@cavium.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vijay.kilari@gmail.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 NNTP newsgroup(s).