[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <159231011243.16989.7064939919417124511.tip-bot2@tip-bot2>
Date: Tue, 16 Jun 2020 12:21:52 -0000
From: "tip-bot2 for Dietmar Eggemann" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Dietmar Eggemann <dietmar.eggemann@....com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: sched/core] sched/deadline: Optimize dl_bw_cpus()
The following commit has been merged into the sched/core branch of tip:
Commit-ID: c81b89329933c6c0be809d4c0d2cb57c49153ee3
Gitweb: https://git.kernel.org/tip/c81b89329933c6c0be809d4c0d2cb57c49153ee3
Author: Dietmar Eggemann <dietmar.eggemann@....com>
AuthorDate: Wed, 20 May 2020 15:42:39 +02:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Mon, 15 Jun 2020 14:10:04 +02:00
sched/deadline: Optimize dl_bw_cpus()
Return the weight of the root domain (rd) span in case it is a subset
of the cpu_active_mask.
Continue to compute the number of CPUs over rd span and cpu_active_mask
when in hotplug.
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@....com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Acked-by: Juri Lelli <juri.lelli@...hat.com>
Link: https://lkml.kernel.org/r/20200520134243.19352-2-dietmar.eggemann@arm.com
---
kernel/sched/deadline.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index f31964a..ec90265 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -54,10 +54,16 @@ static inline struct dl_bw *dl_bw_of(int i)
static inline int dl_bw_cpus(int i)
{
struct root_domain *rd = cpu_rq(i)->rd;
- int cpus = 0;
+ int cpus;
RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held(),
"sched RCU must be held");
+
+ if (cpumask_subset(rd->span, cpu_active_mask))
+ return cpumask_weight(rd->span);
+
+ cpus = 0;
+
for_each_cpu_and(i, rd->span, cpu_active_mask)
cpus++;
Powered by blists - more mailing lists