[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f562bd43-d9bb-af27-0d44-af7902ee15df@nvidia.com>
Date: Wed, 21 Sep 2022 17:13:29 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Dan Williams <dan.j.williams@...el.com>,
Jason Gunthorpe <jgg@...dia.com>,
Alistair Popple <apopple@...dia.com>
Cc: akpm@...ux-foundation.org, Matthew Wilcox <willy@...radead.org>,
Jan Kara <jack@...e.cz>, "Darrick J. Wong" <djwong@...nel.org>,
Christoph Hellwig <hch@....de>, linux-fsdevel@...r.kernel.org,
nvdimm@...ts.linux.dev, linux-xfs@...r.kernel.org,
linux-mm@...ck.org, linux-ext4@...r.kernel.org
Subject: Re: [PATCH v2 16/18] mm/memremap_pages: Support initializing pages to
a zero reference count
On 9/21/22 16:45, Dan Williams wrote:
>> I'm shocked to read this - how does it make any sense?
>
> I think what happened is that since memremap_pages() historically
> produced pages with an elevated reference count that GPU drivers skipped
> taking a reference on first allocation and just passed along an elevated
> reference count page to the first user.
>
> So either we keep that assumption or update all users to be prepared for
> idle pages coming out of memremap_pages().
>
> This is all in reaction to the "set_page_count(page, 1);" in
> free_zone_device_page(). Which I am happy to get rid of but need from
> help from MEMORY_DEVICE_{PRIVATE,COHERENT} folks to react to
> memremap_pages() starting all pages at reference count 0.
>
Just one tiny thing to contribute to this difficult story: I think that
we can make this slightly clearer by saying things like this:
"The device driver is the allocator for device pages. And allocators
keep pages at a refcount == 0, until they hand out the pages in response
to allocation requests."
To me at least, this makes it easier to see why pages are 0 or > 0
refcounts. In case that helps at all.
thanks,
--
John Hubbard
NVIDIA
Powered by blists - more mailing lists