Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/sched: Re-order struct drm_sched_rq members for clarity

Current kerneldoc for struct drm_sched_rq incompletely documents what
fields are protected by the lock.

This is not good because it is misleading.

Lets fix it by listing all the elements which are protected by the lock.

While at it, lets also re-order the members so all protected by the lock
are in a single group.

v2:
* Refer variables by kerneldoc syntax, more verbose commit text. (Philipp)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Luben Tuikov <ltuikov89@gmail.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <pstanner@redhat.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241016122013.7857-4-tursulin@igalia.com

authored by

Tvrtko Ursulin and committed by
Philipp Stanner
a6f46283 6a313579

+6 -4
+6 -4
include/drm/gpu_scheduler.h
··· 243 243 /** 244 244 * struct drm_sched_rq - queue of entities to be scheduled. 245 245 * 246 - * @lock: to modify the entities list. 247 246 * @sched: the scheduler to which this rq belongs to. 248 - * @entities: list of the entities to be scheduled. 247 + * @lock: protects @entities, @rb_tree_root and @current_entity. 249 248 * @current_entity: the entity which is to be scheduled. 249 + * @entities: list of the entities to be scheduled. 250 250 * @rb_tree_root: root of time based priority queue of entities for FIFO scheduling 251 251 * 252 252 * Run queue is a set of entities scheduling command submissions for ··· 254 254 * the next entity to emit commands from. 255 255 */ 256 256 struct drm_sched_rq { 257 - spinlock_t lock; 258 257 struct drm_gpu_scheduler *sched; 259 - struct list_head entities; 258 + 259 + spinlock_t lock; 260 + /* Following members are protected by the @lock: */ 260 261 struct drm_sched_entity *current_entity; 262 + struct list_head entities; 261 263 struct rb_root_cached rb_tree_root; 262 264 }; 263 265