From: "tip-bot2 for Alex Shi" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Alex Shi <alexs@kernel.org>, Ingo Molnar <mingo@kernel.org>,
Ricardo Neri <ricardo.neri-calderon@linux.intel.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] sched/fair: Check the SD_ASYM_PACKING flag in sched_use_asym_prio()
Date: Wed, 28 Feb 2024 22:00:05 -0000 [thread overview]
Message-ID: <170915760555.398.490945038019686205.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20240210113924.1130448-4-alexs@kernel.org>
The following commit has been merged into the sched/core branch of tip:
Commit-ID: fbc449864e0d2ee2c16f3af2d1e9093b9b8d7ad0
Gitweb: https://git.kernel.org/tip/fbc449864e0d2ee2c16f3af2d1e9093b9b8d7ad0
Author: Alex Shi <alexs@kernel.org>
AuthorDate: Sat, 10 Feb 2024 19:39:22 +08:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 28 Feb 2024 15:43:17 +01:00
sched/fair: Check the SD_ASYM_PACKING flag in sched_use_asym_prio()
sched_use_asym_prio() checks whether CPU priorities should be used. It
makes sense to check for the SD_ASYM_PACKING() inside the function.
Since both sched_asym() and sched_group_asym() use sched_use_asym_prio(),
remove the now superfluous checks for the flag in various places.
Signed-off-by: Alex Shi <alexs@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Reviewed-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20240210113924.1130448-4-alexs@kernel.org
---
kernel/sched/fair.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 475e2ca..39781a6 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9744,6 +9744,9 @@ group_type group_classify(unsigned int imbalance_pct,
*/
static bool sched_use_asym_prio(struct sched_domain *sd, int cpu)
{
+ if (!(sd->flags & SD_ASYM_PACKING))
+ return false;
+
if (!sched_smt_active())
return true;
@@ -9937,11 +9940,9 @@ static inline void update_sg_lb_stats(struct lb_env *env,
sgs->group_weight = group->group_weight;
/* Check if dst CPU is idle and preferred to this group */
- if (!local_group && env->sd->flags & SD_ASYM_PACKING &&
- env->idle != CPU_NOT_IDLE && sgs->sum_h_nr_running &&
- sched_group_asym(env, sgs, group)) {
+ if (!local_group && env->idle != CPU_NOT_IDLE && sgs->sum_h_nr_running &&
+ sched_group_asym(env, sgs, group))
sgs->group_asym_packing = 1;
- }
/* Check for loaded SMT group to be balanced to dst CPU */
if (!local_group && smt_balance(env, sgs, group))
@@ -11024,9 +11025,7 @@ static struct rq *find_busiest_queue(struct lb_env *env,
* If balancing between cores, let lower priority CPUs help
* SMT cores with more than one busy sibling.
*/
- if ((env->sd->flags & SD_ASYM_PACKING) &&
- sched_asym(env->sd, i, env->dst_cpu) &&
- nr_running == 1)
+ if (sched_asym(env->sd, i, env->dst_cpu) && nr_running == 1)
continue;
switch (env->migration_type) {
@@ -11122,8 +11121,7 @@ asym_active_balance(struct lb_env *env)
* the lower priority @env::dst_cpu help it. Do not follow
* CPU priority.
*/
- return env->idle != CPU_NOT_IDLE && (env->sd->flags & SD_ASYM_PACKING) &&
- sched_use_asym_prio(env->sd, env->dst_cpu) &&
+ return env->idle != CPU_NOT_IDLE && sched_use_asym_prio(env->sd, env->dst_cpu) &&
(sched_asym_prefer(env->dst_cpu, env->src_cpu) ||
!sched_use_asym_prio(env->sd, env->src_cpu));
}
next prev parent reply other threads:[~2024-02-28 22:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-10 11:39 [PATCH v5 1/5] sched/topology: Remove duplicate descriptions from TOPOLOGY_SD_FLAGS alexs
2024-02-10 11:39 ` [PATCH v5 2/5] sched/fair: Remove unused parameters alexs
2024-02-13 16:45 ` Vincent Guittot
2024-02-28 22:00 ` [tip: sched/core] sched/fair: Remove unused parameter from sched_asym() tip-bot2 for Alex Shi
2024-02-10 11:39 ` [PATCH v5 3/5] sched/fair: Rework sched_use_asym_prio() and sched_asym_prefer() alexs
2024-02-13 16:51 ` Vincent Guittot
2024-02-23 3:52 ` kuiliang Shi
2024-02-28 22:00 ` [tip: sched/core] " tip-bot2 for Alex Shi
2024-02-10 11:39 ` [PATCH v5 4/5] sched/fair: Check the SD_ASYM_PACKING flag in sched_use_asym_prio() alexs
2024-02-13 17:02 ` Vincent Guittot
2024-02-28 22:00 ` tip-bot2 for Alex Shi [this message]
2024-02-10 11:39 ` [PATCH v5 5/5] sched: rename SD_SHARE_PKG_RESOURCES to SD_SHARE_LLC alexs
2024-02-13 7:01 ` Barry Song
2024-02-13 7:21 ` Barry Song
2024-02-28 22:00 ` [tip: sched/core] sched/topology: Rename " tip-bot2 for Alex Shi
2024-02-13 16:45 ` [PATCH v5 1/5] sched/topology: Remove duplicate descriptions from TOPOLOGY_SD_FLAGS Vincent Guittot
2024-02-28 22:00 ` [tip: sched/core] " tip-bot2 for Alex Shi
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=170915760555.398.490945038019686205.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=alexs@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=ricardo.neri-calderon@linux.intel.com \
--cc=vincent.guittot@linaro.org \
--cc=x86@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®