From: Tejun Heo <tj@kernel.org>
To: jiangshanlai@gmail.com
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
Tejun Heo <tj@kernel.org>
Subject: [PATCH 1/4] workqueue: Make wq_affn_dfl_set() use wq_online_cpumask
Date: Fri, 2 Aug 2024 11:18:17 -1000 [thread overview]
Message-ID: <20240802211850.1211737-2-tj@kernel.org> (raw)
In-Reply-To: <20240802211850.1211737-1-tj@kernel.org>
Other unbound pwq update paths are already using wq_online_cpumask which is
protected by wq_pool_mutex. Make wq_affn_dfl_set() to use wq_online_cpumask
too for synchronization and consistency.
Signed-off-by: Tejun Heo <tj@kernel.org>
---
kernel/workqueue.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index d56bd2277e58..6571e1f3c835 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -6909,18 +6909,16 @@ static int wq_affn_dfl_set(const char *val, const struct kernel_param *kp)
if (affn == WQ_AFFN_DFL)
return -EINVAL;
- cpus_read_lock();
mutex_lock(&wq_pool_mutex);
wq_affn_dfl = affn;
list_for_each_entry(wq, &workqueues, list) {
- for_each_online_cpu(cpu)
+ for_each_cpu(cpu, wq_online_cpumask)
unbound_wq_update_pwq(wq, cpu);
}
mutex_unlock(&wq_pool_mutex);
- cpus_read_unlock();
return 0;
}
--
2.45.2
next prev parent reply other threads:[~2024-08-02 21:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 21:18 [PATCHSET wq/for-6.12] workqueue: Use wq_online_cpumask consistently and make CPU hotplug unbound pwq updates asynchronous Tejun Heo
2024-08-02 21:18 ` Tejun Heo [this message]
2024-08-08 4:23 ` [PATCH 1/4] workqueue: Make wq_affn_dfl_set() use wq_online_cpumask Lai Jiangshan
2024-08-13 19:40 ` Tejun Heo
2024-08-02 21:18 ` [PATCH 2/4] workqueue: Make wq_update_node_max_active() " Tejun Heo
2024-08-02 21:18 ` [PATCH 3/4] workqueue: s/unbound_wq_update_pwq/update_unbound_pwqs/ Tejun Heo
2024-08-02 21:18 ` [PATCH 4/4] workqueue: Make unbound pwq updates from CPU hotplug path asynchronous 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=20240802211850.1211737-2-tj@kernel.org \
--to=tj@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=kernel-team@meta.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
all inboxes | Powered by JetHome®