From: Mike Snitzer <snitzer@redhat.com>
To: Shao Miller <shao.miller@treefrog.ca>
Cc: dm-devel@redhat.com
Subject: Re: Shared Memory Pages for Same Base Device
Date: Mon, 22 Sep 2014 09:08:03 -0400 [thread overview]
Message-ID: <20140922130803.GA5343@redhat.com> (raw)
In-Reply-To: <541DA23F.6000003@treefrog.ca>
On Sat, Sep 20 2014 at 11:50am -0400,
Shao Miller <shao.miller@treefrog.ca> wrote:
> Good day to all.
>
> If I've some block device "base" and I've two derived device-mapper
> devices "derived1" and "derived2" that are copy-on-write layers over
> top of that base, and I mount the filesystems on those derived block
> devices and run the same program "foo" from both, does the "foo"
> running from "derived1" share any [read and execute] memory pages
> with the "foo" running from "derived2", since the underlying sectors
> are both from the same position on "base"?
>
> The more general question would be about mmap, but I hope this
> example is clear. "Docker"[1] uses device-mapper in scenarios like
> the above example and I'm curious if they benefit from shared pages.
>
> [1] https://www.docker.com/
Unfortunately device-mapper thin provisioning doesn't offer shared
pagecache pages across snapshot volumes. This is a block layer
limitation (the block layer doesn't allow pages to be shared across
block devices, and dm-thinp snapshot volumes are each a block device).
Modifying the VM, block and DM subsystems to provide this capability is
not an easy task and as such is really not a near-term priority.
Interestingly BTRFS does _not_ offer this page sharing either. I'm told
that the only emerging solution for this is overlayfs.
next prev parent reply other threads:[~2014-09-22 13:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-20 15:50 Shared Memory Pages for Same Base Device Shao Miller
2014-09-22 13:08 ` Mike Snitzer [this message]
2014-09-22 14:08 ` Shao Miller
2014-09-22 14:26 ` Mike Snitzer
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=20140922130803.GA5343@redhat.com \
--to=snitzer@redhat.com \
--cc=dm-devel@redhat.com \
--cc=shao.miller@treefrog.ca \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.