All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Lin Feng <linfeng@cn.fujitsu.com>
Cc: Zhouping Liu <zliu@redhat.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Hugh Dickins <hughd@google.com>, Mel Gorman <mgorman@suse.de>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Amos Kong <akong@redhat.com>
Subject: Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?
Date: Mon, 1 Apr 2013 20:44:34 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.02.1304012041580.10555@chino.kir.corp.google.com> (raw)
In-Reply-To: <515A5329.6020805@cn.fujitsu.com>

On Tue, 2 Apr 2013, Lin Feng wrote:

> > so, again, if I understand correctly, thp should tune the naturally aligned maps, such as generated by mmap()/malloc(),
> > make such maps 'hugepagesize' aligned if the maps or vma is equal and greater than 'hugepagesize', doesn't it?
> 
> We may gain performance improving from this.
> 

To attain the maximum number of hugepages, you would naturally want to 
ensure that the mappings are done aligned to 2MB; for very large 
allocations, missing one or two hugepages typically won't hurt performance 
much.  posix_memalign() is the best way of doing this which just wraps 
mmap() for the needed alignment.  More interesting is creating your own 
custom malloc() that allocates in 2MB aligned chunks, if possible, and 
uses 2MB aligned arenas for its own metadata.  If you do that for 
malloc(), then you'll only need to make code that does its own mmap()s to 
use posix_memalign().

WARNING: multiple messages have this Message-ID (diff)
From: David Rientjes <rientjes@google.com>
To: Lin Feng <linfeng@cn.fujitsu.com>
Cc: Zhouping Liu <zliu@redhat.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Hugh Dickins <hughd@google.com>, Mel Gorman <mgorman@suse.de>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Amos Kong <akong@redhat.com>
Subject: Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?
Date: Mon, 1 Apr 2013 20:44:34 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.02.1304012041580.10555@chino.kir.corp.google.com> (raw)
In-Reply-To: <515A5329.6020805@cn.fujitsu.com>

On Tue, 2 Apr 2013, Lin Feng wrote:

> > so, again, if I understand correctly, thp should tune the naturally aligned maps, such as generated by mmap()/malloc(),
> > make such maps 'hugepagesize' aligned if the maps or vma is equal and greater than 'hugepagesize', doesn't it?
> 
> We may gain performance improving from this.
> 

To attain the maximum number of hugepages, you would naturally want to 
ensure that the mappings are done aligned to 2MB; for very large 
allocations, missing one or two hugepages typically won't hurt performance 
much.  posix_memalign() is the best way of doing this which just wraps 
mmap() for the needed alignment.  More interesting is creating your own 
custom malloc() that allocates in 2MB aligned chunks, if possible, and 
uses 2MB aligned arenas for its own metadata.  If you do that for 
malloc(), then you'll only need to make code that does its own mmap()s to 
use posix_memalign().

--
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-04-02  3:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1207916095.642011.1364800448075.JavaMail.root@redhat.com>
2013-04-01  8:00 ` THP: AnonHugePages in /proc/[pid]/smaps is correct or not? Zhouping Liu
2013-04-01  8:00   ` Zhouping Liu
2013-04-01 22:23   ` David Rientjes
2013-04-01 22:23     ` David Rientjes
2013-04-02  3:09     ` Zhouping Liu
2013-04-02  3:09       ` Zhouping Liu
2013-04-02  3:40       ` Lin Feng
2013-04-02  3:40         ` Lin Feng
2013-04-02  3:44         ` David Rientjes [this message]
2013-04-02  3:44           ` David Rientjes
2013-04-02  3:48         ` Zhouping Liu
2013-04-02  3:48           ` Zhouping Liu
2013-04-02 12:23     ` Simon Jeons
2013-04-02 12:23       ` Simon Jeons
2013-04-02 18:09       ` David Rientjes
2013-04-02 18:09         ` David Rientjes
2013-04-02 23:58         ` Simon Jeons
2013-04-02 23:58           ` Simon Jeons
2013-04-02 12:26     ` Simon Jeons
2013-04-02 12:26       ` Simon Jeons

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=alpine.DEB.2.02.1304012041580.10555@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=aarcange@redhat.com \
    --cc=akong@redhat.com \
    --cc=hughd@google.com \
    --cc=linfeng@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=zliu@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.