From: Lin Feng <linfeng@cn.fujitsu.com> To: Zhouping Liu <zliu@redhat.com> Cc: David Rientjes <rientjes@google.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: Tue, 02 Apr 2013 11:40:25 +0800 [thread overview] Message-ID: <515A5329.6020805@cn.fujitsu.com> (raw) In-Reply-To: <515A4BD1.1020407@redhat.com> 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
WARNING: multiple messages have this Message-ID (diff)
From: Lin Feng <linfeng@cn.fujitsu.com> To: Zhouping Liu <zliu@redhat.com> Cc: David Rientjes <rientjes@google.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: Tue, 02 Apr 2013 11:40:25 +0800 [thread overview] Message-ID: <515A5329.6020805@cn.fujitsu.com> (raw) In-Reply-To: <515A4BD1.1020407@redhat.com> 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 -- 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>
next prev parent reply other threads:[~2013-04-02 3:38 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 [this message] 2013-04-02 3:40 ` Lin Feng 2013-04-02 3:44 ` David Rientjes 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=515A5329.6020805@cn.fujitsu.com \ --to=linfeng@cn.fujitsu.com \ --cc=aarcange@redhat.com \ --cc=akong@redhat.com \ --cc=hughd@google.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=mgorman@suse.de \ --cc=rientjes@google.com \ --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: linkBe 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.