Thread (56 messages) flat view 56 messages, 9 authors, 2026-01-23

Re: [PATCH v2 02/11] drm/amdkfd: Use migrate pfns internally

From: Jordan Niethe <hidden>
Date: 2026-01-08 23:56:49
Also in: dri-devel, intel-xe, linux-mm, lkml

Hi,

On 9/1/26 09:00, Felix Kuehling wrote:
quoted
@@ -235,7 +235,7 @@ svm_migrate_addr(struct amdgpu_device *adev, 
struct page *page)
  {
      unsigned long addr;
-    addr = page_to_pfn(page) << PAGE_SHIFT;
+    addr = (migrate_pfn_from_page(page) >> MIGRATE_PFN_SHIFT) << 
PAGE_SHIFT;
      return (addr - adev->kfd.pgmap.range.start);
I guess we rely on the fact that for DEVICE_PRIVATE memory, adev- 
 >kfd.pgmap.range.start will be 0 after your patch 11. So we don't need 
a special condition here to handle DEVICE_PRIVATE differently.
Actually pgmap.range.start won't be zero - part of the change to the
memremap_device_private_pagemap() in patch 11 is that range is used as an
output parameter.  It returns the range we allocate for the pagemap from the
device_private_pgmap_tree maple tree, representing "device private address
space".

But it's correct that means we don't need special handling here.
In general, I like the way you handle mpfns as it keeps all the special 
casing out of the drivers.
Yeah, it does turn out quite neat.

Thanks for review,
Jordan.
Regards,
   Felix

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help