mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mete Durlu <meted@linux.ibm.com>
To: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	Shrikanth Hegde <sshegde@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>
Cc: Tim Chen <tim.c.chen@linux.intel.com>,
	Chen Yu <yu.c.chen@intel.com>,
	Ilya Leoshkevich <iii@linux.ibm.com>,
	Andrea Righi <arighi@nvidia.com>,
	linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
	Mete Durlu <meted@linux.ibm.com>
Subject: [PATCH RFC 2/2] s390/topology: Enable SCHED_IDLE_SMT_PRIO
Date: Thu, 08 Oct 2026 10:30:48 +0200	[thread overview]
Message-ID: <20261008-hiperdispatchfix-v1-2-73fe41081070@linux.ibm.com> (raw)
In-Reply-To: <20261008-hiperdispatchfix-v1-0-73fe41081070@linux.ibm.com>

On s390, vertical polarization configuration assigns CPUs different
polarization values and capacities. These capacities represent the
virtual runtime being assigned to the shared CPUs by the underlying
hypervisor. Consequently running load on high capacity cores, even if
the SMT sibling (SMT=2 on s390) of a given core is busy is more
favorable compared to a fully idle low capacity CPU.

Implement arch_needs_idle_smt_prio() to enable the sched_idle_smt_prio
static branch when the machine has hardware backed topology.

Signed-off-by: Mete Durlu <meted@linux.ibm.com>
---
 arch/s390/Kconfig                | 1 +
 arch/s390/include/asm/topology.h | 5 +++++
 arch/s390/kernel/topology.c      | 9 +++++++++
 3 files changed, 15 insertions(+)

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 4b51bc6e8948..bd6c826a24af 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -564,6 +564,7 @@ config NODES_SHIFT
 config SCHED_TOPOLOGY
 	def_bool y
 	prompt "Topology scheduler support"
+	select ARCH_SUPPORTS_SCHED_IDLE_SMT_PRIO
 	select ARCH_SUPPORTS_SCHED_SMT
 	select ARCH_SUPPORTS_SCHED_MC
 	select SCHED_SMT
diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h
index 44110847342a..f0f5477565db 100644
--- a/arch/s390/include/asm/topology.h
+++ b/arch/s390/include/asm/topology.h
@@ -49,6 +49,11 @@ void update_cpu_masks(void);
 void topology_expect_change(void);
 const struct cpumask *cpu_coregroup_mask(int cpu);
 
+#ifdef CONFIG_SCHED_IDLE_SMT_PRIO
+#define arch_needs_idle_smt_prio arch_needs_idle_smt_prio
+bool arch_needs_idle_smt_prio(void);
+#endif
+
 #else /* CONFIG_SCHED_TOPOLOGY */
 
 static inline void topology_init_early(void) { }
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 42fc0294f543..6f28e2f1afec 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -344,6 +344,15 @@ int arch_update_cpu_topology(void)
 	return rc;
 }
 
+#ifdef CONFIG_SCHED_IDLE_SMT_PRIO
+bool arch_needs_idle_smt_prio(void)
+{
+	if (topology_mode != TOPOLOGY_MODE_HW)
+		return false;
+	return true;
+}
+#endif
+
 static void topology_work_fn(struct work_struct *work)
 {
 	rebuild_sched_domains();

-- 
2.55.0


  parent reply	other threads:[~2026-10-08  8:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08  8:30 [PATCH RFC 0/2] sched: Introduce idle SMT priority for asymmetric capacity systems Mete Durlu
2026-10-08  8:30 ` [PATCH RFC 1/2] kernel/sched: Introduce idle SMT priority Mete Durlu
2026-10-08  8:30 ` Mete Durlu [this message]
2026-10-08 12:10 ` [PATCH RFC 0/2] sched: Introduce idle SMT priority for asymmetric capacity systems Andrea Righi
2026-10-08 14:58   ` Shrikanth Hegde
2026-10-08 15:24     ` Mete Durlu
2026-10-08 15:44       ` Shrikanth Hegde
2026-10-09 15:12         ` Andrea Righi
2026-10-09 15:35           ` Shrikanth Hegde
2026-10-09 15:32       ` Vincent Guittot
2026-10-08 21:52   ` Tim Chen
2026-10-08 21:29 ` Tim Chen

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=20261008-hiperdispatchfix-v1-2-73fe41081070@linux.ibm.com \
    --to=meted@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=arighi@nvidia.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sshegde@linux.ibm.com \
    --cc=svens@linux.ibm.com \
    --cc=tim.c.chen@linux.intel.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=yu.c.chen@intel.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

all inboxes | Powered by JetHome®