linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Alistair Popple <apopple@nvidia.com>
Cc: akpm@linux-foundation.org, minchan@kernel.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	jhubbard@nvidia.com, pasha.tatashin@soleen.com
Subject: Re: [PATCH] mm/gup.c: Simplify and fix check_and_migrate_movable_pages() return codes
Date: Tue, 2 Aug 2022 09:21:08 -0300	[thread overview]
Message-ID: <YukWtNwRvOPh6jmM@nvidia.com> (raw)
In-Reply-To: <87wnbsd6yp.fsf@nvdebian.thelocal>

On Mon, Aug 01, 2022 at 12:18:53PM +1000, Alistair Popple wrote:

> > AFAICT there is no reason to 'continue' in most of these paths since
> > we intend to return to userspace with an error anyhow? Why try to
> > isolate more pages?
> 
> The main reason would be if callers want to retry the operation. AFAIK
> isolate_folio_lru() can have transient failures, so if callers want to
> retry it makes sense to isolate and migrate as many pages as possible
> rather than one page at a time as subsequent retries may find different
> pages that can't be isolated.

Except we don't try to do the migrate, we just isolate and then
unisolate and return failure.

> Actually I should have called this out more clearly - the previous
> behaviour on isolation failure was to retry indefinitely which is what
> lead to looping in the kernel. This patch turns isolation failure into
> an error and doesn't retry. I wonder though if we need to maintain a
> retry count similar to what migrate_pages() does if there are unexpected
> page refs?

This makes more sense, exporting this mess to the caller and hoping
they retry (they won't) doesn't make sense..

Jason


  parent reply	other threads:[~2022-08-02 12:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29  2:46 Alistair Popple
2022-07-29 19:44 ` Jason Gunthorpe
2022-07-29 21:22   ` John Hubbard
2022-08-01  2:38     ` Alistair Popple
2022-08-01  2:18   ` Alistair Popple
2022-08-01  2:46     ` Alistair Popple
2022-08-02 12:21     ` Jason Gunthorpe [this message]
2022-08-02 12:52       ` 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=YukWtNwRvOPh6jmM@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=pasha.tatashin@soleen.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