linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chintan Pandya <chintan.pandya@oneplus.com>
To: Vlastimil Babka <vbabka@suse.cz>, Will Deacon <will@kernel.org>
Cc: Prathu Baronia <prathu.baronia@oneplus.com>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"alexander.duyck@gmail.com" <alexander.duyck@gmail.com>,
	"mhocko@suse.com" <mhocko@suse.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"gregkh@linuxfoundation.com" <gregkh@linuxfoundation.com>,
	"gthelen@google.com" <gthelen@google.com>,
	"jack@suse.cz" <jack@suse.cz>, Ken Lin <ken.lin@oneplus.com>,
	Gasine Xu <Gasine.Xu@Oneplus.com>,
	"ying.huang@intel.com" <ying.huang@intel.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>
Subject: RE: [PATCH v2] mm: Optimized hugepage zeroing & copying from user
Date: Tue, 21 Apr 2020 13:56:39 +0000	[thread overview]
Message-ID: <SG2PR04MB2921C21D0C36B2FC617E352091D50@SG2PR04MB2921.apcprd04.prod.outlook.com> (raw)
In-Reply-To: <5e334947-22e9-e59d-f7bb-63e04cc8caf0@suse.cz>

> On 4/21/20 3:39 PM, Will Deacon wrote:
> > On Tue, Apr 21, 2020 at 02:48:04PM +0200, Vlastimil Babka wrote:
> >> On 4/21/20 2:47 PM, Vlastimil Babka wrote:
> >> >
> >> > It was suspected that current Intel can prefetch forward and
> >> > backwards, and the tested ARM64 microarchitecture only backwards,
> >> > can it be true? The current code
> >>
> >> Oops, tested ARM64 microarchitecture I meant "only forwards".
> >
> > I'd be surprised if that's the case, but it could be that there's an
> > erratum workaround in play which hampers the prefetch behaviour. We
> > generally try not to assume too much about the prefetcher on arm64
> > because they're not well documented and vary wildly between different
> micro-architectures.
> 
> Yeah it's probably not as simple as I thought, as the test code [1] shows the
> page iteration goes backwards, but per-page memsets are not special. So
> maybe it's not hardware specifics, but x86 memtest implementation is also
> done backwards, so it fits the backwards outer loop, but arm64 memset is
> forward, so the resulting pattern is non-linear?
> 
> In that case it's also a question if the measurement was done in kernel or
> userspace, and if userspace memset have any implications for kernel memset...
> 
Yes, Prathu eventually tried and shared test results with memset implementation
copied from kernel to his userspace test. And that too suggested poor performance
in backward direction for ARM.

However, he also profiled clear_huge_page() using ftrace and 2 different cores of 
SM8150 show improvement with forward memset approach (v2 patch of Prathu).

----------------------------------------------------------------------
Ftrace Results(clear_huge_page ()):
----------------------------------------------------------------------
All timing values are in microseconds(us)
----------------------------------------------------------------------
Base:
        - CPU0:
                - Samples: 95
                - Mean: 242.099 us
                - Std dev: 45.0096 us
        - CPU6:
                - Samples: 61
                - Mean: 258.372 us
                - Std dev: 22.0754 us
----------------------------------------------------------------------
v2:
        - CPU0:
                - Samples: 63
                - Mean: 112.297 us
                - Std dev: 0.310989 us
        - CPU6:
                - Samples: 99
                - Mean: 67.359 us
                - Std dev: 1.15997 us
----------------------------------------------------------------------


> [1]
> https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kern
> el.org%2Flinux-
> mm%2F20200414153829.GA15230%40oneplus.com%2F&amp;data=02%7C01%
> 7Cchintan.pandya%40oneplus.com%7Ca39a8877831f4f696ea008d7e5fa9f97%7
> C0423909d296c463eab5ce5853a518df8%7C1%7C0%7C637230736895823014&
> amp;sdata=HAVsaTkNgmXFkGdULNiIHir7ch3bQQgzn2z2tSZIrxU%3D&amp;reser
> ved=0
> 
> > Will
> >


  reply	other threads:[~2020-04-21 13:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 15:38 [PATCH v2] mm: Optimized hugepage zeroing & copying from user Prathu Baronia
2020-04-14 17:03 ` Michal Hocko
2020-04-14 17:41   ` Daniel Jordan
     [not found]   ` <20200414184743.GB2097@oneplus.com>
2020-04-14 19:32     ` Alexander Duyck
2020-04-15  3:40       ` Huang, Ying
2020-04-15 11:09         ` Michal Hocko
2020-04-19 12:05       ` Prathu Baronia
2020-04-14 19:40     ` Michal Hocko
2020-04-15  3:27 ` Huang, Ying
2020-04-16  1:21   ` Huang, Ying
2020-04-19 15:58   ` Prathu Baronia
2020-04-20  0:18     ` Huang, Ying
2020-04-21  9:36       ` Prathu Baronia
2020-04-21 10:09         ` Will Deacon
2020-04-21 12:47           ` Vlastimil Babka
2020-04-21 12:48             ` Vlastimil Babka
2020-04-21 13:39               ` Will Deacon
2020-04-21 13:48                 ` Vlastimil Babka
2020-04-21 13:56                   ` Chintan Pandya [this message]
2020-04-22  8:18                   ` Will Deacon
2020-04-22 11:19                     ` Will Deacon
2020-04-22 14:38                       ` Prathu Baronia
2020-05-01  8:58                         ` Prathu Baronia
2020-05-05  8:59                           ` Will Deacon
2020-04-21 13:00             ` Michal Hocko
2020-04-21 13:10               ` Will Deacon
2020-04-17  7:48 ` [mm] 134c8b410f: vm-scalability.median -7.9% regression kernel test robot

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=SG2PR04MB2921C21D0C36B2FC617E352091D50@SG2PR04MB2921.apcprd04.prod.outlook.com \
    --to=chintan.pandya@oneplus.com \
    --cc=Gasine.Xu@Oneplus.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.duyck@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=gregkh@linuxfoundation.com \
    --cc=gthelen@google.com \
    --cc=jack@suse.cz \
    --cc=ken.lin@oneplus.com \
    --cc=linux-mm@kvack.org \
    --cc=mark.rutland@arm.com \
    --cc=mhocko@suse.com \
    --cc=prathu.baronia@oneplus.com \
    --cc=vbabka@suse.cz \
    --cc=will@kernel.org \
    --cc=ying.huang@intel.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).