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 4/4] filemap: batched update mm counter,rmap when map file folio
Date: Mon, 6 Feb 2023 23:03:52 +0800 [thread overview]
Message-ID: <5d456528-ad10-4c2d-9374-54aab485fd87@intel.com> (raw)
In-Reply-To: <Y+EQDeTsT4bo2Ddx@casper.infradead.org>
On 2/6/2023 10:34 PM, Matthew Wilcox wrote:
> On Mon, Feb 06, 2023 at 10:06:39PM +0800, Yin Fengwei wrote:
>> @@ -3354,11 +3354,12 @@ static vm_fault_t filemap_map_folio_range(struct vm_fault *vmf,
>> struct file *file = vma->vm_file;
>> struct page *page = folio_page(folio, start);
>> unsigned int mmap_miss = READ_ONCE(file->f_ra.mmap_miss);
>> - unsigned int ref_count = 0, count = 0;
>> + unsigned int mapped = 0;
>> + pte_t *pte = vmf->pte;
>>
>> do {
>> if (PageHWPoison(page))
>> - continue;
>> + goto map;
>>
>> if (mmap_miss > 0)
>> mmap_miss--;
>> @@ -3368,20 +3369,34 @@ static vm_fault_t filemap_map_folio_range(struct vm_fault *vmf,
>> * handled in the specific fault path, and it'll prohibit the
>> * fault-around logic.
>> */
>> - if (!pte_none(*vmf->pte))
>> - continue;
>> + if (!pte_none(pte[mapped]))
>> + goto map;
>
> I see what you're trying to do here, but do_set_pte_range() uses the
> pte from vmf->pte. Perhaps best to save it at the beginning of the
> function and restore it at the end. ie:
>
> pte_t *old_ptep = vmf->pte;
>
> } while (vmf->pte++);
>
> vmf->pte = old_ptep;
Yes. This also works.
>
> The only other thing that bugs me about this patch is the use of
> 'mapped' as the variable name. It's in the past tense, not the future
> tense, so it gives me the wrong impression about what it's counting.
> While we could use 'tomap', that's kind of clunky. 'count' or even just
> 'i' would be better.
OK. Will use count in next version.
Regards
Yin, Fengwei
prev parent reply other threads:[~2023-02-06 15:04 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
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 [this message]
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=5d456528-ad10-4c2d-9374-54aab485fd87@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