From: Tejun Heo <tj@kernel.org>
To: Yuanhan Zhang <zyhtheonly@gmail.com>
Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org,
pmladek@suse.com, zyhtheonly@yeah.net, zwp10758@gmail.com,
tiozhang@didiglobal.com, fuyuanli@didiglobal.com
Subject: Re: [PATCH] workqueue: introduce queue_work_cpumask to queue work onto a given cpumask
Date: Mon, 12 Jun 2023 07:54:16 -1000 [thread overview]
Message-ID: <ZIdbyOBdU6zAGxVw@slm.duckdns.org> (raw)
In-Reply-To: <CAEQmJ=gYe=d53HHC1xW_epmPmmddA4J28SHybwGmQzUZgxZovg@mail.gmail.com>
Hello,
On Fri, Jun 09, 2023 at 02:28:19PM +0800, Yuanhan Zhang wrote:
> // I resend this to put it into the same thread, sorry for the confusion.
This got resent quite a few times and I don't know which one to reply to.
Just picking the one which seems like the latest.
> > Can you elaborate the intended use cases?
>
> Thanks for your reply! Please let me use myself as an example to explain this.
>
> In my scenario, I have 7 cpus on my machine (actually it is uma, so
> queue_work_node
> or using UNBOUND do not works for me), and for some unlucky reasons
> there are always some irqs running on cpu 0 and cpu 6, since I'm using arm64
> with irqs tuning into FIFO threads, those threaded irqs are always running on
> cpu 0 and 6 too (for affinity). And this would not be fixed easily in
> short terms :(
>
> So in order to help async init for better boot times for my devices,
> I'd like to prevent
> works from running on cpu 0 and 6. With queue_work_cpumask(), it would be simply
> done by:
>
> ...
> cpumask_clear_cpu(0, cpumask); // actually I use sysfs to parse my cpumask
> cpumask_clear_cpu(6, cpumask);
> queue_work_cpumask(cpumask, my_wq, &my_work->work);
> ...
But this would require explicit code customization on every call site which
doesn't seem ideal given that this is to work around something which is tied
to the specific hardware.
Wouldn't it be better to add a kernel parameter to further constrain
wq_unbound_cpumask? Right now, on boot, it's only determined by isolcpus but
it shouldn't be difficult to add a workqueue parameter to further constrain
it.
Thanks.
--
tejun
next prev parent reply other threads:[~2023-06-12 17:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 9:31 Tio Zhang
2023-06-08 6:33 ` Lai Jiangshan
2023-06-08 22:52 ` Tejun Heo
[not found] ` <CAEQmJ=gLCzoxUR9Eas+w9=bV7Tg5SZNb+TufanNXnPxR8cn5iQ@mail.gmail.com>
2023-06-09 6:23 ` Yuanhan Zhang
2023-06-09 6:28 ` Yuanhan Zhang
2023-06-12 17:54 ` Tejun Heo [this message]
2023-06-13 10:25 ` Yuanhan Zhang
2023-06-21 21:32 ` Tejun Heo
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=ZIdbyOBdU6zAGxVw@slm.duckdns.org \
--to=tj@kernel.org \
--cc=fuyuanli@didiglobal.com \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=tiozhang@didiglobal.com \
--cc=zwp10758@gmail.com \
--cc=zyhtheonly@gmail.com \
--cc=zyhtheonly@yeah.net \
/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®