linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: George Spelvin <linux@sciencehorizons.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	linux-mm <linux-mm@kvack.org>,
	Mel Gorman <mgorman@techsingularity.net>,
	Rik van Riel <riel@surriel.com>
Subject: Re: A use case for MAP_COPY
Date: Thu, 5 Jan 2017 14:49:58 -0800	[thread overview]
Message-ID: <CA+55aFyZtmjsaE_g6TXoqwhBUL-gtt53ARGmpU8eFFZ0wNWDbg@mail.gmail.com> (raw)
In-Reply-To: <20170105211056.18340.qmail@ns.sciencehorizons.net>

On Thu, Jan 5, 2017 at 1:10 PM, George Spelvin
<linux@sciencehorizons.net> wrote:
>
>> Not going to happen.
>
> Really?  Because the rest of your response is a lot more encouraging.

The thing is, I don't think you can do it with a reasonable patch. It
just gets too nasty.

For example, what happens when there is low memory? What you would
*want* to happen is to just forget the page and read it back in.
That/s how MAP_PRIVATE works. But that won't actually work for
MAP_COPY. You'd need to page the thing out, as if you had written to
it (even though you didn't). Not because you want to, but because your
versioning scheme depends on it.

So how are y ou going to solve that versioning probnlem wrt memory
pressure? The whole point of MAP_COPY is to avoid a memory copy, but
if you now end up having to do IO, and having to have a swap device
for it, it's completely unacceptable. See?

How are you going to avoid the issues with growing 'struct page'?

So the fact is, it's a horrible idea. I don't think you understand how
horrible it is. The only way you'll understand is if you try to write
the patch.

"Siperia opettaa".

So you can try to prove me wrong by sending a patch. I doubt you will.

                  Linus

--
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>

  parent reply	other threads:[~2017-01-05 22:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05  6:37 George Spelvin
2017-01-05 18:59 ` Linus Torvalds
2017-01-05 21:10   ` George Spelvin
2017-01-05 22:14     ` Kirill A. Shutemov
2017-01-05 22:49     ` Linus Torvalds [this message]
2017-01-06  1:08       ` George Spelvin

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=CA+55aFyZtmjsaE_g6TXoqwhBUL-gtt53ARGmpU8eFFZ0wNWDbg@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-mm@kvack.org \
    --cc=linux@sciencehorizons.net \
    --cc=mgorman@techsingularity.net \
    --cc=riel@surriel.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