drm_sched_pick_best(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_sched_pick_best(9) β€” bestie edition

okay so this is a page straight out of the Kernel API Manual, and honestly? it's a little baddie. it does exactly one thing and it does it well. let's get into it 🫢


✨ NAME ✨

drm_sched_pick_best β€” get a drm sched from a sched_list with the least load πŸ’–

like, you hand it a whole lineup of schedulers and it picks the one that's least busy. main character selection energy, fr fr.


🌸 SYNOPSIS 🌸

struct drm_gpu_scheduler * drm_sched_pick_best (struct drm_gpu_scheduler
**sched_list , unsigned int num_sched_list );

so it returns a struct drm_gpu_scheduler * and it takes two things. simple. iconic. no notes. ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • sched_list β€” list of drm_gpu_schedulers πŸ¦‹ the whole roster, the group chat, the lineup.
  • num_sched_list β€” number of drm_gpu_schedulers in the sched_list πŸ’… so it knows how many besties are actually in there and doesn't go reading past the end, which would be so embarrassing.

πŸ”₯ DESCRIPTION πŸ”₯

Returns pointer of the sched with the least load, or NULL if none of the drm_gpu_schedulers are ready 😭

that's it. that's the whole vibe. it looks at everyone in sched_list, finds the one carrying the least, and hands you back a pointer to them. no cap.

⚠️ but if nobody in the list is ready, you get NULL back. so please, for the love of everything, check it before you dereference. we are not doing a segfault today bestie πŸ’€

πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/gpu/drm/scheduler/sched_main.c β€” Overview(9), Flow Control(9), sched_policy (int)(9), drm_sched_can_queue(9), drm_sched_run_job_queue(9), drm_sched_run_free_queue(9), drm_sched_job_done(9), drm_sched_job_done_cb(9), drm_sched_start_timeout(9), drm_sched_tdr_queue_imm(9), drm_sched_fault(9), drm_sched_suspend_timeout(9), drm_sched_resume_timeout(9), drm_sched_job_reinsert_on_false_timeout(9), drm_sched_stop(9), drm_sched_start(9), drm_sched_resubmit_jobs(9), drm_sched_job_init(9), drm_sched_job_arm(9), drm_sched_job_add_dependency(9), drm_sched_job_add_syncobj_dependency(9), drm_sched_job_add_resv_dependencies(9), drm_sched_job_add_implicit_dependencies(9), drm_sched_job_has_dependency(9), drm_sched_job_cleanup(9), drm_sched_wakeup(9), drm_sched_select_entity(9), drm_sched_get_finished_job(9), drm_sched_free_job_work(9), drm_sched_run_job_work(9), drm_sched_init(9), drm_sched_fini(9), drm_sched_increase_karma(9), drm_sched_wqueue_ready(9), drm_sched_wqueue_stop(9), drm_sched_wqueue_start(9), drm_sched_is_stopped(9), drm_sched_job_is_signaled(9)

like yeah that's a lot of friends but they're all slay, go read them 🧚


okay that's the whole page!! πŸ“ this one lives over in ./drivers/gpu/drm/scheduler, it's from October 2026, and it's filed under drm_sched_pick_best(9) in the Kernel API Manual. go pick the least-loaded scheduler bestie, i believe in you πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from