From: menglong8.dong@gmail.com
To: tj@kernel.org
Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org,
Mengen Sun <mengensun@tencent.com>
Subject: [PATCH] hotfix: make sysfs of unbound kworker cpumask more clever
Date: Thu, 14 Oct 2021 11:06:41 +0800 [thread overview]
Message-ID: <20211014030641.2182803-1-mengensun@tencent.com> (raw)
From: Mengen Sun <mengensun@tencent.com>
some unfriendly component eg, dpdk, write the same mask to unbound
kworker cpumask again and agin. every time it write to this interface
some work is queue to cpu, by rr evenly the mask is same with the
original mask.
so, fix it, if the writing cpumask is equal with the old cpumask
just return success and do nothing.
Signed-off-by: Mengen Sun <mengensun@tencent.com>
---
kernel/workqueue.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 1b3eb1e9531f..8216fc45c77b 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5394,6 +5394,11 @@ int workqueue_set_unbound_cpumask(cpumask_var_t cpumask)
cpumask_and(cpumask, cpumask, cpu_possible_mask);
if (!cpumask_empty(cpumask)) {
apply_wqattrs_lock();
+ if (cpumask_equal(cpumask, wq_unbound_cpumask)) {
+ apply_wqattrs_unlock();
+ free_cpumask_var(saved_cpumask);
+ return 0;
+ }
/* save the old wq_unbound_cpumask. */
cpumask_copy(saved_cpumask, wq_unbound_cpumask);
--
2.27.0
next reply other threads:[~2021-10-14 3:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-14 3:06 menglong8.dong [this message]
2021-10-14 21:23 ` 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=20211014030641.2182803-1-mengensun@tencent.com \
--to=menglong8.dong@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mengensun@tencent.com \
--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
all inboxes | Powered by JetHome®