Skip to content

Commit 6b6938e

Browse files
committed
sched: Move STDL_INIT() functions out-of-line
JIRA: https://issues.redhat.com/browse/RHEL-118964 commit 91c614f Author: Peter Zijlstra <peterz@infradead.org> Date: Tue Aug 26 10:55:55 2025 +0200 sched: Move STDL_INIT() functions out-of-line Since all these functions are address-taken in SDTL_INIT() and called indirectly, it doesn't really make sense for them to be inline. Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Phil Auld <pauld@redhat.com>
1 parent 8a5cfa2 commit 6b6938e

File tree

2 files changed

+52
-42
lines changed

2 files changed

+52
-42
lines changed

include/linux/sched/topology.h

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -38,56 +38,21 @@ extern const struct sd_flag_debug sd_flag_debug[];
3838
struct sched_domain_topology_level;
3939

4040
#ifdef CONFIG_SCHED_SMT
41-
static inline int cpu_smt_flags(void)
42-
{
43-
return SD_SHARE_CPUCAPACITY | SD_SHARE_LLC;
44-
}
45-
46-
static inline const
47-
struct cpumask *tl_smt_mask(struct sched_domain_topology_level *tl, int cpu)
48-
{
49-
return cpu_smt_mask(cpu);
50-
}
41+
extern int cpu_smt_flags(void);
42+
extern const struct cpumask *tl_smt_mask(struct sched_domain_topology_level *tl, int cpu);
5143
#endif
5244

5345
#ifdef CONFIG_SCHED_CLUSTER
54-
static inline int cpu_cluster_flags(void)
55-
{
56-
return SD_CLUSTER | SD_SHARE_LLC;
57-
}
58-
59-
static inline const
60-
struct cpumask *tl_cls_mask(struct sched_domain_topology_level *tl, int cpu)
61-
{
62-
return cpu_clustergroup_mask(cpu);
63-
}
46+
extern int cpu_cluster_flags(void);
47+
extern const struct cpumask *tl_cls_mask(struct sched_domain_topology_level *tl, int cpu);
6448
#endif
6549

6650
#ifdef CONFIG_SCHED_MC
67-
static inline int cpu_core_flags(void)
68-
{
69-
return SD_SHARE_LLC;
70-
}
71-
72-
static inline const
73-
struct cpumask *tl_mc_mask(struct sched_domain_topology_level *tl, int cpu)
74-
{
75-
return cpu_coregroup_mask(cpu);
76-
}
51+
extern int cpu_core_flags(void);
52+
extern const struct cpumask *tl_mc_mask(struct sched_domain_topology_level *tl, int cpu);
7753
#endif
7854

79-
static inline const
80-
struct cpumask *tl_pkg_mask(struct sched_domain_topology_level *tl, int cpu)
81-
{
82-
return cpu_node_mask(cpu);
83-
}
84-
85-
#ifdef CONFIG_NUMA
86-
static inline int cpu_numa_flags(void)
87-
{
88-
return SD_NUMA;
89-
}
90-
#endif
55+
extern const struct cpumask *tl_pkg_mask(struct sched_domain_topology_level *tl, int cpu);
9156

9257
extern int arch_asym_cpu_priority(int cpu);
9358

kernel/sched/topology.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,47 @@ sd_init(struct sched_domain_topology_level *tl,
17371737
return sd;
17381738
}
17391739

1740+
#ifdef CONFIG_SCHED_SMT
1741+
int cpu_smt_flags(void)
1742+
{
1743+
return SD_SHARE_CPUCAPACITY | SD_SHARE_LLC;
1744+
}
1745+
1746+
const struct cpumask *tl_smt_mask(struct sched_domain_topology_level *tl, int cpu)
1747+
{
1748+
return cpu_smt_mask(cpu);
1749+
}
1750+
#endif
1751+
1752+
#ifdef CONFIG_SCHED_CLUSTER
1753+
int cpu_cluster_flags(void)
1754+
{
1755+
return SD_CLUSTER | SD_SHARE_LLC;
1756+
}
1757+
1758+
const struct cpumask *tl_cls_mask(struct sched_domain_topology_level *tl, int cpu)
1759+
{
1760+
return cpu_clustergroup_mask(cpu);
1761+
}
1762+
#endif
1763+
1764+
#ifdef CONFIG_SCHED_MC
1765+
int cpu_core_flags(void)
1766+
{
1767+
return SD_SHARE_LLC;
1768+
}
1769+
1770+
const struct cpumask *tl_mc_mask(struct sched_domain_topology_level *tl, int cpu)
1771+
{
1772+
return cpu_coregroup_mask(cpu);
1773+
}
1774+
#endif
1775+
1776+
const struct cpumask *tl_pkg_mask(struct sched_domain_topology_level *tl, int cpu)
1777+
{
1778+
return cpu_node_mask(cpu);
1779+
}
1780+
17401781
/*
17411782
* Topology list, bottom-up.
17421783
*/
@@ -1773,6 +1814,10 @@ void __init set_sched_topology(struct sched_domain_topology_level *tl)
17731814
}
17741815

17751816
#ifdef CONFIG_NUMA
1817+
static int cpu_numa_flags(void)
1818+
{
1819+
return SD_NUMA;
1820+
}
17761821

17771822
static const struct cpumask *sd_numa_mask(struct sched_domain_topology_level *tl, int cpu)
17781823
{

0 commit comments

Comments
 (0)