linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: colpatch@us.ibm.com
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, LSE <lse-tech@lists.sourceforge.net>,
	Andrew Morton <akpm@zip.com.au>,
	Martin Bligh <mjbligh@us.ibm.com>,
	Michael Hohnbaum <hohnbaum@us.ibm.com>
Subject: Re: [rfc][patch] Memory Binding API v0.3 2.5.41
Date: 15 Oct 2002 11:21:26 -0600	[thread overview]
Message-ID: <m1y98z39ex.fsf@frodo.biederman.org> (raw)
In-Reply-To: <3DAB5DF2.5000002@us.ibm.com>

Matthew Dobson <colpatch@us.ibm.com> writes:

> Eric W. Biederman wrote:
> > Matthew Dobson <colpatch@us.ibm.com> writes:
> >>Greetings & Salutations,
> >>	Here's a wonderful patch that I know you're all dying for...  Memory
> >>Binding!  It works just like CPU Affinity (binding) except that it binds a
> >>processes memory allocations (just buddy allocator for now) to specific memory
> 
> >>blocks.
> > Due we want this per numa area or simply per zone?  My suspicion is that
> > internally at least we want this per zone.
> I think that per memory block is better. 
[snip]
> I'm not fanatically
> opposed to per zone binding, though, and if there is a general agreement that it
> would be better that way, I don't think it would be unreasonably difficult to
> change it.

My only feeling with zones is that it could be useful in the non numa cases,
if it was per zone. 

But unless this API becomes is a pure hint we need at least one specifier that 
says writing to swap is o.k.

> > The API doesn't make much sense at the moment.
> Hmm..  That is unfortunate, I'd aimed to make it as simple as possible.

Simple is good only if the proper pieces are connected.
 
> > 1) You are operating on tasks and not mm's, or preferably vmas.
> Correct.  There are plans (somewhere inside my cranium) to allow binding at that
> 
> granularity.  For now, per task seemed an appropriate level.

It makes it terribly unpredictable.  If you have two threads each bound
to a different location there are race conditions which area the memory
is allocated from.  

> > 2) sys_mem_setbinding does not move the mm to the new binding.
> Also correct.  A task may wish to allocate several large data structures from
> one memory area, rebind, do more allocations, rebind, ad nauseum. There are
> plans to have a flag that, if set, would force relocation of all currently
> allocated memory.

Actually the bindings need to stick to the vma or to the struct address_space.
Otherwise you are talking about an allocation hint, as swapping can trivially
undue it and nothing happens when the actual call is made.  A hint is a very
different thing from a binding.

And if we stick this to struct address_space for the non anonymous cases
having a fmem_setbinding(struct fd) that works on files would be a useful
thing as well.

> > 5) mprotect is the more natural model rather than set_cpu_affinity.
> Well, I think that may be true for the API you are imagining (per zone, per
> mm/vma, etc), not the one that I've written.

For a binding with respect to memory I imagine things like mlock().  For
anything else you are talking a future hint to the memory allocators, which
feels less much useful.

Eric

      parent reply	other threads:[~2002-10-15 17:17 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-10  1:12 [rfc][patch] Memory Binding API v0.3 2.5.41 Matthew Dobson
2002-10-10  3:05 ` Andrew Morton
2002-10-10 18:29   ` Matthew Dobson
2002-10-10  4:06 ` Martin J. Bligh
2002-10-10 18:43   ` Matthew Dobson
2002-10-10  9:00 ` Arjan van de Ven
2002-10-10 18:55   ` Matthew Dobson
2002-10-10 10:06 ` Arjan van de Ven
2002-10-10 11:22   ` Alan Cox
2002-10-10 11:28     ` William Lee Irwin III
2002-10-10 19:09       ` Matthew Dobson
2002-10-10 19:06     ` Matthew Dobson
2002-10-10 19:01   ` Matthew Dobson
2002-10-13 22:22 ` Eric W. Biederman
2002-10-15  0:14   ` Matthew Dobson
2002-10-15  0:20     ` Martin J. Bligh
2002-10-15  0:38       ` Matthew Dobson
2002-10-15  0:43         ` Martin J. Bligh
2002-10-15  0:51           ` Matthew Dobson
2002-10-15  0:58             ` William Lee Irwin III
2002-10-15  0:55         ` [Lse-tech] " john stultz
2002-10-15  1:08           ` Martin J. Bligh
2002-10-15  1:20             ` William Lee Irwin III
2002-10-15  1:29               ` Martin J. Bligh
2002-10-15  1:40                 ` William Lee Irwin III
2002-10-15  1:57                   ` William Lee Irwin III
2002-10-15  1:08           ` William Lee Irwin III
2002-10-15  1:16             ` Martin J. Bligh
2002-10-15 17:21     ` Eric W. Biederman [this message]

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=m1y98z39ex.fsf@frodo.biederman.org \
    --to=ebiederm@xmission.com \
    --cc=akpm@zip.com.au \
    --cc=colpatch@us.ibm.com \
    --cc=hohnbaum@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lse-tech@lists.sourceforge.net \
    --cc=mjbligh@us.ibm.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;
as well as URLs for NNTP newsgroup(s).