[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220624013415.GI4147@nvidia.com>
Date: Thu, 23 Jun 2022 22:34:15 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Alistair Popple <apopple@...dia.com>
Cc: Alex Williamson <alex.williamson@...hat.com>,
David Hildenbrand <david@...hat.com>,
akpm@...ux-foundation.org, minchan@...nel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, paulmck@...nel.org,
jhubbard@...dia.com, joaodias@...gle.com
Subject: Re: [PATCH] mm: Re-allow pinning of zero pfns
On Fri, Jun 24, 2022 at 10:11:01AM +1000, Alistair Popple wrote:
> > Hum.. Alistair, maybe you should look at this as well, I'm struggling
> > alot to understand how it is safe to drop the reference on the page
> > but hold a pointer to it on the movable_page_list - sure it was
> > isolated - but why does that mean it won't be concurrently unmapped
> > and freed?
>
> folio_isolate_lru() takes a reference on the page so you're safe from it
> being freed. If it gets unmapped it will be freed when the matching
> putback_movable_pages() is called.
Hm, I guess I didn't dig deep enough into that call chain..
> > Anyhow, it looks like the problem is the tortured logic in this
> > function, what do you think about this:
>
> At a glance it seems reasonable, although I fear it might conflict with
> my changes for device coherent migration. Agree the whole
> check_and_migrate_movable_pages() logic is pretty tortured though, and I
> don't think I'm making it better so would be happy to try cleaning it up
> futher once the device coherent changes are in.
OK, can I leave this patch with you then? I have no way to test it..
Thanks,
Jason
Powered by blists - more mailing lists