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

2024-09-10 Thread Tvrtko Ursulin
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 schrieb Philipp Stanner: On Mon, 2024-09-09 at 13:29 +0200, Christian König wrote: Am 09.09.24 um 11:44 schrieb Philipp Stan

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

2024-09-09 Thread Christian König
Am 09.09.24 um 15:27 schrieb Tvrtko Ursulin: On 09/09/2024 13:46, Philipp Stanner wrote: On Mon, 2024-09-09 at 13:37 +0100, Tvrtko Ursulin wrote: [SNIP] That could also be a great opportunity for improving the lock naming: Well that comment made me laugh because I point out the same when th

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 schrieb Philipp Stanner: > > > > > On Mon, 202

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

2024-09-09 Thread Tvrtko Ursulin
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 Philipp Stanner: On Fri, 2024-09-06 at 19:06 +0100, Tvrtko Ursulin wrote: From: Tvrtko Ursulin Without the locki

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 Philipp Stanner: > > > > > On Fri, 2024-09

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

2024-09-09 Thread Christian König
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 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_ent

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 > > > amdgpu_ctx_set_entity_priority() and dr

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

2024-09-09 Thread Christian König
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 amdgpu_ctx_set_entity_priority() and drm_sched_job_arm(), I would explicitly say "amdgpu's amdgpu_ctx_set_entity_priority()

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

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

2024-09-06 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Without the locking amdgpu currently can race amdgpu_ctx_set_entity_priority() and drm_sched_job_arm(), leading to the latter accesing potentially inconsitent entity->sched_list and entity->num_sched_list pair. The comment on drm_sched_entity_modify_sched() however says: ""