Skip to contentSkip to conversation

Realtime workqueues and panthor realtime submission

RFC Superseded Tvrtko Ursulin 2 participants 6 messages Jul 17

Subsystems (4)

v2 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v2 cover Realtime workqueues and panthor realtime submission

This is a continuation of the previous discussion which was here:
https://lore.kernel.org/dri-devel/[email protected]/

Work is now converted to a much simpler approach by adding real-time scheduling workqueues based on Tejun's feedback

To re-cap, when an userspace thread submits GPU work, due how the DRM scheduler uses workqueues to feed the GPU, and regardless of the GPU rendering context priority, or the CPU scheduling priority of the userspace thread itself, the use of workqueues adds (a lot of) latency to the submit path.

When CPU is busy with enough backround load this translates to severe latency spikes measured as time between userspace submitting work and GPU actually being given that work to execute.

With the panthor workqueue upgraded to use WQ_HIGHPRI and varying the CPU priority of the submit thread, the test program from
https://gitlab.freedesktop.org/panfrost/linux/-/work_items/49 reproduces these kind of latencies:

. N RT
M 27 28 32

  95%  163  246   809
  98%  924  991  1882

Legend:

M = Median submit latency in us
95% = Percentile latency in us

. = Userspace submit thread SCHED_OTHER

   N = -||= nice -1
  RT = -||- FIFO 1

Upgrading the panthor workqueues so that the realtime GPU priority queue uses WQ_RTPRI, submit latency becomes completely controlled with the median of 14us and 95 and 98-th percentiles at 23us and 25us respectively.

Important to note is that VK_QUEUE_GLOBAL_PRIORITY_REALTIME already required the userspace to have CAP_SYS_NICE, meaning access to real-time workqueues is effectively also guared behind this capability. The implementation of WQ_RTPRI itself also adds some limites on the maximum number of worker threads in order to prevent scheduling starvation.

v2:
* See patch 1 changelog.

Cc Boris Brezillon <[email protected]>
Cc Chia-I Wu <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc Matthew Brost <[email protected]>
Cc Steven Price <[email protected]>
Cc Tejun Heo <[email protected]>

Tvrtko Ursulin (2):
workqueue: Add support for real-time workers drm/panthor: Create per queue priority workqueues

 drivers/gpu/drm/panthor/panthor_sched.c |  38 +++++-
 include/linux/workqueue.h               |  23 +++-
 kernel/workqueue.c                      | 149 ++++++++++++++++++------
 3 files changed, 166 insertions(+), 44 deletions(-)
Signature · 1 line
2.54.0
#1 lore raw

RFC v2 1/2 workqueue: Add support for real-time workers

For use cases such as the DRM scheduler submitting work to the GPU on behalf of low latency userspace applications, where latter have sufficient privileges to have had successfully obtained realtime Vulkan global priority, competing with random background CPU load can create large latency spikes which gets in the way of a smooth user experience.

For these situations the existing WQ_HIGHPRI does not bring a noticeable improvement and a stronger hint is needed.

Lets add WQ_RTPRI which creates workers with a SCHED_FIFO scheduling class to improve this.

We use a minimum priority level since we only care about winning the contest against normal background CPU load. We also limit the number of instantiated threads, both per workqueue to a maximum of two, or one on a dual processor machine, and system-wide to one less than the number of CPUs. The idea of that is to prevent system wide starvation caused by potentially misbehaving work items.

Cc Boris Brezillon <[email protected]>
Cc Chia-I Wu <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc Matthew Brost <[email protected]>
Cc Steven Price <[email protected]>
Cc Tejun Heo <[email protected]>

---
v2:
* Limit WQ_RTPRI to unbound workqueues and make it have strict CPU affinitity. (Tejun)
* Fixed commit message typos. (AI)
* Fixed sysfs handling, max_active setting and user modified nice application. (AI)

---
 include/linux/workqueue.h |  23 ++++--
 kernel/workqueue.c        | 149 +++++++++++++++++++++++++++++---------
 2 files changed, 133 insertions(+), 39 deletions(-)
include/linux/workqueue.h +18 -5
index 6177624539b3..bf92271501f0 100644
@@ -140,6 +140,13 @@ enum wq_affn_scope {
 	WQ_AFFN_NR_TYPES,
 };
 
