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:43:54 +0000 [thread overview]
Message-ID: <Y+EuSovF+92VvmB3@casper.infradead.org> (raw)
In-Reply-To: <400c5fb6-11ae-7771-07e0-538ebe652b2a@redhat.com>
On Mon, Feb 06, 2023 at 05:35:55PM +0100, David Hildenbrand wrote:
> On 06.02.23 17:33, Matthew Wilcox wrote:
> > 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>
>
> And that's precisely what I want to have fenced off here. I want that
> function to complain instead of silently doing the wrong thing.
If this were a widely called function, I'd agree. But there are two
callers of do_set_pte; one in filemap.c and one in memory.c. It's
overcautious and has created huge churn in this patchset. If you're
really that concerned, stick a VM_BUG_ON() in folio_add_new_anon_rmap()
instead of making weird stuff happen in set_pte_range().
next prev parent reply other threads:[~2023-02-06 16:44 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
2023-02-06 16:35 ` David Hildenbrand
2023-02-06 16:43 ` Matthew Wilcox [this message]
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+EuSovF+92VvmB3@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