[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <142152a5-d265-4aa5-b103-dede882f9715@nvidia.com>
Date: Sun, 20 Oct 2024 20:26:50 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Alistair Popple <apopple@...dia.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>, linux-mm@...ck.org,
David Hildenbrand <david@...hat.com>, Shigeru Yoshida <syoshida@...hat.com>,
Jason Gunthorpe <jgg@...dia.com>, Minchan Kim <minchan@...nel.org>,
Pasha Tatashin <pasha.tatashin@...een.com>
Subject: Re: [PATCH v3] mm/gup: stop leaking pinned pages in low memory
conditions
On 10/20/24 4:26 PM, Alistair Popple wrote:
> John Hubbard <jhubbard@...dia.com> writes:
> [...]
>> @@ -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);
>
> ie. Doesn't this unpinning need to happen in
> check_and_migrate_movable_folios()?
It already does.
check_and_migrate_movable_folios() calls
migrate_longterm_unpinnable_folios(), which unpins if errors occur.
thanks,
--
John Hubbard
Powered by blists - more mailing lists