hulk inclusion category: bugfix bugzilla: 38260, https://bugzilla.openeuler.org/show_bug.cgi?id=22 CVE: NA
---------------------------
Commit 92010bb6d6b8 ("sched/fair: Start tracking SCHED_IDLE tasks count in cfs_rq") introduced kabi broken, just fix it.
Fixes: 92010bb6d6b8 ("sched/fair: Start tracking SCHED_IDLE tasks count in cfs_rq") Signed-off-by: Cheng Jian cj.chengjian@huawei.com Reviewed-by: Xie XiuQi xiexiuqi@huawei.com --- kernel/sched/sched.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 2e63aa145030..f8c29f1af2d0 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -490,7 +490,6 @@ struct cfs_rq { unsigned long runnable_weight; unsigned int nr_running; unsigned int h_nr_running; /* SCHED_{NORMAL,BATCH,IDLE} */ - unsigned int idle_h_nr_running; /* SCHED_IDLE */
u64 exec_clock; u64 min_vruntime; @@ -574,7 +573,15 @@ struct cfs_rq { #endif /* CONFIG_CFS_BANDWIDTH */ #endif /* CONFIG_FAIR_GROUP_SCHED */
+#ifndef __GENKSYMS__ + union { + unsigned int idle_h_nr_running; /* SCHED_IDLE */ + unsigned long idle_h_nr_running_padding; /* SCHED_IDLE padding for KABI */ + }; +#else KABI_RESERVE(1) +#endif + KABI_RESERVE(2) };
hulk inclusion category: bugfix bugzilla: 38261, https://bugzilla.openeuler.org/show_bug.cgi?id=23 CVE: NA
---------------------------
Previous patches added fields in struct rq and sched_domain_shared, which caused the KABI changed.
We can use some helper structures to fix this KABI change, but this is not necessary, because these structures are only used internally, the driver is not aware of them, so we simply avoid them.
Signed-off-by: Cheng Jian cj.chengjian@huawei.com Reviewed-by: Xie XiuQi xiexiuqi@huawei.com --- include/linux/sched/topology.h | 2 +- kernel/sched/sched.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 936dfbf0e87f..a9032116c13e 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -72,7 +72,7 @@ struct sched_domain_shared { atomic_t ref; atomic_t nr_busy_cpus; int has_idle_cores; -#ifdef CONFIG_SCHED_STEAL +#if defined(CONFIG_SCHED_STEAL) && !defined(__GENKSYMS__) struct sparsemask *cfs_overload_cpus; #endif }; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index a23302037220..ca2fd2d6171f 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -832,7 +832,7 @@ struct rq { struct cfs_rq cfs; struct rt_rq rt; struct dl_rq dl; -#ifdef CONFIG_SCHED_STEAL +#if defined(CONFIG_SCHED_STEAL) && !defined(__GENKSYMS__) struct sparsemask *cfs_overload_cpus; #endif
@@ -939,7 +939,7 @@ struct rq { unsigned int ttwu_count; unsigned int ttwu_local;
-#ifdef CONFIG_SCHED_STEAL +#if defined(CONFIG_SCHED_STEAL) && !defined(__GENKSYMS__) /* Idle search stats */ unsigned int found_idle_core; unsigned int found_idle_cpu;