linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Alistair Popple <apopple@nvidia.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/filemap.c: Update comments in filemap_fault()
Date: Fri, 3 Jun 2022 13:44:44 +0100	[thread overview]
Message-ID: <YpoCPIdsDrBLdIsV@casper.infradead.org> (raw)
In-Reply-To: <20220603071233.2296100-1-apopple@nvidia.com>

On Fri, Jun 03, 2022 at 05:12:33PM +1000, Alistair Popple wrote:
> +++ b/mm/filemap.c
> @@ -3168,8 +3168,9 @@ vm_fault_t filemap_fault(struct vm_fault *vmf)
>  	VM_BUG_ON_FOLIO(!folio_contains(folio, index), folio);
>  
>  	/*
> -	 * We have a locked page in the page cache, now we need to check
> -	 * that it's up-to-date. If not, it is going to be due to an error.
> +	 * We have a locked page in the page cache. Check that it's up-to-date.
> +	 * If not it is because there was no page in the page cache (only likely
> +	 * in the case of MADV_RANDOM) or due to error.

The comment is correct, but the code is buggy!

We should be calling page_cache_ra_order() in do_sync_mmap_readahead(),
even if VM_RAND_READ is set (or !ra_pages, or mmap_miss is high).
At least for one page.  That would allow us to drop the FGP_FOR_MMAP
flag as page_cache_ra_order() will instantiate a folio for us.

Do you want to write that patch or should I do it?


  reply	other threads:[~2022-06-03 12:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03  7:12 Alistair Popple
2022-06-03 12:44 ` Matthew Wilcox [this message]
2022-06-03 12:55   ` Alistair Popple

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=YpoCPIdsDrBLdIsV@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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