Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Development mailing list

Subject: Re: [hwloc-devel] Memory affinity
From: Samuel Thibault (samuel.thibault_at_[hidden])
Date: 2011-02-28 14:02:37

Jeff Squyres, le Mon 28 Feb 2011 19:54:27 +0100, a écrit :
> On Feb 28, 2011, at 12:24 PM, Bernd Kallies wrote:
> >> 1. I have no reason to doubt this person, but was wondering if someone could confirm this (for Linux).
> >
> > set_mempolicy(2) of recent 2.6 kernels says:
> > Process policy is not remembered if the page is swapped out. When such a
> > page is paged back in, it will use the policy of the process or memory
> > range that is in effect at the time the page is allocated.
> Ah, interesting. That implies two different scenarios:
> 1. I set a policy, malloc some memory, that memory gets swapped out, I change the policy, then the memory gets swapped back in. And it now obeys the new policy.
> 2. I malloc some memory and set an explicit policy with hwloc_set_area_membind*(). That memory then gets swapped out, and later gets swapped back in. Since the memory will be the same memory range, it'll keep the same policy as I set with hwloc_set_area_membind(), right?
> That would seem to imply that I should always hwloc_set_area_membind() if I want it to persist beyond any potential future swapping.
> Does that sound right?

I guess that could be right, but it definitely deserves testing before
trusting potentially-outdated documentation :)

I don't remember such kind of document details for other OSes, in any case.