+enum wq_priority {
+	WQ_PRIO_NORMAL = 0,
+	WQ_PRIO_HIGH = 1,
+	WQ_PRIO_RT = 2,
+	NUM_WQ_PRIO, /* Keep last */
+};
+
 /**
  * struct workqueue_attrs - A struct for workqueue attributes.
  *
@@ -147,7 +154,12 @@ enum wq_affn_scope {
  */
 struct workqueue_attrs {
 	/**
-	 * @nice: nice level
+	 * @prio: priority level
+	 */
+	enum wq_priority prio;
+
+	/**
+	 * @nice: nice level for WQ_PRIO_HIGH
 	 */
 	int nice;
 
@@ -374,8 +386,9 @@ enum wq_flags {
 	WQ_FREEZABLE		= 1 << 2, /* freeze during suspend */
 	WQ_MEM_RECLAIM		= 1 << 3, /* may be used for memory reclaim */
 	WQ_HIGHPRI		= 1 << 4, /* high priority */
-	WQ_CPU_INTENSIVE	= 1 << 5, /* cpu intensive workqueue */
-	WQ_SYSFS		= 1 << 6, /* visible in sysfs, see workqueue_sysfs_register() */
+	WQ_RTPRI		= 1 << 5, /* real-time priority, valid only with WQ_UNBOUND */
+	WQ_CPU_INTENSIVE	= 1 << 6, /* cpu intensive workqueue */
+	WQ_SYSFS		= 1 << 7, /* visible in sysfs, see workqueue_sysfs_register() */
 
 	/*
 	 * Per-cpu workqueues are generally preferred because they tend to
@@ -402,8 +415,8 @@ enum wq_flags {
 	 *
 	 * http://thread.gmane.org/gmane.linux.kernel/1480396
 	 */
-	WQ_POWER_EFFICIENT	= 1 << 7,
-	WQ_PERCPU		= 1 << 8, /* bound to a specific cpu */
+	WQ_POWER_EFFICIENT	= 1 << 8,
+	WQ_PERCPU		= 1 << 9, /* bound to a specific cpu */
 
 	__WQ_DESTROYING		= 1 << 15, /* internal: workqueue is destroying */
 	__WQ_DRAINING		= 1 << 16, /* internal: workqueue is draining */
kernel/workqueue.c +115 -34

360 lines not on this page · raw message

Signature · 1 line
2.54.0
Reviewed-by on v2 1/2
#2 lore raw

Re: [RFC v2 1/2] workqueue: Add support for real-time workers

Hi Tvrtko,

Applies to master. On linux-next one hunk rejects, the WQ_RTPRI block in __alloc_workqueue(), the rest is clean. Rebase v3 onto the wq tree, please..

Things to fix:

kernel/workqueue.c static struct worker *create_worker(struct worker_pool *pool) · line 2921

Quoted 6 lines
kernel/workqueue.c +3 -0
+fail_ida:
+	if (pool->attrs->prio == WQ_PRIO_RT)
+		atomic_dec(&total_rtpri_workers);
 fail:
 	ida_free(&pool->worker_ida, id);
 	kfree(worker);

Labels swapped. The ida_alloc() failure falls into fail:, so ida_free() gets a negative id and kfree() an uninitialized pointer, and the later failure paths leak the counter. The fix is something like,

	id = ida_alloc(&pool->worker_ida, GFP_KERNEL);
	if (id < 0)
		goto fail_dec;
	...
fail:
	ida_free(&pool->worker_ida, id);
	kfree(worker);
fail_dec:
	if (pool->attrs->prio == WQ_PRIO_RT)
		atomic_dec(&total_rtpri_workers);
	return NULL;

kernel/workqueue.c static void reap_dying_workers(struct list_head *cull_list) · line 2941

Quoted 2 lines
kernel/workqueue.c +2 -0
+		if (worker->pool->attrs->prio == WQ_PRIO_RT)
+			atomic_dec(&total_rtpri_workers);

worker->pool is NULL here, the WORKER_DIE path clears it before kthread_stop_put() returns, so every cull oopses.

Flag the worker at creation, a bool rtpri in struct worker:

	worker->rtpri = pool->attrs->prio == WQ_PRIO_RT;

and in reap_dying_workers():

- if (worker->pool->attrs->prio == WQ_PRIO_RT)
+ if (worker->rtpri)
atomic_dec(&total_rtpri_workers);

kernel/workqueue.c static struct workqueue_struct *__alloc_workqueue(const char *fmt, · line 5900

Quoted 2 lines
kernel/workqueue.c +2 -0
+		wq->unbound_attrs->affn_scope = WQ_AFFN_CPU;
+		wq->unbound_attrs->affn_strict = true;

Its a dead store, apply_wqattrs_commit() overwrites both, so the headline v2
change never engages. Drop these two lines and mark the RT entries in the workqueue_init_early() attrs loops instead, for both unbound_std_wq_attrs and ordered_wq_attrs:

		attrs->prio = std_prio[i];
		attrs->nice = std_nice[i];

+ if (attrs->prio == WQ_PRIO_RT) {
+ attrs->affn_scope = WQ_AFFN_CPU;
+ attrs->affn_strict = true;
+ }

Questions: the changelog says two workers per workqueue, but the code clamps max_active, which caps work items, not threads. At the global cap create_worker() fails silently and maybe_create_worker() retries forever, so the pool stalls; with strict pods the last pod on an N CPU box may never get a worker. pr_warn() or fall back to a normal worker?

Also the rescuer is not FIFO, so WQ_MEM_RECLAIM plus WQ_RTPRI loses the latency claim exactly under memory pressure.

Nits: the "R" suffix branch is dead code, RT is unbound only. The affinity sysfs files can still undo the forced affinity.
Id prefer NUM_WQ_PRIO over NR_STD_WORKER_POOLS + 1. workqueue.rst needs WQ_RTPRI.

With the rebase and fixes, please add:

Thanks for the patch!

#3 lore raw

Re: [RFC v2 1/2] workqueue: Add support for real-time workers

Hi,

Is this a human review, or AI review, or combined?

Quoted 5 lines · Bradley Morgan

Hi Tvrtko,

Applies to master. On linux-next one hunk rejects, the WQ_RTPRI block in __alloc_workqueue(), the rest is clean. Rebase v3 onto the wq tree, please..

Fixed in v3 already.

Quoted 14 lines

Things to fix:

kernel/workqueue.c static struct worker *create_worker(struct worker_pool *pool) · line 2921

Quoted 6 lines
kernel/workqueue.c +3 -0
+fail_ida:
+	if (pool->attrs->prio == WQ_PRIO_RT)
+		atomic_dec(&total_rtpri_workers);
  fail:
  	ida_free(&pool->worker_ida, id);
  	kfree(worker);

Labels swapped. The ida_alloc() failure falls into fail:, so ida_free() gets a negative id and kfree() an uninitialized pointer, and the later failure paths leak the counter. The fix is something like,

Quoted 11 lines
	id = ida_alloc(&pool->worker_ida, GFP_KERNEL);
	if (id < 0)
		goto fail_dec;
	...
fail:
	ida_free(&pool->worker_ida, id);
	kfree(worker);
fail_dec:
	if (pool->attrs->prio == WQ_PRIO_RT)
		atomic_dec(&total_rtpri_workers);
	return NULL;

Already fixed locally after Sashiko flagged the onion unwind fail.

Quoted 13 lines

kernel/workqueue.c static void reap_dying_workers(struct list_head *cull_list) · line 2941

Quoted 3 lines
kernel/workqueue.c +2 -0
+		if (worker->pool->attrs->prio == WQ_PRIO_RT)
+			atomic_dec(&total_rtpri_workers);

worker->pool is NULL here, the WORKER_DIE path clears it before kthread_stop_put() returns, so every cull oopses.

Flag the worker at creation, a bool rtpri in struct worker:

	worker->rtpri = pool->attrs->prio == WQ_PRIO_RT;

and in reap_dying_workers():

Review

Quoted 3 lines
(quoted diff) +1 -1
-		if (worker->pool->attrs->prio == WQ_PRIO_RT)
+		if (worker->rtpri)
  			atomic_dec(&total_rtpri_workers);

Ditto but differently.

Quoted 12 lines

kernel/workqueue.c static struct workqueue_struct *__alloc_workqueue(const char *fmt, · line 5900

Quoted 2 lines
kernel/workqueue.c +2 -0
+		wq->unbound_attrs->affn_scope = WQ_AFFN_CPU;
+		wq->unbound_attrs->affn_strict = true;

Its a dead store, apply_wqattrs_commit() overwrites both, so the headline v2
change never engages. Drop these two lines and mark the RT entries in the workqueue_init_early() attrs loops instead, for both unbound_std_wq_attrs and ordered_wq_attrs:

		attrs->prio = std_prio[i];
		attrs->nice = std_nice[i];

kernel/workqueue.c static ssize_t wq_nice_store(struct device *dev, struct device_attribute *attr, · line 7397

Quoted 4 lines
kernel/workqueue.c +4 -0
+		if (attrs->prio == WQ_PRIO_RT) {
+			attrs->affn_scope = WQ_AFFN_CPU;
+			attrs->affn_strict = true;
+		}

Already done locally exactly like this.

Quoted 2 lines

Questions: the changelog says two workers per workqueue, but the code clamps max_active, which caps work items, not threads. At the global cap create_worker() fails silently and maybe_create_worker() retries forever, so the pool stalls; with strict pods the last pod on an N CPU box may never get a worker. pr_warn() or fall back to a normal worker?

Yeah it's a design open. I will probably just drop the global limits if Tejun agrees.

Quoted 2 lines

Also the rescuer is not FIFO, so WQ_MEM_RECLAIM plus WQ_RTPRI loses the latency claim exactly under memory pressure.

Sashiko commented on this already. But I don't think latency is super relevant under memory pressure.

Quoted 1 line

Nits: the "R" suffix branch is dead code, RT is unbound only. The

Curiosly lkml Sashiko missed this but I am aware of it. It is leftover from v1. And it's not a branch but an extra array element.

Quoted 1 line

affinity sysfs files can still undo the forced affinity.

I am opting letting the admins shoot themselves in the foot.

Quoted 2 lines

Id prefer NUM_WQ_PRIO over NR_STD_WORKER_POOLS + 1. workqueue.rst needs WQ_RTPRI.

I was on the fence. Either way is not ideal.

RST noted.

Quoted 5 lines

With the rebase and fixes, please add:

Thanks for the patch!

Thank you for reading through it!

Regards,

Tvrtko

#4 lore raw

Re: [RFC v2 1/2] workqueue: Add support for real-time workers

Quoted 4 lines · Tvrtko Ursulin

Hi,

Is this a human review, or AI review, or combined?

Human :)

Quoted 35 lines · Bradley Morgan
Quoted 5 lines

Hi Tvrtko,

Applies to master. On linux-next one hunk rejects, the WQ_RTPRI block in __alloc_workqueue(), the rest is clean. Rebase v3 onto the wq tree, please..

Fixed in v3 already.

Quoted 14 lines

Things to fix:

kernel/workqueue.c static struct worker *create_worker(struct worker_pool *pool) · line 2921

Quoted 6 lines
kernel/workqueue.c +3 -0
+fail_ida:
+	if (pool->attrs->prio == WQ_PRIO_RT)
+		atomic_dec(&total_rtpri_workers);
  fail:
  	ida_free(&pool->worker_ida, id);
  	kfree(worker);

Labels swapped. The ida_alloc() failure falls into fail:, so ida_free() gets a negative id and kfree() an uninitialized pointer, and the later failure paths leak the counter. The fix is something like,

Quoted 11 lines
	id = ida_alloc(&pool->worker_ida, GFP_KERNEL);
	if (id < 0)
		goto fail_dec;
	...
fail:
	ida_free(&pool->worker_ida, id);
	kfree(worker);
fail_dec:
	if (pool->attrs->prio == WQ_PRIO_RT)
		atomic_dec(&total_rtpri_workers);
	return NULL;
Quoted 1 line

Already fixed locally after Sashiko flagged the onion unwind fail.

Thanks.

Quoted 11 lines
Quoted 11 lines

kernel/workqueue.c static void reap_dying_workers(struct list_head *cull_list) · line 2941

Quoted 3 lines
kernel/workqueue.c +2 -0
+		if (worker->pool->attrs->prio == WQ_PRIO_RT)
+			atomic_dec(&total_rtpri_workers);

worker->pool is NULL here, the WORKER_DIE path clears it before kthread_stop_put() returns, so every cull oopses.

Flag the worker at creation, a bool rtpri in struct worker:

	worker->rtpri = pool->attrs->prio == WQ_PRIO_RT;
Quoted 7 lines

Review

Quoted 5 lines

and in reap_dying_workers():

(quoted diff) +1 -1
-		if (worker->pool->attrs->prio == WQ_PRIO_RT)
+		if (worker->rtpri)
  			atomic_dec(&total_rtpri_workers);

Ditto but differently.

Thanks.

Quoted 13 lines
Quoted 4 lines

kernel/workqueue.c static struct workqueue_struct *__alloc_workqueue(const char *fmt, · line 5900

Quoted 2 lines
kernel/workqueue.c +2 -0
+		wq->unbound_attrs->affn_scope = WQ_AFFN_CPU;
+		wq->unbound_attrs->affn_strict = true;

Its a dead store, apply_wqattrs_commit() overwrites both, so the

headline

Quoted 8 lines

v2
change never engages. Drop these two lines and mark the RT entries in the workqueue_init_early() attrs loops instead, for both unbound_std_wq_attrs and ordered_wq_attrs:

		attrs->prio = std_prio[i];
		attrs->nice = std_nice[i];
Quoted 6 lines

kernel/workqueue.c static ssize_t wq_nice_store(struct device *dev, struct device_attribute *attr, · line 7397

Quoted 4 lines
kernel/workqueue.c +4 -0
+		if (attrs->prio == WQ_PRIO_RT) {
+			attrs->affn_scope = WQ_AFFN_CPU;
+			attrs->affn_strict = true;
+		}

Already done locally exactly like this.

Thanks.

Quoted 8 lines
Quoted 1 line

Questions: the changelog says two workers per workqueue, but the code

clamps max_active, which caps work items, not threads. At the global cap create_worker() fails silently and maybe_create_worker() retries forever, so the pool stalls; with strict pods the last pod on an N CPU

Quoted 1 line

box may never get a worker. pr_warn() or fall back to a normal worker?

Yeah it's a design open. I will probably just drop the global limits if Tejun agrees.

Ok.

Quoted 11 lines
Quoted 2 lines

Also the rescuer is not FIFO, so WQ_MEM_RECLAIM plus WQ_RTPRI loses the latency claim exactly under memory pressure.

Sashiko commented on this already. But I don't think latency is super relevant under memory pressure.

Quoted 1 line

Nits: the "R" suffix branch is dead code, RT is unbound only. The

Curiosly lkml Sashiko missed this but I am aware of it. It is leftover from v1. And it's not a branch but an extra array element.

okay.

Quoted 3 lines
Quoted 1 line

affinity sysfs files can still undo the forced affinity.

I am opting letting the admins shoot themselves in the foot.

Heh. Fair enough

Quoted 6 lines
Quoted 2 lines

Id prefer NUM_WQ_PRIO over NR_STD_WORKER_POOLS + 1. workqueue.rst needs WQ_RTPRI.

I was on the fence. Either way is not ideal.

RST noted.

Yeah. Agreed.

Quoted 4 lines
Quoted 4 lines

With the rebase and fixes, please add:

Quoted 10 lines
Quoted 1 line

Thanks for the patch!

Thank you for reading through it!

Regards,

Tvrtko

Thanks!

#5 lore raw

RFC v2 2/2 drm/panthor: Create per queue priority workqueues

In reply to Tvrtko Ursulin

Split the single workqueue shared between the driver internal logic and DRM scheduler use into separate ones, where the DRM scheduler one is created per GPU priority level using the appropriate mapping to workqueue priorities.

Low and medium GPU priority are served by a normal workqueue, high is server by a WQ_HIGHPRI instance, while realtime GPU priority is using the newly added WQ_RTPRI flag for lowest possible latency.

These workqueues are device global and for all three we set the maximum concurrency to two in order to keep the GPU optimally fed with work.

Cc Boris Brezillon <[email protected]>
Cc Chia-I Wu <[email protected]>
Cc Liviu Dudau <[email protected]>
Cc Matthew Brost <[email protected]>
Cc Steven Price <[email protected]>
Cc Tejun Heo <[email protected]>
---
 drivers/gpu/drm/panthor/panthor_sched.c | 38 +++++++++++++++++++++----
 1 file changed, 33 insertions(+), 5 deletions(-)
drivers/gpu/drm/panthor/panthor_sched.c +33 -5
index 2bee1c92fb9e..f01adc8c024c 100644
@@ -152,11 +152,18 @@ struct panthor_scheduler {
 	 *
 	 * Used for the scheduler tick, group update or other kind of FW
 	 * event processing that can't be handled in the threaded interrupt
-	 * path. Also passed to the drm_gpu_scheduler instances embedded
-	 * in panthor_queue.
+	 * path.
 	 */
 	struct workqueue_struct *wq;
 
+	/**
+	 * @submit_wq: Per priority workqueues for the DRM scheduler
+	 *
+	 * Passed to the drm_gpu_scheduler instances embedded
+	 * in panthor_queue based on the queue priority.
+	 */
+	struct workqueue_struct *submit_wq[PANTHOR_CSG_PRIORITY_COUNT];
+
 	/**
 	 * @heap_alloc_wq: Workqueue used to schedule tiler_oom works.
 	 *
@@ -3488,7 +3495,6 @@ group_create_queue(struct panthor_group *group,
 {
 	struct drm_sched_init_args sched_args = {
 		.ops = &panthor_queue_sched_ops,
-		.submit_wq = group->ptdev->scheduler->wq,
 		/*
 		 * The credit limit argument tells us the total number of
 		 * instructions across all CS slots in the ringbuffer, with
@@ -3581,8 +3587,14 @@ group_create_queue(struct panthor_group *group,
 		goto err_free_queue;
 	}
 
+	if (group->priority >= ARRAY_SIZE(group->ptdev->scheduler->submit_wq) ||
+	    !group->ptdev->scheduler->submit_wq[group->priority]) {
+		ret = -EINVAL;
+		goto err_free_queue;
+	}
+
 	sched_args.name = queue->name;
-
+	sched_args.submit_wq = group->ptdev->scheduler->submit_wq[group->priority];
 	ret = drm_sched_init(&queue->scheduler, &sched_args);
 	if (ret)
 		goto err_free_queue;
@@ -4072,6 +4084,15 @@ static void panthor_sched_fini(struct drm_device *ddev, void *res)
 	if (!sched || !sched->csg_slot_count)
 		return;
 
+	if (sched->submit_wq[PANTHOR_CSG_PRIORITY_MEDIUM])
+		destroy_workqueue(sched->submit_wq[PANTHOR_CSG_PRIORITY_MEDIUM]);
+
+	if (sched->submit_wq[PANTHOR_CSG_PRIORITY_HIGH])
+		destroy_workqueue(sched->submit_wq[PANTHOR_CSG_PRIORITY_HIGH]);
+
+	if (sched->submit_wq[PANTHOR_CSG_PRIORITY_RT])
+		destroy_workqueue(sched->submit_wq[PANTHOR_CSG_PRIORITY_RT]);
+
 	if (sched->wq)
 		destroy_workqueue(sched->wq);
 
@@ -4173,7 +4194,14 @@ int panthor_sched_init(struct panthor_device *ptdev)
 	 */
 	sched->heap_alloc_wq = alloc_workqueue("panthor-heap-alloc", WQ_UNBOUND, 0);
 	sched->wq = alloc_workqueue("panthor-csf-sched", WQ_MEM_RECLAIM | WQ_UNBOUND, 0);
-	if (!sched->wq || !sched->heap_alloc_wq) {
+	sched->submit_wq[PANTHOR_CSG_PRIORITY_MEDIUM] = alloc_workqueue("panthor-drm", WQ_MEM_RECLAIM | WQ_UNBOUND, 2);
+	sched->submit_wq[PANTHOR_CSG_PRIORITY_LOW] = sched->submit_wq[PANTHOR_CSG_PRIORITY_MEDIUM];
+	sched->submit_wq[PANTHOR_CSG_PRIORITY_HIGH] = alloc_workqueue("panthor-drm-high", WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_UNBOUND, 2);
+	sched->submit_wq[PANTHOR_CSG_PRIORITY_RT] = alloc_workqueue("panthor-drm-rt", WQ_RTPRI | WQ_MEM_RECLAIM | WQ_UNBOUND, 2);
+	if (!sched->wq || !sched->heap_alloc_wq ||
+	    !sched->submit_wq[PANTHOR_CSG_PRIORITY_MEDIUM] ||
+	    !sched->submit_wq[PANTHOR_CSG_PRIORITY_HIGH] ||
+	    !sched->submit_wq[PANTHOR_CSG_PRIORITY_RT]) {
 		panthor_sched_fini(&ptdev->base, sched);
 		drm_err(&ptdev->base, "Failed to allocate the workqueues");
 		return -ENOMEM;
Signature · 1 line
2.54.0