[PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-11 Thread Nirmoy Das
entity should not keep copy and maintain sched list for itself. Signed-off-by: Nirmoy Das Reviewed-by: Christian König --- drivers/gpu/drm/scheduler/sched_entity.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_entity.c

[PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-11 Thread Nirmoy Das
entity should not keep copy and maintain sched list for itself. Signed-off-by: Nirmoy Das Reviewed-by: Christian König --- drivers/gpu/drm/scheduler/sched_entity.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_entity.c

Re: [PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-11 Thread Christian König
Am 10.12.19 um 19:17 schrieb Nirmoy Das: entity should not keep copy and maintain sched list for itself. Signed-off-by: Nirmoy Das Reviewed-by: Christian König --- drivers/gpu/drm/scheduler/sched_entity.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff

Re: [PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-10 Thread Nirmoy
On 12/10/19 6:32 PM, Christian König wrote: Maybe make this "num_sched_list > 1 ? sched_list : NULL" to avoid accidentally dereferencing a stale pointer to the stack. Do you mean "num_sched_list >= 1 ? sched_list : NULL" No, the entity->sched_list field should be NULL when

[PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-10 Thread Nirmoy Das
entity should not keep copy and maintain sched list for itself. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/scheduler/sched_entity.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_entity.c

Re: [PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-10 Thread Christian König
Am 10.12.19 um 16:08 schrieb Nirmoy: I think amdgpu_ctx_init() should check for num_scheds and not call drm_sched_entity_init() if its zero. Ah, that's where that came from. No that is intentionally this way, but see below. On 12/10/19 3:47 PM, Nirmoy wrote: On 12/10/19 2:00 PM,

[PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-10 Thread Nirmoy Das
entity should not keep copy and maintain sched list for itself. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/scheduler/sched_entity.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_entity.c

Re: [PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-10 Thread Nirmoy
I think amdgpu_ctx_init() should check for num_scheds and not call drm_sched_entity_init() if its zero. On 12/10/19 3:47 PM, Nirmoy wrote: On 12/10/19 2:00 PM, Christian König wrote: Am 10.12.19 um 13:53 schrieb Nirmoy Das: entity should not keep copy and maintain sched list for itself.

Re: [PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-10 Thread Nirmoy
On 12/10/19 2:00 PM, Christian König wrote: Am 10.12.19 um 13:53 schrieb Nirmoy Das: entity should not keep copy and maintain sched list for itself. Signed-off-by: Nirmoy Das ---   drivers/gpu/drm/scheduler/sched_entity.c | 10 +-   1 file changed, 1 insertion(+), 9 deletions(-) diff

Re: [PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-10 Thread Christian König
Am 10.12.19 um 14:00 schrieb Christian König: Am 10.12.19 um 13:53 schrieb Nirmoy Das: entity should not keep copy and maintain sched list for itself. Signed-off-by: Nirmoy Das ---   drivers/gpu/drm/scheduler/sched_entity.c | 10 +-   1 file changed, 1 insertion(+), 9 deletions(-)

Re: [PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-10 Thread Christian König
Am 10.12.19 um 13:53 schrieb Nirmoy Das: entity should not keep copy and maintain sched list for itself. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/scheduler/sched_entity.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git

[PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-09 Thread Nirmoy Das
entity should not keep copy and maintain sched list for itself. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/scheduler/sched_entity.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_entity.c

Re: [PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-09 Thread Christian König
Yeah, that won't work very well. During bring-up we also often have the case that we can't correctly initialize all engines, e.g. only the first SDMA comes up etc. So better stick with the initial approach of constructing the scheduler array for each engine type which needs it. Regards,

Re: [PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-09 Thread Nirmoy
I can see  one issue with this. I am ignoring/removing changes from commit 2a84e48e9712ea8591a10dd59d59ccab3d54efd6 drm/amdgpu: Only add rqs for initialized rings. I wonder if we can handle that differently. Regards, Nirmoy On 12/9/19 2:56 PM, Nirmoy wrote: Hi Christian, I got a

Re: [PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-09 Thread Nirmoy
Hi Christian, I got a different idea, a bit more simple let me know what do you think about it: diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 50bab33cba39..8de4de4f7a43 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++

Re: [PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-09 Thread Christian König
Yes, you need to do this for the SDMA as well but in general that looks like the idea I had in mind as well. I would do it like this: 1. Change the special case when you only get one scheduler for an entity to drop the pointer to the scheduler list.     This way we always use the same

Re: [PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-08 Thread Nirmoy
On 12/6/19 8:41 PM, Christian König wrote: Am 06.12.19 um 18:33 schrieb Nirmoy Das: entity should not keep copy and maintain sched list for itself. That is a good step, but we need to take this further. How about  something like ? diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h

Re: [PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-06 Thread Christian König
Am 06.12.19 um 18:33 schrieb Nirmoy Das: entity should not keep copy and maintain sched list for itself. That is a good step, but we need to take this further. The sched_list is static for the whole device and we shouldn't allocate it inside the context at all. Christian. Signed-off-by:

[PATCH 4/4] drm/scheduler: do not keep a copy of sched list

2019-12-06 Thread Nirmoy Das
entity should not keep copy and maintain sched list for itself. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 11 --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h | 1 + drivers/gpu/drm/scheduler/sched_entity.c | 12 +--- 3 files changed, 10