From: John Hubbard <jhubbard@nvidia.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
Alistair Popple <apopple@nvidia.com>,
"Arnd Bergmann" <arnd@arndb.de>,
Christoph Hellwig <hch@infradead.org>,
"Daniel Vetter" <daniel.vetter@ffwll.ch>,
Dave Airlie <airlied@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
Dongwon Kim <dongwon.kim@intel.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
Hugh Dickins <hughd@google.com>,
"Jason Gunthorpe" <jgg@nvidia.com>,
Junxiao Chang <junxiao.chang@intel.com>,
"Mike Kravetz" <mike.kravetz@oracle.com>,
Minchan Kim <minchan@kernel.org>,
"Oscar Salvador" <osalvador@suse.de>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
Peter Xu <peterx@redhat.com>,
Shigeru Yoshida <syoshida@redhat.com>,
"Vivek Kasireddy" <vivek.kasireddy@intel.com>
Subject: Re: [PATCH v2 0/2] mm/gup: stop leaking pinned pages in low memory conditions
Date: Fri, 18 Oct 2024 15:16:02 -0700 [thread overview]
Message-ID: <691ae680-b8c0-400e-b2ad-f3d43057f350@nvidia.com> (raw)
In-Reply-To: <20241018151322.6dd3e6ccbbe73599f70179d4@linux-foundation.org>
On 10/18/24 3:13 PM, Andrew Morton wrote:
> On Thu, 17 Oct 2024 18:17:09 -0700 John Hubbard <jhubbard@nvidia.com> wrote:
>
> I added cc:stable to both of these. Which might be inappropriate since
> "patch #2 is not really required".
Right.
>
>> mm/gup: stop leaking pinned pages in low memory conditions
>
> Fixes: 24a95998e9ba ("mm/gup.c: simplify and fix check_and_migrate_movable_pages() return codes")
>
> In mainline since v6.1!
>
>> mm/gup: memfd: stop leaking pinned pages in low memory conditions
>
> Fixes: 89c1905d9c14 ("mm/gup: introduce memfd_pin_folios() for pinning memfd folios")
>
> Since v6.11.
>
>
> So these are quite independent fixes. Kernels 6.1.x ... 6.10.x will
> have the first patch and not the second. That's presumably an untested
> combination, fingers crossed.
>
Probably fine.
>
Ah, I'm actually about to send out v3 in a moment, which only has one patch,
whose diffs are just comment changes, plus David's latest suggestion:
static long check_and_migrate_movable_pages(unsigned long nr_pages,
struct page **pages)
@@ -2437,8 +2440,10 @@ static long check_and_migrate_movable_pages(unsigned long nr_pages,
long i, ret;
folios = kmalloc_array(nr_pages, sizeof(*folios), GFP_KERNEL);
- if (!folios)
+ if (!folios) {
+ unpin_user_pages(pages, nr_pages);
return -ENOMEM;
+ }
for (i = 0; i < nr_pages; i++)
folios[i] = page_folio(pages[i]);
thanks,
--
John Hubbard
prev parent reply other threads:[~2024-10-18 22:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 1:17 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
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 [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=691ae680-b8c0-400e-b2ad-f3d43057f350@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=airlied@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=arnd@arndb.de \
--cc=daniel.vetter@ffwll.ch \
--cc=david@redhat.com \
--cc=dongwon.kim@intel.com \
--cc=hch@infradead.org \
--cc=hughd@google.com \
--cc=jgg@nvidia.com \
--cc=junxiao.chang@intel.com \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=minchan@kernel.org \
--cc=osalvador@suse.de \
--cc=pasha.tatashin@soleen.com \
--cc=peterx@redhat.com \
--cc=syoshida@redhat.com \
--cc=vivek.kasireddy@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox