Skip to contentSkip to conversation

drm/virtio: allocate fences with GFP_KERNEL

PATCH In review Chia-I Wu 4 participants 5 messages Apr 29, 2019 – May 6, 2019

Subsystems (3)
lore
Share & tools
lore

Chia-I Wu

author reviewer
#0 lore raw

PATCH 1/1 drm/virtio: allocate fences with GFP_KERNEL

It was changed to GFP_ATOMIC in commit ec2f0577c (add & use virtio_gpu_queue_fenced_ctrl_buffer) because the allocation happened with a spinlock held. That was no longer true after commit 9fdd90c0f (add virtio_gpu_alloc_fence()).

Cc Gerd Hoffmann <[email protected]>
Cc Gustavo Padovan <[email protected]>
Cc Robert Foss <[email protected]>
---
 drivers/gpu/drm/virtio/virtgpu_fence.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_fence.c +1 -1
index 87d1966192f4..b63ea4797afc 100644
@@ -71,7 +71,7 @@ struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev)
 {
 	struct virtio_gpu_fence_driver *drv = &vgdev->fence_drv;
 	struct virtio_gpu_fence *fence = kzalloc(sizeof(struct virtio_gpu_fence),
-							GFP_ATOMIC);
+							GFP_KERNEL);
 	if (!fence)
 		return fence;
 
Signature · 6 lines
2.21.0.593.g511ec345e18-goog

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Hey Chia-I,

This looks good to me, I can't find any spinlocks being held during that allocation.

Quoted 19 lines · Chia-I Wu

It was changed to GFP_ATOMIC in commit ec2f0577c (add & use virtio_gpu_queue_fenced_ctrl_buffer) because the allocation happened with a spinlock held. That was no longer true after commit 9fdd90c0f (add virtio_gpu_alloc_fence()).

Cc Gerd Hoffmann <[email protected]>
Cc Gustavo Padovan <[email protected]>
Cc Robert Foss <[email protected]>
---
  drivers/gpu/drm/virtio/virtgpu_fence.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/virtio/virtgpu_fence.c +0 -0
index 87d1966192f4..b63ea4797afc 100644

drivers/gpu/drm/virtio/virtgpu_fence.c struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev) · line 77

Quoted 8 lines
drivers/gpu/drm/virtio/virtgpu_fence.c +1 -1
@@ -71,7 +71,7 @@ struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev)
  {
  	struct virtio_gpu_fence_driver *drv = &vgdev->fence_drv;
  	struct virtio_gpu_fence *fence = kzalloc(sizeof(struct virtio_gpu_fence),
-							GFP_ATOMIC);
+							GFP_KERNEL);
  	if (!fence)
  		return fence;
 

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 1/1
#2 lore raw
In reply to Chia-I Wu
Quoted 10 lines · Chia-I Wu

It was changed to GFP_ATOMIC in commit ec2f0577c (add & use virtio_gpu_queue_fenced_ctrl_buffer) because the allocation happened with a spinlock held. That was no longer true after commit 9fdd90c0f (add virtio_gpu_alloc_fence()).

Cc Gerd Hoffmann <[email protected]>
Cc Gustavo Padovan <[email protected]>
Cc Robert Foss <[email protected]>

Side:
Rob, should we follow-up on 9fdd90c0f and drop the virtio_gpu_fence_emit() return type?

HTH
-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 12 lines · Emil Velikov
Quoted 10 lines · Chia-I Wu

It was changed to GFP_ATOMIC in commit ec2f0577c (add & use virtio_gpu_queue_fenced_ctrl_buffer) because the allocation happened with a spinlock held. That was no longer true after commit 9fdd90c0f (add virtio_gpu_alloc_fence()).

Cc Gerd Hoffmann <[email protected]>
Cc Gustavo Padovan <[email protected]>
Cc Robert Foss <[email protected]>
Quoted 5 lines

Side:
Rob, should we follow-up on 9fdd90c0f and drop the virtio_gpu_fence_emit() return type?

Good idea. None of the called functions return anything. I'll get right on it.

Rob.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#4 lore raw
In reply to Chia-I Wu
Quoted 4 lines · Chia-I Wu

It was changed to GFP_ATOMIC in commit ec2f0577c (add & use virtio_gpu_queue_fenced_ctrl_buffer) because the allocation happened with a spinlock held. That was no longer true after commit 9fdd90c0f (add virtio_gpu_alloc_fence()).

Added to drm-misc-next.

thanks,
Gerd

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel