Re: [PATCH v6 0/6] drm/sched: Job queue peek/pop helpers and struct job re-order

2025-02-24 Thread Philipp Stanner
rmat. > > v6: >  * Added SPDX to the new header file. > > Cc: Christian König > Cc: Danilo Krummrich > Cc: Matthew Brost > Cc: Philipp Stanner > > Tvrtko Ursulin (6): >   drm/sched: Add internal job peek/pop API >   drm/amdgpu: Pop jobs from the queue more

Re: [PATCH v5 1/6] drm/sched: Add internal job peek/pop API

2025-02-19 Thread Philipp Stanner
On Tue, 2025-02-18 at 14:17 -0800, Matthew Brost wrote: > On Tue, Feb 18, 2025 at 06:26:15PM +, Tvrtko Ursulin wrote: > > > > On 18/02/2025 12:26, Philipp Stanner wrote: > > > Thx for the updated version. Overlooked it, I was out on Friday. > > > See > &g

Re: [PATCH v5 1/6] drm/sched: Add internal job peek/pop API

2025-02-18 Thread Philipp Stanner
mplemented with a container_of. > > This also allows us to remove duplicate definitions of > to_drm_sched_job. > > Signed-off-by: Tvrtko Ursulin > Cc: Christian König > Cc: Danilo Krummrich > Cc: Matthew Brost > Cc: Philipp Stanner > --- >  drivers/gpu/drm/sched

Re: [PATCH 1/6] drm/sched: Add internal job peek/pop API

2025-02-18 Thread Philipp Stanner
On Thu, 2025-02-13 at 14:05 -0800, Matthew Brost wrote: > On Wed, Feb 12, 2025 at 01:36:58PM +0100, Philipp Stanner wrote: > > On Wed, 2025-02-12 at 12:30 +, Tvrtko Ursulin wrote: > > > > > > On 12/02/2025 10:40, Philipp Stanner wrote: > > > > On Wed, 20

Re: [PATCH 1/6] drm/sched: Add internal job peek/pop API

2025-02-12 Thread Philipp Stanner
On Wed, 2025-02-12 at 09:32 +, Tvrtko Ursulin wrote: > > On 12/02/2025 09:02, Philipp Stanner wrote: > > On Fri, 2025-02-07 at 14:50 +, Tvrtko Ursulin wrote: > > > Idea is to add helpers for peeking and popping jobs from entities > > > with > >

Re: [PATCH v4] drm/sched: Use struct for drm_sched_init() params

2025-02-12 Thread Philipp Stanner
On Tue, 2025-02-11 at 12:14 +0100, Philipp Stanner wrote: > drm_sched_init() has a great many parameters and upcoming new > functionality for the scheduler might add even more. Generally, the > great number of parameters reduces readability and has already caused > one missnaming,

Re: [PATCH 1/6] drm/sched: Add internal job peek/pop API

2025-02-12 Thread Philipp Stanner
e definitions of > to_drm_sched_job. > > Signed-off-by: Tvrtko Ursulin > Cc: Christian König > Cc: Danilo Krummrich > Cc: Matthew Brost > Cc: Philipp Stanner > --- >  drivers/gpu/drm/scheduler/sched_entity.c   | 11 +++--- >  drivers/gpu/drm/scheduler/sched_

Re: [PATCH 4/6] drm/sched: Move drm_sched_entity_is_ready to internal header

2025-02-12 Thread Philipp Stanner
> Cc: Danilo Krummrich > Cc: Matthew Brost > Cc: Philipp Stanner > --- >  drivers/gpu/drm/scheduler/sched_entity.c   | 12 >  drivers/gpu/drm/scheduler/sched_internal.h | 13 + >  include/drm/gpu_scheduler.h    |  1 - >  3 files chan

Re: [PATCH 1/6] drm/sched: Add internal job peek/pop API

