Skip to contentSkip to conversation

nouveau: Fix migrate_to_ram() for faulting page

PATCH Applied Alistair Popple 3 participants 4 messages Oct 19, 2022 – Oct 21, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nouveau: Fix migrate_to_ram() for faulting page

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.

Fixes 16ce101db85d ("mm/memory.c: fix race when faulting a device private page")
Cc John Hubbard <[email protected]>
Cc Ralph Campbell <[email protected]>
Cc Lyude Paul <[email protected]>
Cc Ben Skeggs <[email protected]>

---

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(+)
drivers/gpu/drm/nouveau/nouveau_dmem.c +1 -0
index 5fe209107246..20fe53815b20 100644
@@ -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,
 	};
 
Signature · 1 line
2.35.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Alistair Popple

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.

Fixes 16ce101db85d ("mm/memory.c: fix race when faulting a device private page")
Cc John Hubbard <[email protected]>
Cc Ralph Campbell <[email protected]>
Cc Lyude Paul <[email protected]>
Cc Ben Skeggs <[email protected]>
Quoted 6 lines

---

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.

Hi!

I will push this to drm-misc-next in just a moment, thanks for the patch!

Quoted 16 lines
---
 drivers/gpu/drm/nouveau/nouveau_dmem.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/nouveau_dmem.c +1 -0
index 5fe209107246..20fe53815b20 100644
@@ -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,
 	};
 
Signature · 3 lines
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat
maintainer
#2 lore raw
Quoted 10 lines · On Fri, 21 Oct 2022 15:53:19 -0400 Lyude Paul <[email protected]> wrote:
Quoted 4 lines

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.

Hi!

I will push this to drm-misc-next in just a moment, thanks for the patch!

Linus merged it but minutes ago.

maintainer
#3 lore raw
Quoted 7 lines · Andrew Morton
Quoted 5 lines · On Fri, 21 Oct 2022 15:53:19 -0400 Lyude Paul <[email protected]> wrote:
Quoted 4 lines

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.

Quoted 7 lines
Quoted 5 lines

Hi!

I will push this to drm-misc-next in just a moment, thanks for the patch!

Linus merged it but minutes ago.

Agh, sorry about that - I already pushed this over an hour ago

Quoted 1 line
Signature · 3 lines
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat