[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240623015057.3383223-2-tj@kernel.org>
Date: Sat, 22 Jun 2024 15:50:20 -1000
From: Tejun Heo <tj@...nel.org>
To: torvalds@...ux-foundation.org
Cc: void@...ifault.com,
mingo@...hat.com,
peterz@...radead.org,
tglx@...utronix.de,
linux-kernel@...r.kernel.org,
kernel-team@...a.com,
Tejun Heo <tj@...nel.org>
Subject: [PATCH 1/3] sched_ext: Minor cleanups in kernel/sched/ext.h
- scx_ops_cpu_preempt is only used in kernel/sched/ext.c and doesn't need to
be global. Make it static.
- Relocate task_on_scx() so that the inline functions are located together.
Signed-off-by: Tejun Heo <tj@...nel.org>
Cc: David Vernet <void@...ifault.com>
---
kernel/sched/ext.c | 2 +-
kernel/sched/ext.h | 12 +++++-------
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 28f7a4266fde..d4c645f9e031 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -771,7 +771,7 @@ static bool scx_warned_zero_slice;
static DEFINE_STATIC_KEY_FALSE(scx_ops_enq_last);
static DEFINE_STATIC_KEY_FALSE(scx_ops_enq_exiting);
-DEFINE_STATIC_KEY_FALSE(scx_ops_cpu_preempt);
+static DEFINE_STATIC_KEY_FALSE(scx_ops_cpu_preempt);
static DEFINE_STATIC_KEY_FALSE(scx_builtin_idle_enabled);
struct static_key_false scx_has_op[SCX_OPI_END] =
diff --git a/kernel/sched/ext.h b/kernel/sched/ext.h
index 0a7b9a34b18f..229007693504 100644
--- a/kernel/sched/ext.h
+++ b/kernel/sched/ext.h
@@ -26,13 +26,6 @@ DECLARE_STATIC_KEY_FALSE(__scx_switched_all);
#define scx_enabled() static_branch_unlikely(&__scx_ops_enabled)
#define scx_switched_all() static_branch_unlikely(&__scx_switched_all)
-DECLARE_STATIC_KEY_FALSE(scx_ops_cpu_preempt);
-
-static inline bool task_on_scx(const struct task_struct *p)
-{
- return scx_enabled() && p->sched_class == &ext_sched_class;
-}
-
void scx_tick(struct rq *rq);
void init_scx_entity(struct sched_ext_entity *scx);
void scx_pre_fork(struct task_struct *p);
@@ -54,6 +47,11 @@ static inline u32 scx_cpuperf_target(s32 cpu)
return 0;
}
+static inline bool task_on_scx(const struct task_struct *p)
+{
+ return scx_enabled() && p->sched_class == &ext_sched_class;
+}
+
static inline const struct sched_class *next_active_class(const struct sched_class *class)
{
class++;
--
2.45.2
Powered by blists - more mailing lists