linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <cl@linux.com>
To: Mordae <mordae@anilinux.org>
Cc: linux-mm@kvack.org
Subject: Re: COW userspace memory mapping question
Date: Fri, 11 Mar 2011 09:15:42 -0600 (CST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1103110914290.18585@router.home> (raw)
In-Reply-To: <474da85b78a7bd1e16726b72e9162f5c@anilinux.org>

On Thu, 10 Mar 2011, Mordae wrote:

> On Thu, 10 Mar 2011 15:33:31 -0600 (CST), Christoph Lameter <cl@linux.com>
> wrote:
> > First establish an RW mapping of the file.
> > Then -- when you want to take the snapshot -- unmap it and do two mmaps
> to
> > the old and new location. Make both readonly and MAP_PRIVATE. That will
> > cause the kernel to create readonly pages that are subject to COW.
>
> I see, that seems reasonable. But what if I was picky and want to snapshot
> that piece of memory continuously? Let's say once in several minutes, then
> let some thread to do stuffs to the original using consistent information
> from the snapshot.

Keep the RW mapping around and tear down and repeat the MAP_PRIVATE mmaps
areas as needed? Updates would have to be done to the RW mapping.


--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-03-11 15:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08 21:38 Mordae
2011-03-10 19:13 ` Christoph Lameter
2011-03-10 21:00   ` Mordae
2011-03-10 21:33     ` Christoph Lameter
2011-03-10 22:11       ` Mordae
2011-03-11 15:15         ` Christoph Lameter [this message]
2011-03-11 16:33           ` Jan Dvorak

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=alpine.DEB.2.00.1103110914290.18585@router.home \
    --to=cl@linux.com \
    --cc=linux-mm@kvack.org \
    --cc=mordae@anilinux.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