Re: [PATCH] drm/amdgpu: allocate entities on demand

2020-01-28 Thread Christian König
Patch is Reviewed-by: Christian König Regards, Christian. Am 28.01.20 um 11:13 schrieb Nirmoy: Gentle reminder ! On 1/24/20 5:31 PM, Nirmoy Das wrote: Currently we pre-allocate entities and fences for all the HW IPs on context creation and some of which are might never be used. This patch

Re: [PATCH] drm/amdgpu: allocate entities on demand

2020-01-28 Thread Nirmoy
Gentle reminder ! On 1/24/20 5:31 PM, Nirmoy Das wrote: Currently we pre-allocate entities and fences for all the HW IPs on context creation and some of which are might never be used. This patch tries to resolve entity/fences wastage by creating entity only when needed. v2: allocate memory

[PATCH] drm/amdgpu: allocate entities on demand

2020-01-24 Thread Nirmoy Das
Currently we pre-allocate entities and fences for all the HW IPs on context creation and some of which are might never be used. This patch tries to resolve entity/fences wastage by creating entity only when needed. v2: allocate memory for entity and fences together Signed-off-by: Nirmoy Das

Re: [PATCH] drm/amdgpu: allocate entities on demand

2020-01-24 Thread Nirmoy
On 1/24/20 1:56 PM, Christian König wrote: +    entity->fences = kcalloc(amdgpu_sched_jobs, + sizeof(struct dma_fence*), GFP_KERNEL); It would be rather nice to have to allocate the fences array together with the entity. Take a look at struct dma_resv_list and the

Re: [PATCH] drm/amdgpu: allocate entities on demand

2020-01-24 Thread Christian König
Am 24.01.20 um 13:43 schrieb Nirmoy: On 1/24/20 1:09 PM, Christian König wrote: + return  -ENOMEM; That's complete overkill, just statically allocate the array in the amdgpu_ctx structure. The maximum instance should be 4 IIRC, so something like "struct amdgpu_ctx_entity

Re: [PATCH] drm/amdgpu: allocate entities on demand

2020-01-24 Thread Christian König
Am 24.01.20 um 13:41 schrieb Nirmoy Das: Currently we pre-allocate entities and fences for all the HW IPs on context creation and some of which are might never be used. This patch tries to resolve entity/fences wastage by creating entity only when needed. Signed-off-by: Nirmoy Das ---

Re: [PATCH] drm/amdgpu: allocate entities on demand

2020-01-24 Thread Nirmoy
On 1/24/20 1:09 PM, Christian König wrote: + return  -ENOMEM; That's complete overkill, just statically allocate the array in the amdgpu_ctx structure. The maximum instance should be 4 IIRC, so something like "struct amdgpu_ctx_entity *entities[AMDGPU_HW_IP_NUM][4];" so a maximum of 288

[PATCH] drm/amdgpu: allocate entities on demand

2020-01-24 Thread Nirmoy Das
Currently we pre-allocate entities and fences for all the HW IPs on context creation and some of which are might never be used. This patch tries to resolve entity/fences wastage by creating entity only when needed. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 232

Re: [PATCH] drm/amdgpu: allocate entities on demand

2020-01-24 Thread Christian König
Am 24.01.20 um 12:53 schrieb Nirmoy Das: Currently we pre-allocate entities and fences for all the HW IPs on context creation and some of which are might never be used. This patch tries to resolve entity/fences wastage by creating entity only when needed. Signed-off-by: Nirmoy Das ---

[PATCH] drm/amdgpu: allocate entities on demand

2020-01-24 Thread Nirmoy Das
Currently we pre-allocate entities and fences for all the HW IPs on context creation and some of which are might never be used. This patch tries to resolve entity/fences wastage by creating entity only when needed. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 244

Re: [PATCH] drm/amdgpu: allocate entities on demand

2020-01-24 Thread Nirmoy
On 1/23/20 5:13 PM, Nirmoy Das wrote: + kfree(ctx->entities[i]; Forgot to add change that fix ^ Regards, Nirmoy ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH] drm/amdgpu: allocate entities on demand

2020-01-23 Thread Nirmoy Das
Currently we pre-allocate entities and fences for all the HW IPs on context creation and some of which are might never be used. This patch tries to resolve entity/fences wastage by creating entity only when needed. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 244

Re: [RFC PATCH] drm/amdgpu: allocate entities on demand

2020-01-20 Thread Christian König
Am 20.01.20 um 14:05 schrieb Nirmoy: Hi Christian, On 11/26/19 10:45 AM, Christian König wrote: It looks like a start, but there numerous things which needs to be fixed. Question number one is: What's that good for? Entities are not the problem here. The real issue is the fence ring and the

Re: [RFC PATCH] drm/amdgpu: allocate entities on demand

