From: Feng Tang <feng.tang@intel.com>
To: Michal Hocko <mhocko@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
andi.kleen@intel.com, tim.c.chen@intel.com,
dave.hansen@intel.com, ying.huang@intel.com,
Roman Gushchin <guro@fb.com>
Subject: Re: [PATCH 1/2] mm: page_counter: relayout structure to reduce false sharing
Date: Mon, 4 Jan 2021 22:44:02 +0800 [thread overview]
Message-ID: <20210104144402.GB101866@shbuild999.sh.intel.com> (raw)
In-Reply-To: <20210104141140.GH13207@dhcp22.suse.cz>
On Mon, Jan 04, 2021 at 03:11:40PM +0100, Michal Hocko wrote:
> On Mon 04-01-21 21:34:45, Feng Tang wrote:
> > Hi Michal,
> >
> > On Mon, Jan 04, 2021 at 02:03:57PM +0100, Michal Hocko wrote:
> > > On Tue 29-12-20 22:35:13, Feng Tang wrote:
> > > > When checking a memory cgroup related performance regression [1],
> > > > from the perf c2c profiling data, we found high false sharing for
> > > > accessing 'usage' and 'parent'.
> > > >
> > > > On 64 bit system, the 'usage' and 'parent' are close to each other,
> > > > and easy to be in one cacheline (for cacheline size == 64+ B). 'usage'
> > > > is usally written, while 'parent' is usually read as the cgroup's
> > > > hierarchical counting nature.
> > > >
> > > > So move the 'parent' to the end of the structure to make sure they
> > > > are in different cache lines.
> > >
> > > Yes, parent is write-once field so having it away from other heavy RW
> > > fields makes sense to me.
> > >
> > > > Following are some performance data with the patch, against
> > > > v5.11-rc1, on several generations of Xeon platforms. Most of the
> > > > results are improvements, with only one malloc case on one platform
> > > > shows a -4.0% regression. Each category below has several subcases
> > > > run on different platform, and only the worst and best scores are
> > > > listed:
> > > >
> > > > fio: +1.8% ~ +8.3%
> > > > will-it-scale/malloc1: -4.0% ~ +8.9%
> > > > will-it-scale/page_fault1: no change
> > > > will-it-scale/page_fault2: +2.4% ~ +20.2%
> > >
> > > What is the second number? Std?
> >
> > For each case like 'page_fault2', I run several subcases on different
> > generations of Xeon, and only listed the lowest (first number) and
> > highest (second number) scores.
> >
> > There are 5 runs and the result are: +3.6%, +2.4%, +10.4%, +20.2%,
> > +4.7%, and +2.4% and +20.2% are listed.
>
> This should be really explained in the changelog and ideally mention the
> model as well. Seeing a std would be appreciated as well.
I guess I haven't made it clear (due to my poor English :))
The five scores are for different parameters on different HW:
Cascadelake (100%) 77844 +3.6% 80667 will-it-scale.per_process_ops
Cascadelake (50%) 182475 +2.4% 186866 will-it-scale.per_process_ops
Haswell (100%) 84870 +10.4% 93671 will-it-scale.per_process_ops
Haswell (50%) 197684 +20.2% 237585 will-it-scale.per_process_ops
Newer Xeon (50%) 268569 +4.7% 281320 will-it-scale.per_process_ops
+2.4% is the lowest improvement, while +20.2% is the highest.
100% means the number of forked test processes eqauls to CPU number,
while 50% is the half. Each line has been runed several times, whose score
are consistent without big deviations.
Thanks,
Feng
next prev parent reply other threads:[~2021-01-04 14:44 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-29 14:35 Feng Tang
2020-12-29 14:35 ` [PATCH 2/2] mm: memcg: add a new MEMCG_UPDATE_BATCH Feng Tang
2020-12-29 17:13 ` Roman Gushchin
2021-01-04 2:53 ` Feng Tang
2021-01-04 7:46 ` [mm] 4d8191276e: vm-scalability.throughput 43.4% improvement kernel test robot
2021-01-04 13:15 ` [PATCH 2/2] mm: memcg: add a new MEMCG_UPDATE_BATCH Michal Hocko
2021-01-05 1:57 ` Feng Tang
2021-01-06 0:47 ` Shakeel Butt
2021-01-06 2:12 ` Feng Tang
2021-01-06 3:43 ` Chris Down
2021-01-06 3:45 ` Chris Down
2021-01-06 4:45 ` Feng Tang
2020-12-29 16:56 ` [PATCH 1/2] mm: page_counter: relayout structure to reduce false sharing Roman Gushchin
2020-12-30 14:19 ` Feng Tang
2021-01-04 13:03 ` Michal Hocko
2021-01-04 13:34 ` Feng Tang
2021-01-04 14:11 ` Michal Hocko
2021-01-04 14:44 ` Feng Tang [this message]
2021-01-04 15:34 ` Michal Hocko
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=20210104144402.GB101866@shbuild999.sh.intel.com \
--to=feng.tang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=andi.kleen@intel.com \
--cc=dave.hansen@intel.com \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=tim.c.chen@intel.com \
--cc=vdavydov.dev@gmail.com \
--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