The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Xin Zhao <jackzxcui1989@163.com>
Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] workqueue: Support RT workqueue
Date: Fri, 17 Oct 2025 05:15:58 -1000	[thread overview]
Message-ID: <aPJdrqSiuijOcaPE@slm.duckdns.org> (raw)
In-Reply-To: <20251017091041.3026848-1-jackzxcui1989@163.com>

Hello, Xin.

On Fri, Oct 17, 2025 at 05:10:41PM +0800, Xin Zhao wrote:
> Thank you for your suggestion. We can indeed replace some simple work usage
> scenarios with kthread_work. However, it is not a panacea, especially in
> cases where work processing requires concurrency.
> If we cannot use the RT workqueue implementation, we need to create another
> kthread to improve concurrency performance? In addition, we may need to
> incorporate logic to split works that are originally of the same type?
> This splitting modification can be quite time-consuming and is likely to
> encounter various strange errors during the split.
> Given that the workqueue mechanism is so excellent and effectively matches
> the needs for concurrent and ordered work while also managing work thread
> resources efficiently, perhaps we should consider adding the RT workqueue
> feature to the kernel. After all, the changes are too simple to carry any
> minimal risk, yet the benefits could be substantial in handling concurrent
> demands and preventing thread resource wastage.
> If we do not pursue this, continue relying on kthread_work to handle RT-prio
> work concurrency, it would be equivalent to re-implementing the logic of
> pwq and worker_pool.

There are a couple reasons why I don't think we don't want to go this way:

- Maybe RT is enough for your specific use case but others may want to use
  e.g. deadline, pinning to specific CPUs, persistent kthread-tied
  accounting and prioritization (note that kworkers carries arbitrary
  scheduling history across work item boundaries).

- Running anything RT presents a signficant cost to the system overall.
  There's significant loss in terms of the scheduler's ability to manage the
  system. Once you have too many things running in RT, you just don't have a
  working scheduler on the system. So, I think it makes sense to keep the
  decision to allow / use RT a clearly deliberate choice, something which
  has to be a lot more intentional than picking a different workqueue.

This will be a pretty hard no from me. Of course, I can be wrong and you can
argue your case, but it'd probably be most effective if the arguments are
based on concrete and specific use cases.

Thanks.

-- 
tejun

  reply	other threads:[~2025-10-17 15:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 10:23 [PATCH] workqueue: Support RT workqueue Xin Zhao
2025-10-16 15:32 ` Tejun Heo
2025-10-17  9:10   ` Xin Zhao
2025-10-17 15:15     ` Tejun Heo [this message]
2025-10-17 15:16       ` Tejun Heo
2025-10-17  6:19 ` kernel test robot
2025-10-17  6:26 ` Christoph Hellwig
2025-10-17  8:23   ` 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=aPJdrqSiuijOcaPE@slm.duckdns.org \
    --to=tj@kernel.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