[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <691ae680-b8c0-400e-b2ad-f3d43057f350@nvidia.com>
Date: Fri, 18 Oct 2024 15:16:02 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: LKML <linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>, "Matthew Wilcox
(Oracle)" <willy@...radead.org>, Alistair Popple <apopple@...dia.com>, "Arnd
Bergmann" <arnd@...db.de>, Christoph Hellwig <hch@...radead.org>, "Daniel
Vetter" <daniel.vetter@...ll.ch>, Dave Airlie <airlied@...hat.com>, "David
Hildenbrand" <david@...hat.com>, Dongwon Kim <dongwon.kim@...el.com>, "Gerd
Hoffmann" <kraxel@...hat.com>, Hugh Dickins <hughd@...gle.com>, "Jason
Gunthorpe" <jgg@...dia.com>, Junxiao Chang <junxiao.chang@...el.com>, "Mike
Kravetz" <mike.kravetz@...cle.com>, Minchan Kim <minchan@...nel.org>, "Oscar
Salvador" <osalvador@...e.de>, Pasha Tatashin <pasha.tatashin@...een.com>,
Peter Xu <peterx@...hat.com>, Shigeru Yoshida <syoshida@...hat.com>, "Vivek
Kasireddy" <vivek.kasireddy@...el.com>
Subject: Re: [PATCH v2 0/2] mm/gup: stop leaking pinned pages in low memory
conditions
On 10/18/24 3:13 PM, Andrew Morton wrote:
> On Thu, 17 Oct 2024 18:17:09 -0700 John Hubbard <jhubbard@...dia.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
Powered by blists - more mailing lists