search for: ida_alloc

Displaying 12 results from an estimated 12 matches for "ida_alloc".

Did you mean: bad_alloc
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 ;-)
2019 Mar 20
0
[PATCH] drm/virtio: make resource id workaround runtime switchable.
...#include "virtgpu_drv.h" +static int virtio_gpu_virglrenderer_workaround = 1; +module_param_named(virglhack, virtio_gpu_virglrenderer_workaround, int, 0400); + static int virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev, uint32_t *resid) { -#if 0 - int handle = ida_alloc(&vgdev->resource_ida, GFP_KERNEL); - - if (handle < 0) - return handle; -#else - static int handle; - - /* - * FIXME: dirty hack to avoid re-using IDs, virglrenderer - * can't deal with that. Needs fixing in virglrenderer, also - * should figure a better way to handle that in the...
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_i...
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:/...
2019 Feb 08
0
[PATCH] drm/virtio: do NOT reuse resource ids
...m/virtio/virtgpu_object.c index f39a183d59..e7e9460350 100644 --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -28,10 +28,21 @@ static int virtio_gpu_resource_id_get(struct virtio_gpu_device *vgdev, uint32_t *resid) { +#if 0 int handle = ida_alloc(&vgdev->resource_ida, GFP_KERNEL); if (handle < 0) return handle; +#else + static int handle; + + /* + * FIXME: dirty hack to avoid re-using IDs, virglrenderer + * can't deal with that. Needs fixing in virglrenderer, also + * should figure a better way to handle that in the...
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
2013 Jul 06
3
[PATCH-v2 0/3] target/vhost-scsi: Add per-cpu ida tag pre-allocation for v3.12
...he last two fast-path allocations to be dropped from tcm_vhost_submission_work() -> vhost_scsi_map_to_sgl() fast-path execution. Please review as v3.12 material. Thanks! --nab Nicholas Bellinger (3): target: Add transport_init_session_tags using per-cpu ida vhost/scsi: Convert to per-cpu ida_alloc + ida_free command map vhost/scsi: Add pre-allocation for tv_cmd SGL + upages memory drivers/target/target_core_transport.c | 33 ++++++++ drivers/vhost/scsi.c | 130 ++++++++++++++++++++++++-------- include/target/target_core_base.h | 5 + include/target/target_cor...
2013 Jul 06
3
[PATCH-v2 0/3] target/vhost-scsi: Add per-cpu ida tag pre-allocation for v3.12
...he last two fast-path allocations to be dropped from tcm_vhost_submission_work() -> vhost_scsi_map_to_sgl() fast-path execution. Please review as v3.12 material. Thanks! --nab Nicholas Bellinger (3): target: Add transport_init_session_tags using per-cpu ida vhost/scsi: Convert to per-cpu ida_alloc + ida_free command map vhost/scsi: Add pre-allocation for tv_cmd SGL + upages memory drivers/target/target_core_transport.c | 33 ++++++++ drivers/vhost/scsi.c | 130 ++++++++++++++++++++++++-------- include/target/target_core_base.h | 5 + include/target/target_cor...
2013 Aug 16
6
[PATCH-v3 0/4] target/vhost-scsi: Add per-cpu ida tag pre-allocation for v3.12
...dropped from tcm_vhost_submission_work() -> vhost_scsi_map_to_sgl() fast-path execution. Please review as v3.12 material. Thanks! --nab Kent Overstreet (1): idr: Percpu ida Nicholas Bellinger (3): target: Add transport_init_session_tags using per-cpu ida vhost/scsi: Convert to per-cpu ida_alloc + ida_free command map vhost/scsi: Add pre-allocation for tv_cmd SGL + upages memory drivers/target/target_core_transport.c | 33 ++++ drivers/vhost/scsi.c | 132 +++++++++---- include/linux/idr.h | 53 ++++++ include/target/target_core_base.h |...
2013 Aug 16
6
[PATCH-v3 0/4] target/vhost-scsi: Add per-cpu ida tag pre-allocation for v3.12
...dropped from tcm_vhost_submission_work() -> vhost_scsi_map_to_sgl() fast-path execution. Please review as v3.12 material. Thanks! --nab Kent Overstreet (1): idr: Percpu ida Nicholas Bellinger (3): target: Add transport_init_session_tags using per-cpu ida vhost/scsi: Convert to per-cpu ida_alloc + ida_free command map vhost/scsi: Add pre-allocation for tv_cmd SGL + upages memory drivers/target/target_core_transport.c | 33 ++++ drivers/vhost/scsi.c | 132 +++++++++---- include/linux/idr.h | 53 ++++++ include/target/target_core_base.h |...
2020 Nov 01
12
[PATCH mlx5-next v1 00/11] Convert mlx5 to use auxiliary bus
From: Leon Romanovsky <leonro at nvidia.com> Changelog: v1: * Renamed _mlx5_rescan_driver to be mlx5_rescan_driver_locked like in other parts of the mlx5 driver. * Renamed MLX5_INTERFACE_PROTOCOL_VDPA to tbe MLX5_INTERFACE_PROTOCOL_VNET as a preparation to coming series from Eli C. * Some small naming renames in mlx5_vdpa. * Refactored adev index code to make Parav's SF series