linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@engr.sgi.com>
To: Paul Jackson <pj@sgi.com>
Cc: Andi Kleen <ak@suse.de>,
	kenneth.w.chen@intel.com, linux-mm@kvack.org,
	linux-ia64@vger.kernel.org
Subject: Re: [NUMA] Display and modify the memory policy of a process through /proc/<pid>/numa_policy
Date: Sat, 16 Jul 2005 18:55:13 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.62.0507161842090.26674@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20050716163030.0147b6ba.pj@sgi.com>

On Sat, 16 Jul 2005, Paul Jackson wrote:

> On the other hand, I hear him saying we can't do it, because the
> locking cannot be safely handled.

That should have been brought up earlier because the page migration 
patches by Ray always modified the policy and Andi agreed to that.

We can certainly find a way to provide proper locking for policy changes 
if there are concerns. The most trivial would to require atomic 
modifications via cmpxchg.

However, there is a fundamental issue with the application and the one who 
manages the process from the outside making changed to the policy.
 
Currently only the application can make these changes which avoids locking
issues but also restricts the usefulness of these policies since they then
cannot be used from the outside to manage the memory allocation behavior
of a process. 

If both are making changes then the outside controller may find that 
memory allocation policy suddenly changes and an application already using
libnuma may experience unexpected changes in memory policy. However, 
libnuma/numactl is used when memory areas are setup to define how the 
system should treat these memory areas. The outside management always
works with the settings already established by the application and 
modifies those. So in practice there will be little change of 
interference.

> There is also one confusion that I sometimes succumb to, reading these
> replies - between memory policies to control future allocations and
> memory policies to relocate already allocated memory.
> 
> I think between the numa calls (mbind, set_mempolicy) and cpusets,
> we have a decent array of mechanisms to control future allocations.
> The full set of features required may not be complete, but the
> framework seems to be in place, and the majority of what features we
> will need are supported now.

Correct. We could implement the changing of policies via an extension of 
the existing libnuma. That could be easily done as far as I can tell. If 
that is done then the patch that I proposed is no longer necessary. But 
then libnuma needs to also be extended to

1. Allow the discovery of the memory policies of each vma for each process 
in a system. Otherwise intelligent decisions about page migration cannot 
be made and we end up with the kernel guessing which vma's to migrate and 
we cannot control migration of the text segments separately from the data 
segment etc.

2. Add a function call to migrate pages in a particular vma to another 
node. I.e.

sys_page_migrate(pid, address, from-node, to_node, nr-pages)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2005-07-17  1:55 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-15  1:39 Christoph Lameter
2005-07-15  3:50 ` Paul Jackson
2005-07-15  4:52 ` Chen, Kenneth W
2005-07-15  5:07   ` Christoph Lameter
2005-07-15  5:55     ` Chen, Kenneth W
2005-07-15  6:05     ` Paul Jackson
2005-07-15 11:46       ` Andi Kleen
2005-07-15 16:06       ` Christoph Lameter
2005-07-15 21:04         ` Paul Jackson
2005-07-15 21:12           ` Andi Kleen
2005-07-15 21:20             ` Christoph Lameter
2005-07-15 21:47               ` Andi Kleen
2005-07-15 21:55                 ` Christoph Lameter
2005-07-15 22:07                   ` Andi Kleen
2005-07-15 22:30                     ` Christoph Lameter
2005-07-15 22:37                       ` Andi Kleen
2005-07-15 22:49                         ` Christoph Lameter
2005-07-15 22:56                           ` Andi Kleen
2005-07-15 23:11                             ` Christoph Lameter
2005-07-15 23:44                               ` Andi Kleen
2005-07-15 23:56                                 ` Christoph Lameter
2005-07-16  2:01                                   ` Andi Kleen
2005-07-16 15:14                                     ` Christoph Lameter
2005-07-16 22:39                                       ` Paul Jackson
2005-07-16 23:30                                     ` Paul Jackson
2005-07-17  1:55                                       ` Christoph Lameter [this message]
2005-07-17  3:50                                         ` Paul Jackson
2005-07-17  5:56                                           ` Christoph Lameter
2005-07-17  7:22                                             ` Paul Jackson
2005-07-17  3:21                                       ` Christoph Lameter
2005-07-17  4:51                                         ` Paul Jackson
2005-07-17  6:00                                           ` Christoph Lameter
2005-07-17  8:17                                             ` Paul Jackson
2005-07-16  0:00                                 ` David Singleton
2005-07-16  0:16                                 ` Steve Neuner

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=Pine.LNX.4.62.0507161842090.26674@schroedinger.engr.sgi.com \
    --to=clameter@engr.sgi.com \
    --cc=ak@suse.de \
    --cc=kenneth.w.chen@intel.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pj@sgi.com \
    /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