Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-02 Thread Simon Jeons
Hi David, On 04/03/2013 02:09 AM, David Rientjes wrote: On Tue, 2 Apr 2013, Simon Jeons wrote: Both thp and hugetlb pages should be 2MB aligned, correct? To answer this question and your followup reply at the same time: they come from one level higher in the page table so they will naturally

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-02 Thread David Rientjes
On Tue, 2 Apr 2013, Simon Jeons wrote: > Both thp and hugetlb pages should be 2MB aligned, correct? > To answer this question and your followup reply at the same time: they come from one level higher in the page table so they will naturally need to be 2MB aligned. -- To unsubscribe from this

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-02 Thread Simon Jeons
On 04/02/2013 06:23 AM, David Rientjes wrote: On Mon, 1 Apr 2013, Zhouping Liu wrote: Hi all, I found THP can't correctly distinguish one anonymous hugepage map. 1. when /sys/kernel/mm/transparent_hugepage/enabled is 'always', the amount of THP always is one less. It's not a problem

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-02 Thread Simon Jeons
Hi David, On 04/02/2013 06:23 AM, David Rientjes wrote: On Mon, 1 Apr 2013, Zhouping Liu wrote: Hi all, I found THP can't correctly distinguish one anonymous hugepage map. 1. when /sys/kernel/mm/transparent_hugepage/enabled is 'always', the amount of THP always is one less. It's not a

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-02 Thread Simon Jeons
Hi David, On 04/02/2013 06:23 AM, David Rientjes wrote: On Mon, 1 Apr 2013, Zhouping Liu wrote: Hi all, I found THP can't correctly distinguish one anonymous hugepage map. 1. when /sys/kernel/mm/transparent_hugepage/enabled is 'always', the amount of THP always is one less. It's not a

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-02 Thread Simon Jeons
On 04/02/2013 06:23 AM, David Rientjes wrote: On Mon, 1 Apr 2013, Zhouping Liu wrote: Hi all, I found THP can't correctly distinguish one anonymous hugepage map. 1. when /sys/kernel/mm/transparent_hugepage/enabled is 'always', the amount of THP always is one less. It's not a problem

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-02 Thread David Rientjes
On Tue, 2 Apr 2013, Simon Jeons wrote: Both thp and hugetlb pages should be 2MB aligned, correct? To answer this question and your followup reply at the same time: they come from one level higher in the page table so they will naturally need to be 2MB aligned. -- To unsubscribe from this

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-02 Thread Simon Jeons
Hi David, On 04/03/2013 02:09 AM, David Rientjes wrote: On Tue, 2 Apr 2013, Simon Jeons wrote: Both thp and hugetlb pages should be 2MB aligned, correct? To answer this question and your followup reply at the same time: they come from one level higher in the page table so they will naturally

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-01 Thread Zhouping Liu
On 04/02/2013 11:40 AM, Lin Feng wrote: 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

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-01 Thread David Rientjes
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

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-01 Thread Lin Feng
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

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-01 Thread Zhouping Liu
On 04/02/2013 06:23 AM, David Rientjes wrote: On Mon, 1 Apr 2013, Zhouping Liu wrote: Hi all, I found THP can't correctly distinguish one anonymous hugepage map. 1. when /sys/kernel/mm/transparent_hugepage/enabled is 'always', the amount of THP always is one less. It's not a problem

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-01 Thread David Rientjes
On Mon, 1 Apr 2013, Zhouping Liu wrote: > Hi all, > > I found THP can't correctly distinguish one anonymous hugepage map. > > 1. when /sys/kernel/mm/transparent_hugepage/enabled is 'always', the >amount of THP always is one less. > It's not a problem with identifying an anonymous mapping

THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-01 Thread Zhouping Liu
Hi all, I found THP can't correctly distinguish one anonymous hugepage map. 1. when /sys/kernel/mm/transparent_hugepage/enabled is 'always', the amount of THP always is one less. Testing code: snip unsigned long hugepagesize = (1UL << 21); int main() { void *addr;

THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-01 Thread Zhouping Liu
Hi all, I found THP can't correctly distinguish one anonymous hugepage map. 1. when /sys/kernel/mm/transparent_hugepage/enabled is 'always', the amount of THP always is one less. Testing code: snip unsigned long hugepagesize = (1UL 21); int main() { void *addr;

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-01 Thread David Rientjes
On Mon, 1 Apr 2013, Zhouping Liu wrote: Hi all, I found THP can't correctly distinguish one anonymous hugepage map. 1. when /sys/kernel/mm/transparent_hugepage/enabled is 'always', the amount of THP always is one less. It's not a problem with identifying an anonymous mapping as a

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-01 Thread Zhouping Liu
On 04/02/2013 06:23 AM, David Rientjes wrote: On Mon, 1 Apr 2013, Zhouping Liu wrote: Hi all, I found THP can't correctly distinguish one anonymous hugepage map. 1. when /sys/kernel/mm/transparent_hugepage/enabled is 'always', the amount of THP always is one less. It's not a problem

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-01 Thread Lin Feng
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

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-01 Thread David Rientjes
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

Re: THP: AnonHugePages in /proc/[pid]/smaps is correct or not?

2013-04-01 Thread Zhouping Liu
On 04/02/2013 11:40 AM, Lin Feng wrote: 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