From fb0a2ae8c96496bf06c55daf8d9979631045b064 Mon Sep 17 00:00:00 2001 From: Dao Huang Date: Fri, 14 Mar 2025 10:56:03 +0800 Subject: [PATCH] ANDROID: sched: Include new structure members brought by sched_ext for KABI As discussed in b/401436689, include new structure members used by sched_ext, to facilitate enabling sched_ext in subsequent OGKI kernel without breaking KABI. Bug: 401436689 Change-Id: I1a73b998b46fb321c617f9654ddee6a99900a4e3 Signed-off-by: Dao Huang [jstultz: Slightly reworded commit message] Signed-off-by: John Stultz --- include/linux/sched.h | 2 -- include/linux/sched/ext.h | 5 ++--- kernel/sched/sched.h | 6 ------ 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 4b9d3c827368..82650a6fb544 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -849,9 +849,7 @@ struct task_struct { struct sched_rt_entity rt; struct sched_dl_entity dl; struct sched_dl_entity *dl_server; -#ifdef CONFIG_SCHED_CLASS_EXT struct sched_ext_entity scx; -#endif const struct sched_class *sched_class; #ifdef CONFIG_SCHED_CORE diff --git a/include/linux/sched/ext.h b/include/linux/sched/ext.h index 2799e7284fff..c9d52eb44021 100644 --- a/include/linux/sched/ext.h +++ b/include/linux/sched/ext.h @@ -9,7 +9,6 @@ #ifndef _LINUX_SCHED_EXT_H #define _LINUX_SCHED_EXT_H -#ifdef CONFIG_SCHED_CLASS_EXT #include #include @@ -196,12 +195,12 @@ struct sched_ext_entity { bool disallow; /* reject switching into SCX */ /* cold fields */ -#ifdef CONFIG_EXT_GROUP_SCHED struct cgroup *cgrp_moving_from; -#endif struct list_head tasks_node; }; +#ifdef CONFIG_SCHED_CLASS_EXT + void sched_ext_free(struct task_struct *p); void print_scx_info(const char *log_lvl, struct task_struct *p); diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index c0751dcb7f52..51459688fee1 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -469,10 +469,8 @@ struct task_group { struct rt_bandwidth rt_bandwidth; #endif -#ifdef CONFIG_EXT_GROUP_SCHED u32 scx_flags; /* SCX_TG_* */ u32 scx_weight; -#endif struct rcu_head rcu; struct list_head list; @@ -755,7 +753,6 @@ struct cfs_rq { #endif /* CONFIG_FAIR_GROUP_SCHED */ }; -#ifdef CONFIG_SCHED_CLASS_EXT /* scx_rq->flags, protected by the rq lock */ enum scx_rq_flags { /* @@ -792,7 +789,6 @@ struct scx_rq { struct irq_work deferred_irq_work; struct irq_work kick_cpus_irq_work; }; -#endif /* CONFIG_SCHED_CLASS_EXT */ static inline int rt_bandwidth_enabled(void) { @@ -1152,9 +1148,7 @@ struct rq { struct cfs_rq cfs; struct rt_rq rt; struct dl_rq dl; -#ifdef CONFIG_SCHED_CLASS_EXT struct scx_rq scx; -#endif struct sched_dl_entity fair_server;