Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-04-05 Thread Daniel Vetter
On Tue, Mar 07, 2023 at 11:25:36PM +0900, Asahi Lina wrote: > drm_sched_fini() currently leaves any pending jobs dangling, which > causes segfaults and other badness when job completion fences are > signaled after the scheduler is torn down. > > Explicitly detach all jobs from their completion

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-13 Thread Faith Ekstrand
On Fri, 2023-03-10 at 18:58 +0900, Asahi Lina wrote: > On 10/03/2023 04.59, Faith Ekstrand wrote: > > On Thu, 2023-03-09 at 18:43 +0900, Asahi Lina wrote: > > > On 09/03/2023 17.42, Christian König wrote: > > > > Long story short: Don't do this! This is what the Windows > > > > drivers > > > >

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-10 Thread Asahi Lina
On 10/03/2023 04.59, Faith Ekstrand wrote: > On Thu, 2023-03-09 at 18:43 +0900, Asahi Lina wrote: >> On 09/03/2023 17.42, Christian König wrote: >>> Long story short: Don't do this! This is what the Windows drivers >>> have >>> been doing and it creates tons of problems. > > Yeah, we tried to do

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-09 Thread Faith Ekstrand
On Thu, 2023-03-09 at 18:43 +0900, Asahi Lina wrote: > On 09/03/2023 17.42, Christian König wrote: > > Am 08.03.23 um 20:37 schrieb Asahi Lina: > > > On 09/03/2023 03.12, Christian König wrote: > > > > Am 08.03.23 um 18:32 schrieb Asahi Lina: > > > > > [SNIP] > > > > > Yes but... none of this

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-09 Thread Asahi Lina
On 09/03/2023 20.47, Christian König wrote: > Am 09.03.23 um 10:43 schrieb Asahi Lina: >> On 09/03/2023 17.42, Christian König wrote: >>> Am 08.03.23 um 20:37 schrieb Asahi Lina: On 09/03/2023 03.12, Christian König wrote: > Am 08.03.23 um 18:32 schrieb Asahi Lina: >> [SNIP] >>

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-09 Thread Christian König
Am 09.03.23 um 10:43 schrieb Asahi Lina: On 09/03/2023 17.42, Christian König wrote: Am 08.03.23 um 20:37 schrieb Asahi Lina: On 09/03/2023 03.12, Christian König wrote: Am 08.03.23 um 18:32 schrieb Asahi Lina: [SNIP] Yes but... none of this cleans up jobs that are already submitted by the

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-09 Thread Asahi Lina
On 09/03/2023 17.42, Christian König wrote: > Am 08.03.23 um 20:37 schrieb Asahi Lina: >> On 09/03/2023 03.12, Christian König wrote: >>> Am 08.03.23 um 18:32 schrieb Asahi Lina: [SNIP] Yes but... none of this cleans up jobs that are already submitted by the scheduler and in its

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-09 Thread Christian König
Am 08.03.23 um 20:37 schrieb Asahi Lina: On 09/03/2023 03.12, Christian König wrote: Am 08.03.23 um 18:32 schrieb Asahi Lina: [SNIP] Yes but... none of this cleans up jobs that are already submitted by the scheduler and in its pending list, with registered completion callbacks, which were

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-08 Thread Asahi Lina
On 09/03/2023 03.12, Christian König wrote: > Am 08.03.23 um 18:32 schrieb Asahi Lina: >> [SNIP] >> Yes but... none of this cleans up jobs that are already submitted by the >> scheduler and in its pending list, with registered completion callbacks, >> which were already popped off of the entities.

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-08 Thread Christian König
Am 08.03.23 um 18:39 schrieb aly...@rosenzweig.io: You can't ask me for a list of pending jobs (the scheduler knows this, it doesn't make any sense to duplicate that outside) Silly question: could you add a new exported function to drm_sched to get the list of pending jobs, to be used by the

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-08 Thread Christian König
Am 08.03.23 um 18:32 schrieb Asahi Lina: [SNIP] Yes but... none of this cleans up jobs that are already submitted by the scheduler and in its pending list, with registered completion callbacks, which were already popped off of the entities. *That* is the problem this patch fixes! Ah! Yes that

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-08 Thread alyssa
> You can't ask me for a list > of pending jobs (the scheduler knows this, it doesn't make any sense to > duplicate that outside) Silly question: could you add a new exported function to drm_sched to get the list of pending jobs, to be used by the Rust abstraction internally? IDK if that makes

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-08 Thread Asahi Lina
On 09/03/2023 02.39, aly...@rosenzweig.io wrote: >> You can't ask me for a list >> of pending jobs (the scheduler knows this, it doesn't make any sense to >> duplicate that outside) > > Silly question: could you add a new exported function to drm_sched to get the > list of pending jobs, to be

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-08 Thread Asahi Lina
On 09/03/2023 00.42, Christian König wrote: > Am 08.03.23 um 16:18 schrieb Asahi Lina: >> On 08/03/2023 19.03, Christian König wrote: >>> Am 08.03.23 um 10:57 schrieb Maarten Lankhorst: On 2023-03-07 15:25, Asahi Lina wrote: > drm_sched_fini() currently leaves any pending jobs dangling,

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-08 Thread Christian König
Am 08.03.23 um 16:18 schrieb Asahi Lina: On 08/03/2023 19.03, Christian König wrote: Am 08.03.23 um 10:57 schrieb Maarten Lankhorst: On 2023-03-07 15:25, Asahi Lina wrote: drm_sched_fini() currently leaves any pending jobs dangling, which causes segfaults and other badness when job completion

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-08 Thread Asahi Lina
On 08/03/2023 19.03, Christian König wrote: > Am 08.03.23 um 10:57 schrieb Maarten Lankhorst: >> >> On 2023-03-07 15:25, Asahi Lina wrote: >>> drm_sched_fini() currently leaves any pending jobs dangling, which >>> causes segfaults and other badness when job completion fences are >>> signaled after

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-08 Thread Christian König
Am 08.03.23 um 10:57 schrieb Maarten Lankhorst: On 2023-03-07 15:25, Asahi Lina wrote: drm_sched_fini() currently leaves any pending jobs dangling, which causes segfaults and other badness when job completion fences are signaled after the scheduler is torn down. Explicitly detach all jobs

Re: [PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-08 Thread Maarten Lankhorst
On 2023-03-07 15:25, Asahi Lina wrote: drm_sched_fini() currently leaves any pending jobs dangling, which causes segfaults and other badness when job completion fences are signaled after the scheduler is torn down. Explicitly detach all jobs from their completion callbacks and free them. This

[PATCH RFC 11/18] drm/scheduler: Clean up jobs when the scheduler is torn down

2023-03-07 Thread Asahi Lina
drm_sched_fini() currently leaves any pending jobs dangling, which causes segfaults and other badness when job completion fences are signaled after the scheduler is torn down. Explicitly detach all jobs from their completion callbacks and free them. This makes it possible to write a sensible safe