public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Xin Zhao <jackzxcui1989@163.com>
Cc: jiangshanlai@gmail.com, hch@infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/3] workqueue: Add configure to reduce work latency
Date: Fri, 5 Dec 2025 07:47:40 -1000	[thread overview]
Message-ID: <aTMavHuVyOUPA9p8@slm.duckdns.org> (raw)
In-Reply-To: <20251205125445.4154667-1-jackzxcui1989@163.com>

Hello,

On Fri, Dec 05, 2025 at 08:54:42PM +0800, Xin Zhao wrote:
> 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.

I don't think I'm applying this:

- The rationale is too vague. What are you exactly running and observing?
  How does this improve the situation?

- If wq supports private pools, then I don't think it makes sense to add wq
  interface to change their attributes. Once turned private, the worker
  threads are fixed and userspace can set whatever attributes they want to
  set, no?

Thanks.

-- 
tejun

  parent reply	other threads:[~2025-12-05 17:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Tejun Heo [this message]
2025-12-06  4:33   ` [RFC PATCH 0/3] workqueue: Add configure to reduce work latency Xin Zhao
2025-12-28 16:49     ` Xin Zhao

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=aTMavHuVyOUPA9p8@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=hch@infradead.org \
    --cc=jackzxcui1989@163.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.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