From: Vincent Guittot <vincent.guittot@linaro.org>
To: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
Rik van Riel <riel@surriel.com>
Subject: [PATCH 1/4] sched/numa: remove unused code from update_numa_stats()
Date: Wed, 29 Aug 2018 15:19:09 +0200 [thread overview]
Message-ID: <1535548752-4434-2-git-send-email-vincent.guittot@linaro.org> (raw)
In-Reply-To: <1535548752-4434-1-git-send-email-vincent.guittot@linaro.org>
With :
commit 2d4056fafa19 ("sched/numa: Remove numa_has_capacity()")
the local variables smt, cpus and capacity and their results are not used
anymore in numa_has_capacity()
Remove this unused code
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: linux-kernel@vger.kernel.org (open list)
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
kernel/sched/fair.c | 21 +--------------------
1 file changed, 1 insertion(+), 20 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 309c93f..c2b8bf4 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1463,8 +1463,7 @@ struct numa_stats {
*/
static void update_numa_stats(struct numa_stats *ns, int nid)
{
- int smt, cpu, cpus = 0;
- unsigned long capacity;
+ int cpu;
memset(ns, 0, sizeof(*ns));
for_each_cpu(cpu, cpumask_of_node(nid)) {
@@ -1473,26 +1472,8 @@ static void update_numa_stats(struct numa_stats *ns, int nid)
ns->nr_running += rq->nr_running;
ns->load += weighted_cpuload(rq);
ns->compute_capacity += capacity_of(cpu);
-
- cpus++;
}
- /*
- * If we raced with hotplug and there are no CPUs left in our mask
- * the @ns structure is NULL'ed and task_numa_compare() will
- * not find this node attractive.
- *
- * We'll detect a huge imbalance and bail there.
- */
- if (!cpus)
- return;
-
- /* smt := ceil(cpus / capacity), assumes: 1 < smt_power < 2 */
- smt = DIV_ROUND_UP(SCHED_CAPACITY_SCALE * cpus, ns->compute_capacity);
- capacity = cpus / smt; /* cores */
-
- capacity = min_t(unsigned, capacity,
- DIV_ROUND_CLOSEST(ns->compute_capacity, SCHED_CAPACITY_SCALE));
}
struct task_numa_env {
--
2.7.4
next prev parent reply other threads:[~2018-08-29 13:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-29 13:19 [PATCH 0/4] sched/numa: remove unused code Vincent Guittot
2018-08-29 13:19 ` Vincent Guittot [this message]
2018-09-04 6:39 ` [PATCH 1/4] sched/numa: remove unused code from update_numa_stats() Srikar Dronamraju
2018-09-10 10:19 ` [tip:sched/core] sched/numa: Remove " tip-bot for Vincent Guittot
2018-08-29 13:19 ` [PATCH 2/4] sched/numa: remove unused nr_running field Vincent Guittot
2018-09-04 6:40 ` Srikar Dronamraju
2018-09-10 10:20 ` [tip:sched/core] sched/numa: Remove unused numa_stats::nr_running field tip-bot for Vincent Guittot
2018-08-29 13:19 ` [RFC PATCH 3/4] sched/topology: remove smt_gain Vincent Guittot
2018-08-29 14:08 ` Qais Yousef
2018-08-29 14:42 ` Vincent Guittot
2018-09-07 12:42 ` Peter Zijlstra
2018-09-10 11:23 ` Qais Yousef
2018-09-04 8:24 ` Srikar Dronamraju
2018-09-04 9:36 ` Vincent Guittot
2018-09-04 10:37 ` Srikar Dronamraju
2018-09-05 7:36 ` Vincent Guittot
2018-09-05 8:50 ` Srikar Dronamraju
2018-09-05 9:11 ` Vincent Guittot
2018-09-05 11:14 ` Srikar Dronamraju
2018-09-06 9:21 ` Vincent Guittot
2018-09-10 11:05 ` Qais Yousef
2018-09-10 10:07 ` [tip:sched/core] sched/fair: Fix scale_rt_capacity() for SMT tip-bot for Vincent Guittot
2018-12-11 15:31 ` [tip:sched/core] sched/topology: Remove the ::smt_gain field from 'struct sched_domain' tip-bot for Vincent Guittot
2018-08-29 13:19 ` [RFC PATCH 4/4] sched/topology: remove unused sd param from arch_scale_cpu_capacity() Vincent Guittot
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=1535548752-4434-2-git-send-email-vincent.guittot@linaro.org \
--to=vincent.guittot@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=riel@surriel.com \
--cc=srikar@linux.vnet.ibm.com \
/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).