From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: <linux-kernel@vger.kernel.org>
Cc: Tejun Heo <tj@kernel.org>, Lai Jiangshan <laijs@cn.fujitsu.com>
Subject: [PATCH] workqueue: get the probable node ID from the first CPU of the mask
Date: Tue, 22 Jul 2014 13:04:02 +0800 [thread overview]
Message-ID: <1406005442-12070-1-git-send-email-laijs@cn.fujitsu.com> (raw)
Current get_unbound_pool() considers all node IDs are probable for
the pool, and it travel all nodes to find the node ID for the pool.
This travel is unnecessary, the probable node ID can be attained
from the first CPU and we need check only one possible node ID.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
kernel/workqueue.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 347ac5b..942103d9 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3482,12 +3482,10 @@ static struct worker_pool *get_unbound_pool(const struct workqueue_attrs *attrs)
/* if cpumask is contained inside a NUMA node, we belong to that node */
if (wq_numa_enabled) {
- for_each_node(node) {
- if (cpumask_subset(pool->attrs->cpumask,
- wq_numa_possible_cpumask[node])) {
- pool->node = node;
- break;
- }
+ node = cpu_to_node(cpumask_first(pool->attrs->cpumask));
+ if (cpumask_subset(pool->attrs->cpumask,
+ wq_numa_possible_cpumask[node])) {
+ pool->node = node;
}
}
--
1.7.4.4
next reply other threads:[~2014-07-22 5:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 5:04 Lai Jiangshan [this message]
2014-07-22 15:30 ` [PATCH] workqueue: get the probable node ID from the first CPU of the mask Tejun Heo
2014-07-23 1:26 ` Lai Jiangshan
2014-07-23 15:10 ` 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=1406005442-12070-1-git-send-email-laijs@cn.fujitsu.com \
--to=laijs@cn.fujitsu.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;
as well as URLs for NNTP newsgroup(s).