sched_ext: Move internal type and accessor definitions to ext_internal.h

There currently isn't a place to place SCX-internal types and accessors to
be shared between ext.c and ext_idle.c. Create kernel/sched/ext_internal.h
and move internal type and accessor definitions there. This trims ext.c a
bit and makes future additions easier. Pure code reorganization. No
functional changes.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Andrea Righi <arighi@nvidia.com>
This commit is contained in:
Tejun Heo
2025-09-03 11:33:28 -10:00
parent 4a1d9d73aa
commit 0c2b8356e4
4 changed files with 1062 additions and 1057 deletions

View File

@@ -58,6 +58,7 @@
#include "deadline.c"
#ifdef CONFIG_SCHED_CLASS_EXT
# include "ext_internal.h"
# include "ext.c"
# include "ext_idle.c"
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -8,29 +8,6 @@
*/
#ifdef CONFIG_SCHED_CLASS_EXT
static inline bool scx_kf_allowed_if_unlocked(void)
{
return !current->scx.kf_mask;
}
static inline bool scx_rq_bypassing(struct rq *rq)
{
return unlikely(rq->scx.flags & SCX_RQ_BYPASSING);
}
DECLARE_STATIC_KEY_FALSE(scx_ops_allow_queued_wakeup);
DECLARE_PER_CPU(struct rq *, scx_locked_rq_state);
/*
* Return the rq currently locked from an scx callback, or NULL if no rq is
* locked.
*/
static inline struct rq *scx_locked_rq(void)
{
return __this_cpu_read(scx_locked_rq_state);
}
void scx_tick(struct rq *rq);
void init_scx_entity(struct sched_ext_entity *scx);
void scx_pre_fork(struct task_struct *p);

1061
kernel/sched/ext_internal.h Normal file

File diff suppressed because it is too large Load Diff