From: John Hubbard <jhubbard@nvidia.com>
To: Alistair Popple <apopple@nvidia.com>
Cc: David Hildenbrand <david@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org, Shigeru Yoshida <syoshida@redhat.com>,
Jason Gunthorpe <jgg@nvidia.com>,
Minchan Kim <minchan@kernel.org>,
Pasha Tatashin <pasha.tatashin@soleen.com>
Subject: Re: [PATCH v2 1/2] mm/gup: stop leaking pinned pages in low memory conditions
Date: Sun, 20 Oct 2024 23:33:24 -0700 [thread overview]
Message-ID: <fc42d9bf-3460-4d85-a09d-39b5634363d4@nvidia.com> (raw)
In-Reply-To: <8734kqcr5g.fsf@nvdebian.thelocal>
On 10/20/24 3:59 PM, Alistair Popple wrote:
> John Hubbard <jhubbard@nvidia.com> writes:
>> On 10/18/24 12:47 AM, David Hildenbrand wrote:
>>> On 18.10.24 03:17, John Hubbard wrote:
> [...]
>> And actually this whole thing of "pin the pages, just for a short time, even
>> though you're not allowed to" is partly why this area is so entertaining.
>
> I'm looking at your v3 but as an aside I disagree with this
> statement. AFAIK you're always allowed to pin the pages for a short time
> (ie. !FOLL_LONGTERM), or did I misunderstand your comment?
Sort of: short term pins are allowed, but at this point in the code,
here:
pin_user_pages(FOLL_PIN | FOLL_LONGTERM)
__gup_longterm_locked()
__get_user_pages_locked(FOLL_PIN | FOLL_LONGTERM)
, just before calling check_and_migrate_movable_pages(), we have already
filtered out any cases other than (FOLL_PIN | FOLL_LONGTERM).
And that means that code has taken a *longterm* pin of presumably short
duration (this incongruity bothers me), on pages that are not actually
allowed to be long term pinned. That also feels imperfect, even though
it is supposedly short duration...except that page migration is only
sort of short...hmmm.
I'm starting to think that migrating any ZONE_MOVABLE pages away first
might be better.
Since I'm already preparing that "wait for folio refcount" idea for
migration, which is almost related, I'll take a closer look at this
idea while I'm at it.
thanks,
--
John Hubbard
next prev parent reply other threads:[~2024-10-21 6:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 1:17 [PATCH v2 0/2] " John Hubbard
2024-10-18 1:17 ` [PATCH v2 1/2] " John Hubbard
2024-10-18 7:47 ` David Hildenbrand
2024-10-18 17:46 ` John Hubbard
2024-10-20 22:59 ` Alistair Popple
2024-10-21 6:33 ` John Hubbard [this message]
2024-10-18 1:17 ` [PATCH v2 2/2] mm/gup: memfd: " John Hubbard
2024-10-18 22:13 ` [PATCH v2 0/2] mm/gup: " Andrew Morton
2024-10-18 22:16 ` John Hubbard
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=fc42d9bf-3460-4d85-a09d-39b5634363d4@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=david@redhat.com \
--cc=jgg@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=pasha.tatashin@soleen.com \
--cc=syoshida@redhat.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