Subject: Re: libnuma interleaving oddness

From: Adam Litke <[email-masked]>
Date: Wed, 30 Aug 2006 13:13:05 -0500

On Wed, 2006-08-30 at 11:01 -0700, Tim Pepper wrote:
> On 8/30/06, Andi Kleen <[email-masked]> wrote:
> > Then it's probably some new problem in hugetlbfs.
> 
> It's something subtle though, because I _am_ able to get interleaving
> on hugetlbfs with a slightly simplified test case (see previous email)
> compared to Nish's.
> 
> > Does it work with shmfs?
> 
> Haven't tried shmfs, but the following correctly does the expected
> interleaving with hugepages (although not hugetlbfs backed):
>      shmid = shmget( 0, NR_HUGE_PAGES, IPC_CREAT | SHM_HUGETLB | 0666 );
>      shmat_addr = shmat( shmid, NULL, 0 );
>      ...
>      numa_interleave_memory( shmat_addr, SHM_SIZE, &nm );
> I'd expect it works fine with non-huge pages, shmfs.

Actually, the above call will yield hugetlbfs backed huge pages.  The
kernel just prepares the hugetlbfs file for you.  See
hugetlb_zero_setup().

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