linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Peter Collingbourne <pcc@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Evgenii Stepanov <eugenis@google.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm: introduce reference pages
Date: Tue, 4 Aug 2020 18:48:04 +0300	[thread overview]
Message-ID: <20200804154804.hm5bglb7nrmzoxky@box> (raw)
In-Reply-To: <20200804152749.GE31076@gaia>

On Tue, Aug 04, 2020 at 04:27:50PM +0100, Catalin Marinas wrote:
> On Mon, Aug 03, 2020 at 05:50:32PM -0700, Peter Collingbourne wrote:
> > On Mon, Aug 3, 2020 at 5:01 AM Catalin Marinas <catalin.marinas@arm.com> wrote:
> > > I think this would work even for the arm64 MTE (though I haven't tried):
> > > use memfd_create() to get such file descriptor, mmap() it as MAP_SHARED
> > > to populate the initial pattern, mmap() it as MAP_PRIVATE for any
> > > subsequent mapping that needs to be copied-on-write.
> > 
> > That would require a separate mmap() (i.e. separate VMA) for each
> > page, no? That sounds like it could be expensive both in terms of VMAs
> > and the number of mmap syscalls required (i.e. N/PAGE_SIZE). You could
> > decrease these costs by increasing the size of the memfd files to more
> > than a page, but that would also increase the amount of memory
> > required for the reference pages.
> 
> I think I get it now. You'd like a multiple page mmap() to be covered by
> a single reference page. The memfd trick wouldn't give you this without
> multiple mmap() calls, one for each page.

That's why I suggested a special file descriptor that would give the same
page on any access. We can piggy back on memfd infrastrucure or create a
new interface.

-- 
 Kirill A. Shutemov


      reply	other threads:[~2020-08-04 15:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31 20:32 Peter Collingbourne
2020-08-03  3:28 ` John Hubbard
2020-08-03  3:51   ` Matthew Wilcox
2020-08-13 22:03     ` Peter Collingbourne
2020-08-13 22:03   ` Peter Collingbourne
2020-08-03  9:32 ` Kirill A. Shutemov
2020-08-03 12:01   ` Catalin Marinas
2020-08-04  0:50     ` Peter Collingbourne
2020-08-04 15:27       ` Catalin Marinas
2020-08-04 15:48         ` Kirill A. Shutemov [this message]

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=20200804154804.hm5bglb7nrmzoxky@box \
    --to=kirill@shutemov.name \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=eugenis@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=pcc@google.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