Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Vito Caputo <vcaputo@pengaru.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: linux-fsdevel@vger.kernel.org, Dave Chinner <david@fromorbit.com>
Subject: [QUESTION] Sharing a `struct page` across multiple `struct address_space` instances
Date: Fri, 24 Jul 2020 17:22:21 -0700	[thread overview]
Message-ID: <20200725002221.dszdahfhqrbz43cz@shells.gnugeneration.com> (raw)

Hello folks,

I've been poking around the shmem/tmpfs code with an eye towards
adding reflink support to tmpfs.

Prior to looking at the code, conceptually I was envisioning the pages
in the reflink source inode's address_space would simply get their
refcounts bumped as they were added to the dest inode's address_space,
with some CoW flag set to prevent writes.

But there seems to be a fundamental assumption that a `struct page`
would only belong to a single `struct address_space` at a time, as it
has single `mapping` and `index` members for reverse mapping the page
to its address_space.

Am I completely lost here or does it really look like a rather
invasive modification to support this feature?

I have vague memories of Dave Chinner mentioning work towards sharing
pages across address spaces in the interests of getting reflink copies
more competitive with overlayfs in terms of page cache utilization.

Dave did you ever end up going down this path?

Regards,
Vito Caputo

             reply	other threads:[~2020-07-25  0:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-25  0:22 Vito Caputo [this message]
2020-07-25  3:11 ` Matthew Wilcox
2020-07-27 19:38   ` Vito Caputo

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=20200725002221.dszdahfhqrbz43cz@shells.gnugeneration.com \
    --to=vcaputo@pengaru.com \
    --cc=david@fromorbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [QUESTION] Sharing a `struct page` across multiple `struct address_space` instances' \
    /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

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