drm_sched_e...modify_sched(9)
π drm_sched_e...modify_sched(9) β a.k.a. the "swap out ur entity's scheds" girlie
okay so welcome to the Kernel API Manual, bestie π this one is short but she is important, so pay attention.
β¨ NAME β¨
drm_sched_entity_modify_sched β Modify sched of an entity. that's it. that's the whole vibe. she modifies the sched. of an entity. π
π¦ SYNOPSIS π¦
void drm_sched_entity_modify_sched (struct drm_sched_entity *entity ,
struct drm_gpu_scheduler **sched_list , unsigned int num_sched_list );
like, literally copy-paste that, no cap. returns nothing (void) β she's not here to give you answers, she's here to do the thing. π₯
πΈ ARGUMENTS πΈ
entityβ the scheduler entity to init π«Ά (yes that's what the manpage says, and yes we're keeping it word for word, don't come for me)sched_listβ the list of new drm scheds which will replace the existingentity->sched_list. so it's a whole glow-up for your entity's sched list β out with the old, in with the new β¨num_sched_listβ number of drm sched insched_list. gotta tell her how many besties are in the group chat, otherwise she's just guessing π
π DESCRIPTION π
okay so here's the part where you actually have to be careful, listen up:
Note that this must be called under the same common lock forentityasdrm_sched_job_armanddrm_sched_entity_push_job, or the driver needs to guarantee through some other means that this is never called while new jobs can be pushed toentity.
fr fr. this is the main character warning of the whole page π¨ you either hold that same common lock that drm_sched_job_arm and drm_sched_entity_push_job use for entity, or your driver has to guarantee some other way that nobody is pushing new jobs to entity while you're in here swapping scheds. no "eh it'll probably be fine" energy allowed. that's a race condition and race conditions are NOT slay. π
π SEE ALSO π
the kernel file, in all her glory:
Kernel file ./drivers/gpu/drm/scheduler/sched_entity.c
and the whole friend group π:
drm_sched_entity_stats_release(9)drm_sched_entity_stats_new(9)drm_sched_entity_stats_job_add_gpu_time(9)drm_sched_entity_init(9)drm_sched_entity_error(9)drm_sched_entity_kill(9)drm_sched_entity_flush(9)drm_sched_entity_fini(9)drm_sched_entity_destroy(9)drm_sched_entity_set_priority(9)drm_sched_entity_push_job(9)
like, the entire drm_sched_entity_* squad. go read them, iykyk π
mwah that's the page!! this lil drop lives in ./drivers/gpu/drm/scheduler π¦, straight outta the Kernel API Manual, dated October 2026 β β and the header/footer both just say drm_sched_e...modify_sched(9) again because the manpage loves a callback. anyway ily, go hold that lock ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms