From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: prefetch inconsistency in copy_page()
Date: Tue, 11 Jul 2017 18:52:57 +0100 [thread overview]
Message-ID: <20170711175257.GF13977@arm.com> (raw)
In-Reply-To: <CAKv+Gu9hGwLJxBCMCTK2fsK31SgX7E=qc3PQcNXZA6OP2uUs8Q@mail.gmail.com>
On Tue, Jul 11, 2017 at 10:42:19AM +0100, Ard Biesheuvel wrote:
> Hi all,
>
> No big deal, but I spotted an inconsistency in how copy_page() does
> its prefetching. With the code as-is, it prefetches 2 lines at the
> start of the function, but it is off by one line in the loop, i.e., it
> prefetches 3 lines ahead (and skips a line at entry). So imo, we need
> either
>
> """
> @@ -30,9 +30,10 @@
> */
> ENTRY(copy_page)
> alternative_if ARM64_HAS_NO_HW_PREFETCH
> - # Prefetch two cache lines ahead.
> + # Prefetch three cache lines ahead.
> prfm pldl1strm, [x1, #128]
> prfm pldl1strm, [x1, #256]
> + prfm pldl1strm, [x1, #384]
> alternative_else_nop_endif
>
> ldp x2, x3, [x1]
> """
>
> or
>
> """
> @@ -50,7 +51,7 @@ alternative_else_nop_endif
> subs x18, x18, #128
>
> alternative_if ARM64_HAS_NO_HW_PREFETCH
> - prfm pldl1strm, [x1, #384]
> + prfm pldl1strm, [x1, #256]
> alternative_else_nop_endif
>
> stnp x2, x3, [x0]
>
> """
>
> to make things consistent again.
>
> Thoughts?
Either of those look good to me. Andrew -- any preference? If not, I'll take
the second one.
Will
next prev parent reply other threads:[~2017-07-11 17:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 9:42 prefetch inconsistency in copy_page() Ard Biesheuvel
2017-07-11 17:52 ` Will Deacon [this message]
2017-07-11 17:53 ` Pinski, Andrew
2017-07-11 17:58 ` Ard Biesheuvel
2017-07-11 18:26 ` Will Deacon
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=20170711175257.GF13977@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.