2025-02-12 Thread Philipp Stanner
On Wed, 2025-02-12 at 12:30 +, Tvrtko Ursulin wrote: > > On 12/02/2025 10:40, Philipp Stanner wrote: > > On Wed, 2025-02-12 at 09:32 +, Tvrtko Ursulin wrote: > > > > > > On 12/02/2025 09:02, Philipp Stanner wrote: > > > > On Fri, 2025-

Re: [PATCH 2/3] drm/amdgpu: Pop jobs from the queue more robustly

2025-02-11 Thread Philipp Stanner
gt; amdgpu_job_stop_all_jobs_on_sched is removed. > > > > Signed-off-by: Tvrtko Ursulin > > Cc: Christian König > > Cc: Danilo Krummrich > > Cc: Matthew Brost > > Cc: Philipp Stanner > > Cc: "Zhang, Hawking" > > Reviewed-by: Christian Kön

[PATCH v4] drm/sched: Use struct for drm_sched_init() params

2025-02-11 Thread Philipp Stanner
me in nouveau_sched_init()"). Introduce a new struct for the scheduler init parameters and port all users. Signed-off-by: Philipp Stanner Reviewed-by: Liviu Dudau Acked-by: Matthew Brost # for Xe Reviewed-by: Boris Brezillon # for Panfrost and Panthor Reviewed-by: Christian Gmeiner # for Etnavi

[PATCH v3] drm/sched: Use struct for drm_sched_init() params

2025-02-07 Thread Philipp Stanner
_init()"). Introduce a new struct for the scheduler init parameters and port all users. Signed-off-by: Philipp Stanner Reviewed-by: Liviu Dudau Acked-by: Matthew Brost # for Xe Reviewed-by: Boris Brezillon # for Panfrost and Panthor Reviewed-by: Christian Gmeiner # for Etnaviv Reviewed

Re: [PATCH 1/4] drm/scheduler: Add drm_sched_cancel_all_jobs helper

2025-02-06 Thread Philipp Stanner
On Thu, 2025-02-06 at 14:46 +0100, Christian König wrote: > Am 06.02.25 um 14:35 schrieb Philipp Stanner: > > On Wed, 2025-02-05 at 15:33 +, Tvrtko Ursulin wrote: > > > The helper copies code from the existing > > > amdgpu_job_stop_all_jobs_on_sched > > &

Re: [PATCH 3/4] drm/sched: Add internal job peek/pop API

2025-02-06 Thread Philipp Stanner
his also allows us to remove duplicate definition of > to_drm_sched_job > which the scheduler apparently tried to keep internal, but failed > since > in one of the previous patches we also removed a copy from amdgpu. > > Signed-off-by: Tvrtko Ursulin This one LGTM, +1 > Cc: Christian

Re: [PATCH 1/4] drm/scheduler: Add drm_sched_cancel_all_jobs helper

2025-02-06 Thread Philipp Stanner
re. P. > > Signed-off-by: Tvrtko Ursulin > Cc: Christian König > Cc: Danilo Krummrich > Cc: Matthew Brost > Cc: Philipp Stanner > --- >  drivers/gpu/drm/scheduler/sched_main.c | 44 > ++ >  include/drm/gpu_scheduler.h    |  1 + &

Re: [PATCH 1/4] drm/scheduler: Add drm_sched_cancel_all_jobs helper

2025-02-06 Thread Philipp Stanner
On Thu, 2025-02-06 at 13:53 +, Tvrtko Ursulin wrote: > > On 06/02/2025 13:46, Christian König wrote: > > Am 06.02.25 um 14:35 schrieb Philipp Stanner: > > > On Wed, 2025-02-05 at 15:33 +, Tvrtko Ursulin wrote: > > > > The hel

Re: [PATCH v2] drm/sched: Use struct for drm_sched_init() params

2025-01-30 Thread Philipp Stanner
On Tue, 2025-01-28 at 15:56 +0100, Danilo Krummrich wrote: > On Tue, Jan 28, 2025 at 03:29:27PM +0100, Philipp Stanner wrote: > > drm_sched_init() has a great many parameters and upcoming new > > functionality for the scheduler might add even more. Generally, the > > great

