All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Popple <apopple@nvidia.com>
To: <akpm@linux-foundation.org>, Matthew Wilcox <willy@infradead.org>
Cc: <dhowells@redhat.com>, <hughd@google.com>, <jgg@nvidia.com>,
	<jglisse@redhat.com>, <jhubbard@nvidia.com>,
	<mm-commits@vger.kernel.org>, <rcampbell@nvidia.com>
Subject: Re: + mm-migratec-rework-migration_entry_wait-to-not-take-a-pageref.patch added to -mm tree
Date: Mon, 13 Dec 2021 22:30:55 +1100	[thread overview]
Message-ID: <2420988.TeagO0yf0P@nvdebian> (raw)
In-Reply-To: <YbQqXKrwVtr+HRLe@casper.infradead.org>

On Saturday, 11 December 2021 3:34:36 PM AEDT Matthew Wilcox wrote:
> On Thu, Nov 18, 2021 at 01:54:27PM -0800, akpm@linux-foundation.org wrote:
> > +++ a/mm/migrate.c
> > @@ -305,15 +305,7 @@ void __migration_entry_wait(struct mm_st
> >  	page = pfn_swap_entry_to_page(entry);
> >  	page = compound_head(page);
> >  
> > -	/*
> > -	 * Once page cache replacement of page migration started, page_count
> > -	 * is zero; but we must not call put_and_wait_on_page_locked() without
> > -	 * a ref. Use get_page_unless_zero(), and just fault again if it fails.
> > -	 */
> > -	if (!get_page_unless_zero(page))
> > -		goto out;
> > -	pte_unmap_unlock(ptep, ptl);
> > -	put_and_wait_on_page_locked(page, TASK_UNINTERRUPTIBLE);
> > +	migration_entry_wait_on_locked(page_folio(page), ptep, ptl);
> 
> This is clearly bogus.  The 'page = compound_head(page)' line should
> be deleted.
> 
> But I think we should go further and turn this into:
> 
> 	migration_entry_wait_on_locked(entry, ptep, ptl);
> 
> Neither caller has anything useful to do with the page any more.

Thanks for spotting that, I have posted a new version which does that.




      reply	other threads:[~2021-12-13 11:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18 21:54 + mm-migratec-rework-migration_entry_wait-to-not-take-a-pageref.patch added to -mm tree akpm
2021-12-11  4:34 ` Matthew Wilcox
2021-12-13 11:30   ` Alistair Popple [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=2420988.TeagO0yf0P@nvdebian \
    --to=apopple@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=hughd@google.com \
    --cc=jgg@nvidia.com \
    --cc=jglisse@redhat.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=rcampbell@nvidia.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.