From: Vincent Donnefort <vdonnefort@google.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: maz@kernel.org, oliver.upton@linux.dev, kvmarm@lists.linux.dev,
linux-arm-kernel@lists.infradead.org, kernel-team@android.com,
will@kernel.org
Subject: Re: [PATCH v1 1/2] KVM: arm64: Do not transfer page refcount for THP adjustment
Date: Wed, 27 Sep 2023 13:40:42 +0100 [thread overview]
Message-ID: <ZRQiypIrEVFAo_3Y@google.com> (raw)
In-Reply-To: <ZRPTDJwcImUTHbm+@casper.infradead.org>
On Wed, Sep 27, 2023 at 08:00:28AM +0100, Matthew Wilcox wrote:
> On Tue, Sep 26, 2023 at 07:19:31PM +0100, Vincent Donnefort wrote:
> > With folios, GUP affects a refcount common to all pages forming the THP.
> > There is therefore no need to move the refcount from the tail to the
> > head page. Under the hood it decrements and increments
> > the same counter.
>
> FYI, this isn't new to folios. get_page() has _always_ operated on the
> head page of a compound page. Here's how it worked in 2.6.12-rc2:
>
> +static inline void get_page(struct page *page)
> +{
> + if (unlikely(PageCompound(page)))
> + page = (struct page *)page->private;
> + atomic_inc(&page->_count);
> +}
>
> I can't be bothered to switch over to the linux-fullhistory tree and
> show how it evolved, because i think this sufficiently makes the point --
> you can backport this patch as far as you like.
Thanks for having a look!
I'll refine that description in the next version.
>
> Folios just make it obvious that this is what's going on. And that's a
> good thing! Making the MM less inscrutable is a win for everybody.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-09-27 12:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 18:19 [PATCH v1 0/2] KVM: arm64: Use folio for THP support Vincent Donnefort
2023-09-26 18:19 ` [PATCH v1 1/2] KVM: arm64: Do not transfer page refcount for THP adjustment Vincent Donnefort
2023-09-27 7:00 ` Matthew Wilcox
2023-09-27 12:40 ` Vincent Donnefort [this message]
2023-09-26 18:19 ` [PATCH v1 2/2] KVM: arm64: Use folio " Vincent Donnefort
2023-09-27 6:30 ` [PATCH v1 0/2] KVM: arm64: Use folio for THP support Oliver Upton
2023-09-27 12:39 ` Vincent Donnefort
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=ZRQiypIrEVFAo_3Y@google.com \
--to=vdonnefort@google.com \
--cc=kernel-team@android.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=will@kernel.org \
--cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).