diff mbox series

drm/virtio: allocate fences with GFP_KERNEL

Message ID 20190429221021.159784-1-olvaffe@gmail.com (mailing list archive)
State New, archived
Headers show
Series drm/virtio: allocate fences with GFP_KERNEL | expand

Commit Message

Chia-I Wu April 29, 2019, 10:10 p.m. UTC
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()).

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Robert Foss <robert.foss@collabora.com>
---
 drivers/gpu/drm/virtio/virtgpu_fence.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Robert Foss April 30, 2019, 12:16 p.m. UTC | #1
Hey Chia-I,

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

Reviewed-by: Robert Foss <robert.foss@collabora.com>

On 30.04.19 00:10, Chia-I Wu wrote:
> 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()).
> 
> Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
> Cc: Robert Foss <robert.foss@collabora.com>
> ---
>   drivers/gpu/drm/virtio/virtgpu_fence.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c
> index 87d1966192f4..b63ea4797afc 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_fence.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_fence.c
> @@ -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;
>   
>
Emil Velikov May 3, 2019, 2:31 p.m. UTC | #2
On Mon, 29 Apr 2019 at 23:10, Chia-I Wu <olvaffe@gmail.com> wrote:
>
> 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()).
>
> Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
> Cc: Robert Foss <robert.foss@collabora.com>

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

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

HTH
-Emil
Robert Foss May 3, 2019, 2:47 p.m. UTC | #3
On 03.05.19 16:31, Emil Velikov wrote:
> On Mon, 29 Apr 2019 at 23:10, Chia-I Wu <olvaffe@gmail.com> wrote:
>>
>> 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()).
>>
>> Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
>> Cc: Robert Foss <robert.foss@collabora.com>
> 
> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
> 
> 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.
Gerd Hoffmann May 6, 2019, 8:55 a.m. UTC | #4
On Mon, Apr 29, 2019 at 03:10:21PM -0700, Chia-I Wu wrote:
> 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
diff mbox series

Patch

diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c
index 87d1966192f4..b63ea4797afc 100644
--- a/drivers/gpu/drm/virtio/virtgpu_fence.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fence.c
@@ -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;