[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1304012041580.10555@chino.kir.corp.google.com>
Date: Mon, 1 Apr 2013 20:44:34 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Lin Feng <linfeng@...fujitsu.com>
cc: Zhouping Liu <zliu@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Hugh Dickins <hughd@...gle.com>, Mel Gorman <mgorman@...e.de>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Amos Kong <akong@...hat.com>
Subject: Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?
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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists