linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Alistair Popple <apopple@nvidia.com>
Cc: linux-mm@kvack.org, jgg@nvidia.com, minchan@kernel.org,
	linux-kernel@vger.kernel.org, jhubbard@nvidia.com,
	pasha.tatashin@soleen.com, david@redhat.com
Subject: Re: [PATCH v2] mm/gup.c: Simplify and fix check_and_migrate_movable_pages() return codes
Date: Tue, 2 Aug 2022 17:12:15 -0700	[thread overview]
Message-ID: <20220802171215.3c909e1984ec345ff94af155@linux-foundation.org> (raw)
In-Reply-To: <814dee5d3aadd38c3370eaaf438ba7eee9bf9d2b.1659399696.git-series.apopple@nvidia.com>

On Tue,  2 Aug 2022 10:30:12 +1000 Alistair Popple <apopple@nvidia.com> wrote:

> When pinning pages with FOLL_LONGTERM check_and_migrate_movable_pages()
> is called to migrate pages out of zones which should not contain any
> longterm pinned pages.
> 
> When migration succeeds all pages will have been unpinned so pinning
> needs to be retried. This is indicated by returning zero. When all pages
> are in the correct zone the number of pinned pages is returned.
> 
> However migration can also fail, in which case pages are unpinned and
> -ENOMEM is returned. However if the failure was due to not being unable
> to isolate a page zero is returned. This leads to indefinite looping in
> __gup_longterm_locked().
> 
> Fix this by simplifying the return codes such that zero indicates all
> pages were successfully pinned in the correct zone while errors indicate
> either pages were migrated and pinning should be retried or that
> migration has failed and therefore the pinning operation should fail.
> 
> This fixes the indefinite looping on page isolation failure by failing
> the pin operation instead of retrying indefinitely.
> 

Are we able to identify a Fixes: for this?  Presumably something in the
series "Add MEMORY_DEVICE_COHERENT for coherent device memory mapping"?


  parent reply	other threads:[~2022-08-03  0:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02  0:30 Alistair Popple
2022-08-02 13:50 ` Jason Gunthorpe
2022-08-02 21:36 ` Pasha Tatashin
2022-08-04  0:01   ` Alistair Popple
2022-08-03  0:12 ` Andrew Morton [this message]
2022-08-04  0:12   ` Alistair Popple
2022-08-04  7:40     ` David Hildenbrand
2022-08-04  9:57       ` 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=20220802171215.3c909e1984ec345ff94af155@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=david@redhat.com \
    --cc=jgg@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