linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Reiji Watanabe <reijiw@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,  Marc Zyngier <maz@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Peter Collingbourne <pcc@google.com>,
	Evgenii Stepanov <eugenis@google.com>,
	linux-arm-kernel@lists.infradead.org,
	Peter Shier <pshier@google.com>,
	Ricardo Koller <ricarkol@google.com>,
	Oliver Upton <oupton@google.com>,
	Jing Zhang <jingzhangos@google.com>,
	Raghavendra Rao Anata <rananta@google.com>
Subject: Re: [PATCH v2 1/2] arm64: clear_page() shouldn't use DC ZVA when DCZID_EL0.DZP == 1
Date: Thu, 18 Nov 2021 11:42:15 +0000	[thread overview]
Message-ID: <f6935b34-7696-4284-af7b-30b36224f3fd@arm.com> (raw)
In-Reply-To: <CAAeT=FxyjLUE2yauK5fWfRxr9yk5moiC+ss3=93bzr-z-1mXrQ@mail.gmail.com>

On 2021-11-18 08:18, Reiji Watanabe wrote:
> On Tue, Nov 16, 2021 at 3:00 PM Robin Murphy <robin.murphy@arm.com> wrote:
>>
>> On 2021-11-08 07:11, Reiji Watanabe wrote:
>>> Currently, clear_page() uses DC ZVA instruction unconditionally.  But it
>>> should make sure that DCZID_EL0.DZP, which indicates whether or not use
>>> of DC ZVA instruction is prohibited, is zero when using the instruction.
>>> Use STP as memset does instead when DCZID_EL0.DZP == 1.
>>
>> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
>>
>> FWIW I did eventually figure out the "pre-bias" trick from v1 thanks to
>> Mark's nod toward the original context, but a quick survey of various
>> optimisation guides implied that the explicit add should generally be
>> preferred over post-index writeback anyway, so I think we're all good here.
> 
> Thank you for the review!
> The original code, which used *pre*-index (not post-index) addressing,

Oops, in the context I think I meant writeback in general anyway. This 
is what happens when a sudden urge to review random patches at 11PM 
strikes :)

> made no significant difference in page_clear performance on my test
> environment from the current code.
> 
> Now, I am looking at creating v3 patches to use stnp instead of stp
> in page_clear (NOTE: DC ZVA shows much better performance on my test
> system than stp/stnp).
> 
> Although using stnp didn't show significant difference in clear_page()
> performance on my test system from stp (no significant difference in
> cache-misses, cache_refill, cache_wb, or cache_allocate event counter
> either), using stnp should be more appropriate for page_clear than stp,
> and I understand it could show better performance on some CPUs.

Indeed - certainly most Arm Ltd. cores tend to be good at spotting the 
store pattern and switching into write-streaming mode automatically - 
but semantically, STNP probably is appropriate for the great majority of 
clear_page() usage. Feel free to keep my review tag with that change.

Thanks,
Robin.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-11-18 11:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08  7:11 [PATCH v2 0/2] arm64: DC {ZVA,GVA,GZVA} shouldn't be used when DCZID_EL0.DZP == 1 Reiji Watanabe
2021-11-08  7:11 ` [PATCH v2 1/2] arm64: clear_page() shouldn't use DC ZVA " Reiji Watanabe
2021-11-16 23:00   ` Robin Murphy
2021-11-18  8:18     ` Reiji Watanabe
2021-11-18 11:42       ` Robin Murphy [this message]
2021-11-08  7:11 ` [PATCH v2 2/2] arm64: mte: DC {GVA,GZVA} shouldn't be used " Reiji Watanabe
2021-12-03 18:29   ` Catalin Marinas
2021-12-03 18:51     ` Catalin Marinas
2021-12-04  8:03       ` Reiji Watanabe

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=f6935b34-7696-4284-af7b-30b36224f3fd@arm.com \
    --to=robin.murphy@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=eugenis@google.com \
    --cc=jingzhangos@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oupton@google.com \
    --cc=pcc@google.com \
    --cc=pshier@google.com \
    --cc=rananta@google.com \
    --cc=reijiw@google.com \
    --cc=ricarkol@google.com \
    --cc=will@kernel.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).