linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yin Fengwei <fengwei.yin@intel.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: <linux-mm@kvack.org>, Dave Hansen <dave.hansen@intel.com>,
	"David Hildenbrand" <david@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 1/2] mm: Report success more often from filemap_map_folio_range()
Date: Wed, 20 Sep 2023 12:31:59 +0800	[thread overview]
Message-ID: <b5807ae9-0696-8c7f-22b3-c9ab39c34f00@intel.com> (raw)
In-Reply-To: <20230920035336.854212-1-willy@infradead.org>



On 9/20/23 11:53, Matthew Wilcox (Oracle) wrote:
> Even though we had successfully mapped the relevant page, we would
> rarely return success from filemap_map_folio_range().  That leads to
> falling back from the VMA lock path to the mmap_lock path, which is a
> speed & scalability issue.  Found by inspection.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Fixes: 617c28ecab22 ("filemap: batch PTE mappings")
> ---
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>

Thanks a lot for taking care of this.

Regards
Yin, Fengwei



>  mm/filemap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/filemap.c b/mm/filemap.c
> index 582f5317ff71..580d0b2b1a7c 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -3506,7 +3506,7 @@ static vm_fault_t filemap_map_folio_range(struct vm_fault *vmf,
>  		if (count) {
>  			set_pte_range(vmf, folio, page, count, addr);
>  			folio_ref_add(folio, count);
> -			if (in_range(vmf->address, addr, count))
> +			if (in_range(vmf->address, addr, count * PAGE_SIZE))
>  				ret = VM_FAULT_NOPAGE;
>  		}
>  
> @@ -3520,7 +3520,7 @@ static vm_fault_t filemap_map_folio_range(struct vm_fault *vmf,
>  	if (count) {
>  		set_pte_range(vmf, folio, page, count, addr);
>  		folio_ref_add(folio, count);
> -		if (in_range(vmf->address, addr, count))
> +		if (in_range(vmf->address, addr, count * PAGE_SIZE))
>  			ret = VM_FAULT_NOPAGE;
>  	}
>  


      parent reply	other threads:[~2023-09-20  4:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20  3:53 Matthew Wilcox (Oracle)
2023-09-20  3:53 ` [PATCH 2/2] mm: Abstract moving to the next PFN Matthew Wilcox (Oracle)
2023-09-20  4:07   ` Matthew Wilcox
2023-09-20  9:19   ` kernel test robot
2023-09-20  4:09 ` Matthew Wilcox (Oracle)
2023-09-20  4:32   ` Yin Fengwei
2023-09-20 16:52   ` Andrew Morton
2023-09-20  4:31 ` 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=b5807ae9-0696-8c7f-22b3-c9ab39c34f00@intel.com \
    --to=fengwei.yin@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=david@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=tglx@linutronix.de \
    --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