Re: [PATCH 5/5] [hugetlb] Try to grow pool for MAP_SHARED mappings

Nish Aravamudan
2007-07-17T23:42:39Z

On 7/13/07, Paul Jackson <pj@sgi.com> wrote:
> Adam wrote:
> > To be honest, I just don't think a global hugetlb pool and cpusets are
> > compatible, period.
>
> It's not an easy fit, that's for sure ;).

In the context of my patches to make the hugetlb pool's interleave
work with memoryless nodes, I may have pseudo-solution for growing the
pool while respecting cpusets.

Essentially, given that GFP_THISNODE allocations stay on the node
requested (which is the case after Christoph's set of memoryless node
patches go in), we invoke:

pol = mpol_new(MPOL_INTERLEAVE, &node_states[N_MEMORY])

in the two callers of alloc_fresh_huge_page(pol) in hugetlb.c.
alloc_fresh_huge_page() in turn invokes interleave_nodes(pol) so that
we request hugepages in an interleaved fashion over all nodes with
memory.

Now, what I'm wondering is why interleave_nodes() is not cpuset aware?
Or is it expected that the caller do the right thing with the policy
beforehand? If so, I think I could just make those two callers do

pol = mpol_new(MPOL_INTERLEAVE, cpuset_mems_allowed(current))

?

Or am I way off here?

Thanks,
Nish