From: Alistair Popple <apopple@nvidia.com>
To: Felix Kuehling <felix.kuehling@amd.com>
Cc: "Dan Williams" <dan.j.williams@intel.com>,
akpm@linux-foundation.org, "Matthew Wilcox" <willy@infradead.org>,
"Jan Kara" <jack@suse.cz>, "Darrick J. Wong" <djwong@kernel.org>,
"Christoph Hellwig" <hch@lst.de>,
"John Hubbard" <jhubbard@nvidia.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Ben Skeggs" <bskeggs@redhat.com>,
"Karol Herbst" <kherbst@redhat.com>,
"Lyude Paul" <lyude@redhat.com>,
"Jérôme Glisse" <jglisse@redhat.com>,
"Jason Gunthorpe" <jgg@nvidia.com>,
linux-mm@kvack.org, dri-devel@lists.freedesktop.org,
nvdimm@lists.linux.dev
Subject: Re: [PATCH] mm/memremap: Introduce pgmap_request_folio() using pgmap offsets
Date: Mon, 24 Oct 2022 12:44:34 +1100 [thread overview]
Message-ID: <87tu3uq9fa.fsf@nvidia.com> (raw)
In-Reply-To: <0d2efd01-956c-3e61-6bd0-81e449fad4f9@amd.com>
Felix Kuehling <felix.kuehling@amd.com> writes:
> On 2022-10-20 19:17, Dan Williams wrote:
>> Felix Kuehling wrote:
>>> Am 2022-10-20 um 17:56 schrieb Dan Williams:
>>>>
>>>> For now this only converts the callers to lookup the pgmap and generate
>>>> the pgmap offset, but it does not do the deeper cleanup of teaching
>>>> those call sites to generate those arguments without walking the page
>>>> metadata. For next steps it appears the DEVICE_PRIVATE implementations
>>>> could plumb the pgmap into the necessary callsites and switch to using
>>>> gen_pool_alloc() to track which offsets of a pgmap are allocated.
That's an interesting idea. I might take a look at converting hmm-tests
to do this (and probably by extension Nouveau as the allocator is
basically the same).
Feel free to also add:
Reviewed-by: Alistair Popple <apopple@nvidia.com>
For the memremap/nouveau/hmm-test parts.
>>> Wouldn't that duplicate whatever device memory allocator we already have
>>> in our driver? Couldn't I just take the memory allocation from our TTM
>>> allocator and make necessary pgmap_request_folio calls to allocate the
>>> corresponding pages from the pgmap?
>> I think you could, as long as the output from that allocator is a
>> pgmap_offset rather than a pfn.
>>
>>> Or does the pgmap allocation need a finer granularity than the device
>>> memory allocation?
>> I would say the pgmap *allocation* happens at memremap_pages() time.
>> pgmap_request_folio() is a request to put a pgmap page into service.
>>
>> So, yes, I think you can bring your own allocator for what offsets are
>> in/out of service in pgmap space.
>
> Thank you for the explanation. The patch is
>
> Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
WARNING: multiple messages have this Message-ID (diff)
From: Alistair Popple <apopple@nvidia.com>
To: Felix Kuehling <felix.kuehling@amd.com>
Cc: nvdimm@lists.linux.dev, "Jan Kara" <jack@suse.cz>,
"Jason Gunthorpe" <jgg@nvidia.com>,
"Karol Herbst" <kherbst@redhat.com>,
"Christian König" <christian.koenig@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Darrick J. Wong" <djwong@kernel.org>,
dri-devel@lists.freedesktop.org, "Pan,
Xinhui" <Xinhui.Pan@amd.com>,
"Matthew Wilcox" <willy@infradead.org>,
"Christoph Hellwig" <hch@lst.de>,
linux-mm@kvack.org, "Jérôme Glisse" <jglisse@redhat.com>,
"Ben Skeggs" <bskeggs@redhat.com>,
"John Hubbard" <jhubbard@nvidia.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Dan Williams" <dan.j.williams@intel.com>,
akpm@linux-foundation.org
Subject: Re: [PATCH] mm/memremap: Introduce pgmap_request_folio() using pgmap offsets
Date: Mon, 24 Oct 2022 12:44:34 +1100 [thread overview]
Message-ID: <87tu3uq9fa.fsf@nvidia.com> (raw)
In-Reply-To: <0d2efd01-956c-3e61-6bd0-81e449fad4f9@amd.com>
Felix Kuehling <felix.kuehling@amd.com> writes:
> On 2022-10-20 19:17, Dan Williams wrote:
>> Felix Kuehling wrote:
>>> Am 2022-10-20 um 17:56 schrieb Dan Williams:
>>>>
>>>> For now this only converts the callers to lookup the pgmap and generate
>>>> the pgmap offset, but it does not do the deeper cleanup of teaching
>>>> those call sites to generate those arguments without walking the page
>>>> metadata. For next steps it appears the DEVICE_PRIVATE implementations
>>>> could plumb the pgmap into the necessary callsites and switch to using
>>>> gen_pool_alloc() to track which offsets of a pgmap are allocated.
That's an interesting idea. I might take a look at converting hmm-tests
to do this (and probably by extension Nouveau as the allocator is
basically the same).
Feel free to also add:
Reviewed-by: Alistair Popple <apopple@nvidia.com>
For the memremap/nouveau/hmm-test parts.
>>> Wouldn't that duplicate whatever device memory allocator we already have
>>> in our driver? Couldn't I just take the memory allocation from our TTM
>>> allocator and make necessary pgmap_request_folio calls to allocate the
>>> corresponding pages from the pgmap?
>> I think you could, as long as the output from that allocator is a
>> pgmap_offset rather than a pfn.
>>
>>> Or does the pgmap allocation need a finer granularity than the device
>>> memory allocation?
>> I would say the pgmap *allocation* happens at memremap_pages() time.
>> pgmap_request_folio() is a request to put a pgmap page into service.
>>
>> So, yes, I think you can bring your own allocator for what offsets are
>> in/out of service in pgmap space.
>
> Thank you for the explanation. The patch is
>
> Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
next prev parent reply other threads:[~2022-10-24 1:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-20 21:56 [PATCH] mm/memremap: Introduce pgmap_request_folio() using pgmap offsets Dan Williams
2022-10-20 21:56 ` Dan Williams
2022-10-20 22:32 ` Felix Kuehling
2022-10-20 22:32 ` Felix Kuehling
2022-10-20 23:17 ` Dan Williams
2022-10-20 23:17 ` Dan Williams
2022-10-21 18:31 ` Felix Kuehling
2022-10-21 18:31 ` Felix Kuehling
2022-10-24 1:44 ` Alistair Popple [this message]
2022-10-24 1:44 ` Alistair Popple
2022-10-21 20:36 ` Lyude Paul
2022-10-21 20:36 ` Lyude Paul
2022-10-28 18:33 ` Jason Gunthorpe
2022-10-28 18:33 ` Jason Gunthorpe
2022-12-01 0:22 ` Dan Williams
2022-12-01 0:22 ` Dan Williams
2022-12-01 23:12 ` Andrew Morton
2022-12-01 23:12 ` Andrew Morton
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=87tu3uq9fa.fsf@nvidia.com \
--to=apopple@nvidia.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=akpm@linux-foundation.org \
--cc=alexander.deucher@amd.com \
--cc=bskeggs@redhat.com \
--cc=christian.koenig@amd.com \
--cc=dan.j.williams@intel.com \
--cc=daniel@ffwll.ch \
--cc=djwong@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=felix.kuehling@amd.com \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=jgg@nvidia.com \
--cc=jglisse@redhat.com \
--cc=jhubbard@nvidia.com \
--cc=kherbst@redhat.com \
--cc=linux-mm@kvack.org \
--cc=lyude@redhat.com \
--cc=nvdimm@lists.linux.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.