From: "Yin, Fengwei" <fengwei.yin@intel.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: <david@redhat.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 22:58:09 +0800 [thread overview]
Message-ID: <c930077b-630e-71f9-b698-f741bdf24f2d@intel.com> (raw)
In-Reply-To: <Y+ESPqBnmh2OT+P7@casper.infradead.org>
On 2/6/2023 10:44 PM, Matthew Wilcox wrote:
> On Mon, Feb 06, 2023 at 10:06:38PM +0800, Yin Fengwei wrote:
>> diff --git a/include/linux/mm.h b/include/linux/mm.h
>> index d6f8f41514cc..93192f04b276 100644
>> --- a/include/linux/mm.h
>> +++ b/include/linux/mm.h
>> @@ -1162,6 +1162,9 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
>>
>> vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page);
>> void do_set_pte(struct vm_fault *vmf, struct page *page, unsigned long addr);
>> +void do_set_pte_range(struct vm_fault *vmf, struct folio *folio,
>> + unsigned long addr, pte_t *pte,
>> + unsigned long start, unsigned int nr);
>
> There are only two callers of do_set_pte(), and they're both in mm.
> I don't think we should retain do_set_pte() as a wrapper, but rather
> change both callers to call 'set_pte_range()'. The 'do' doesn't add
> any value, so let's drop that word.
OK.
>
>> + if (!cow) {
>> + folio_add_file_rmap_range(folio, start, nr, vma, false);
>> + add_mm_counter(vma->vm_mm, mm_counter_file(page), nr);
>> + } else {
>> + /*
>> + * rmap code is not ready to handle COW with anonymous
>> + * large folio yet. Capture and warn if large folio
>> + * is given.
>> + */
>> + VM_WARN_ON_FOLIO(folio_test_large(folio), folio);
>> + }
>
> 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.
>
>> + set_pte_at(vma->vm_mm, addr, pte, entry);
>> +
>> + /* no need to invalidate: a not-present page won't be cached */
>> + update_mmu_cache(vma, addr, pte);
>> + } while (pte++, page++, addr += PAGE_SIZE, --nr > 0);
>
> There's no need to speed-run this. Let's do it properly and get the
Sorry. I don't get your point here. Do you mean the pte_next()? Or other
things?
Regards
Yin, Fengwei
> arch interface right. This code isn't going to hit linux-next for four
> more weeks, which is plenty of time.
next prev parent reply other threads:[~2023-02-06 14:58 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 [this message]
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
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=c930077b-630e-71f9-b698-f741bdf24f2d@intel.com \
--to=fengwei.yin@intel.com \
--cc=dave.hansen@intel.com \
--cc=david@redhat.com \
--cc=linux-mm@kvack.org \
--cc=tim.c.chen@intel.com \
--cc=willy@infradead.org \
--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