xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Ankur Arora <ankur.a.arora@oracle.com>
Cc: andrew.cooper3@citrix.com, roger.pau@citrix.com,
	xen-devel@lists.xenproject.org
Subject: Re: x86: memset() / clear_page() / page scrubbing
Date: Mon, 12 Apr 2021 11:15:36 +0200	[thread overview]
Message-ID: <13709035-2bf6-5dd6-a3f6-1761dde948f7@suse.com> (raw)
In-Reply-To: <df955d0c-b78f-641b-41f6-ed52f9e45cb7@oracle.com>

On 09.04.2021 23:01, Ankur Arora wrote:
> On 2021-04-08 11:38 p.m., Jan Beulich wrote:
>> On 09.04.2021 08:08, Ankur Arora wrote:
>>> On 4/8/2021 6:58 AM, Jan Beulich wrote:
>>>> The present copy_page() is the way it is because of the desire to
>>>> avoid disturbing the cache. The effect of REP STOS on the L1 cache
>>>> (compared to the present use of MOVNTI) is more or less noticable on
>>>> all hardware, and at least on Intel hardware more noticable when the
>>>> cache starts out clean. For L2 the results are more mixed when
>>>> comparing cache-clean and cache-filled cases, but the difference
>>>> between MOVNTI and REP STOS remains or (at least on Zen2 and older
>>>> Intel hardware) becomes more prominent.
>>>
>>> Could you give me any pointers on the cache-effects on this? This
>>> obviously makes sense but I couldn't come up with any benchmarks
>>> which would show this in a straight-forward fashion.
>>
>> No benchmarks in that sense, but a local debugging patch measuring
>> things before bringing up APs, to have a reasonably predictable
>> environment. I have attached it for your reference.
> 
> Thanks, that does look like a pretty good predictable test.
> (Btw, there might be an oversight in the clear_page_clzero() logic.
> I believe that also needs an sfence.)

Oh, good point.

> Just curious: you had commented out the local irq disable/enable clauses.
> Is that because you decided that it the code ran at an early enough
> point that they were not required or some other reason?

It's not so much "early enough to not be required" but "too early to
be valid to enable interrupts". And then I didn't want to switch to
save/restore, so left them just as comments.

> Would you have any intuition on, if the power consumption of
> the non-temporal primitives is meaningfully different from
> REP STOS and friends?

If power can be saved when caches don't get modified (no idea if
that's possible, as the cached data still requires keeping intact),
then non-temporal stores might be better.

Jan


  reply	other threads:[~2021-04-12  9:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 13:58 x86: memset() / clear_page() / page scrubbing Jan Beulich
2021-04-09  6:08 ` Ankur Arora
2021-04-09  6:38   ` Jan Beulich
2021-04-09 21:01     ` Ankur Arora
2021-04-12  9:15       ` Jan Beulich [this message]
2021-04-13 13:17 ` Andrew Cooper
2021-04-14  8:12   ` Jan Beulich
2021-04-15 16:21     ` Andrew Cooper
2021-04-21 13:55       ` Jan Beulich

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=13709035-2bf6-5dd6-a3f6-1761dde948f7@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ankur.a.arora@oracle.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.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).