linux-numa.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Serge Ayoun <serge.ayoun@gmail.com>
To: linux-numa@vger.kernel.org
Subject: Several calls to set_mempolicy and heap consistency
Date: Thu, 8 Jun 2017 17:05:43 +0300	[thread overview]
Message-ID: <CAF4-xDgmjwru24+zgKwr02cYVbK1Mg0-CYMMMZj5BjQiFQi3ow@mail.gmail.com> (raw)

We are trying to understand the usage model with numa in order to see
how SGX technology can cope with NUMA and we have a few points that
are not clear. Maybe someone can put some light:

Imagine (for example) that someone calls set_mempolicy(node=1) on say
thread t1. And calls set_mempolicy(node=2) on thread t2.

Any subsequent allocations made on thread t1 will come from node 1 -
agreed. But then if those buffers are freed back to the heap and
thread t2 calls alloc(), can the same buffer (just freed by t1) be
returned to t2 by the heap? In short how does the heap ensure
consistency of the policies across threads? Is their extra code
required in the heap manager in order to be NUMA compliant.

Second question: suppose t1 calls set_mempolicy(node=1) at some time=0
and calls set_mempolicy(node=2) at time=100. Again buffers being
released back to the heap between time 0 and 100 are all from node 1
and potentially can be used for allocation after time 100; i.e. those
allocations will not be consistent with the policy set at time 100.
The question is about how those conflicts are being resolved, special
heap manager / rules about using the NUMA apis / others?

Thanks in advance,
Serge

                 reply	other threads:[~2017-06-08 14:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAF4-xDgmjwru24+zgKwr02cYVbK1Mg0-CYMMMZj5BjQiFQi3ow@mail.gmail.com \
    --to=serge.ayoun@gmail.com \
    --cc=linux-numa@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).