drm_sched_e...modify_sched(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 existing entity->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 in sched_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 for entity as drm_sched_job_arm and drm_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 to entity.

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 πŸ’–:

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