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: Fix outdated comments referencing thread

The GPU scheduler's comments refer to a "thread" at various places.
Those are leftovers from commit a6149f039369 ("drm/sched: Convert drm
scheduler to use a work queue rather than kthread").

Replace all references to kthreads.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250314101023.111248-2-phasta@kernel.org

+18 -16
+4 -4
drivers/gpu/drm/scheduler/sched_entity.c
··· 545 545 return; 546 546 547 547 /* 548 - * Only when the queue is empty are we guaranteed that the scheduler 549 - * thread cannot change ->last_scheduled. To enforce ordering we need 550 - * a read barrier here. See drm_sched_entity_pop_job() for the other 551 - * side. 548 + * Only when the queue is empty are we guaranteed that 549 + * drm_sched_run_job_work() cannot change entity->last_scheduled. To 550 + * enforce ordering we need a read barrier here. See 551 + * drm_sched_entity_pop_job() for the other side. 552 552 */ 553 553 smp_rmb(); 554 554
+13 -11
drivers/gpu/drm/scheduler/sched_main.c
··· 391 391 * drm_sched_job_done - complete a job 392 392 * @s_job: pointer to the job which is done 393 393 * 394 - * Finish the job's fence and wake up the worker thread. 394 + * Finish the job's fence and resubmit the work items. 395 395 */ 396 396 static void drm_sched_job_done(struct drm_sched_job *s_job, int result) 397 397 { ··· 551 551 552 552 if (job) { 553 553 /* 554 - * Remove the bad job so it cannot be freed by concurrent 555 - * drm_sched_cleanup_jobs. It will be reinserted back after sched->thread 556 - * is parked at which point it's safe. 554 + * Remove the bad job so it cannot be freed by a concurrent 555 + * &struct drm_sched_backend_ops.free_job. It will be 556 + * reinserted after the scheduler's work items have been 557 + * cancelled, at which point it's safe. 557 558 */ 558 559 list_del_init(&job->list); 559 560 spin_unlock(&sched->job_list_lock); ··· 600 599 601 600 /* 602 601 * Reinsert back the bad job here - now it's safe as 603 - * drm_sched_get_finished_job cannot race against us and release the 602 + * drm_sched_get_finished_job() cannot race against us and release the 604 603 * bad job at this point - we parked (waited for) any in progress 605 - * (earlier) cleanups and drm_sched_get_finished_job will not be called 606 - * now until the scheduler thread is unparked. 604 + * (earlier) cleanups and drm_sched_get_finished_job() will not be 605 + * called now until the scheduler's work items are submitted again. 607 606 */ 608 607 if (bad && bad->sched == sched) 609 608 /* ··· 616 615 * Iterate the job list from later to earlier one and either deactive 617 616 * their HW callbacks or remove them from pending list if they already 618 617 * signaled. 619 - * This iteration is thread safe as sched thread is stopped. 618 + * This iteration is thread safe as the scheduler's work items have been 619 + * cancelled. 620 620 */ 621 621 list_for_each_entry_safe_reverse(s_job, tmp, &sched->pending_list, 622 622 list) { ··· 682 680 struct drm_sched_job *s_job, *tmp; 683 681 684 682 /* 685 - * Locking the list is not required here as the sched thread is parked 686 - * so no new jobs are being inserted or removed. Also concurrent 687 - * GPU recovers can't run in parallel. 683 + * Locking the list is not required here as the scheduler's work items 684 + * are currently not running, so no new jobs are being inserted or 685 + * removed. Also concurrent GPU recovers can't run in parallel. 688 686 */ 689 687 list_for_each_entry_safe(s_job, tmp, &sched->pending_list, list) { 690 688 struct dma_fence *fence = s_job->s_fence->parent;
+1 -1
include/drm/gpu_scheduler.h
··· 192 192 * @last_scheduled: 193 193 * 194 194 * Points to the finished fence of the last scheduled job. Only written 195 - * by the scheduler thread, can be accessed locklessly from 195 + * by drm_sched_entity_pop_job(). Can be accessed locklessly from 196 196 * drm_sched_job_arm() if the queue is empty. 197 197 */ 198 198 struct dma_fence __rcu *last_scheduled;