Re: [PATCH v2] drm/sched: Use struct for drm_sched_init() params

2025-01-29 Thread Philipp Stanner
On Wed, 2025-01-29 at 07:53 -0300, Maíra Canal wrote: > Hi Philipp, > > On 28/01/25 11:29, Philipp Stanner wrote: > > drm_sched_init() has a great many parameters and upcoming new > > functionality for the scheduler might add even more. Generally, the > > great n

[PATCH v2] drm/sched: Use struct for drm_sched_init() params

2025-01-28 Thread Philipp Stanner
me in nouveau_sched_init()"). Introduce a new struct for the scheduler init parameters and port all users. Signed-off-by: Philipp Stanner --- Changes in v2: - Point out that the hang-limit is deprecated. (Christian) - Initialize the structs to 0 at declaration. (Planet Earth) - Don't set stuff

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Philipp Stanner
On Thu, 2025-01-23 at 08:10 -0300, Maíra Canal wrote: > Hi Philipp, > > On 23/01/25 05:10, Philipp Stanner wrote: > > On Wed, 2025-01-22 at 19:07 -0300, Maíra Canal wrote: > > > Hi Philipp, > > > > > > On 22/01/25 11:08, Philipp Stanner wrote: > >

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Philipp Stanner
On Wed, 2025-01-22 at 18:16 +0100, Boris Brezillon wrote: > On Wed, 22 Jan 2025 15:08:20 +0100 > Philipp Stanner wrote: > > >  int drm_sched_init(struct drm_gpu_scheduler *sched, > > -    const struct drm_sched_backend_ops *ops, > > -    struct workqueue_struct *subm

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Philipp Stanner
On Thu, 2025-01-23 at 10:29 +0100, Danilo Krummrich wrote: > On Thu, Jan 23, 2025 at 08:33:01AM +0100, Philipp Stanner wrote: > > On Wed, 2025-01-22 at 18:16 +0100, Boris Brezillon wrote: > > > On Wed, 22 Jan 2025 15:08:20 +0100 > > > Philipp Stanner wrote: > &g

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Philipp Stanner
On Thu, 2025-01-23 at 09:10 +0100, Philipp Stanner wrote: > On Wed, 2025-01-22 at 19:07 -0300, Maíra Canal wrote: > > Hi Philipp, > > > > On 22/01/25 11:08, Philipp Stanner wrote: > > > drm_sched_init() has a great many parameters and upcoming new > > > fu

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Philipp Stanner
On Wed, 2025-01-22 at 19:07 -0300, Maíra Canal wrote: > Hi Philipp, > > On 22/01/25 11:08, Philipp Stanner wrote: > > drm_sched_init() has a great many parameters and upcoming new > > functionality for the scheduler might add even more. Generally, the > > great n

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-22 Thread Philipp Stanner
t; > On Wed, 22 Jan 2025 15:08:20 +0100 > > > > Philipp Stanner wrote: > > > >   > > > > > --- a/drivers/gpu/drm/panthor/panthor_sched.c > > > > > +++ b/drivers/gpu/drm/panthor/panthor_sched.c > > > > > @@ -3272,6 +3272,7 @@ group_creat

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-22 Thread Philipp Stanner
On Wed, 2025-01-22 at 16:06 +0100, Christian König wrote: > Am 22.01.25 um 15:48 schrieb Philipp Stanner: > > On Wed, 2025-01-22 at 15:34 +0100, Christian König wrote: > > > Am 22.01.25 um 15:08 schrieb Philipp Stanner: > > > > drm_sched_init() has a great ma

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-22 Thread Philipp Stanner
On Wed, 2025-01-22 at 15:34 +0100, Christian König wrote: > Am 22.01.25 um 15:08 schrieb Philipp Stanner: > > drm_sched_init() has a great many parameters and upcoming new > > functionality for the scheduler might add even more. Generally, the > > great number of parameters re

[PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-22 Thread Philipp Stanner
me in nouveau_sched_init()"). Introduce a new struct for the scheduler init parameters and port all users. Signed-off-by: Philipp Stanner --- Howdy, I have a patch-series in the pipe that will add a `flags` argument to drm_sched_init(). I thought it would be wise to first rework the API as detailed in this p

Re: [PATCH] drm/amdgpu: Make the submission path memory reclaim safe

2024-12-17 Thread Philipp Stanner
> the > submission path use it. > > Signed-off-by: Tvrtko Ursulin > References: 746ae46c1113 ("drm/sched: Mark scheduler work queues with > WQ_MEM_RECLAIM") > Fixes: a6149f039369 ("drm/sched: Convert drm scheduler to use a work > queue rather than kthread&quo

Re: [PATCH v2] drm/sched: Further optimise drm_sched_entity_push_job

2024-09-26 Thread Philipp Stanner
; > We also align drm_sched_rq_update_fifo_locked(), > > > > > drm_sched_rq_add_entity() and > > > > > drm_sched_rq_remove_fifo_locked() function signatures, by > > > > > adding rq > > > > > as a > > > > > parameter to the lat

Re: [PATCH v2] drm/sched: Further optimise drm_sched_entity_push_job

2024-09-26 Thread Philipp Stanner
q_update_fifo_locked(), > > drm_sched_rq_add_entity() and > > drm_sched_rq_remove_fifo_locked() function signatures, by adding rq > > as a > > parameter to the latter. > > > > v2: > >   * Fix after rebase of the series. > >   * Avoid naming incos

Re: [PATCH 6/8] drm/sched: Re-order struct drm_sched_rq members for clarity

2024-09-16 Thread Philipp Stanner
Ursulin > Cc: Christian König > Cc: Alex Deucher > Cc: Luben Tuikov > Cc: Matthew Brost > Cc: Philipp Stanner > Reviewed-by: Christian König Looks good, thx Reviewed-by: Philipp Stanner > --- >  include/drm/gpu_scheduler.h | 10 ++ >  1 file change

Re: [PATCH 8/8] drm/sched: Further optimise drm_sched_entity_push_job

2024-09-13 Thread Philipp Stanner
On Wed, 2024-09-11 at 13:22 +0100, Tvrtko Ursulin wrote: > > On 10/09/2024 11:25, Philipp Stanner wrote: > > On Mon, 2024-09-09 at 18:19 +0100, Tvrtko Ursulin wrote: > > > From: Tvrtko Ursulin > > > > > > Having removed one re-lock cycle on the entity-&

Re: [PATCH 6/8] drm/sched: Re-order struct drm_sched_rq members for clarity

2024-09-10 Thread Philipp Stanner
On Tue, 2024-09-10 at 11:42 +0100, Tvrtko Ursulin wrote: > > On 10/09/2024 11:05, Philipp Stanner wrote: > > On Mon, 2024-09-09 at 18:19 +0100, Tvrtko Ursulin wrote: > > > From: Tvrtko Ursulin > > > > > > Lets re-order the members to make it clear whic

Re: [PATCH 8/8] drm/sched: Further optimise drm_sched_entity_push_job

2024-09-10 Thread Philipp Stanner
Why is dereferencing it a problem? > > Signed-off-by: Tvrtko Ursulin > Cc: Christian König > Cc: Alex Deucher > Cc: Luben Tuikov > Cc: Matthew Brost > Cc: Philipp Stanner > --- >  drivers/gpu/drm/scheduler/sched_entity.c |  7 ++-- >  drivers/gpu/drm/scheduler/

Re: [PATCH 6/8] drm/sched: Re-order struct drm_sched_rq members for clarity

2024-09-10 Thread Philipp Stanner
visible." > > Signed-off-by: Tvrtko Ursulin > Cc: Christian König > Cc: Alex Deucher > Cc: Luben Tuikov > Cc: Matthew Brost > Cc: Philipp Stanner > --- >  include/drm/gpu_scheduler.h | 10 ++ >  1 file changed, 6 insertions(+), 4 deletions(-) > > d

Re: [PATCH 5/8] drm/sched: Stop setting current entity in FIFO mode

2024-09-10 Thread Philipp Stanner
e the change in behaviour is > simply > to restart from the first entity, instead of continuing in RR mode > from > where FIFO left it, and that sounds completely fine. > > Signed-off-by: Tvrtko Ursulin I went through the code and agree that this looks good. Reviewed-by: Phili

Re: [RFC 1/4] drm/sched: Add locking to drm_sched_entity_modify_sched

2024-09-09 Thread Philipp Stanner
On Mon, 2024-09-09 at 14:27 +0100, Tvrtko Ursulin wrote: > > On 09/09/2024 13:46, Philipp Stanner wrote: > > On Mon, 2024-09-09 at 13:37 +0100, Tvrtko Ursulin wrote: > > > > > > On 09/09/2024 13:18, Christian König wrote: > > > > Am 09.09.24 um 14:13

Re: [RFC 1/4] drm/sched: Add locking to drm_sched_entity_modify_sched

2024-09-09 Thread Philipp Stanner
On Mon, 2024-09-09 at 13:37 +0100, Tvrtko Ursulin wrote: > > On 09/09/2024 13:18, Christian König wrote: > > Am 09.09.24 um 14:13 schrieb Philipp Stanner: > > > On Mon, 2024-09-09 at 13:29 +0200, Christian König wrote: > > > > Am 09.09.24 um 11:44 schrieb Philip

Re: [RFC 1/4] drm/sched: Add locking to drm_sched_entity_modify_sched

2024-09-09 Thread Philipp Stanner
On Mon, 2024-09-09 at 13:29 +0200, Christian König wrote: > Am 09.09.24 um 11:44 schrieb Philipp Stanner: > > On Fri, 2024-09-06 at 19:06 +0100, Tvrtko Ursulin wrote: > > > From: Tvrtko Ursulin > > > > > > Without the locking amdgpu currently can race > &

Re: [RFC 2/4] drm/sched: Always wake up correct scheduler in drm_sched_entity_push_job

2024-09-09 Thread Philipp Stanner
On Fri, 2024-09-06 at 19:06 +0100, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin > > Since drm_sched_entity_modify_sched() can modify the entities run > queue > lets make sure to only derefernce the pointer once so both adding and > waking up are guaranteed to be consistent. > > Signed-off-by: Tv

Re: [RFC 1/4] drm/sched: Add locking to drm_sched_entity_modify_sched

2024-09-09 Thread Philipp Stanner
On Fri, 2024-09-06 at 19:06 +0100, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin > > Without the locking amdgpu currently can race > amdgpu_ctx_set_entity_priority() and drm_sched_job_arm(),  I would explicitly say "amdgpu's amdgpu_ctx_set_entity_priority() races through drm_sched_entity_modify_s

Re: [RFC 0/4] DRM scheduler fixes, or not, or incorrect kind

2024-09-09 Thread Philipp Stanner
Hi, On Fri, 2024-09-06 at 19:06 +0100, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin > > In a recent conversation with Christian there was a thought that > drm_sched_entity_modify_sched() should start using the entity- > >rq_lock to be > safe against job submission and simultaneous priority chang

Re: [RFC PATCH 0/6] Supporting GMEM (generalized memory management) for external memory devices

2023-12-01 Thread Philipp Stanner
On Fri, 2023-12-01 at 02:37 +, zhuweixi wrote: > From your argument on KVM I can see that the biggest miscommunication > between us is that you believed that GMEM wanted to share the whole > address space. No, it is not the case. GMEM is only providing > coordination via certain mmap() calls. S