From: Tejun Heo <tj@kernel.org>
To: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: linux-kernel@vger.kernel.org, kernel-dev@igalia.com,
dri-devel@lists.freedesktop.org,
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: [RFC v5 2/3] workqueue: Add support for real-time workers
Date: Mon, 28 Sep 2026 14:00:43 -1000 [thread overview]
Message-ID: <3ff40909da4f1510419ac0e2f9f4e6a1@kernel.org> (raw)
In-Reply-To: <20260923161251.45428-3-tvrtko.ursulin@igalia.com>
Hello,
On Wed, Sep 23, 2026 at 05:12:50PM +0100, Tvrtko Ursulin wrote:
> 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.
panthor's group_priority_permit() also allows realtime groups for DRM
master without CAP_SYS_NICE. What's the usage model there? Should DRM
master be enough to get RT workers?
> @@ -374,8 +374,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() */
Can we name it just WQ_RT? Also, I think WQ_RT is closer to WQ_BH. We can
reorder the flags later if that helps but for now can you just put it in an
empty slot?
> @@ -127,6 +127,7 @@ enum wq_internal_consts {
> */
> RESCUER_NICE_LEVEL = MIN_NICE,
> HIGHPRI_NICE_LEVEL = MIN_NICE,
> + RTPRI_NICE_LEVEL = MIN_NICE - 1,
Can we match the scheduler's representation instead by replacing
attrs->nice with attrs->prio which uses the same encoding as p->prio?
Normal pools would be NICE_TO_PRIO(nice) and WQ_RT pools would be in the RT
range. create_worker() would then do:
if (rt_prio(pool->attrs->prio))
sched_set_fifo_low(worker->task);
else
set_user_nice(worker->task, PRIO_TO_NICE(pool->attrs->prio));
> @@ -7606,7 +7626,10 @@ static ssize_t nice_show(struct device *dev, struct device_attribute *attr,
> int written;
>
> mutex_lock(&wq->mutex);
> - written = scnprintf(buf, PAGE_SIZE, "%d\n", wq->attrs->nice);
> + if (wq->attrs->nice == RTPRI_NICE_LEVEL)
> + written = scnprintf(buf, PAGE_SIZE, "rt\n");
> + else
> + written = scnprintf(buf, PAGE_SIZE, "%d\n", wq->attrs->nice);
Can you also show rt in pr_cont_pool_info() and tools/workqueue/wq_dump.py?
Thanks.
--
tejun
next prev parent reply other threads:[~2026-09-29 0:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 16:12 [RFC v5 0/3] Realtime workqueues and panthor realtime submission Tvrtko Ursulin
2026-09-23 16:12 ` [RFC v5 1/3] workqueue: Simplify unbound sysfs attribute registration Tvrtko Ursulin
2026-09-23 17:12 ` Tvrtko Ursulin
2026-09-23 16:12 ` [RFC v5 2/3] workqueue: Add support for real-time workers Tvrtko Ursulin
2026-09-29 0:00 ` Tejun Heo [this message]
2026-09-23 16:12 ` [RFC v5 3/3] drm/panthor: Create per queue priority workqueues Tvrtko Ursulin
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=3ff40909da4f1510419ac0e2f9f4e6a1@kernel.org \
--to=tj@kernel.org \
--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=tvrtko.ursulin@igalia.com \
/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®