linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Adam Litke <agl@us.ibm.com>
To: Andi Kleen <ak@suse.de>
Cc: Nishanth Aravamudan <nacc@us.ibm.com>,
	Christoph Lameter <clameter@sgi.com>,
	linux-mm@kvack.org, linuxppc-dev@ozlabs.org, lnxninja@us.ibm.com
Subject: Re: libnuma interleaving oddness
Date: Wed, 30 Aug 2006 12:44:10 -0500	[thread overview]
Message-ID: <1156959851.7185.8647.camel@localhost.localdomain> (raw)
In-Reply-To: <200608300919.13125.ak@suse.de>

On Wed, 2006-08-30 at 09:19 +0200, Andi Kleen wrote:
> mous pages.
> > 
> > The order is (with necessary params filled in):
> > 
> > p = mmap( , newsize, RW, PRIVATE, unlinked_hugetlbfs_heap_fd, );
> > 
> > numa_interleave_memory(p, newsize);
> > 
> > mlock(p, newsize); /* causes all the hugepages to be faulted in */
> > 
> > munlock(p,newsize);
> > 
> > From what I gathered from the numa manpages, the interleave policy
> > should take effect on the mlock, as that is "fault-time" in this
> > context. We're forcing the fault, that is.
> 
> mlock shouldn't be needed at all here. the new hugetlbfs is supposed
> to reserve at mmap time and numa_interleave_memory() sets a VMA 
> policy which will should do the right thing no matter when the fault
> occurs.

mmap-time reservation of huge pages is done only for shared mappings.
MAP_PRIVATE mappings have full-overcommit semantics.  We use the mlock
call to "guarantee" the MAP_PRIVATE memory to the process.  If mlock
fails, we simply unmap the hugetlb region and tell glibc to revert to
its normal allocation method (mmap normal pages).

> Hmm, maybe mlock() policy() is broken.

The policy decision is made further down than mlock.  As each huge page
is allocated from the static pool, the policy is consulted to see from
which node to pop a huge page. 

The function huge_zonelist() seems to encapsulate the numa policy logic
and after sniffing the code, it looks right to me.

-- 
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center

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

  parent reply	other threads:[~2006-08-30 17:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-29 23:15 Nishanth Aravamudan
2006-08-29 23:57 ` Christoph Lameter
2006-08-30  0:21   ` Nishanth Aravamudan
2006-08-30  2:26     ` Nishanth Aravamudan
2006-08-30  4:26       ` Christoph Lameter
2006-08-30  5:31         ` Nishanth Aravamudan
2006-08-30  5:40         ` Tim Pepper
2006-08-30  7:19     ` Andi Kleen
2006-08-30  7:29       ` Nishanth Aravamudan
2006-08-30  7:32         ` Andi Kleen
2006-08-30 18:01           ` Tim Pepper
2006-08-30 18:12             ` Andi Kleen
2006-08-30 18:13             ` Adam Litke
2006-08-30 21:04         ` Christoph Lameter
2006-08-31  6:00           ` Nishanth Aravamudan
2006-08-31  7:47             ` Andi Kleen
2006-08-31 15:49               ` Nishanth Aravamudan
2006-08-31 16:00             ` [PATCH] fix NUMA interleaving for huge pages (was RE: libnuma interleaving oddness) Nishanth Aravamudan
2006-08-31 16:08               ` Adam Litke
2006-08-31 16:19               ` Tim Pepper
2006-08-31 16:37               ` Christoph Lameter
2006-08-30 17:44       ` Adam Litke [this message]
2006-08-30  7:16   ` libnuma interleaving oddness Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2006-08-29 23:02 Nishanth Aravamudan

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=1156959851.7185.8647.camel@localhost.localdomain \
    --to=agl@us.ibm.com \
    --cc=ak@suse.de \
    --cc=clameter@sgi.com \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=lnxninja@us.ibm.com \
    --cc=nacc@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox