]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/mempolicy.c: convert the shared_policy lock to a rwlock
authorNathan Zimmer <nzimmer@sgi.com>
Thu, 14 Jan 2016 23:18:36 +0000 (15:18 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 27 Feb 2017 01:50:09 +0000 (17:50 -0800)
commit11f053f99382eb32c75b9c15928680d3b6775393
treec05846cb50649c96b82992b2977e0738a9621932
parent0ec726b4f0dbd81814cd440dded5a94a6f390151
mm/mempolicy.c: convert the shared_policy lock to a rwlock

Orabug: 25477822

When running the SPECint_rate gcc on some very large boxes it was
noticed that the system was spending lots of time in
mpol_shared_policy_lookup().  The gamess benchmark can also show it and
is what I mostly used to chase down the issue since the setup for that I
found to be easier.

To be clear the binaries were on tmpfs because of disk I/O requirements.
We then used text replication to avoid icache misses and having all the
copies banging on the memory where the instruction code resides.  This
results in us hitting a bottleneck in mpol_shared_policy_lookup() since
lookup is serialised by the shared_policy lock.

I have only reproduced this on very large (3k+ cores) boxes.  The
problem starts showing up at just a few hundred ranks getting worse
until it threatens to livelock once it gets large enough.  For example
on the gamess benchmark at 128 ranks this area consumes only ~1% of
time, at 512 ranks it consumes nearly 13%, and at 2k ranks it is over
90%.

To alleviate the contention in this area I converted the spinlock to an
rwlock.  This allows a large number of lookups to happen simultaneously.
The results were quite good reducing this consumtion at max ranks to
around 2%.

[akpm@linux-foundation.org: tidy up code comments]
Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Nadia Yvette Chambers <nyc@holomorphy.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 4a8c7bb59ac85b038c29adf6d32ff56e11fbb267)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
fs/hugetlbfs/inode.c
include/linux/mempolicy.h
mm/mempolicy.c