lkml.org 
[lkml]   [2013]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?
Hi Zhouping,

On 04/02/2013 11:09 AM, Zhouping Liu wrote:
> I don't understand clearly the last sentence 'you'll probably only get 100% hugepages only 1/512th of the time.'
> could you please explain more details about 'only 1/512th of the time'?

IIUC, thp size is 2M so it may be comprised of 512 normal page(size 4k).
Since your test code is not 2M aligned(not using posix_memalign()) so
the start address of the mapped vma will be random, such as
2M*i+4k*1, 2M*i+4k*2...2M*i+k4*511, there is 512 possibilities.

The only chance you get thp happens when the first map just starts at 2M*i,
and the consequent maps also benefit from this.

-------- snip --------
>
> 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.

thanks,
linfeng


\
 
 \ /
  Last update: 2013-04-02 06:21    [W:0.141 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site