linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
To: Andi Kleen <ak@suse.de>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
	nish.aravamudan@gmail.com, clameter@sgi.com
Subject: Re: [PATCH/RFC 0/8] Mapped File Policy Overview
Date: Thu, 24 May 2007 17:05:44 -0400	[thread overview]
Message-ID: <1180040744.5327.110.camel@localhost> (raw)
In-Reply-To: <200705242241.35373.ak@suse.de>

On Thu, 2007-05-24 at 22:41 +0200, Andi Kleen wrote:
> > 
> > Basic "problem":  currently [~2.6.21], files mmap()ed SHARED
> > do not follow mem policy applied to the mapped regions.  Instead, 
> > shared, file backed pages are allocated using the allocating
> > tasks' task policy.  This is inconsistent with the way that anon
> > and shmem pages are handled, violating, for me, the Principle
> > of Least Astonishment.
> 
> Do you have some specific use cases? Did this actually improve
> some application significantly? 

Same use cases for using mbind() at all.  I want to specify the
placement of memory backing any of my address space.  A shared mapping
of a regular file is, IMO, morally equivalent to a shared memory region,
with the added semantic that is it automatically initialized from the
file contents, and any changes persist after the file is closed.  [One
related semantic that Linux is missing is to initialize the shared
mapping from the file, but not writeback any changes--e.g.,
MAP_NOWRITEBACK.  Some "enterprise unix" support this, presumably at
ISV/customer request.]

> 
> The main basic issue is that it seems weird semantics to have the policy randomly
> disappear when everybody closes the file depending on whether the system
> decides to flush the inode or not. But using EAs or similar
> also looked like overkill.

IMO, it's also weird that the system ignores my mbind()s on regular
files mmap()ed shared, or just because I only do read accesses
[admittedly I don't address the latter "feature"].  It seems like a
fundamental correctness issue to me.  I guess I'm just used to
applications [and language run time environments] that evaluate the
topology of the system, or subset thereof, that they're running on and
mbind() all of the components of the address space accordingly.

I have a more difficult time envisioning a use for policies stored with
the file, except in the case of embedded or other fixed hardware
configurations where you can determine a priori how you want your memory
placed, and don't want to have to add the binding into each application.
I believe that this is the use case that Steve Longerbeam had in mind a
few years ago when he proposed this.  As I responded to Christoph, if we
want to store policy with the file itself and have it automatically
installed when the file is opened or mmap'd, we'd need such a mechanism
as I propose below it.

Lee

--
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:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-05-24 21:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-24 17:28 Lee Schermerhorn
2007-05-24 17:28 ` [PATCH/RFC 1/8] Mapped File Policy: move shared policy to inode/mapping Lee Schermerhorn
2007-05-24 17:28 ` [PATCH/RFC 2/8] Mapped File Policy: allocate shared policies as needed Lee Schermerhorn
2007-05-24 17:28 ` [PATCH/RFC 3/8] Mapped File Policy: let vma policy ops handle sub-vma policies Lee Schermerhorn
2007-05-24 17:28 ` [PATCH/RFC 4/8] Mapped File Policy: add generic file set/get policy vm ops Lee Schermerhorn
2007-05-24 17:28 ` [PATCH/RFC 5/8] Mapped File Policy: Factor alloc_page_pol routine Lee Schermerhorn
2007-05-24 17:29 ` [PATCH/RFC 6/8] Mapped File Policy: use file policy for page cache allocations Lee Schermerhorn
2007-05-24 17:29 ` [PATCH/RFC 7/8] Mapped File Policy: fix migration of private mappings Lee Schermerhorn
2007-05-24 17:29 ` [PATCH/RFC 8/8] Mapped File Policy: fix show_numa_maps() Lee Schermerhorn
2007-05-24 19:24 ` [PATCH/RFC 0/8] Mapped File Policy Overview Christoph Lameter
2007-05-24 20:46   ` Lee Schermerhorn
2007-05-24 20:41 ` Andi Kleen
2007-05-24 21:05   ` Lee Schermerhorn [this message]
2007-05-24 21:17     ` Christoph Lameter
2007-05-25 14:55       ` Lee Schermerhorn
2007-05-25 15:25         ` Christoph Lameter
2007-05-25 16:06           ` Lee Schermerhorn
2007-05-25 16:24             ` Christoph Lameter
2007-05-25 17:37               ` Lee Schermerhorn
2007-05-25 19:10                 ` Christoph Lameter
2007-05-25 21:12                   ` Lee Schermerhorn
2007-05-25 21:43                     ` Christoph Lameter
2007-05-25 21:01                 ` Andi Kleen
2007-05-25 21:41                   ` Lee Schermerhorn
2007-05-25 21:46                     ` Christoph Lameter
2007-05-29 13:57                       ` Lee Schermerhorn
2007-05-25 21:03           ` Andi Kleen
2007-05-25 21:14             ` Lee Schermerhorn
2007-05-25 22:44               ` Andi Kleen
2007-05-29 14:17                 ` Lee Schermerhorn

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=1180040744.5327.110.camel@localhost \
    --to=lee.schermerhorn@hp.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=linux-mm@kvack.org \
    --cc=nish.aravamudan@gmail.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