Re: [PATCH 3/8] Preserve local node for KSM copies

Andi Kleen
2011-02-22T17:15:00Z

On 2/22/2011 8:20 AM, Andrea Arcangeli wrote:
> On Tue, Feb 22, 2011 at 09:47:26AM -0600, Christoph Lameter wrote:
>> On Mon, 21 Feb 2011, Andi Kleen wrote:
>>
>>> Add a alloc_page_vma_node that allows passing the "local" node in.
>>> Use it in ksm to allocate copy pages on the same node as
>>> the original as possible.
>> Why would that be useful? The shared page could be on a node that is not
>> near the process that maps the page. Would it not be better to allocate on
>> the node that is local to the process that maps the page?
> This is what I was trying to understand. To me it looks like this is
> making things worse. Following the "vma" advice like current code

The problem is: most people use local policy and for that the correct node
is the node that the memory got allocated on.

You cannot get that information from the vma because the vma just says
"local"

If you don't use that node the daemon will arbitarily destroy memory
locality.
In fact this has happened. This is really bad regression caused by THP.

Now full KSM locality is more difficult (obviously you can have a
conflict), but
keeping it on the original node is still the most predictable. At least
you won't
make anything worse for that process.

-Andi