public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] workqueue: Add configure to reduce work latency
@ 2025-12-05 12:54 Xin Zhao
  2025-12-05 12:54 ` [RFC PATCH 1/3] workqueue: Support unbound RT workqueue by sysfs Xin Zhao
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Xin Zhao @ 2025-12-05 12:54 UTC (permalink / raw)
  To: tj, jiangshanlai; +Cc: hch, jackzxcui1989, linux-kernel

In a system with high real-time requirements, we have noticed that many
high-priority tasks, such as kernel threads responsible for dispatching
GPU tasks and receiving data sources, often experience latency spikes
due to insufficient real-time execution of work.
The existing sysfs can adjust nice value for unbound workqueues. Add new
'policy' node to support three common policies: SCHED_NORMAL, SCHED_FIFO,
or SCHED_RR. The original 'nice' node is retained for compatibility, add
new 'rtprio' node to adjust real-time priority when 'policy' is SCHED_FIFO
or SCHED_RR. The value of 'rtprio' uses the same numerical meaning as user
space tool chrt.
Introduce variable 'nr_idle_extra', which allows user space to configure
unbound workqueue through sysfs according to the real-time requirement.
By default, workqueue created by system will set 'nr_idle_extra' to 0.
When the policy of workqueue is set to SCHED_FIFO or SCHED_RR via sysfs,
'nr_idle_extra' will be set to WORKER_NR_RT_DEF(2) as default.
Supporting the private configuration aims to deterministically ensure that
tasks within one workqueue are not affected by tasks from other workqueues
with the same attributes. If the user has high real-time requirements,
they can increase the nr_idle_extra supported in the previous patch while
also setting the workqueue 'private', allowing it to independently use
kworker threads, thus ensuring scheduling-related work delays never occur.

Xin Zhao (3):
  workqueue: Support unbound RT workqueue by sysfs
  workqueue: Introduce nr_idle_extra to reduce work tail latency
  workqueue: Support private workqueue by sysfs

 include/linux/workqueue.h |  32 ++++-
 kernel/workqueue.c        | 295 +++++++++++++++++++++++++++++++++-----
 2 files changed, 290 insertions(+), 37 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-12-28 16:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-05 12:54 [RFC PATCH 0/3] workqueue: Add configure to reduce work latency Xin Zhao
2025-12-05 12:54 ` [RFC PATCH 1/3] workqueue: Support unbound RT workqueue by sysfs Xin Zhao
2025-12-05 12:54 ` [RFC PATCH 2/3] workqueue: Introduce nr_idle_extra to reduce work tail latency Xin Zhao
2025-12-05 12:54 ` [RFC PATCH 3/3] workqueue: Support private workqueue by sysfs Xin Zhao
2025-12-05 17:47 ` [RFC PATCH 0/3] workqueue: Add configure to reduce work latency Tejun Heo
2025-12-06  4:33   ` Xin Zhao
2025-12-28 16:49     ` Xin Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox