linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	akpm@linux-foundation.org
Subject: Re: [PATCH v2 3/4] mm/memory: convert do_shared_fault() to folios
Date: Wed, 5 Jul 2023 21:19:32 +0100	[thread overview]
Message-ID: <ZKXQVNHOB2Ddx4hN@casper.infradead.org> (raw)
In-Reply-To: <b6e056d7-5b35-bcfa-4661-ebeb8cffd1c4@oracle.com>

On Wed, Jul 05, 2023 at 01:16:25PM -0700, Sidhartha Kumar wrote:
> On 7/5/23 1:13 PM, Matthew Wilcox wrote:
> > On Wed, Jul 05, 2023 at 12:43:34PM -0700, Sidhartha Kumar wrote:
> > >   	/*
> > >   	 * Check if the backing address space wants to know that the page is
> > >   	 * about to become writable
> > >   	 */
> > >   	if (vma->vm_ops->page_mkwrite) {
> > > -		unlock_page(vmf->page);
> > > +		folio_unlock(folio);
> > >   		tmp = do_page_mkwrite(vmf);
> > >   		if (unlikely(!tmp ||
> > >   				(tmp & (VM_FAULT_ERROR | VM_FAULT_NOPAGE)))) {
> > > -			put_page(vmf->page);
> > > +			folio_put(folio);
> > 
> > This is _probably_ OK.  However, do_page_mkwrite() calls
> > vm_ops->page_mkwrite(), and I think it's theoretically possible for the
> > driver to replace vmf->page with a different one.  The chance of them
> > actually doing that is pretty low (particularly if they return error or
> > nopage!), but I'm going to flag it just in case it comes up.
> > 
> > Also, should we pass a folio to do_page_mkwrite() instead of having it
> > extract the folio from vmf->page?
> 
> I can take a look at doing this in a follow-up patch.
> > 
> > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> 
> Did you mean for this to be reviewed-by?

Uh, yes.  Maybe I need to get more rest ...


  reply	other threads:[~2023-07-05 20:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 19:43 [PATCH v2 1/4] mm/memory: convert do_page_mkwrite() to use folios Sidhartha Kumar
2023-07-05 19:43 ` [PATCH v2 2/4] mm/memory: convert wp_page_shared() " Sidhartha Kumar
2023-07-05 20:03   ` Matthew Wilcox
2023-07-05 19:43 ` [PATCH v2 3/4] mm/memory: convert do_shared_fault() to folios Sidhartha Kumar
2023-07-05 20:13   ` Matthew Wilcox
2023-07-05 20:16     ` Sidhartha Kumar
2023-07-05 20:19       ` Matthew Wilcox [this message]
2023-07-05 19:43 ` [PATCH v2 4/4] mm/memory: convert do_read_fault() to use folios Sidhartha Kumar
2023-07-05 20:19   ` Matthew Wilcox
2023-07-05 20:25     ` Sidhartha Kumar
2023-07-05 19:52 ` [PATCH v2 1/4] mm/memory: convert do_page_mkwrite() " Matthew Wilcox

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=ZKXQVNHOB2Ddx4hN@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sidhartha.kumar@oracle.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