aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/sched.h
diff options
context:
space:
mode:
authorDietmar Eggemann <dietmar.eggemann@arm.com>2022-07-29 13:13:03 +0200
committerIngo Molnar <mingo@kernel.org>2022-08-02 12:32:45 +0200
commit740cf8a760b73e8375bfb4bedcbe9746183350f9 (patch)
tree32df6e4db3c83a27fa5738b3fb79fcbecfd3a4fb /kernel/sched/sched.h
parentMerge tag 'irq-core-2022-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (diff)
downloadlinux-dev-740cf8a760b73e8375bfb4bedcbe9746183350f9.tar.xz
linux-dev-740cf8a760b73e8375bfb4bedcbe9746183350f9.zip
sched/core: Introduce sched_asym_cpucap_active()
Create an inline helper for conditional code to be only executed on asymmetric CPU capacity systems. This makes these (currently ~10 and future) conditions a lot more readable. Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20220729111305.1275158-2-dietmar.eggemann@arm.com
Diffstat (limited to 'kernel/sched/sched.h')
-rw-r--r--kernel/sched/sched.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index aad7f5ee9666..86fc36069f38 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1813,6 +1813,11 @@ DECLARE_PER_CPU(struct sched_domain __rcu *, sd_asym_packing);
DECLARE_PER_CPU(struct sched_domain __rcu *, sd_asym_cpucapacity);
extern struct static_key_false sched_asym_cpucapacity;
+static __always_inline bool sched_asym_cpucap_active(void)
+{
+ return static_branch_unlikely(&sched_asym_cpucapacity);
+}
+
struct sched_group_capacity {
atomic_t ref;
/*