Re: [PATCH v8 5/6] workqueue: Imply strict CPU affinity for WQ_RT

From: Tvrtko Ursulin

Date: Mon Nov 09 2026 - 05:00:14 EST



On 05/11/2026 19:00, Tejun Heo wrote:
Hello, Tvrtko.

On Wed, Nov 04, 2026 at 09:52:24AM +0000, Tvrtko Ursulin wrote:
- if (wq->flags & WQ_RT)
+ if (wq->flags & WQ_RT) {
attrs->prio = RT_PRIORITY;
+ /* Strict CPU affinity for low latency execution. */
+ attrs->affn_scope = WQ_AFFN_CPU;
+ attrs->affn_strict = true;
+ }

I don't think this needs to be hard-coded. If setting it through
workqueue attrs is too inconvenient, how about adding WQ_ flags so that
the affinity scope and strictness can be set easily when the workqueue
is created? The flags can be expanded to u64 to make room and
reorganized cleanly while at it.

apply_workqueue_attrs() would work in theory but is not exported for modules which is required for panthor.

Regarding the flag reorganization, what would require expanding to u64? Unless I am missing something I see currently only 20 bits are used.

Although on a higher level my feeling is that panthor could first try with WQ_RT as is, and we consider adding strict affinity, via either of the above options, if that will not be good enough.

Regards,

Tvrtko