linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nouveau: Fix migrate_to_ram() for faulting page
@ 2022-10-19 12:29 Alistair Popple
  2022-10-21 19:53 ` Lyude Paul
  0 siblings, 1 reply; 4+ messages in thread
From: Alistair Popple @ 2022-10-19 12:29 UTC (permalink / raw)
  To: Ben Skeggs, Andrew Morton
  Cc: linux-mm, nouveau, Alistair Popple, John Hubbard, Ralph Campbell,
	Lyude Paul

Commit 16ce101db85d ("mm/memory.c: fix race when faulting a device private
page") changed the migrate_to_ram() callback to take a reference on the
device page to ensure it can't be freed while handling the fault.
Unfortunately the corresponding update to Nouveau to accommodate this
change was inadvertently dropped from that patch causing GPU to CPU
migration to fail so add it here.

Signed-off-by: Alistair Popple <apopple@nvidia.com>
Fixes: 16ce101db85d ("mm/memory.c: fix race when faulting a device private page")
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Ben Skeggs <bskeggs@redhat.com>

---

Hi Andrew/Ben, apologies I must have accidentally dropped this small hunk
when rebasing prior to sending v2 of the original series. Without this
migration from GPU to CPU won't work in Nouveau so hopefully one of you can
take this for v6.1-rcX. Thanks.
---
 drivers/gpu/drm/nouveau/nouveau_dmem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c
index 5fe209107246..20fe53815b20 100644
--- a/drivers/gpu/drm/nouveau/nouveau_dmem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c
@@ -176,6 +176,7 @@ static vm_fault_t nouveau_dmem_migrate_to_ram(struct vm_fault *vmf)
 		.src		= &src,
 		.dst		= &dst,
 		.pgmap_owner	= drm->dev,
+		.fault_page	= vmf->page,
 		.flags		= MIGRATE_VMA_SELECT_DEVICE_PRIVATE,
 	};
 
-- 
2.35.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-21 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 12:29 [PATCH] nouveau: Fix migrate_to_ram() for faulting page Alistair Popple
2022-10-21 19:53 ` Lyude Paul
2022-10-21 20:49   ` Andrew Morton
2022-10-21 21:10     ` Lyude Paul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox