mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
To: Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	kernel-dev@igalia.com,
	Boris Brezillon <boris.brezillon@collabora.com>,
	Bradley Morgan <include@grrlz.net>, Chia-I Wu <olv@google.com>,
	Liviu Dudau <liviu.dudau@arm.com>,
	Matthew Brost <matthew.brost@intel.com>,
	Steven Price <steven.price@arm.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Breno Leitao <leitao@debian.org>
Subject: Re: [PATCH v7 3/4] workqueue: Add support for real-time workers
Date: Sat, 24 Oct 2026 09:33:42 +0100	[thread overview]
Message-ID: <9d6add80-2ec9-4f29-a815-ad0e955f7b5a@igalia.com> (raw)
In-Reply-To: <a3ae9a0f13e3972d0645f555bcc26f4f@kernel.org>


Hi Tejun,

On 23/10/2026 22:28, Tejun Heo wrote:
> Hello, Tvrtko.
> 
> On Thu, Oct 22, 2026 at 10:38:47AM +0100, Tvrtko Ursulin wrote:
>>   struct workqueue_attrs {
>>   	/**
>> -	 * @nice: nice level
>> +	 * @prio: priority encoded analogous to task_struct->prio.
>>   	 */
>> -	int nice;
>> +	int prio;
> 
> Can the nice to prio conversion be split into a preparation patch with
> no functional change, so that this patch only adds WQ_RT on top?

Can do. I'll get to it the week after next. (Tweaks to other patches in 
the series as well.) Should I switch to a different base branch by then?

>>   sanitize_immutable_workqueue_attrs(struct workqueue_struct *wq,
>>   				   struct workqueue_attrs *attrs)
>>   {
>> +	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;
>> +	}
> 
> Can WQ_RT set only the priority and leave the affinity at the defaults?
> If the pinning is needed for the latency, can you share numbers with
> and without it?

I could do that although note the current numbers are actually without 
strict affinity because that is what the initial RFC did. Then in msg-id 
  b3e5bcb21184d13c7c631daac955f465@kernel.org you suggested to make them 
strict affinity. So latencies 95% and 9% percentiles were already good 
enough without it. But if you are curious how much better strict 
affinity makes them I can measure, it is not a huge effort.

>>   	mutex_lock(&wq->mutex);
>> -	written = scnprintf(buf, PAGE_SIZE, "%d\n", wq->attrs->nice);
>> +	if (wq->attrs->prio == RT_PRIORITY)
>> +		written = scnprintf(buf, PAGE_SIZE, "rt\n");
>> +	else
>> +		written = scnprintf(buf, PAGE_SIZE, "%d\n",
>> +				    PRIO_TO_NICE(wq->attrs->prio));
> 
> Can the sysfs interface comment above struct wq_device be updated too?
> It still lists nice as RW int, while nice reads "rt" and is read-only
> for WQ_RT.

Sure, I did not spot that comment until now. Tunnel vision it seems. :)

>> +rt_prio = prog.constant('RT_PRIORITY', filename='kernel/workqueue.c')
>> ...
>> +    nice = pool.attrs.prio.value_()
>> +    if nice == rt_prio:
>> +        nice = 'rt'
>> +    else:
>> +        nice = nice - 120 # PRIO_TO_NICE
> 
> These fail on a kernel without this patch, where neither RT_PRIORITY
> nor attrs.prio exists. Can they fall back to nice, the way wq_attrs()
> falls back to unbound_attrs for the earlier rename?

Hmm.. I could do that, but since the tool ships within the kernel does 
it _need_ to have backward compatibility regarding kernel _internal_ 
implementation details?

Regards,

Tvrtko


  reply	other threads:[~2026-10-24  8:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22  9:38 [PATCH v7 0/4] Realtime workqueues and panthor realtime submission Tvrtko Ursulin
2026-10-22  9:38 ` [PATCH v7 1/4] workqueue: Simplify unbound sysfs attribute registration Tvrtko Ursulin
2026-10-23 13:14   ` Liviu Dudau
2026-10-23 21:04   ` Tejun Heo
2026-10-22  9:38 ` [PATCH v7 2/4] workqueue: Separate sysfs mutable vs immutable wq attribute sanitizing Tvrtko Ursulin
2026-10-23 13:17   ` Liviu Dudau
2026-10-23 21:28   ` Tejun Heo
2026-10-22  9:38 ` [PATCH v7 3/4] workqueue: Add support for real-time workers Tvrtko Ursulin
2026-10-23 13:23   ` Liviu Dudau
2026-10-23 21:28   ` Tejun Heo
2026-10-24  8:33     ` Tvrtko Ursulin [this message]
2026-10-22  9:38 ` [PATCH v7 4/4] drm/panthor: Create per queue priority workqueues Tvrtko Ursulin
2026-10-23 13:26   ` Liviu Dudau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d6add80-2ec9-4f29-a815-ad0e955f7b5a@igalia.com \
    --to=tvrtko.ursulin@igalia.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=include@grrlz.net \
    --cc=jiangshanlai@gmail.com \
    --cc=kernel-dev@igalia.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=matthew.brost@intel.com \
    --cc=olv@google.com \
    --cc=steven.price@arm.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®