From: Tal Shorer <tal.shorer@gmail.com>
To: tj@kernel.org, jiangshanlai@gmail.com, linux-kernel@vger.kernel.org
Cc: Tal Shorer <tal.shorer@gmail.com>
Subject: [PATCH v2] workqueue: respect isolated cpus when queueing an unbound work
Date: Sat, 21 Oct 2017 19:29:24 +0300 [thread overview]
Message-ID: <1508603364-892-1-git-send-email-tal.shorer@gmail.com> (raw)
In-Reply-To: <20171021161533.GQ1302522@devbig577.frc2.facebook.com>
Initialize wq_unbound_cpumask to exclude cpus that were isolated by
the cmdline's isolcpus parameter.
Signed-off-by: Tal Shorer <tal.shorer@gmail.com>
---
kernel/workqueue.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index ca937b0..0add5d4 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4947,6 +4947,10 @@ int workqueue_set_unbound_cpumask(cpumask_var_t cpumask)
if (!zalloc_cpumask_var(&saved_cpumask, GFP_KERNEL))
return -ENOMEM;
+ /*
+ * Not excluding isolated cpus on purpose.
+ * If the user wishes to include them, we allow that.
+ */
cpumask_and(cpumask, cpumask, cpu_possible_mask);
if (!cpumask_empty(cpumask)) {
apply_wqattrs_lock();
@@ -5546,7 +5550,7 @@ int __init workqueue_init_early(void)
WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long));
BUG_ON(!alloc_cpumask_var(&wq_unbound_cpumask, GFP_KERNEL));
- cpumask_copy(wq_unbound_cpumask, cpu_possible_mask);
+ cpumask_andnot(wq_unbound_cpumask, cpu_possible_mask, cpu_isolated_map);
pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC);
--
2.7.4
next prev parent reply other threads:[~2017-10-21 16:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-19 21:44 [PATCH] workqueue: respect isolated cpus when queueing an unbound work Tal Shorer
2017-10-21 15:49 ` Tejun Heo
[not found] ` <CAFDyS3Mgt=Vt-sJXVL_pY_DwrC2dDTDQ0jMNyAbCwvLptu88Sw@mail.gmail.com>
[not found] ` <20171021160446.GO1302522@devbig577.frc2.facebook.com>
2017-10-21 16:13 ` Tal Shorer
2017-10-21 16:15 ` Tejun Heo
2017-10-21 16:29 ` Tal Shorer [this message]
2017-10-21 16:33 ` [PATCH v2] " 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=1508603364-892-1-git-send-email-tal.shorer@gmail.com \
--to=tal.shorer@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@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