linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alex Thorlton <athorlton@sgi.com>
To: linux-kernel@vger.kernel.org
Cc: Mike Galbraith <bitbucket@online.de>, Robin Holt <holt@sgi.com>,
	Li Zefan <lizefan@huawei.com>, Rob Landley <rob@landley.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mel Gorman <mgorman@suse.de>, Rik van Riel <riel@redhat.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>,
	linux-doc@vger.kernel.org, linux-mm@kvack.org,
	David Rientjes <rientjes@google.com>,
	Alex Thorlton <athorlton@sgi.com>
Subject: Re: [PATCH v2] Make transparent hugepages cpuset aware
Date: Mon, 29 Jul 2013 14:42:51 -0500	[thread overview]
Message-ID: <20130729194250.GC26476@sgi.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1306201334460.24145@chino.kir.corp.google.com>

We've re-evaluated the need for a patch to support some sort of finer
grained control over thp, and, based on some tests performed by our 
benchmarking team, we're seeing that we'd definitely still like to
implement some method to support this.  Here's an e-mail from John 
Baron (jbaron@sgi.com), on our benchmarking team,  containing some data
which shows a decrease in performance for some SPEC OMP benchmarks when
thp is enabled:

> Here are results for SPEC OMP benchmarks on UV2 using 512 threads / 64
> sockets.  These show the performance ratio for jobs run with THP
> disabled versus THP enabled (so > 1.0 means THP disabled is faster).  
> One possible reason for lower performance with THP enabled is that the 
> larger page granularity can result in more remote data accesses.
> 
> 
> SPEC OMP2012:
> 
> 350.md          1.0
> 351.bwaves      1.3
> 352.nab         1.0
> 357.bt331       0.9
> 358.botsalgn    1.0
> 359.botsspar    1.1
> 360.ilbdc       1.8
> 362.fma3d       1.0
> 363.swim        1.4
> 367.imagick     0.9
> 370.mgrid331    1.1
> 371.applu331    0.9
> 372.smithwa     1.0
> 376.kdtree      1.0
> 
> SPEC OMPL2001:
> 
> 311.wupwise_l   1.1
> 313.swim_l      1.5
> 315.mgrid_l     1.0
> 317.applu_l     1.1
> 321.equake_l    5.8
> 325.apsi_l      1.5
> 327.gafort_l    1.0
> 329.fma3d_l     1.0
> 331.art_l       0.8
> 
> One could argue that real-world applications could be modified to avoid
> these kinds of effects, but (a) it is not always possible to modify code
> (e.g. in benchmark situations) and (b) even if it is possible to do so,
> it is not necessarily easy to do so (e.g. for customers with large
> legacy Fortran codes).
> 
> We have also observed on Intel Sandy Bridge processors that, as
> counter-intuitive as it may seem, local memory bandwidth is actually
> slightly lower with THP enabled (1-2%), even with unit stride data
> accesses.  This may not seem like much of a performance hit but
> it is important for HPC workloads.  No code modification will help here.

In light of the previous issues discussed in this thread, and some
suggestions from David Rientjes:

> why not make it per-process so users don't have to configure
> cpusets to control it?

Robin and I have come up with a proposal for a way to replicate behavior
similar to what this patch introduced, only on a per-process level
instead of at the cpuset level.

Our idea would be to add a flag somewhere in the task_struct to keep
track of whether or not thp is enabled for each task.  The flag would be
controlled by an additional option included in prctl(), allowing
programmers to set/unset this flag via the prctl() syscall.  We would 
also introduce some code into the clone() syscall to ensure that this 
flag is copied down from parent to child tasks when necessary.  The flag
would be checked in the same place the the per-cpuset flag was checked
in my original patch, thereby allowing the same behavior to be
replicated on a per-process level.

In this way, we will also be able to get static binaries to behave
appropriately by setting this flag in a userland program, and then
having that program exec the static binary for which we need to disable
thp.

This solution allows us to incorporate the behavior that we're looking
for into the kernel, without abusing cpusets for the purpose of
containerization.

Please let me know if anyone has any objections to this approach, or if
you have any suggestions as to how we could improve upon this idea.

Thanks!

- Alex

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2013-07-29 19:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-11 16:14 Alex Thorlton
2013-06-11 22:20 ` David Rientjes
2013-06-18 16:45   ` Alex Thorlton
2013-06-19  0:01     ` David Rientjes
2013-06-19  9:32       ` Robin Holt
2013-06-19 21:24         ` David Rientjes
2013-06-20  2:27           ` Robin Holt
2013-06-20  2:43             ` David Rientjes
2013-06-20  3:10               ` Mike Galbraith
2013-06-20 20:37                 ` David Rientjes
2013-07-29 19:42                   ` Alex Thorlton [this message]
2013-06-20  3:34           ` Li Zefan

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=20130729194250.GC26476@sgi.com \
    --to=athorlton@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=bitbucket@online.de \
    --cc=hannes@cmpxchg.org \
    --cc=holt@sgi.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizefan@huawei.com \
    --cc=mgorman@suse.de \
    --cc=riel@redhat.com \
    --cc=rientjes@google.com \
    --cc=rob@landley.net \
    --cc=xiaoguangrong@linux.vnet.ibm.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