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: Remove a hole from struct drm_sched_job

We can re-order some struct members and take u32 credits outside of the
pointer sandwich and also for the last_dependency member we can get away
with an unsigned int since for dependency we use xa_limit_32b.

Pahole report before:
/* size: 160, cachelines: 3, members: 14 */
/* sum members: 156, holes: 1, sum holes: 4 */
/* last cacheline: 32 bytes */

And after:
/* size: 152, cachelines: 3, members: 14 */
/* last cacheline: 24 bytes */

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250221105038.79665-4-tvrtko.ursulin@igalia.com

authored by

Tvrtko Ursulin and committed by
Philipp Stanner
b76f1467 80b6ef8a

+21 -19
+21 -19
include/drm/gpu_scheduler.h
··· 338 338 * to schedule the job. 339 339 */ 340 340 struct drm_sched_job { 341 - struct spsc_node queue_node; 342 - struct list_head list; 341 + u64 id; 342 + 343 + /** 344 + * @submit_ts: 345 + * 346 + * When the job was pushed into the entity queue. 347 + */ 348 + ktime_t submit_ts; 343 349 344 350 /** 345 351 * @sched: ··· 355 349 * has finished. 356 350 */ 357 351 struct drm_gpu_scheduler *sched; 358 - struct drm_sched_fence *s_fence; 359 352 353 + struct drm_sched_fence *s_fence; 354 + struct drm_sched_entity *entity; 355 + 356 + enum drm_sched_priority s_priority; 360 357 u32 credits; 358 + /** @last_dependency: tracks @dependencies as they signal */ 359 + unsigned int last_dependency; 360 + atomic_t karma; 361 + 362 + struct spsc_node queue_node; 363 + struct list_head list; 361 364 362 365 /* 363 366 * work is used only after finish_cb has been used and will not be 364 367 * accessed anymore. 365 368 */ 366 369 union { 367 - struct dma_fence_cb finish_cb; 368 - struct work_struct work; 370 + struct dma_fence_cb finish_cb; 371 + struct work_struct work; 369 372 }; 370 373 371 - uint64_t id; 372 - atomic_t karma; 373 - enum drm_sched_priority s_priority; 374 - struct drm_sched_entity *entity; 375 374 struct dma_fence_cb cb; 375 + 376 376 /** 377 377 * @dependencies: 378 378 * ··· 387 375 * drm_sched_job_add_implicit_dependencies(). 388 376 */ 389 377 struct xarray dependencies; 390 - 391 - /** @last_dependency: tracks @dependencies as they signal */ 392 - unsigned long last_dependency; 393 - 394 - /** 395 - * @submit_ts: 396 - * 397 - * When the job was pushed into the entity queue. 398 - */ 399 - ktime_t submit_ts; 400 378 }; 401 379 402 380 static inline bool drm_sched_invalidate_job(struct drm_sched_job *s_job,