[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZKXQVNHOB2Ddx4hN@casper.infradead.org>
Date: Wed, 5 Jul 2023 21:19:32 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Sidhartha Kumar <sidhartha.kumar@...cle.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
akpm@...ux-foundation.org
Subject: Re: [PATCH v2 3/4] mm/memory: convert do_shared_fault() to folios
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@...radead.org>
>
> Did you mean for this to be reviewed-by?
Uh, yes. Maybe I need to get more rest ...
Powered by blists - more mailing lists