Displaying 5 results from an estimated 5 matches for "ida_alloc_min".
Did you mean:
ida_alloc_max
2018 Sep 26
5
[PATCH 0/4] Improve virtio ID allocation
I noticed you were using IDRs where you could be using the more efficient
IDAs, then while fixing that I noticed the lack of error handling,
and I decided to follow that up with an efficiency improvement.
There's probably a v2 of this to follow because I couldn't figure
out how to properly handle one of the error cases ... see the comment
embedded in one of the patches.
Matthew Wilcox
2018 Sep 26
2
[PATCH 4/4] drm/virtio: Use IDAs more efficiently
...,6 +59,7 @@ static int virtio_gpu_context_create(struct virtio_gpu_device *vgdev,
>
> if (handle < 0)
> return handle;
> + handle++;
> virtio_gpu_cmd_context_create(vgdev, handle, nlen, name);
> return handle;
> }
Uh. This line is missing.
- int handle = ida_alloc_min(&vgdev->ctx_id_ida, 1, GFP_KERNEL);
+ int handle = ida_alloc(&vgdev->ctx_id_ida, GFP_KERNEL);
It'll be there in v2 ;-)
2018 Sep 26
2
[PATCH 4/4] drm/virtio: Use IDAs more efficiently
...,6 +59,7 @@ static int virtio_gpu_context_create(struct virtio_gpu_device *vgdev,
>
> if (handle < 0)
> return handle;
> + handle++;
> virtio_gpu_cmd_context_create(vgdev, handle, nlen, name);
> return handle;
> }
Uh. This line is missing.
- int handle = ida_alloc_min(&vgdev->ctx_id_ida, 1, GFP_KERNEL);
+ int handle = ida_alloc(&vgdev->ctx_id_ida, GFP_KERNEL);
It'll be there in v2 ;-)
2018 Sep 26
0
[PATCH 4/4] drm/virtio: Use IDAs more efficiently
...a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c
index 387951c971d4..81297fe0147d 100644
--- a/drivers/gpu/drm/virtio/virtgpu_vq.c
+++ b/drivers/gpu/drm/virtio/virtgpu_vq.c
@@ -40,12 +40,15 @@
int virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev)
{
- return ida_alloc_min(&vgdev->resource_ida, 1, GFP_KERNEL);
+ int handle = ida_alloc(&vgdev->resource_ida, GFP_KERNEL);
+ if (handle < 0)
+ return handle;
+ return handle + 1;
}
void virtio_gpu_resource_id_put(struct virtio_gpu_device *vgdev, uint32_t id)
{
- ida_free(&vgdev->resource_ida,...
2018 Oct 02
0
[PATCH 4/4] drm/virtio: Use IDAs more efficiently
...virtio_gpu_device *vgdev,
> >
> > if (handle < 0)
> > return handle;
> > + handle++;
> > virtio_gpu_cmd_context_create(vgdev, handle, nlen, name);
> > return handle;
> > }
>
> Uh. This line is missing.
>
> - int handle = ida_alloc_min(&vgdev->ctx_id_ida, 1, GFP_KERNEL);
> + int handle = ida_alloc(&vgdev->ctx_id_ida, GFP_KERNEL);
>
> It'll be there in v2 ;-)
I've touched the resource/object id handling too, see my "drm/virtio:
rework ttm resource handling" patch series
(https://pat...