From: Catalin Marinas <catalin.marinas@arm.com>
To: Peter Collingbourne <pcc@google.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
Andrew Morton <akpm@linux-foundation.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Evgenii Stepanov <eugenis@google.com>,
linux-mm@kvack.org
Subject: Re: [PATCH] mm: introduce reference pages
Date: Tue, 4 Aug 2020 16:27:50 +0100 [thread overview]
Message-ID: <20200804152749.GE31076@gaia> (raw)
In-Reply-To: <CAMn1gO54gTG5f1dVfZHAaXWJRWeOe8BwTAvbk376_pjzcLYRSQ@mail.gmail.com>
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.
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: Peter Collingbourne <pcc@google.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
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 16:27:50 +0100 [thread overview]
Message-ID: <20200804152749.GE31076@gaia> (raw)
In-Reply-To: <CAMn1gO54gTG5f1dVfZHAaXWJRWeOe8BwTAvbk376_pjzcLYRSQ@mail.gmail.com>
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.
--
Catalin
next prev parent reply other threads:[~2020-08-04 15:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-31 20:32 [PATCH] mm: introduce reference pages Peter Collingbourne
2020-07-31 20:32 ` Peter Collingbourne
2020-08-03 3:28 ` John Hubbard
2020-08-03 3:28 ` John Hubbard
2020-08-03 3:51 ` Matthew Wilcox
2020-08-03 3:51 ` Matthew Wilcox
2020-08-13 22:03 ` Peter Collingbourne
2020-08-13 22:03 ` Peter Collingbourne
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 9:32 ` Kirill A. Shutemov
2020-08-03 12:01 ` Catalin Marinas
2020-08-03 12:01 ` Catalin Marinas
2020-08-04 0:50 ` Peter Collingbourne
2020-08-04 0:50 ` Peter Collingbourne
2020-08-04 15:27 ` Catalin Marinas [this message]
2020-08-04 15:27 ` Catalin Marinas
2020-08-04 15:48 ` Kirill A. Shutemov
2020-08-04 15:48 ` Kirill A. Shutemov
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=20200804152749.GE31076@gaia \
--to=catalin.marinas@arm.com \
--cc=akpm@linux-foundation.org \
--cc=eugenis@google.com \
--cc=kirill@shutemov.name \
--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 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.