From: Matthew Wilcox <willy@infradead.org>
To: David Hildenbrand <david@redhat.com>
Cc: "Yin, Fengwei" <fengwei.yin@intel.com>,
linux-mm@kvack.org, dave.hansen@intel.com, tim.c.chen@intel.com,
ying.huang@intel.com
Subject: Re: [RFC PATCH v4 3/4] mm: add do_set_pte_range()
Date: Mon, 6 Feb 2023 16:33:04 +0000 [thread overview]
Message-ID: <Y+ErwKQBeU5esU+9@casper.infradead.org> (raw)
In-Reply-To: <7c8d3d2c-35e3-5be4-684b-4b991a0adb8e@redhat.com>
On Mon, Feb 06, 2023 at 04:13:44PM +0100, David Hildenbrand wrote:
> > > The handling of cow pages is still very clunky.
> > > folio_add_new_anon_rmap() handles anonymous large folios just fine. I
> > > think David was looking at current code, not the code in mm-next.
> > OK. Let's wait for further comment from David.
>
> As I raised, page_add_new_anon_rmap() -> folio_add_new_anon_rmap() can be
> used to add a fresh (a) PMD-mapped THP or (b) order-0 folio.
>
> folio_add_new_anon_rmap() is not suitable for PTE-mapping a large folio.
> Which is what we are intending to do here unless I am completely off.
I think you are. While the infrastructure here handles large folios
which are not PMDs, there's nobody who will allocate such a thing, so
there is no problem. Right>
> PTE-mapping a large folio requires different accounting, different mapcount
> handling and different PG_anon_exclusive handling.
>
> Which is all not there yet.
Assuming you mean "a large folio which is not PMD sized", I agree. But we
haven't even started discussing how we should decide to allocate folios
which are not 0 or PMD order yet, so this worry seems premature. When we
have figured that out, it'll be time to look at folio_add_new_anon_rmap()
to decide how to support it, but hopefully before then we'll have a
better way of handling mapcount.
next prev parent reply other threads:[~2023-02-06 16:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 14:06 [RFC PATCH v4 0/4] folio based filemap_map_pages() Yin Fengwei
2023-02-06 14:06 ` [RFC PATCH v4 1/4] filemap: add function filemap_map_folio_range() Yin Fengwei
2023-02-06 14:06 ` [RFC PATCH v4 2/4] rmap: add folio_add_file_rmap_range() Yin Fengwei
2023-02-06 14:06 ` [RFC PATCH v4 3/4] mm: add do_set_pte_range() Yin Fengwei
2023-02-06 14:44 ` Matthew Wilcox
2023-02-06 14:58 ` Yin, Fengwei
2023-02-06 15:13 ` David Hildenbrand
2023-02-06 16:33 ` Matthew Wilcox [this message]
2023-02-06 16:35 ` David Hildenbrand
2023-02-06 16:43 ` Matthew Wilcox
2023-02-06 16:49 ` David Hildenbrand
2023-02-06 17:10 ` Matthew Wilcox
2023-02-06 17:35 ` David Hildenbrand
2023-02-07 6:05 ` Yin, Fengwei
2023-02-06 14:06 ` [RFC PATCH v4 4/4] filemap: batched update mm counter,rmap when map file folio Yin Fengwei
2023-02-06 14:34 ` Matthew Wilcox
2023-02-06 15:03 ` Yin, Fengwei
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=Y+ErwKQBeU5esU+9@casper.infradead.org \
--to=willy@infradead.org \
--cc=dave.hansen@intel.com \
--cc=david@redhat.com \
--cc=fengwei.yin@intel.com \
--cc=linux-mm@kvack.org \
--cc=tim.c.chen@intel.com \
--cc=ying.huang@intel.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