include/drm/gpu_scheduler.h
Source file repositories/reference/linux-study-clean/include/drm/gpu_scheduler.h
File Facts
- System
- Linux kernel
- Corpus path
include/drm/gpu_scheduler.h- Extension
.h- Size
- 25304 bytes
- Lines
- 757
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/spsc_queue.hlinux/average.hlinux/dma-fence.hlinux/completion.hlinux/xarray.hlinux/workqueue.h
Detected Declarations
struct dma_resvstruct drm_gem_objectstruct drm_gpu_schedulerstruct drm_sched_rqstruct drm_filestruct drm_sched_entity_statsstruct drm_sched_entitystruct drm_sched_rqstruct drm_sched_fencestruct drm_sched_jobstruct drm_sched_backend_opsstruct drm_gpu_schedulerstruct drm_sched_init_argsstruct drm_sched_pending_job_iterenum dma_resv_usageenum drm_sched_priorityenum drm_gpu_sched_statfunction drm_sched_invalidate_jobfunction __drm_sched_pending_job_iter_beginfunction __drm_sched_pending_job_iter_endfunction class_drm_sched_pending_job_iter_lock_ptr
Annotated Snippet
struct drm_sched_entity {
/**
* @list:
*
* Used to append this struct to the list of entities in the runqueue
* @rq under &drm_sched_rq.entities.
*
* Protected by &drm_sched_rq.lock of @rq.
*/
struct list_head list;
/**
* @lock:
*
* Lock protecting the run-queue (@rq) to which this entity belongs,
* @priority and the list of schedulers (@sched_list, @num_sched_list).
*/
spinlock_t lock;
/**
* @rq:
*
* Runqueue on which this entity is currently scheduled.
*
* FIXME: Locking is very unclear for this. Writers are protected by
* @lock, but readers are generally lockless and seem to just race with
* not even a READ_ONCE.
*/
struct drm_sched_rq *rq;
/**
* @stats: Stats object reference held by the entity and jobs.
*/
struct drm_sched_entity_stats *stats;
/**
* @sched_list:
*
* A list of schedulers (struct drm_gpu_scheduler). Jobs from this entity can
* be scheduled on any scheduler on this list.
*
* This can be modified by calling drm_sched_entity_modify_sched().
* Locking is entirely up to the driver, see the above function for more
* details.
*
* This will be set to NULL if &num_sched_list equals 1 and @rq has been
* set already.
*
* FIXME: This means priority changes through
* drm_sched_entity_set_priority() will be lost henceforth in this case.
*/
struct drm_gpu_scheduler **sched_list;
/**
* @num_sched_list:
*
* Number of drm_gpu_schedulers in the @sched_list.
*/
unsigned int num_sched_list;
/**
* @priority:
*
* Priority of the entity. This can be modified by calling
* drm_sched_entity_set_priority(). Protected by @lock.
*/
enum drm_sched_priority priority;
/**
* @job_queue: the list of jobs of this entity.
*/
struct spsc_queue job_queue;
/**
* @fence_seq:
*
* A linearly increasing seqno incremented with each new
* &drm_sched_fence which is part of the entity.
*
* FIXME: Callers of drm_sched_job_arm() need to ensure correct locking,
* this doesn't need to be atomic.
*/
atomic_t fence_seq;
/**
* @fence_context:
*
* A unique context for all the fences which belong to this entity. The
* &drm_sched_fence.scheduled uses the fence_context but
* &drm_sched_fence.finished uses fence_context + 1.
Annotation
- Immediate include surface: `drm/spsc_queue.h`, `linux/average.h`, `linux/dma-fence.h`, `linux/completion.h`, `linux/xarray.h`, `linux/workqueue.h`.
- Detected declarations: `struct dma_resv`, `struct drm_gem_object`, `struct drm_gpu_scheduler`, `struct drm_sched_rq`, `struct drm_file`, `struct drm_sched_entity_stats`, `struct drm_sched_entity`, `struct drm_sched_rq`, `struct drm_sched_fence`, `struct drm_sched_job`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.