2020-01-20 Thread Nirmoy
Hi Christian, On 11/26/19 10:45 AM, Christian König wrote: It looks like a start, but there numerous things which needs to be fixed. Question number one is: What's that good for? Entities are not the problem here. The real issue is the fence ring and the rq_list. The rq_list could actually

Re: [RFC PATCH] drm/amdgpu: allocate entities on demand

2019-12-04 Thread Nirmoy
I saw y On 12/3/19 6:47 PM, Christian König wrote: Am 03.12.19 um 18:33 schrieb Christian König: Am 03.12.19 um 16:02 schrieb Nirmoy: Hi Christian, On 12/2/19 3:59 PM, Christian König wrote: Am 02.12.19 um 15:43 schrieb Nirmoy: Do you mean something like diff --git

Re: [RFC PATCH] drm/amdgpu: allocate entities on demand

2019-12-03 Thread Christian König
Am 03.12.19 um 18:33 schrieb Christian König: Am 03.12.19 um 16:02 schrieb Nirmoy: Hi Christian, On 12/2/19 3:59 PM, Christian König wrote: Am 02.12.19 um 15:43 schrieb Nirmoy: Do you mean something like diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index

Re: [RFC PATCH] drm/amdgpu: allocate entities on demand

2019-12-03 Thread Christian König
Am 03.12.19 um 16:02 schrieb Nirmoy: Hi Christian, On 12/2/19 3:59 PM, Christian König wrote: Am 02.12.19 um 15:43 schrieb Nirmoy: Do you mean something like diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index 684692a8ed76..ac67f8f098fa 100644 ---

Re: [RFC PATCH] drm/amdgpu: allocate entities on demand

2019-12-03 Thread Nirmoy
Hi Christian, On 12/2/19 3:59 PM, Christian König wrote: Am 02.12.19 um 15:43 schrieb Nirmoy: Do you mean something like diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index 684692a8ed76..ac67f8f098fa 100644 --- a/include/drm/gpu_scheduler.h +++

Re: [RFC PATCH] drm/amdgpu: allocate entities on demand

2019-12-02 Thread Christian König
Am 02.12.19 um 15:43 schrieb Nirmoy: On 11/29/19 7:42 PM, Christian König wrote: Am 29.11.19 um 15:29 schrieb Nirmoy: Hi Christian, On 11/26/19 10:45 AM, Christian König wrote: It looks like a start, but there numerous things which needs to be fixed. Question number one is: What's that

Re: [RFC PATCH] drm/amdgpu: allocate entities on demand

2019-12-02 Thread Nirmoy
On 11/29/19 7:42 PM, Christian König wrote: Am 29.11.19 um 15:29 schrieb Nirmoy: Hi Christian, On 11/26/19 10:45 AM, Christian König wrote: It looks like a start, but there numerous things which needs to be fixed. Question number one is: What's that good for? Entities are not the problem

Re: [RFC PATCH] drm/amdgpu: allocate entities on demand

2019-11-29 Thread Christian König
Am 29.11.19 um 15:29 schrieb Nirmoy: Hi Christian, On 11/26/19 10:45 AM, Christian König wrote: It looks like a start, but there numerous things which needs to be fixed. Question number one is: What's that good for? Entities are not the problem here. The real issue is the fence ring and the

Re: [RFC PATCH] drm/amdgpu: allocate entities on demand

2019-11-29 Thread Nirmoy
Hi Christian, On 11/26/19 10:45 AM, Christian König wrote: It looks like a start, but there numerous things which needs to be fixed. Question number one is: What's that good for? Entities are not the problem here. The real issue is the fence ring and the rq_list. The rq_list could actually

Re: [RFC PATCH] drm/amdgpu: allocate entities on demand

2019-11-26 Thread Nirmoy
Thanks Christian for reviewing it.  I will try to cleanup drm_sched_entity_set_priority and come up with another patch. On 11/26/19 10:45 AM, Christian König wrote: It looks like a start, but there numerous things which needs to be fixed. Question number one is: What's that good for? Entities

Re: [RFC PATCH] drm/amdgpu: allocate entities on demand

2019-11-26 Thread Christian König
It looks like a start, but there numerous things which needs to be fixed. Question number one is: What's that good for? Entities are not the problem here. The real issue is the fence ring and the rq_list. The rq_list could actually be made constant since it should never be changed by the

[RFC PATCH] drm/amdgpu: allocate entities on demand

2019-11-26 Thread Nirmoy Das
Currently we pre-allocate entities for all the HW IPs on context creation and some of which are might never be used. This patch tries to resolve entity wastage by creating entities for a HW IP only when it is required. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 142

Re: [RFC PATCH] drm/amdgpu: allocate entities on demand

2019-11-25 Thread Nirmoy
Ran amdgpu_test(drm) successfully multiple times to test this. But I am pretty sure I am missing some corner case here. Regards, Nirmoy On 11/26/19 12:17 AM, Nirmoy Das wrote: Currently we pre-allocate entities for all the HW IPs on context creation and some of which are might never be